mirror of
https://github.com/openharmony/third_party_libnl.git
synced 2026-07-19 20:13:35 -04:00
neigh: add get/set functions for NEIGH_ATTR_MASTER
Beeing able to set NEIGH_ATTR_MASTER hash based lookups are possible for AF_BRIDGE neighbours. https://github.com/thom311/libnl/pull/189
This commit is contained in:
committed by
Thomas Haller
parent
ad7c49e77b
commit
2e87f72bf4
@@ -82,6 +82,9 @@ extern int rtnl_neigh_get_family(struct rtnl_neigh *);
|
||||
extern void rtnl_neigh_set_vlan(struct rtnl_neigh *, int);
|
||||
extern int rtnl_neigh_get_vlan(struct rtnl_neigh *);
|
||||
|
||||
extern void rtnl_neigh_set_master(struct rtnl_neigh *, int);
|
||||
extern int rtnl_neigh_get_master(struct rtnl_neigh *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1048,6 +1048,16 @@ int rtnl_neigh_get_vlan(struct rtnl_neigh *neigh)
|
||||
return -1;
|
||||
}
|
||||
|
||||
void rtnl_neigh_set_master(struct rtnl_neigh *neigh, int ifindex)
|
||||
{
|
||||
neigh->n_master = ifindex;
|
||||
neigh->ce_mask |= NEIGH_ATTR_MASTER;
|
||||
}
|
||||
|
||||
int rtnl_neigh_get_master(struct rtnl_neigh *neigh) {
|
||||
return neigh->n_master;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
static struct nl_object_ops neigh_obj_ops = {
|
||||
|
||||
@@ -1106,4 +1106,6 @@ global:
|
||||
rtnl_mall_get_first_action;
|
||||
rtnl_mall_del_action;
|
||||
rtnl_neigh_get_by_vlan;
|
||||
rtnl_neigh_get_master;
|
||||
rtnl_neigh_set_master;
|
||||
} libnl_3_4;
|
||||
|
||||
Reference in New Issue
Block a user