libcoap 4.3.2rc2

Data Structures | Macros | Typedefs | Enumerations | Functions
coap_session_internal.h File Reference

CoAP session internal information. More...

`#include "coap_internal.h"`
`#include "coap_io_internal.h"`
`#include "coap_ws_internal.h"`

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 | COAP_SESSION_REF(s) ((s)->ref
#define | COAP_ACK_TIMEOUT(s) ((s)->ack_timeout)
#define | COAP_ACK_RANDOM_FACTOR(s) ((s)->ack_random_factor)
#define | COAP_MAX_RETRANSMIT(s) ((s)->max_retransmit)
#define | COAP_NSTART(s) ((s)->nstart)
#define | COAP_DEFAULT_LEISURE(s) ((s)->default_leisure)
#define | COAP_PROBING_RATE(s) ((s)->probing_rate)
#define | COAP_MAX_PAYLOADS(s) ((s)->max_payloads)
#define | COAP_NON_MAX_RETRANSMIT(s) ((s)->non_max_retransmit)
#define | COAP_NON_TIMEOUT(s) ((s)->non_timeout)
#define | COAP_NON_TIMEOUT_TICKS(s)
#define | COAP_NON_RECEIVE_TIMEOUT(s) ((s)->non_receive_timeout)
#define | COAP_NON_PROBING_WAIT_BASE(s) ((s)->non_probing_wait_base)
#define | COAP_NON_PARTIAL_TIMEOUT(s) ((s)->non_partial_timeout)
#define | COAP_DEFAULT_LEISURE_TICKS(s)
| The DEFAULT_LEISURE definition for the session (s). More...
#define | COAP_MAX_TRANSMIT_SPAN(s)
| The MAX_TRANSMIT_SPAN definition for the session (s). More...
#define | COAP_MAX_TRANSMIT_WAIT(s)
| The MAX_TRANSMIT_WAIT definition for the session (s). More...
#define | COAP_MAX_TRANSMIT_WAIT_TICKS(s) (COAP_MAX_TRANSMIT_WAIT(s) * COAP_TICKS_PER_SECOND)
#define | COAP_PROCESSING_DELAY(s)
| The PROCESSING_DELAY definition for the session (s). More...
#define | COAP_MAX_RTT(s) ((2 * COAP_DEFAULT_MAX_LATENCY) + COAP_PROCESSING_DELAY(s))
| The MAX_RTT definition for the session (s). More...
#define | COAP_EXCHANGE_LIFETIME(s)
| The EXCHANGE_LIFETIME definition for the session (s). More...
#define | COAP_NON_LIFETIME(s) (COAP_MAX_TRANSMIT_SPAN(s) + COAP_DEFAULT_MAX_LATENCY)
| The NON_LIFETIME definition for the session (s). More...
#define | COAP_NON_RECEIVE_TIMEOUT_TICKS(s)
| The NON_RECEIVE_TIMEOUT definition for the session (s). More...
#define | COAP_NON_PROBING_WAIT(s)
| The NON_PROBING_WAIT definition for the session (s). More...
#define | COAP_NON_PROBING_WAIT_TICKS(s)
#define | COAP_NON_PARTIAL_TIMEOUT_TICKS(s)
| The NON_PARTIAL_TIMEOUT definition for the session (s). More...
#define | COAP_NON_TIMEOUT_RANDOM(s) coap_get_non_timeout_random(s)
| The NON_TIMEOUT_RANDOM definition for the session (s). More...
#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)

## Typedefs
typedef enum coap_ext_token_check_t | coap_ext_token_check_t
| coap_ext_token_check_t values More...

## Enumerations
enum | COAP_OSCORE_B_2_STEP { COAP_OSCORE_B_2_NONE = 0 , COAP_OSCORE_B_2_STEP_1 , COAP_OSCORE_B_2_STEP_2 , COAP_OSCORE_B_2_STEP_3 , COAP_OSCORE_B_2_STEP_4 , COAP_OSCORE_B_2_STEP_5 }
enum | coap_ext_token_check_t { COAP_EXT_T_NOT_CHECKED = 0 , COAP_EXT_T_CHECKED , COAP_EXT_T_CHECKING }
| coap_ext_token_check_t values More...

## Functions
coap_fixed_point_t | coap_multi_fixed_fixed (coap_fixed_point_t fp1, coap_fixed_point_t fp2)
coap_fixed_point_t | coap_multi_fixed_uint (coap_fixed_point_t fp1, uint32_t u2)
coap_fixed_point_t | coap_add_fixed_fixed (coap_fixed_point_t fp1, coap_fixed_point_t fp2)
coap_fixed_point_t | coap_add_fixed_uint (coap_fixed_point_t fp1, uint32_t u2)
coap_fixed_point_t | coap_sub_fixed_uint (coap_fixed_point_t fp1, uint32_t u2)
coap_fixed_point_t | coap_div_fixed_uint (coap_fixed_point_t fp1, uint32_t u2)
coap_fixed_point_t | coap_get_non_timeout_random (coap_session_t *session)
coap_tick_t | coap_get_non_timeout_random_ticks (coap_session_t *session)
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...
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). More...
coap_session_t * | coap_new_server_session (coap_context_t *ctx, coap_endpoint_t *ep)
| Creates a new server session for the specified endpoint. More...
void | coap_session_establish (coap_session_t *session)
| Layer function interface for layer below session accept/connect being established. 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_t * | coap_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...
size_t | coap_session_max_pdu_rcv_size (const coap_session_t *session)
| Get maximum acceptable receive PDU size. More...
coap_session_t * | coap_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 27 of file coap_session_internal.h.

## ◆ COAP_DEFAULT_SESSION_TIMEOUT

#define COAP_DEFAULT_SESSION_TIMEOUT 300

Definition at line 25 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 26 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 529 of file coap_session_internal.h.

## ◆ SESSIONS_DELETE

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

Definition at line 532 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 541 of file coap_session_internal.h.

## ◆ SESSIONS_ITER

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

Definition at line 535 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 538 of file coap_session_internal.h.