mbed port of tinydtls
The netq utility functions implement an ordered queue of data packets to send over the network and can also be used to queue received packets from the network. More...
Typedefs | |
typedef unsigned char | netq_packet_t [DTLS_MAX_BUF] |
Datagrams in the netq_t structure have a fixed maximum size of DTLS_MAX_BUF to simplify memory management on constrained nodes. | |
Functions | |
int | netq_insert_node (netq_t **queue, netq_t *node) |
Adds a node to the given queue, ordered by their time-stamp t. | |
void | netq_node_free (netq_t *node) |
Destroys specified node and releases any memory that was allocated for the associated datagram. | |
void | netq_delete_all (netq_t *queue) |
Removes all items from given queue and frees the allocated storage. | |
netq_t * | netq_node_new () |
Creates a new node suitable for adding to a netq_t queue. | |
netq_t * | netq_head (netq_t **queue) |
Returns a pointer to the first item in given queue or NULL if empty. | |
netq_t * | netq_pop_first (netq_t **queue) |
Removes the first item in given queue and returns a pointer to the removed element. |
Detailed Description
The netq utility functions implement an ordered queue of data packets to send over the network and can also be used to queue received packets from the network.
Typedef Documentation
typedef unsigned char netq_packet_t[DTLS_MAX_BUF] |
Function Documentation
void netq_delete_all | ( | netq_t * | queue ) |
netq_t* netq_head | ( | netq_t ** | queue ) |
int netq_insert_node | ( | netq_t ** | queue, |
netq_t * | node | ||
) |
Adds a node to the given queue, ordered by their time-stamp t.
This function returns 0
on error, or non-zero if node
has been added successfully.
- Parameters:
-
queue A pointer to the queue head where node
will be added.node The new item to add.
- Returns:
0
on error, or non-zero if the new item was added.
void netq_node_free | ( | netq_t * | node ) |
netq_t* netq_node_new | ( | ) |
netq_t* netq_pop_first | ( | netq_t ** | queue ) |
Removes the first item in given queue and returns a pointer to the removed element.
If queue is empty when netq_pop_first() is called, this function returns NULL.
Generated on Thu Jul 14 2022 20:00:56 by 1.7.2