Random Early Detection (RED)
[Queueing Discipline Modules]

Attribute Access



int rtnl_red_set_limit (struct rtnl_qdisc *qdisc, int limit)
 Set limit of RED qdisc.
int rtnl_red_get_limit (struct rtnl_qdisc *qdisc)
 Get limit of RED qdisc.

Function Documentation

int rtnl_red_set_limit ( struct rtnl_qdisc *  qdisc,
int  limit 
)
Parameters:
qdisc RED qdisc to be modified.
limit New limit in number of packets.
Returns:
0 on success or a negative error code.

Definition at line 168 of file red.c.

00169 {
00170         struct rtnl_red *red;
00171 
00172         red = red_alloc(qdisc);
00173         if (!red)
00174                 return nl_errno(ENOMEM);
00175 
00176         red->qr_limit = limit;
00177         red->qr_mask |= RED_ATTR_LIMIT;
00178 
00179         return 0;
00180 }

int rtnl_red_get_limit ( struct rtnl_qdisc *  qdisc  ) 
Parameters:
qdisc RED qdisc.
Returns:
Limit or a negative error code.

Definition at line 187 of file red.c.

00188 {
00189         struct rtnl_red *red;
00190 
00191         red = red_qdisc(qdisc);
00192         if (red && (red->qr_mask & RED_ATTR_LIMIT))
00193                 return red->qr_limit;
00194         else
00195                 return nl_errno(ENOENT);
00196 }


Generated on 30 Oct 2009 for libnl by  doxygen 1.6.1