diff options
author | Thomas Haller <thaller@redhat.com> | 2019-09-01 12:56:19 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-09-01 13:54:33 (GMT) |
commit | 03ee05d97565da9ef935ebbdd6d56f7ab3da5bfc (patch) | |
tree | efc06edc5443569864f6b7b0904a176bee0f99a6 /include/netlink | |
parent | 4cf69a1b7b2518d18e1a62c79a461bca109132fc (diff) | |
download | libnl-03ee05d97565da9ef935ebbdd6d56f7ab3da5bfc.zip libnl-03ee05d97565da9ef935ebbdd6d56f7ab3da5bfc.tar.gz libnl-03ee05d97565da9ef935ebbdd6d56f7ab3da5bfc.tar.bz2 |
route/qdisc: adjust API for 64 bit rate/ceil support for htb class
- existing API/ABI must stay unchanged. We cannot change parameter
types. Ad most we can add new variants that support 64 bit integers.
- rtnl_tc_calc_txtime64() and rtnl_tc_calc_bufsize64() are trivial.
We should not blow up the public API of libnl for such a thing.
If the users needs it, they can just reimplement it.
- getters should return an error code. Especially if the return type
does not support encoding an error there.
- don't add separate rs_rate64/rs_ceil64 field. Instead, extend the
"rs_rate" field of "struct rtnl_ratespec" to 64 bits. It's internal
API.
Diffstat (limited to 'include/netlink')
-rw-r--r-- | include/netlink/route/qdisc/htb.h | 15 | ||||
-rw-r--r-- | include/netlink/route/tc.h | 4 |
2 files changed, 13 insertions, 6 deletions
diff --git a/include/netlink/route/qdisc/htb.h b/include/netlink/route/qdisc/htb.h index 72f7f75..5d7ca45 100644 --- a/include/netlink/route/qdisc/htb.h +++ b/include/netlink/route/qdisc/htb.h @@ -30,10 +30,17 @@ extern int rtnl_htb_set_defcls(struct rtnl_qdisc *, uint32_t); extern uint32_t rtnl_htb_get_prio(struct rtnl_class *); extern int rtnl_htb_set_prio(struct rtnl_class *, uint32_t); -extern uint64_t rtnl_htb_get_rate(struct rtnl_class *); -extern int rtnl_htb_set_rate(struct rtnl_class *, uint64_t); -extern uint64_t rtnl_htb_get_ceil(struct rtnl_class *); -extern int rtnl_htb_set_ceil(struct rtnl_class *, uint64_t); + +extern uint32_t rtnl_htb_get_rate(struct rtnl_class *); +extern int rtnl_htb_set_rate(struct rtnl_class *, uint32_t); +extern uint32_t rtnl_htb_get_ceil(struct rtnl_class *); +extern int rtnl_htb_set_ceil(struct rtnl_class *, uint32_t); + +extern int rtnl_htb_get_rate64(struct rtnl_class *, uint64_t *); +extern int rtnl_htb_set_rate64(struct rtnl_class *, uint64_t); +extern int rtnl_htb_get_ceil64(struct rtnl_class *, uint64_t *); +extern int rtnl_htb_set_ceil64(struct rtnl_class *, uint64_t); + extern uint32_t rtnl_htb_get_rbuffer(struct rtnl_class *); extern int rtnl_htb_set_rbuffer(struct rtnl_class *, uint32_t); extern uint32_t rtnl_htb_get_cbuffer(struct rtnl_class *); diff --git a/include/netlink/route/tc.h b/include/netlink/route/tc.h index 5cfa7a0..51d670a 100644 --- a/include/netlink/route/tc.h +++ b/include/netlink/route/tc.h @@ -100,8 +100,8 @@ extern uint64_t rtnl_tc_get_stat(struct rtnl_tc *, enum rtnl_tc_stat); extern char * rtnl_tc_stat2str(enum rtnl_tc_stat, char *, size_t); extern int rtnl_tc_str2stat(const char *); -extern int rtnl_tc_calc_txtime(int, uint64_t); -extern int rtnl_tc_calc_bufsize(int, uint64_t); +extern int rtnl_tc_calc_txtime(int, int); +extern int rtnl_tc_calc_bufsize(int, int); extern int rtnl_tc_calc_cell_log(int); extern int rtnl_tc_read_classid_file(void); |