Use 16bit ints for classifier prio/protocol
This commit is contained in:
parent
23ee46ef71
commit
5d92f9c03d
3 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue