| ML_INIT(9) | Kernel Developer's Manual | ML_INIT(9) |
ml_init,
ml_enqueue, ml_dequeue,
ml_enlist, ml_dechain,
ml_len, ml_empty,
ml_hdatalen, ml_purge,
MBUF_LIST_INITIALIZER,
MBUF_LIST_FIRST,
MBUF_LIST_NEXT,
MBUF_LIST_FOREACH — mbuf
list API
#include
<sys/mbuf.h>
void
ml_init(struct
mbuf_list *ml);
void
ml_enqueue(struct
mbuf_list *ml, struct
mbuf *m);
struct mbuf *
ml_dequeue(struct
mbuf_list *ml);
void
ml_enlist(struct
mbuf_list *ml, struct
mbuf_list *src);
struct mbuf *
ml_dechain(struct
mbuf_list *ml);
unsigned int
ml_len(struct
mbuf_list *ml);
int
ml_empty(struct
mbuf_list *ml);
unsigned int
ml_hdatalen(struct
mbuf_list *ml);
unsigned int
ml_purge(struct
mbuf_list *ml);
struct mbuf_list
MBUF_LIST_INITIALIZER();
struct mbuf *
MBUF_LIST_FIRST(struct
mbuf_list *ml);
struct mbuf *
MBUF_LIST_NEXT(struct
mbuf *m);
MBUF_LIST_FOREACH(struct
mbuf_list *ml,
VARNAME);
The mbuf list API provides implementations of data structures and operations for managing lists of mbufs between contexts.
mbuf_list structures support the following functionality:
ml_init(struct
mbuf_list *ml)MBUF_LIST_INITIALIZER()ml_enqueue(struct
mbuf_list *ml, struct mbuf *m)ml_dequeue(struct
mbuf_list *ml)ml_enlist(struct
mbuf_list *ml, struct mbuf_list *src)ml_dechain(struct
mbuf_list *ml)ml_len(struct
mbuf_list *ml)ml_empty(struct
mbuf_list *ml)ml_hdatalen(struct
mbuf_list *ml)ml_purge(struct
mbuf_list *ml)MBUF_LIST_FIRST(struct
mbuf_list *ml)MBUF_LIST_NEXT(struct
mbuf *m)MBUF_LIST_FOREACH(struct
mbuf_list *ml, VARNAME)ml_init(),
ml_enqueue(), ml_dequeue(),
ml_enlist(), ml_dechain(),
ml_len(), ml_empty(),
ml_purge(),
MBUF_LIST_INITIALIZER(),
MBUF_LIST_FIRST(),
MBUF_LIST_NEXT(), and
MBUF_LIST_FOREACH() can be called during autoconf,
from process context, or from interrupt context.
ml_dequeue() returns the mbuf that was at
the head of its list. If the list was empty, NULL is
returned.
ml_dechain() returns all the mbufs that
were on the list via a pointer to an mbuf with the chain accessible via
m_nextpkt members. If the list was empty, NULL is
returned.
ml_len() returns the number of mbufs on
the list.
ml_empty() return a non-zero value if the
list is empty, otherwise 0.
ml_hdatalen() returns the size of a packet
on the list, or 0 if the list is empty.
ml_purge() returns the number of mbufs
that were freed.
MBUF_LIST_FIRST() returns the first mbuf
in the mbuf list, or NULL if the list is empty.
MBUF_LIST_NEXT() returns the next mbuf in
the mbuf list, or NULL if the end of the list has
been reached.
| January 23, 2020 | Debian |