33 volatile uint32_t
len;
37#define MMPKT_LIST_INIT { NULL, NULL, 0 }
156 return (list->
head == NULL);
210#define MMPKT_LIST_WALK(_lst, _wlk, _nxt) \
211 if ((_lst)->head != NULL) \
212 for (_wlk = (_lst)->head, _nxt = mmpkt_get_next(_wlk); _wlk != NULL; \
213 _wlk = _nxt, _nxt = _wlk ? mmpkt_get_next(_wlk) : NULL)
struct mmpkt * mmpkt_list_dequeue_tail(struct mmpkt_list *list)
Remove the mmpkt at the tail of the list and return it.
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.
static struct mmpkt * mmpkt_list_dequeue_all(struct mmpkt_list *list)
Remove all mmpkts from the list and return as a linked list.
static uint32_t mmpkt_list_length(struct mmpkt_list *list)
Gets the current length of the given mmpkt list.
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.
void mmpkt_list_prepend(struct mmpkt_list *list, struct mmpkt *mmpkt)
Add an mmpkt to the start of an mmpkt list.
void mmpkt_list_remove(struct mmpkt_list *list, struct mmpkt *mmpkt)
Remove an mmpkt from an mmpkt list.
static struct mmpkt * mmpkt_list_peek(struct mmpkt_list *list)
Returns the head of the mmpkt list.
static bool mmpkt_list_is_empty(struct mmpkt_list *list)
Checks whether the given mmpkt list is empty.
static struct mmpkt * mmpkt_list_peek_tail(struct mmpkt_list *list)
Returns the tail of the mmpkt list.
static void mmpkt_list_init(struct mmpkt_list *list)
Initialization function for mmpkt_list, for cases where MMPKT_LIST_INIT cannot be used.
struct mmpkt * mmpkt_list_dequeue(struct mmpkt_list *list)
Remove the mmpkt at the head of the list and return it.
uint32_t mmpkt_list_clear(struct mmpkt_list *list)
Free all the packets in the given list and reset the list to empty state.
void mmpkt_list_append(struct mmpkt_list *list, struct mmpkt *mmpkt)
Add an mmpkt to the end of an mmpkt list.
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.
Structure that can be used as the head of a linked list of mmpkts that counts its length.
struct mmpkt *volatile tail
Last mmpkt in the list.
volatile uint32_t len
Length of the list.
struct mmpkt *volatile head
First mmpkt in the list.
Core mmpkt data structure.