10#include <netinet/in.h>
11#include <sys/socket.h>
14#ifdef CONFIG_DAWN_PROTO_WAKAAMA_DTLS_PSK
17# include <tinydtls/dtls.h>
23namespace wakaama_internal
38 uint16_t securityInstanceId;
39 const uint8_t *pskIdentity;
40 size_t pskIdentityLen;
41 const uint8_t *pskKey;
43 sockaddr_storage addr;
45#ifdef CONFIG_DAWN_PROTO_WAKAAMA_DTLS_PSK
46 session_t dtlsSession;
47 dtls_context_t *dtlsContext;
104 bool receiveOne(uint8_t *buffer,
size_t capacity);
108 std::vector<Connection *> connectionPool;
110#ifdef CONFIG_DAWN_PROTO_WAKAAMA_DTLS_PSK
111 dtls_context_t *dtlsContext;
112 dtls_handler_t dtlsHandler;
Wakaama LwM2M client protocol implementation.
UDP and optional DTLS transport used by the Wakaama client runtime.
void closeAllConnections()
Close every active server connection.
int openSocket()
Open and bind the local UDP socket.
void handlePacket(Connection *conn, uint8_t *buffer, size_t length)
Deliver one received packet into the Wakaama runtime.
~Transport()
Close sockets, DTLS state, and connection-pool allocations.
Connection * findConnection(const void *addr, size_t addrLen)
Find an active connection by peer address.
int initDtls()
Initialize optional shared DTLS context state.
void destroyDtls()
Destroy optional shared DTLS context state.
void closeConnection(Connection *conn)
Close one active server connection.
Connection * connectServer(uint16_t securityInstanceId)
Connect to the server referenced by a Security object instance.
int initConnectionPool()
Allocate the fixed connection pool used by Wakaama callbacks.
void thread()
Run the transport receive loop.
Out-of-tree user-extension hooks for Dawn.
Runtime state for one remote LwM2M server connection.