![]() |
Morse Micro IoT SDK
2.11.2
|
Data Structures | |
| struct | mmpkt_list |
| Structure that can be used as the head of a linked list of mmpkts that counts its length. More... | |
Macros | |
| #define | MMPKT_LIST_INIT { NULL, NULL, 0 } |
| Static initializer for mmpkt_list. More... | |
| #define | MMPKT_LIST_WALK(_lst, _wlk, _nxt) |
| Safely walk the mmpkt list. More... | |
Functions | |
| static void | mmpkt_list_init (struct mmpkt_list *list) |
Initialization function for mmpkt_list, for cases where MMPKT_LIST_INIT cannot be used. More... | |
| static uint32_t | mmpkt_list_length (struct mmpkt_list *list) |
| Gets the current length of the given mmpkt list. More... | |
| void | mmpkt_list_prepend (struct mmpkt_list *list, struct mmpkt *mmpkt) |
| Add an mmpkt to the start of an mmpkt list. More... | |
| void | mmpkt_list_append (struct mmpkt_list *list, struct mmpkt *mmpkt) |
| Add an mmpkt to the end of an mmpkt list. More... | |
| void | mmpkt_list_insert_after (struct mmpkt_list *list, struct mmpkt *ref, struct mmpkt *mmpkt) |
| Insert an mmpkt into an mmpkt list after a specified list entry. More... | |
| void | mmpkt_list_remove (struct mmpkt_list *list, struct mmpkt *mmpkt) |
| Remove an mmpkt from an mmpkt list. More... | |
| struct mmpkt * | mmpkt_list_dequeue (struct mmpkt_list *list) |
| Remove the mmpkt at the head of the list and return it. More... | |
| uint32_t | mmpkt_list_dequeue_multiple (struct mmpkt_list *src, struct mmpkt_list *dst, uint32_t count) |
Remove up to count mmpkts from the head of src and append them to dst. More... | |
| struct mmpkt * | mmpkt_list_dequeue_tail (struct mmpkt_list *list) |
| Remove the mmpkt at the tail of the list and return it. More... | |
| static struct mmpkt * | mmpkt_list_dequeue_all (struct mmpkt_list *list) |
| Remove all mmpkts from the list and return as a linked list. More... | |
| static bool | mmpkt_list_is_empty (struct mmpkt_list *list) |
| Checks whether the given mmpkt list is empty. More... | |
| static struct mmpkt * | mmpkt_list_peek (struct mmpkt_list *list) |
| Returns the head of the mmpkt list. More... | |
| static struct mmpkt * | mmpkt_list_peek_tail (struct mmpkt_list *list) |
| Returns the tail of the mmpkt list. More... | |
| uint32_t | mmpkt_list_clear (struct mmpkt_list *list) |
| Free all the packets in the given list and reset the list to empty state. More... | |
| void | mmpkt_list_append_list (struct mmpkt_list *list, struct mmpkt_list *other) |
| Insert mmpkts to the end of an mmpkt list, from another mmpkt list. More... | |
| #define MMPKT_LIST_INIT { NULL, NULL, 0 } |
Static initializer for mmpkt_list.
Definition at line 37 of file mmpkt_list.h.
| #define MMPKT_LIST_WALK | ( | _lst, | |
| _wlk, | |||
| _nxt | |||
| ) |
Safely walk the mmpkt list.
if (x) MMPKT_LIST_WALK(a,b,c) else foo(); – instead: if (x) { MMPKT_LIST_WALK(a,b,c) } else foo(); Definition at line 210 of file mmpkt_list.h.
| void mmpkt_list_append | ( | struct mmpkt_list * | list, |
| struct mmpkt * | mmpkt | ||
| ) |
Add an mmpkt to the end of an mmpkt list.
| list | The list to append to. |
| mmpkt | The mmpkt to append. |
| void mmpkt_list_append_list | ( | struct mmpkt_list * | list, |
| struct mmpkt_list * | other | ||
| ) |
Insert mmpkts to the end of an mmpkt list, from another mmpkt list.
The mmpkts will be removed from the other list, and the other list will be marked as empty.
| list | The list to append to. |
| other | The list to remove mmpkts from for appending. |
| uint32_t mmpkt_list_clear | ( | struct mmpkt_list * | list | ) |
Free all the packets in the given list and reset the list to empty state.
| list | The list to clear. |
| struct mmpkt * mmpkt_list_dequeue | ( | struct mmpkt_list * | list | ) |
Remove the mmpkt at the head of the list and return it.
| list | The list to dequeue from. |
NULL if the list is empty.
|
inlinestatic |
Remove all mmpkts from the list and return as a linked list.
| list | The list to dequeue from. |
NULL if the list is empty. Definition at line 138 of file mmpkt_list.h.
| uint32_t mmpkt_list_dequeue_multiple | ( | struct mmpkt_list * | src, |
| struct mmpkt_list * | dst, | ||
| uint32_t | count | ||
| ) |
Remove up to count mmpkts from the head of src and append them to dst.
The relative packet order is preserved. If count exceeds the list length, all packets are moved.
| src | The list to dequeue from. |
| dst | The list to append to. |
| count | The maximum number of packets to dequeue. |
| struct mmpkt * mmpkt_list_dequeue_tail | ( | struct mmpkt_list * | list | ) |
Remove the mmpkt at the tail of the list and return it.
| list | The list to dequeue from. |
NULL if the list is empty.
|
inlinestatic |
Initialization function for mmpkt_list, for cases where MMPKT_LIST_INIT cannot be used.
| list | The mmpkt_list to init. |
Definition at line 45 of file mmpkt_list.h.
| void mmpkt_list_insert_after | ( | struct mmpkt_list * | list, |
| struct mmpkt * | ref, | ||
| struct mmpkt * | mmpkt | ||
| ) |
Insert an mmpkt into an mmpkt list after a specified list entry.
| list | The list to insert into. |
| ref | The packet to insert after. |
| mmpkt | The mmpkt to insert. |
|
inlinestatic |
Checks whether the given mmpkt list is empty.
| list | The list to check. |
true if the list is empty, else false. Definition at line 154 of file mmpkt_list.h.
|
inlinestatic |
Gets the current length of the given mmpkt list.
| list | The list to get the length of. |
list. Definition at line 59 of file mmpkt_list.h.
|
inlinestatic |
Returns the head of the mmpkt list.
| list | The list to peek into. |
Definition at line 166 of file mmpkt_list.h.
|
inlinestatic |
Returns the tail of the mmpkt list.
| list | The list to peek into. |
Definition at line 178 of file mmpkt_list.h.
| void mmpkt_list_prepend | ( | struct mmpkt_list * | list, |
| struct mmpkt * | mmpkt | ||
| ) |
Add an mmpkt to the start of an mmpkt list.
| list | The list to prepend to. |
| mmpkt | The mmpkt to prepend. |
| void mmpkt_list_remove | ( | struct mmpkt_list * | list, |
| struct mmpkt * | mmpkt | ||
| ) |
Remove an mmpkt from an mmpkt list.
| list | The list to remove from. |
| mmpkt | The mmpkt to remove. |