libnl  1.1.4

The FIFO qdisc comes in two flavours: More...

Attribute Modification

int rtnl_qdisc_fifo_set_limit (struct rtnl_qdisc *qdisc, int limit)
 Set limit of FIFO qdisc. More...
 
int rtnl_qdisc_fifo_get_limit (struct rtnl_qdisc *qdisc)
 Get limit of a FIFO qdisc. More...
 

Detailed Description

bfifo (Byte FIFO)
Allows enqueuing until the currently queued volume in bytes exceeds the configured limit.backlog contains currently enqueued volume in bytes.
pfifo (Packet FIFO)
Allows enquueing until the currently queued number of packets exceeds the configured limit.

The configuration is exactly the same, the decision which of the two variations is going to be used is made based on the kind of the qdisc (rtnl_qdisc_set_kind()).

Function Documentation

int rtnl_qdisc_fifo_set_limit ( struct rtnl_qdisc *  qdisc,
int  limit 
)
Parameters
qdiscFIFO qdisc to be modified.
limitNew limit.
Returns
0 on success or a negative error code.

Definition at line 145 of file fifo.c.

146 {
147  struct rtnl_fifo *fifo;
148 
149  fifo = fifo_alloc(qdisc);
150  if (!fifo)
151  return nl_errno(ENOMEM);
152 
153  fifo->qf_limit = limit;
154  fifo->qf_mask |= SCH_FIFO_ATTR_LIMIT;
155 
156  return 0;
157 }
int rtnl_qdisc_fifo_get_limit ( struct rtnl_qdisc *  qdisc)
Parameters
qdiscFIFO qdisc.
Returns
Numeric limit or a negative error code.

Definition at line 164 of file fifo.c.

165 {
166  struct rtnl_fifo *fifo;
167 
168  fifo = fifo_qdisc(qdisc);
169  if (fifo && fifo->qf_mask & SCH_FIFO_ATTR_LIMIT)
170  return fifo->qf_limit;
171  else
172  return nl_errno(ENOMEM);
173 }