libcoap  4.3.0rc3
coap_session_internal.h File Reference

COAP session internal information. More...

#include "coap_io_internal.h"
+ Include dependency graph for coap_session_internal.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  coap_addr_hash_t
 Only used for servers for hashing incoming packets. More...
 
struct  coap_session_t
 Abstraction of virtual session that can be attached to coap_context_t (client) or coap_endpoint_t (server). More...
 
struct  coap_endpoint_t
 Abstraction of virtual endpoint that can be attached to coap_context_t. More...
 

Macros

#define COAP_DEFAULT_SESSION_TIMEOUT   300
 
#define COAP_PARTIAL_SESSION_TIMEOUT_TICKS   (30 * COAP_TICKS_PER_SECOND)
 
#define COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS   100
 
#define SESSIONS_ADD(e, obj)    HASH_ADD(hh, (e), addr_hash, sizeof((obj)->addr_hash), (obj))
 
#define SESSIONS_DELETE(e, obj)    HASH_DELETE(hh, (e), (obj))
 
#define SESSIONS_ITER(e, el, rtmp)    HASH_ITER(hh, (e), el, rtmp)
 
#define SESSIONS_ITER_SAFE(e, el, rtmp)   for ((el) = (e); (el) && ((rtmp) = (el)->hh.next, 1); (el) = (rtmp))
 
#define SESSIONS_FIND(e, k, res)
 

Functions

void coap_session_send_csm (coap_session_t *session)
 Notify session transport has just connected and CSM exchange can now start. More...
 
void coap_session_connected (coap_session_t *session)
 Notify session that it has just connected or reconnected. More...
 
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). More...
 
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). More...
 
coap_session_tcoap_new_server_session (coap_context_t *ctx, coap_endpoint_t *ep)
 Creates a new server session for the specified endpoint. More...
 
ssize_t coap_session_send (coap_session_t *session, const uint8_t *data, size_t datalen)
 Function interface for datagram data transmission. More...
 
ssize_t coap_session_write (coap_session_t *session, const uint8_t *data, size_t datalen)
 Function interface for stream data transmission. More...
 
ssize_t coap_session_send_pdu (coap_session_t *session, coap_pdu_t *pdu)
 Send a pdu according to the session's protocol. More...
 
ssize_t coap_session_delay_pdu (coap_session_t *session, coap_pdu_t *pdu, coap_queue_t *node)
 
coap_session_tcoap_endpoint_get_session (coap_endpoint_t *endpoint, const coap_packet_t *packet, coap_tick_t now)
 Lookup the server session for the packet received on an endpoint, or create a new one. More...
 
coap_session_tcoap_session_new_dtls_session (coap_session_t *session, coap_tick_t now)
 Create a new DTLS session for the session. More...
 
void coap_session_free (coap_session_t *session)
 
void coap_session_mfree (coap_session_t *session)
 

Detailed Description

COAP session internal information.

Definition in file coap_session_internal.h.

Macro Definition Documentation

◆ COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS

#define COAP_DEFAULT_MAX_HANDSHAKE_SESSIONS   100

Definition at line 23 of file coap_session_internal.h.

◆ COAP_DEFAULT_SESSION_TIMEOUT

#define COAP_DEFAULT_SESSION_TIMEOUT   300

Definition at line 21 of file coap_session_internal.h.

◆ COAP_PARTIAL_SESSION_TIMEOUT_TICKS

#define COAP_PARTIAL_SESSION_TIMEOUT_TICKS   (30 * COAP_TICKS_PER_SECOND)

Definition at line 22 of file coap_session_internal.h.

◆ SESSIONS_ADD

#define SESSIONS_ADD (   e,
  obj 
)     HASH_ADD(hh, (e), addr_hash, sizeof((obj)->addr_hash), (obj))

Definition at line 277 of file coap_session_internal.h.

◆ SESSIONS_DELETE

#define SESSIONS_DELETE (   e,
  obj 
)     HASH_DELETE(hh, (e), (obj))

Definition at line 280 of file coap_session_internal.h.

◆ SESSIONS_FIND

#define SESSIONS_FIND (   e,
  k,
  res 
)
Value:
{ \
HASH_FIND(hh, (e), &(k), sizeof(k), (res)); \
}

Definition at line 289 of file coap_session_internal.h.

◆ SESSIONS_ITER

#define SESSIONS_ITER (   e,
  el,
  rtmp 
)     HASH_ITER(hh, (e), el, rtmp)

Definition at line 283 of file coap_session_internal.h.

◆ SESSIONS_ITER_SAFE

#define SESSIONS_ITER_SAFE (   e,
  el,
  rtmp 
)    for ((el) = (e); (el) && ((rtmp) = (el)->hh.next, 1); (el) = (rtmp))

Definition at line 286 of file coap_session_internal.h.