libnl  1.1.4

Attribute Access

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

Detailed Description

Function Documentation

◆ rtnl_red_set_limit()

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

Definition at line 168 of file red.c.

169 {
170  struct rtnl_red *red;
171 
172  red = red_alloc(qdisc);
173  if (!red)
174  return nl_errno(ENOMEM);
175 
176  red->qr_limit = limit;
177  red->qr_mask |= RED_ATTR_LIMIT;
178 
179  return 0;
180 }

◆ rtnl_red_get_limit()

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

Definition at line 187 of file red.c.

188 {
189  struct rtnl_red *red;
190 
191  red = red_qdisc(qdisc);
192  if (red && (red->qr_mask & RED_ATTR_LIMIT))
193  return red->qr_limit;
194  else
195  return nl_errno(ENOENT);
196 }