mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
d5b2aa8a2f
Macros that changed: DTLS_PSK -> CONFIG_DTLS_PSK DTLS_ECC -> CONFIG_DTLS_ECC (except in release-notes.txt) DTLS_CONTEXT_MAX -> CONFIG_DTLS_CONTEXT_MAX DTLS_PEER_MAX -> CONFIG_DTLS_PEER_MAX DTLS_HANDSHAKE_MAX -> CONFIG_DTLS_HANDSHAKE_MAX DTLS_SECURITY_MAX -> CONFIG_DTLS_SECURITY_MAX DTLS_HASH_MAX -> CONFIG_DTLS_HASH_MAX
43 lines
954 B
Markdown
43 lines
954 B
Markdown
# DTLS sock example
|
|
|
|
This example shows how to use DTLS sock `sock_dtls_t`.
|
|
|
|
## Testing using RIOT `native`
|
|
|
|
For testing, we can use two RIOT `native` RIOT instances. For that first we
|
|
need to prepare the network interfaces:
|
|
|
|
```bash
|
|
$ ./../../dist/tools/tapsetup/tapsetup --create 2
|
|
```
|
|
|
|
For the server instance:
|
|
|
|
```
|
|
$ PORT=tap0 make all term
|
|
[...]
|
|
> dtlss start
|
|
ifconfig
|
|
```
|
|
|
|
For the client:
|
|
|
|
```
|
|
$ PORT=tap1 make all term
|
|
[...]
|
|
> dtlsc <server ip address> "DATA to send"
|
|
```
|
|
|
|
## Debug logs
|
|
|
|
To enable debug logs uncomment `CFLAGS += -DCONFIG_DTLS_DEBUG` in the Makefile.
|
|
Tinydtls supports setting the log level. See Makefile for more info.
|
|
|
|
## Configs and constraints
|
|
|
|
DTLS sock acts as a wrapper for the underlying DTLS stack and as such, the
|
|
constraints that applies specifically to the stack are also applied here.
|
|
For tinydtls, please refer to [dtls-echo README][1].
|
|
|
|
[1]: https://github.com/RIOT-OS/RIOT/blob/master/examples/dtls-echo/README.md
|