man.bsd.lv manual page server

Manual Page Search Parameters

ALTQ(9) Kernel Developer's Manual ALTQ(9)

ALTQkernel interfaces for manipulating output queues on network interfaces

#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ifq_var.h>

static int
ifq_enqueue(struct ifaltq *_ifq, struct mbuf *_m, struct altq_pktattr *_pa);

static int
ifq_handoff(struct ifnet *_ifp, struct mbuf *_m, struct altq_pktattr *_pa);

struct mbuf *
ifq_dequeue(struct ifaltq *_ifq, struct mbuf *_mpolled);

struct mbuf *
ifq_poll(struct ifaltq *_ifq);

void
ifq_purge(struct ifaltq *_ifq);

void
ifq_classify(struct ifaltq *_ifq, struct mbuf *_m, uint8_t _af, struct altq_pktattr *_pa);

int
ifq_is_empty(struct ifaltq *_ifq);

void
ifq_set_maxlen(struct ifaltq *_ifq, int _len);

void
ifq_set_ready(struct ifaltq *_ifq);

int
ifq_is_enabled(struct ifaltq *_ifq);

The ALTQ system is a framework to manage queueing disciplines on network interfaces. ALTQ introduces new functions to manipulate output queues. The output queue functions are used to abstract queue operations and not to touch the internal fields of the output queue structure.

() and () enqueue a packet _m to the queue _ifq. The underlying queueing discipline may discard the packet. They return 0 on success, or ENOBUFS if the packet is discarded. The packet pointed to by _m will be freed by the device driver on success or by the queueing discipline on failure, so that the caller should not touch _m after calling ifq_enqueue(). ifq_handoff() combines the enqueue operation with statistic generation and calls () upon successful enqueue to initiate the actual send.

() dequeues a packet from the queue. It returns the dequeued packet, or NULL if no packet is dequeued. The caller must always check the return value since a non-empty queue could return NULL under rate-limiting.

() returns the next packet without removing it from the queue. It is guaranteed by the underlying queueing discipline that ifq_dequeue() immediately after ifq_poll() returns the same packet.

() discards all the packets in the queue. The purge operation is needed since a non-work conserving queue cannot be emptied by a dequeue loop.

() classifies a packet to a scheduling class, and returns the result in _pa.

() can be used to check if the queue is empty. Note that ifq_dequeue() could still return NULL if the queueing discipline is non-work conserving.

() sets the queue length limit to the default FIFO queue.

() sets a flag to indicate that this driver is converted to use the new macros. ALTQ can be enabled only on interfaces with this flag.

() returns 1 if ALTQ is enabled for the queue, 0 if not.

Queueing disciplines need to maintain ifq_len (used by ifq_is_empty()). Queueing disciplines also need to guarantee that the same mbuf is returned if ifq_dequeue() is called immediately after ifq_poll().

altq(4), pf(4), pf.conf(5), pfctl(8)

The ALTQ system first appeared in March 1997 and was imported into DragonFly 1.1.

November 18, 2007 DragonFly-5.6.1