libcoap
4.3.0
|
CoAP Session Structures, Enums and Functions that are not exposed to applications. More...
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... | |
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_t * | coap_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_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... | |
void | coap_session_free (coap_session_t *session) |
void | coap_session_mfree (coap_session_t *session) |
CoAP Session Structures, Enums and Functions that are not exposed to applications.
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.
endpoint | Active endpoint the packet was received on. |
packet | Received packet. |
now | The current time in ticks. |
NULL
if error. Definition at line 554 of file coap_session.c.
coap_session_t* coap_new_server_session | ( | coap_context_t * | ctx, |
coap_endpoint_t * | ep | ||
) |
Creates a new server session for the specified endpoint.
ctx | The CoAP context. |
ep | An endpoint where an incoming connection request is pending. |
Definition at line 1106 of file coap_session.c.
void coap_session_connected | ( | coap_session_t * | session | ) |
Notify session that it has just connected or reconnected.
session | The CoAP session. |
Definition at line 399 of file coap_session.c.
ssize_t coap_session_delay_pdu | ( | coap_session_t * | session, |
coap_pdu_t * | pdu, | ||
coap_queue_t * | node | ||
) |
Definition at line 312 of file coap_session.c.
void coap_session_free | ( | coap_session_t * | session | ) |
Definition at line 225 of file coap_session.c.
void coap_session_mfree | ( | coap_session_t * | session | ) |
Definition at line 159 of file coap_session.c.
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).
Note: A copy of psk_hint
is maintained in the session by libcoap.
session | The current coap_session_t object. |
psk_hint | If NULL, the Identity Hint will revert to the initial Identity Hint used at session setup. |
1
if successful, else 0
. Definition at line 996 of file coap_session.c.
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).
Note: A copy of psk_key
is maintained in the session by libcoap.
session | The current coap_session_t object. |
psk_key | If NULL, the pre-shared key will revert to the initial pre-shared key used as session setup. |
1
if successful, else 0
. Definition at line 1025 of file coap_session.c.
ssize_t coap_session_send | ( | coap_session_t * | session, |
const uint8_t * | data, | ||
size_t | datalen | ||
) |
Function interface for datagram data transmission.
This function returns the number of bytes that have been transmitted, or a value less than zero on error.
session | Session to send data on. |
data | The data to send. |
datalen | The actual length of data . |
Definition at line 277 of file coap_session.c.
void coap_session_send_csm | ( | coap_session_t * | session | ) |
Notify session transport has just connected and CSM exchange can now start.
session | The CoAP session. |
Definition at line 351 of file coap_session.c.
ssize_t coap_session_send_pdu | ( | coap_session_t * | session, |
coap_pdu_t * | pdu | ||
) |
Send a pdu according to the session's protocol.
This function returns the number of bytes that have been transmitted, or a value less than zero on error.
session | Session to send pdu on. |
pdu | The pdu to send. |
Definition at line 766 of file net.c.
ssize_t coap_session_write | ( | coap_session_t * | session, |
const uint8_t * | data, | ||
size_t | datalen | ||
) |
Function interface for stream data transmission.
This function returns the number of bytes that have been transmitted, or a value less than zero on error. The number of bytes written may be less than datalen because of congestion control.
session | Session to send data on. |
data | The data to send. |
datalen | The actual length of data . |
Definition at line 298 of file coap_session.c.