Skip to content

Commit

Permalink
provide function to retrieve htb rate
Browse files Browse the repository at this point in the history
  • Loading branch information
tgraf committed Mar 17, 2011
1 parent 552c85c commit 5dc897d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/netlink/route/sch/htb.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ extern void rtnl_htb_set_defcls(struct rtnl_qdisc *, uint32_t);

extern void rtnl_htb_set_prio(struct rtnl_class *, uint32_t);
extern void rtnl_htb_set_rate(struct rtnl_class *, uint32_t);
extern uint32_t rtnl_htb_get_rate(struct rtnl_class *);
extern void rtnl_htb_set_ceil(struct rtnl_class *, uint32_t);
extern void rtnl_htb_set_rbuffer(struct rtnl_class *, uint32_t);
extern void rtnl_htb_set_cbuffer(struct rtnl_class *, uint32_t);
Expand Down
9 changes: 9 additions & 0 deletions lib/route/sch/htb.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,15 @@ void rtnl_htb_set_rate(struct rtnl_class *class, uint32_t rate)
d->ch_mask |= SCH_HTB_HAS_RATE;
}

uint32_t rtnl_htb_get_rate(struct rtnl_class *class)
{
struct rtnl_htb_class *d = htb_class(class);
if (d == NULL)
return 0;

return d->ch_rate.rs_rate;
}

/**
* Set ceil of HTB class.
* @arg class HTB class to be modified.
Expand Down

0 comments on commit 5dc897d

Please sign in to comment.