[riot-notifications] [RIOT-OS/RIOT] sock/dtls: add function to retrieve epoch of session (#15881)

János Brodbeck notifications at github.com
Fri Jan 29 22:57:42 CET 2021


@janosbrodbeck commented on this pull request.



> @@ -296,6 +296,19 @@ int sock_dtls_create(sock_dtls_t *sock, sock_udp_t *udp_sock,
     return 0;
 }
 
+int16_t sock_dtls_session_get_epoch(sock_dtls_t *sock, sock_dtls_session_t *session)
+{
+    assert(sock);
+    assert(session);
+
+    dtls_peer_t *peer = dtls_get_peer(sock->dtls_ctx, &session->dtls_session);
+    if (!peer) {
+        return -ENOTCONN;
+    }
+    dtls_security_parameters_t *security = dtls_security_params(peer);

But it would make sense to add a safety check here I guess - tinyDTLS may also change this at some point. 

-- 
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/15881#discussion_r567115823
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210129/7cfe1239/attachment-0001.htm>


More information about the notifications mailing list