diff options
author | Thomas Graf <tgr@plip.localdomain> | 2008-10-15 10:25:26 (GMT) |
---|---|---|
committer | Thomas Graf <tgr@plip.localdomain> | 2008-10-15 10:25:26 (GMT) |
commit | 5d92f9c03d85cefee5afe7f40d7ea69dfde4cf77 (patch) | |
tree | 90a3516b31a7fc3ba912b4fcd74d344b6f7124c0 | |
parent | 23ee46ef7115c2e311c36e43a833e6c3deada18a (diff) | |
download | libnl-5d92f9c03d85cefee5afe7f40d7ea69dfde4cf77.zip libnl-5d92f9c03d85cefee5afe7f40d7ea69dfde4cf77.tar.gz libnl-5d92f9c03d85cefee5afe7f40d7ea69dfde4cf77.tar.bz2 |
Use 16bit ints for classifier prio/protocol
-rw-r--r-- | include/netlink-types.h | 4 | ||||
-rw-r--r-- | include/netlink/route/classifier.h | 8 | ||||
-rw-r--r-- | lib/route/cls_obj.c | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/include/netlink-types.h b/include/netlink-types.h index 238b131..cddace9 100644 --- a/include/netlink-types.h +++ b/include/netlink-types.h @@ -475,8 +475,8 @@ struct rtnl_class struct rtnl_cls { NL_TCA_GENERIC(c); - uint32_t c_prio; - uint32_t c_protocol; + uint16_t c_prio; + uint16_t c_protocol; struct rtnl_cls_ops *c_ops; }; diff --git a/include/netlink/route/classifier.h b/include/netlink/route/classifier.h index 0c0b9c5..01a26a9 100644 --- a/include/netlink/route/classifier.h +++ b/include/netlink/route/classifier.h @@ -44,11 +44,11 @@ extern void rtnl_cls_set_handle(struct rtnl_cls *, uint32_t); extern void rtnl_cls_set_parent(struct rtnl_cls *, uint32_t); extern void rtnl_cls_set_kind(struct rtnl_cls *, const char *); -extern void rtnl_cls_set_prio(struct rtnl_cls *, int); -extern int rtnl_cls_get_prio(struct rtnl_cls *); +extern void rtnl_cls_set_prio(struct rtnl_cls *, uint16_t); +extern uint16_t rtnl_cls_get_prio(struct rtnl_cls *); -extern void rtnl_cls_set_protocol(struct rtnl_cls *, int); -extern int rtnl_cls_get_protocol(struct rtnl_cls *); +extern void rtnl_cls_set_protocol(struct rtnl_cls *, uint16_t); +extern uint16_t rtnl_cls_get_protocol(struct rtnl_cls *); #ifdef __cplusplus } diff --git a/lib/route/cls_obj.c b/lib/route/cls_obj.c index 500ee5a..6c92572 100644 --- a/lib/route/cls_obj.c +++ b/lib/route/cls_obj.c @@ -149,13 +149,13 @@ void rtnl_cls_set_kind(struct rtnl_cls *f, const char *kind) f->c_ops = __rtnl_cls_lookup_ops(kind); } -void rtnl_cls_set_prio(struct rtnl_cls *cls, int prio) +void rtnl_cls_set_prio(struct rtnl_cls *cls, uint16_t prio) { cls->c_prio = prio; cls->ce_mask |= CLS_ATTR_PRIO; } -int rtnl_cls_get_prio(struct rtnl_cls *cls) +uint16_t rtnl_cls_get_prio(struct rtnl_cls *cls) { if (cls->ce_mask & CLS_ATTR_PRIO) return cls->c_prio; @@ -163,13 +163,13 @@ int rtnl_cls_get_prio(struct rtnl_cls *cls) return 0; } -void rtnl_cls_set_protocol(struct rtnl_cls *cls, int protocol) +void rtnl_cls_set_protocol(struct rtnl_cls *cls, uint16_t protocol) { cls->c_protocol = protocol; cls->ce_mask |= CLS_ATTR_PROTOCOL; } -int rtnl_cls_get_protocol(struct rtnl_cls *cls) +uint16_t rtnl_cls_get_protocol(struct rtnl_cls *cls) { if (cls->ce_mask & CLS_ATTR_PROTOCOL) return cls->c_protocol; |