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:
Tobias Jungel
2018-04-17 12:54:14 +02:00
committed by Thomas Haller
parent ad7c49e77b
commit 2e87f72bf4
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -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
+10
View File
@@ -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 = {
+2
View File
@@ -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;