libcoap 4.3.5-develop-10e2af6
Loading...
Searching...
No Matches
coap_session_internal.h
Go to the documentation of this file.
1/*
2 * coap_session_internal.h -- Structures, Enums & Functions that are not
3 * exposed to application programming
4 *
5 * Copyright (C) 2010-2026 Olaf Bergmann <bergmann@tzi.org>
6 *
7 * SPDX-License-Identifier: BSD-2-Clause
8 *
9 * This file is part of the CoAP library libcoap. Please see README for terms
10 * of use.
11 */
12
17
18#ifndef COAP_SESSION_INTERNAL_H_
19#define COAP_SESSION_INTERNAL_H_
20
21#include "coap_ws_internal.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#ifndef COAP_DEFAULT_SESSION_TIMEOUT
28#define COAP_DEFAULT_SESSION_TIMEOUT 300
29#endif /* !COAP_DEFAULT_SESSION_TIMEOUT */
30
31#define COAP_PARTIAL_SESSION_TIMEOUT_TICKS (30 * COAP_TICKS_PER_SECOND)
32#define COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS 100
33
40
50
59
68
69#ifndef COAP_MAX_PING_FAILURES
70#define COAP_MAX_PING_FAILURES 3
71#endif
72
73/*
74 * Upper bound for PDUs queued on session->doing_first_pdu while the client
75 * waits for the first exchange (OSCORE confirmation, Extended Token probe,
76 * Q-Block probe, etc.). Override before including libcoap headers if needed.
77 */
78#ifndef COAP_DOING_FIRST_MAX_QUEUE
79#define COAP_DOING_FIRST_MAX_QUEUE 4
80#endif /* COAP_DOING_FIRST_MAX_QUEUE */
81
91 unsigned ref;
92 unsigned hold_in_use;
97 uint8_t disconnecting;
102 size_t mtu;
103 size_t csm_rcv_mtu;
105 UT_hash_handle hh;
107#if COAP_CLIENT_SUPPORT
108 coap_address_t local_reconnect;
109#endif /* COAP_CLIENT_SUPPORT */
111#if COAP_SERVER_SUPPORT
112 unsigned ref_subscriptions;
113 unsigned ref_proxy_subs;
114#endif /* COAP_SERVER_SUPPORT */
117#if COAP_SERVER_SUPPORT
118 coap_endpoint_t *endpoint;
119#endif /* COAP_SERVER_SUPPORT */
121#if COAP_ASYNC_SUPPORT
122 size_t async_count;
123#endif /* COAP_ASYNC_SUPPORT */
124 void *tls;
125 uint16_t tx_mid;
127 uint8_t con_active;
135#if COAP_CLIENT_SUPPORT
136 coap_lg_crcv_t *lg_crcv;
137#endif /* COAP_CLIENT_SUPPORT */
138#if COAP_SERVER_SUPPORT
139 coap_lg_srcv_t *lg_srcv;
140#endif /* COAP_SERVER_SUPPORT */
144 uint8_t read_header[8];
183 void *app_data;
189 uint16_t max_retransmit;
191 uint16_t nstart;
195 uint32_t probing_rate;
197#if COAP_Q_BLOCK_SUPPORT
198 uint16_t max_payloads;
200 uint16_t non_max_retransmit;
202 coap_fixed_point_t non_timeout;
204 coap_fixed_point_t non_receive_timeout;
207 coap_fixed_point_t non_probing_wait_base;
210 coap_fixed_point_t non_partial_timeout;
213#endif /* COAP_Q_BLOCK_SUPPORT */
214 unsigned int dtls_timeout_count;
217 uint32_t tx_rtag;
218 uint32_t block_mode;
221#if COAP_CLIENT_SUPPORT
222 uint8_t doing_first;
223#endif /* COAP_CLIENT_SUPPORT */
228 uint8_t csm_not_seen;
229#if COAP_OSCORE_SUPPORT
230 uint8_t oscore_encryption;
231 COAP_OSCORE_B_2_STEP b_2_step;
232 oscore_recipient_ctx_t *recipient_ctx;
234 oscore_association_t *associations;
236 uint64_t oscore_r2;
237 coap_str_const_t *b_2_retransmit_token;
238#endif /* COAP_OSCORE_SUPPORT */
239#if COAP_WS_SUPPORT
240 coap_ws_state_t *ws;
241 coap_str_const_t *ws_host;
242#endif /* COAP_WS_SUPPORT */
243#if COAP_OSCORE_SUPPORT
244 uint8_t doing_b_1_2;
245#endif /* COAP_OSCORE_SUPPORT */
246 volatile uint8_t max_token_checked;
248 uint8_t is_dtls13;
249#if COAP_CLIENT_SUPPORT
250 uint8_t negotiated_cid;
251 uint8_t doing_send_recv;
252 uint8_t session_failed;
253 uint8_t client_initiated;
254 uint8_t retry_count;
255 coap_tick_t doing_first_timeout;
256 coap_pdu_t *doing_first_pdu;
257#endif /* COAP_CLIENT_SUPPORT */
261 uint32_t max_token_size;
262 uint64_t tx_token;
269#if COAP_SERVER_SUPPORT
270 coap_bin_const_t *client_cid;
271 coap_addr_tuple_t cid_addr_info;
272 uint8_t cid_addr_pending;
274 coap_pdu_t *last_resp_pdu;
275#endif /* COAP_SERVER_SUPPORT */
276#if COAP_CLIENT_SUPPORT
277 coap_pdu_t *resp_pdu;
278 coap_bin_const_t *req_token;
279#endif /* COAP_CLIENT_SUPPORT */
280#if COAP_PROXY_SUPPORT
281 coap_proxy_entry_t *proxy_entry;
282 coap_proxy_server_list_t *server_list;
283#endif /* COAP_PROXY_SUPPORT */
287 uint32_t ping_failed;
288#ifdef HAVE_LINUX_ERRQUEUE_H
289 coap_str_const_t *last_data_write;
291#endif /* HAVE_LINUX_ERRQUEUE_H */
292};
293
294#if COAP_SERVER_SUPPORT
299struct coap_endpoint_t {
300 struct coap_endpoint_t *next;
301 coap_context_t *context;
302 coap_proto_t proto;
303 uint16_t default_mtu;
304 coap_socket_t sock;
306 coap_address_t bind_addr;
307 coap_session_t *sessions;
308
309 void *app_data;
311};
312#endif /* COAP_SERVER_SUPPORT */
313
316
318 uint32_t u2);
319
322
324 uint32_t u2);
325
327 uint32_t u2);
328
330
332
334
335
342
349
360 coap_nack_reason_t reason);
361
371
383 const coap_bin_const_t *psk_hint);
384
396 const coap_bin_const_t *psk_key);
397
409 const coap_bin_const_t *psk_identity);
410
411#if COAP_SERVER_SUPPORT
421coap_session_t *coap_new_server_session(coap_context_t *ctx,
422 coap_endpoint_t *ep,
423 void *extra);
424#endif /* COAP_SERVER_SUPPORT */
425
435
445
463int coap_session_set_type_client_lkd(coap_session_t *session, int report_changed);
464
482
493
509
521
535 coap_nack_reason_t reason);
536
548ssize_t coap_session_send_pdu(coap_session_t *session, coap_pdu_t *pdu);
549
551 coap_queue_t *node);
552
553#if COAP_SERVER_SUPPORT
563coap_session_t *coap_endpoint_get_session(coap_endpoint_t *endpoint,
564 const coap_packet_t *packet, coap_tick_t now);
565
573void coap_session_cid_update_addr(coap_session_t *session);
574
589coap_endpoint_t *coap_new_endpoint_lkd(coap_context_t *context, const coap_address_t *listen_addr,
590 coap_proto_t proto);
591
599void coap_free_endpoint_lkd(coap_endpoint_t *endpoint);
600
601#endif /* COAP_SERVER_SUPPORT */
602
609size_t coap_session_max_pdu_rcv_size(const coap_session_t *session);
610
620size_t coap_session_max_pdu_size_lkd(const coap_session_t *session);
621
652 const coap_address_t *local_if,
653 const coap_address_t *server,
654 coap_proto_t proto,
655 void *app_data,
657 coap_str_const_t *ws_host
658 );
659
692 const coap_address_t *local_if,
693 const coap_address_t *server,
694 coap_proto_t proto,
695 coap_dtls_pki_t *setup_data,
696 void *app_data,
698 coap_str_const_t *ws_host
699 );
700
721 const coap_address_t *local_if,
722 const coap_address_t *server,
723 coap_proto_t proto,
724 const char *identity,
725 const uint8_t *key,
726 unsigned key_len
727 );
728
761 const coap_address_t *local_if,
762 const coap_address_t *server,
763 coap_proto_t proto,
764 coap_dtls_cpsk_t *setup_data,
765 void *app_data,
767 coap_str_const_t *ws_host
768 );
769
777
790 coap_tick_t now);
791
801
820void *coap_session_set_app_data2_lkd(coap_session_t *session, void *data,
822
843
844void coap_session_free(coap_session_t *session);
846
848
850
851void coap_handle_nack(coap_session_t *session,
852 coap_pdu_t *sent,
853 const coap_nack_reason_t reason,
854 const coap_mid_t mid);
855
862
869
870#define COAP_SESSION_REF(s) ((s)->ref
871
872/* RFC7252 */
873#define COAP_ACK_TIMEOUT(s) ((s)->ack_timeout)
874#define COAP_ACK_RANDOM_FACTOR(s) ((s)->ack_random_factor)
875#define COAP_MAX_RETRANSMIT(s) ((s)->max_retransmit)
876#define COAP_NSTART(s) ((s)->nstart)
877#define COAP_DEFAULT_LEISURE(s) ((s)->default_leisure)
878#define COAP_PROBING_RATE(s) ((s)->probing_rate)
879/* RFC9177 */
880#define COAP_MAX_PAYLOADS(s) ((s)->max_payloads)
881#define COAP_NON_MAX_RETRANSMIT(s) ((s)->non_max_retransmit)
882#define COAP_NON_TIMEOUT(s) ((s)->non_timeout)
883#define COAP_NON_TIMEOUT_TICKS(s) \
884 (COAP_NON_TIMEOUT(s).integer_part * COAP_TICKS_PER_SECOND + \
885 COAP_NON_TIMEOUT(s).fractional_part * COAP_TICKS_PER_SECOND / 1000)
886#define COAP_NON_RECEIVE_TIMEOUT(s) ((s)->non_receive_timeout)
887#define COAP_NON_PROBING_WAIT_BASE(s) ((s)->non_probing_wait_base)
888#define COAP_NON_PARTIAL_TIMEOUT(s) ((s)->non_partial_timeout)
889
896#define COAP_DEFAULT_LEISURE_TICKS(s) \
897 (COAP_DEFAULT_LEISURE(s).integer_part * COAP_TICKS_PER_SECOND + \
898 COAP_DEFAULT_LEISURE(s).fractional_part * COAP_TICKS_PER_SECOND / 1000)
899
905#define COAP_MAX_TRANSMIT_SPAN(s) \
906 (((s)->ack_timeout.integer_part * 1000 + (s)->ack_timeout.fractional_part) * \
907 ((1 << ((s)->max_retransmit)) -1) * \
908 ((s)->ack_random_factor.integer_part * 1000 + \
909 (s)->ack_random_factor.fractional_part) \
910 / 1000000)
911
918#define COAP_MAX_TRANSMIT_WAIT(s) \
919 (((s)->ack_timeout.integer_part * 1000 + (s)->ack_timeout.fractional_part) * \
920 ((1 << ((s)->max_retransmit + 1)) -1) * \
921 ((s)->ack_random_factor.integer_part * 1000 + \
922 (s)->ack_random_factor.fractional_part) \
923 / 1000000)
924
925#define COAP_MAX_TRANSMIT_WAIT_TICKS(s) \
926 (COAP_MAX_TRANSMIT_WAIT(s) * COAP_TICKS_PER_SECOND)
927
934#define COAP_PROCESSING_DELAY(s) \
935 (((s)->ack_timeout.integer_part * 1000 + (s)->ack_timeout.fractional_part + \
936 500) / 1000)
937
944#define COAP_MAX_RTT(s) \
945 ((2 * COAP_DEFAULT_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))
946
953#define COAP_EXCHANGE_LIFETIME(s) \
954 (COAP_MAX_TRANSMIT_SPAN(s) + (2 * COAP_DEFAULT_MAX_LATENCY) + \
955 COAP_PROCESSING_DELAY(s))
956
963#define COAP_NON_LIFETIME(s) \
964 (COAP_MAX_TRANSMIT_SPAN(s) + COAP_DEFAULT_MAX_LATENCY)
965
972#define COAP_NON_RECEIVE_TIMEOUT_TICKS(s) ( \
973 COAP_NON_RECEIVE_TIMEOUT(s).integer_part * COAP_TICKS_PER_SECOND + \
974 COAP_NON_RECEIVE_TIMEOUT(s).fractional_part * COAP_TICKS_PER_SECOND / 1000)
975
984#define COAP_NON_PROBING_WAIT(s) \
985 coap_add_fixed_fixed(COAP_NON_PROBING_WAIT_BASE(s), \
986 COAP_NON_TIMEOUT_RANDOM(s))
987
988#define COAP_NON_PROBING_WAIT_TICKS(s) \
989 (COAP_NON_PROBING_WAIT(s).integer_part * COAP_TICKS_PER_SECOND + \
990 COAP_NON_PROBING_WAIT(s).fractional_part * COAP_TICKS_PER_SECOND / 1000)
991
998#define COAP_NON_PARTIAL_TIMEOUT_TICKS(s) \
999 (COAP_NON_PARTIAL_TIMEOUT(s).integer_part * COAP_TICKS_PER_SECOND + \
1000 COAP_NON_PARTIAL_TIMEOUT(s).fractional_part * COAP_TICKS_PER_SECOND / 1000)
1001
1008#define COAP_NON_TIMEOUT_RANDOM(s) \
1009 coap_get_non_timeout_random(s)
1010
1012
1013#define SESSIONS_ADD(e, obj) \
1014 HASH_ADD(hh, (e), addr_hash, sizeof((obj)->addr_hash), (obj))
1015
1016#define SESSIONS_DELETE(e, obj) \
1017 HASH_DELETE(hh, (e), (obj))
1018
1019#define SESSIONS_ITER(e, el, rtmp) \
1020 HASH_ITER(hh, (e), el, rtmp)
1021
1022#define SESSIONS_ITER_SAFE(e, el, rtmp) \
1023 for ((el) = (e); (el) && ((rtmp) = (el)->hh.next, 1); (el) = (rtmp))
1024
1025#define SESSIONS_FIND(e, k, res) { \
1026 HASH_FIND(hh, (e), &(k), sizeof(k), (res)); \
1027 }
1028
1029#ifdef __cplusplus
1030}
1031#endif
1032
1033#endif /* COAP_SESSION_INTERNAL_H_ */
struct coap_lg_crcv_t coap_lg_crcv_t
struct coap_endpoint_t coap_endpoint_t
struct coap_proxy_entry_t coap_proxy_entry_t
Proxy information.
struct coap_lg_srcv_t coap_lg_srcv_t
coap_nack_reason_t
Definition coap_io.h:64
Internal CoAP WebSockets support.
uint64_t coap_tick_t
This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.
Definition coap_time.h:149
coap_response_t
Definition coap_net.h:51
coap_session_t * coap_session_new_dtls_session(coap_session_t *session, coap_tick_t now)
Create a new DTLS session for the session.
int coap_mid_t
coap_mid_t is used to store the CoAP Message ID of a CoAP PDU.
Definition coap_pdu.h:192
coap_proto_t
CoAP protocol types Note: coap_layers_coap[] needs updating if extended.
Definition coap_pdu.h:242
coap_session_t * coap_new_client_session_pki3_lkd(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_pki_t *setup_data, void *app_data, coap_app_data_free_callback_t callback, coap_str_const_t *ws_host)
Creates a new client session to the designated server, with PKI credentials along with app_data infor...
void coap_connect_session(coap_session_t *session, coap_tick_t now)
void coap_session_reestablished(coap_session_t *session)
Session has been re-connected to server.
ssize_t coap_session_delay_pdu(coap_session_t *session, coap_pdu_t *pdu, coap_queue_t *node)
int coap_session_refresh_psk_hint(coap_session_t *session, const coap_bin_const_t *psk_hint)
Refresh the session's current Identity Hint (PSK).
void coap_session_hold_lkd(coap_session_t *session)
Mark the session as in use for a unit of work (reading and dispatching received data,...
void coap_session_disconnected_do_it_lkd(coap_session_t *session, coap_nack_reason_t reason)
Notify session that it has failed.
void coap_session_send_csm(coap_session_t *session)
Notify session transport has just connected and CSM exchange can now start.
coap_fixed_point_t coap_add_fixed_uint(coap_fixed_point_t fp1, uint32_t u2)
void coap_handle_nack(coap_session_t *session, coap_pdu_t *sent, const coap_nack_reason_t reason, const coap_mid_t mid)
size_t coap_session_max_pdu_rcv_size(const coap_session_t *session)
Get maximum acceptable receive PDU size.
coap_fixed_point_t coap_sub_fixed_uint(coap_fixed_point_t fp1, uint32_t u2)
int coap_session_set_type_server_lkd(coap_session_t *session)
Set the session type to server.
void coap_session_unhold_lkd(coap_session_t *session)
End a unit of work started by coap_session_hold_lkd().
coap_session_t * coap_new_client_session_psk_lkd(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, const char *identity, const uint8_t *key, unsigned key_len)
Creates a new client session to the designated server with PSK credentials.
coap_ext_token_check_t
coap_ext_token_check_t values
void coap_read_session(coap_context_t *ctx, coap_session_t *session, coap_tick_t now)
Definition coap_net.c:2726
coap_session_t * coap_new_client_session_psk3_lkd(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, coap_dtls_cpsk_t *setup_data, void *app_data, coap_app_data_free_callback_t callback, coap_str_const_t *ws_host)
Creates a new client session to the designated server, with PSK credentials along with app_data infor...
int coap_session_reconnect(coap_session_t *session)
Close the current session (if not already closed) and reconnect to server (client session only).
void coap_session_server_keepalive_failed(coap_session_t *session)
Clear down a session following a keepalive failure.
void * coap_endpoint_set_app_data_lkd(coap_endpoint_t *endpoint, void *data, coap_app_data_free_callback_t callback)
Stores data with the given endpoint, returning the previously stored value or NULL.
void coap_session_establish(coap_session_t *session)
Layer function interface for layer below session accept/connect being established.
coap_fixed_point_t coap_add_fixed_fixed(coap_fixed_point_t fp1, coap_fixed_point_t fp2)
coap_tick_t coap_get_non_timeout_random_ticks(coap_session_t *session)
int coap_session_refresh_psk_key(coap_session_t *session, const coap_bin_const_t *psk_key)
Refresh the session's current pre-shared key (PSK).
void coap_session_connected(coap_session_t *session)
Notify session that it has just connected or reconnected.
void coap_session_failed(coap_session_t *session)
Session has failed due to a socket error.
coap_fixed_point_t coap_multi_fixed_fixed(coap_fixed_point_t fp1, coap_fixed_point_t fp2)
ssize_t coap_session_send_pdu(coap_session_t *session, coap_pdu_t *pdu)
Send a pdu according to the session's protocol.
Definition coap_net.c:1271
size_t coap_session_max_pdu_size_lkd(const coap_session_t *session)
Get maximum acceptable PDU size.
coap_mid_t coap_session_send_ping_lkd(coap_session_t *session)
Send a ping message for the session.
coap_fixed_point_t coap_div_fixed_uint(coap_fixed_point_t fp1, uint32_t u2)
void coap_session_free(coap_session_t *session)
void coap_session_mfree(coap_session_t *session)
void coap_session_release_lkd(coap_session_t *session)
Decrement reference counter on a session.
int coap_session_refresh_psk_identity(coap_session_t *session, const coap_bin_const_t *psk_identity)
Refresh the session's current pre-shared identity (PSK).
coap_session_t * coap_new_client_session3_lkd(coap_context_t *ctx, const coap_address_t *local_if, const coap_address_t *server, coap_proto_t proto, void *app_data, coap_app_data_free_callback_t callback, coap_str_const_t *ws_host)
Creates a new client session to the designated server, with PSK credentials along with app_data infor...
int coap_session_set_type_client_lkd(coap_session_t *session, int report_changed)
Set the session type to client.
coap_fixed_point_t coap_get_non_timeout_random(coap_session_t *session)
COAP_OSCORE_B_2_STEP
coap_session_t * coap_session_reference_lkd(coap_session_t *session)
Increment reference counter on a session.
void * coap_session_set_app_data2_lkd(coap_session_t *session, void *data, coap_app_data_free_callback_t callback)
Stores data with the given session, returning the previously stored value or NULL.
coap_fixed_point_t coap_multi_fixed_uint(coap_fixed_point_t fp1, uint32_t u2)
void coap_session_disconnected_lkd(coap_session_t *session, coap_nack_reason_t reason)
The session is to be disconnected (a send on it has failed, the peer or the (D)TLS layer has closed i...
@ COAP_EXT_T_NOT_CHECKED
Not checked.
@ COAP_EXT_T_CHECKING
Token size check request sent.
@ COAP_EXT_T_CHECKED
Token size valid.
@ COAP_OSCORE_B_2_NONE
@ COAP_OSCORE_B_2_STEP_3
@ COAP_OSCORE_B_2_STEP_1
@ COAP_OSCORE_B_2_STEP_4
@ COAP_OSCORE_B_2_STEP_5
@ COAP_OSCORE_B_2_STEP_2
coap_session_type_t
coap_session_type_t values
coap_session_state_t
coap_session_state_t values
void(* coap_app_data_free_callback_t)(void *data)
Callback to free off the app data when the entry is being deleted / freed off.
Only used for servers for hashing incoming packets.
uint16_t lport
local port
coap_address_t remote
remote address and port
coap_proto_t proto
CoAP protocol.
Multi-purpose address abstraction.
CoAP binary data definition with const data.
Definition coap_str.h:65
The CoAP stack's global state is stored in a coap_context_t object.
The structure used for defining the Client PSK setup data to be used.
Definition coap_dtls.h:418
The structure used for defining the PKI setup data to be used.
Definition coap_dtls.h:317
Abstraction of a fixed point number that can be used where necessary instead of a float.
Structure to hold large body (many blocks) transmission information.
structure for CoAP PDUs
Queue entry.
Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (se...
coap_lg_xmit_t * lg_xmit
list of large transmissions
volatile uint8_t max_token_checked
Check for max token size coap_ext_token_check_t.
coap_nack_reason_t disconnect_reason
reason for the pending disconnect
uint8_t csm_not_seen
Set if timeout waiting for CSM.
unsigned int dtls_timeout_count
dtls setup retry counter
coap_bin_const_t * psk_key
If client, this field contains the current pre-shared key for server; When this field is NULL,...
uint32_t block_mode
Zero or more COAP_BLOCK_ or'd options.
coap_app_data_free_callback_t app_cb
call-back to release app_data
uint8_t delay_recursive
Set if in coap_client_delay_first().
coap_socket_t sock
socket object for the session, if any
coap_pdu_t * partial_pdu
incomplete incoming pdu
uint32_t max_token_size
Largest token size supported RFC8974.
uint32_t ping_failed
Ping failure count.
uint16_t nstart
maximum concurrent confirmable xmits (default 1)
coap_bin_const_t * psk_identity
If client, this field contains the current identity for server; When this field is NULL,...
coap_session_state_t state
current state of relationship with peer
uint8_t csm_bert_rem_support
CSM TCP BERT blocks supported (remote).
coap_mid_t last_resp_mid
The last response mid that has been been processed.
uint64_t tx_token
Next token number to use.
uint8_t is_rate_limiting
Currently NON rate limiting.
coap_mid_t remote_test_mid
mid used for checking remote support
uint8_t read_header[8]
storage space for header of incoming message header
uint8_t csm_bert_loc_support
CSM TCP BERT blocks supported (local).
coap_addr_tuple_t addr_info
remote/local address info
coap_proto_t proto
protocol used
uint16_t tx_mid
the last message id that was used in this session
uint8_t disconnect_pending
Set if a disconnect is deferred until the session is no longer in use.
uint8_t is_dtls13
Set if session is DTLS1.3.
unsigned ref
reference count from queues
size_t csm_rcv_mtu
CSM mtu (rcv).
coap_response_t last_con_handler_res
The result of calling the response handler of the last CON.
coap_tick_t last_tx
Last time a ratelimited packet is sent.
coap_bin_const_t * psk_hint
If client, this field contains the server provided identity hint.
coap_bin_const_t * last_token
uint8_t no_path_abbrev
Set is remote does not support Uri-Path-Abbrev.
coap_dtls_cpsk_t cpsk_setup_data
client provided PSK initial setup data
size_t mtu
path or CSM mtu (xmt)
uint8_t no_observe_cancel
Set if do not cancel observe on session close.
size_t partial_read
if > 0 indicates number of bytes already read for an incoming message
int dtls_event
Tracking any (D)TLS events on this session.
void * tls
security parameters
uint16_t max_retransmit
maximum re-transmit count (default 4)
unsigned hold_in_use
depth of work in progress on the session (coap_session_hold_lkd())
uint8_t csm_block_supported
CSM TCP blocks supported.
coap_fixed_point_t ack_random_factor
ack random factor backoff (default 1.5)
uint8_t proxy_session
Set if this is an ongoing proxy session.
uint8_t con_active
Active CON request sent.
coap_queue_t * delayqueue
list of delayed messages waiting to be sent
size_t tls_overhead
overhead of TLS layer
void * app_data
application-specific data
uint32_t tx_rtag
Next Request-Tag number to use.
coap_mid_t last_ping_mid
the last keepalive message id that was used in this session
uint8_t disconnecting
Set while the session is being disconnected.
coap_fixed_point_t ack_timeout
timeout waiting for ack (default 2.0 secs)
uint64_t rl_ticks_per_packet
If not 0, rate limit NON to ticks per packet.
coap_fixed_point_t default_leisure
Mcast leisure time (default 5.0 secs).
coap_session_type_t type
client or server side socket
uint32_t probing_rate
Max transfer wait when remote is not responding (default 1 byte/sec).
coap_context_t * context
session's context
coap_queue_t * delayqueue_tail
tail of delayqueue for O(1) append
size_t partial_write
if > 0 indicates number of bytes already written from the pdu at the head of sendqueue
coap_addr_hash_t addr_hash
Address hash for server incoming packets.
int ifindex
interface index
coap_bin_const_t * echo
last token used to make a request
CoAP string data definition with const data.
Definition coap_str.h:47
WebSockets session state.