32#ifndef PROTOCORE_COAPS_SERVER_H
33#define PROTOCORE_COAPS_SERVER_H
37#if PROTOCORE_ENABLE_DTLS && PROTOCORE_ENABLE_COAP
41#ifndef PROTOCORE_COAPS_MAX_CONNS
42#define PROTOCORE_COAPS_MAX_CONNS 2
44#ifndef PROTOCORE_COAPS_INGEST_RING
45#define PROTOCORE_COAPS_INGEST_RING 6
47#ifndef PROTOCORE_COAPS_PORT
48#define PROTOCORE_COAPS_PORT 5684
50#ifndef PROTOCORE_COAPS_IDLE_MS
51#define PROTOCORE_COAPS_IDLE_MS 60000
65 const uint8_t *cert_der;
67 uint8_t ed25519_seed[32];
68 uint8_t cookie_key[32];
69 void (*rng)(uint8_t *out,
size_t len);
70} CoapsServerIdentityArgs;
78#if !PROTOCORE_HAS_NET_STACK
80typedef void (*CoapsServerOutFn)(
void *ctx,
const uint8_t *datagram,
size_t len,
const char *ip, uint16_t port);
96} CoapsServerIngestArgs;
124 CoapsServerIdentityArgs identity;
125 CoapsServerBindArgs bind;
126#if !PROTOCORE_HAS_NET_STACK
127 CoapsServerSinkArgs sink;
128 CoapsServerIngestArgs dgram;
132#if !PROTOCORE_HAS_NET_STACK
137extern CoapsServerVars CoapsServerV;
142 void (*
const begin)(uint8_t *work);
143 void (*
const poll)(uint8_t *work);
144 void (*
const active_conns)(uint8_t *work);
145 void (*
const stop)(uint8_t *work);
146 void (*
const set_out_sink)(uint8_t *work);
147 void (*
const ingest)(uint8_t *work);
152void protocore_coaps_server_begin(uint8_t *work);
153void protocore_coaps_server_poll(uint8_t *work);
154void protocore_coaps_server_active_conns(uint8_t *work);
155void protocore_coaps_server_stop(uint8_t *work);
156#if !PROTOCORE_HAS_NET_STACK
157void protocore_coaps_server_set_out_sink(uint8_t *work);
158void protocore_coaps_server_ingest(uint8_t *work);
165static const CoapsServerNs CoapsServer __attribute__((unused)) = {
166 .begin = protocore_coaps_server_begin,
167 .poll = protocore_coaps_server_poll,
168 .active_conns = protocore_coaps_server_active_conns,
169 .stop = protocore_coaps_server_stop,
170#if !PROTOCORE_HAS_NET_STACK
171 .set_out_sink = protocore_coaps_server_set_out_sink,
172 .ingest = protocore_coaps_server_ingest,
185uint8_t *protocore_coaps_server_span(
void);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS