[riot-notifications] [RIOT-OS/RIOT] sock_dtls: a DTLS sock API (#10897)

Aiman Ismail notifications at github.com
Wed Mar 13 22:08:18 CET 2019


I just made a PR #11177 providing TinyDTLS implementation of the API. Changes since last initial draft:
1. `sock_dtls_init`, `sock_dtls_close_session` and `sock_dtls_destroy` now have `void` as return value (previously `int`)
2. `sock_dtls_close_session` have additional `sock_dtls_session_t` as parameter

First post will be updated.

Following is what I'm considering right now and hope to get some feedback before I proceed with it:
1. Remove `sock_dtls_init` from the API and move `dtls_init` call that is needed by TinyDTLS to autoinit. wolfSSL doesn't have such init functions.

2.  Remove the queue from `sock_dtls_init_server` because TinyDTLS already has its own
internal queue to keep track of all established session. Having an additional queue will just be
a duplicate of it. Looking at wolfSSL PR, they also doesn't have any queue to to save established
session. So I think it will be okay to remove it.

    The new `sock_dtls_init_server` will then look like this:

```C
void sock_dtls_init_server(sock_dtls_t *sock);
```
Just leaving my thoughts out here. Removing the queue will also mean that  `sock_dtls_init_server` will do nothing more than setting the role of the endpoint to a DTLS_SERVER (see [code][1]). So maybe `sock_dtls_init_server` could be removed altogether from the API but I'm *really* not sure about this and leaning more towards leaving it there in case anything needs it in the future.

[1]: https://github.com/RIOT-OS/RIOT/pull/11177/commits/e3701adeba10c3c2085fd4647968e6871c18e34e#diff-c71021b55895d420e83f1d22409d8c37R260

-- 
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/issues/10897#issuecomment-472606057
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190313/a1b5c2f2/attachment.html>


More information about the notifications mailing list