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.
Datagrams in the netq_t structure have a fixed maximum size of DTLS_MAX_BUF to simplify memory management on constrained nodes.
Definition at line 36 of file netq.h.
void netq_delete_all |
( |
list_t |
queue | ) |
|
Removes all items from given queue and frees the allocated storage
Definition at line 133 of file netq.c.
Returns a pointer to the first item in given queue or NULL if empty.
Definition at line 80 of file netq.c.
static void netq_init |
( |
| ) |
|
|
inlinestatic |
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.
Definition at line 61 of file netq.c.
void netq_node_free |
( |
netq_t * |
node | ) |
|
Destroys specified node and releases any memory that was allocated for the associated datagram.
Definition at line 127 of file netq.c.
netq_t* netq_node_new |
( |
size_t |
size | ) |
|
Creates a new node suitable for adding to a netq_t queue.
Definition at line 111 of file netq.c.
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.
Definition at line 103 of file netq.c.