ifq_deq_begin(9)
Canonical URL: /ifq_deq_begin.9/
NAME
ifq_deq_begin,
ifq_deq_commit,
ifq_deq_rollback —
dequeue an mbuf from an interface
sending queue
SYNOPSIS
#include
<net/if_var.h>
struct mbuf *
ifq_deq_begin(struct
ifqueue *ifq);
void
ifq_deq_commit(struct
ifqueue *ifq, struct mbuf
*m);
void
ifq_deq_rollback(struct
ifqueue *ifq, struct mbuf
*m);
DESCRIPTION
The ifq_deq_* set of functions provides a non-atomic alternative to ifq_dequeue(9). Their use is discouraged, code should use ifq_dequeue(9) whenever possible.
ifq_deq_begin(struct ifqueue *ifq)- Get a reference to the next mbuf to be transmitted from the
ifq interface send queue. If an mbuf is to be
transmitted, also acquire a lock on the send queue to exclude modification
or freeing of the referenced mbuf. Its packet header must not be modified
until the mbuf has been dequeued with
ifq_deq_commit(). ifq_deq_commit(struct ifqueue *ifq, struct mbuf *m)- Dequeue the mbuf m that was referenced by a previous
call to
ifq_deq_begin() and release the lock on ifq. ifq_deq_rollback(struct ifqueue *ifq, struct mbuf *m)- Release the lock on the interface send queue ifq that was acquired while a reference to m was being held.
CONTEXT
ifq_deq_begin(),
ifq_deq_commit(), and
ifq_deq_rollback() can be called during autoconf,
from process context, or from interrupt context.
RETURN VALUES
ifq_deq_begin() returns the next mbuf to
be transmitted by the interface. If no packet is available for transmission,
NULL is returned.
SEE ALSO
Need conceptual guidance? Continue in the OpenBSD Handbook.