[riot-notifications] [RIOT-OS/RIOT] net/gcoap: support DTLS (#15549)

Martine Lenders notifications at github.com
Fri May 28 13:16:57 CEST 2021


@miri64 commented on this pull request.

Just some style nits because I just noticed them

> @@ -316,7 +338,16 @@ int gcoap_cli_cmd(int argc, char **argv)
     if (strcmp(argv[1], "info") == 0) {
         uint8_t open_reqs = gcoap_op_state();
 
-        printf("CoAP server is listening on port %u\n", CONFIG_GCOAP_PORT);
+        if (IS_ACTIVE(CONFIG_GCOAP_ENABLE_DTLS)) {
+            printf("CoAP server is listening on port %u\n", CONFIG_GCOAPS_PORT);
+        } else {
+            printf("CoAP server is listening on port %u\n", CONFIG_GCOAP_PORT);
+        }
+#if IS_ACTIVE(CONFIG_GCOAP_ENABLE_DTLS)
+            printf("Connection secured with DTLS\n");
+            printf("Free DTLS session slots: %d/%d\n", dsm_get_num_available_slots(),

Indentation is off here

> +        int res = credman_add(&credential);
+        if (res < 0 && res != CREDMAN_EXIST) {
+            /* ignore duplicate credentials */
+            printf("gcoap: cannot add credential to system: %d\n", res);
+            return;
+        }
+        sock_dtls_t *gcoap_sock_dtls = gcoap_get_sock_dtls();
+        res = sock_dtls_add_credential(gcoap_sock_dtls, GCOAP_DTLS_CREDENTIAL_TAG);
+        if (res < 0) {
+            printf("gcoap: cannot add credential to DTLS sock: %d\n", res);
+        }

Here too.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15549#pullrequestreview-671194115
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210528/bc987f3c/attachment.htm>


More information about the notifications mailing list