libnl
1.1
|
The neighbour table establishes bindings between protocol addresses and link layer addresses for hosts sharing the same physical link. More...
Neighbour Object Allocation/Freeage | |
struct rtnl_neigh * | rtnl_neigh_alloc (void) |
void | rtnl_neigh_put (struct rtnl_neigh *neigh) |
Neighbour Cache Managament | |
struct nl_cache * | rtnl_neigh_alloc_cache (struct nl_handle *handle) |
Build a neighbour cache including all neighbours currently configured in the kernel. | |
struct rtnl_neigh * | rtnl_neigh_get (struct nl_cache *cache, int ifindex, struct nl_addr *dst) |
Look up a neighbour by interface index and destination address. |
Neighbour Addition | |
struct nl_msg * | rtnl_neigh_build_add_request (struct rtnl_neigh *tmpl, int flags) |
Build netlink request message to add a new neighbour. | |
int | rtnl_neigh_add (struct nl_handle *handle, struct rtnl_neigh *tmpl, int flags) |
Add a new neighbour. |
Neighbour Deletion | |
struct nl_msg * | rtnl_neigh_build_delete_request (struct rtnl_neigh *neigh, int flags) |
Build a netlink request message to delete a neighbour. | |
int | rtnl_neigh_delete (struct nl_handle *handle, struct rtnl_neigh *neigh, int flags) |
Delete a neighbour. |
Neighbour Modification | |
struct nl_msg * | rtnl_neigh_build_change_request (struct rtnl_neigh *neigh, int flags) |
Build a netlink request message to change neighbour attributes. | |
int | rtnl_neigh_change (struct nl_handle *handle, struct rtnl_neigh *neigh, int flags) |
Change neighbour attributes. |
Neighbour States Translations | |
char * | rtnl_neigh_state2str (int state, char *buf, size_t len) |
int | rtnl_neigh_str2state (const char *name) |
Neighbour Flags Translations | |
char * | rtnl_neigh_flags2str (int flags, char *buf, size_t len) |
int | rtnl_neigh_str2flag (const char *name) |
This module allows you to access and manipulate the content of these tables.
|
read |
handle | netlink handle |
Allocates a new neighbour cache, initializes it properly and updates it to include all neighbours currently configured in the kernel.
Definition at line 534 of file neigh.c.
References nl_cache_alloc(), nl_cache_free(), and nl_cache_refill().
|
read |
cache | neighbour cache |
ifindex | interface index the neighbour is on |
dst | destination address of the neighbour |
Definition at line 559 of file neigh.c.
References nl_addr_cmp(), and nl_object_get().
|
read |
tmpl | template with data of new neighbour |
flags | additional netlink message flags |
Builds a new netlink message requesting a addition of a new neighbour. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed. tmpl must contain the attributes of the new neighbour set via rtnl_neigh_set_*
functions.
The following attributes must be set in the template:
Definition at line 633 of file neigh.c.
References NLM_F_CREATE.
Referenced by rtnl_neigh_add().
int rtnl_neigh_add | ( | struct nl_handle * | handle, |
struct rtnl_neigh * | tmpl, | ||
int | flags | ||
) |
handle | netlink handle |
tmpl | template with requested changes |
flags | additional netlink message flags |
Builds a netlink message by calling rtnl_neigh_build_add_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.
The following attributes must be set in the template:
Definition at line 656 of file neigh.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_neigh_build_add_request().
|
read |
neigh | neighbour to delete |
flags | additional netlink message flags |
Builds a new netlink message requesting a deletion of a neighbour. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed. neigh must point to an existing neighbour.
Definition at line 693 of file neigh.c.
Referenced by rtnl_neigh_delete().
int rtnl_neigh_delete | ( | struct nl_handle * | handle, |
struct rtnl_neigh * | neigh, | ||
int | flags | ||
) |
handle | netlink handle |
neigh | neighbour to delete |
flags | additional netlink message flags |
Builds a netlink message by calling rtnl_neigh_build_delete_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.
Definition at line 711 of file neigh.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_neigh_build_delete_request().
|
read |
neigh | the neighbour to change |
flags | additional netlink message flags |
Builds a new netlink message requesting a change of a neigh attributes. The netlink message header isn't fully equipped with all relevant fields and must thus be sent out via nl_send_auto_complete() or supplemented as needed.
Definition at line 750 of file neigh.c.
References NLM_F_REPLACE.
Referenced by rtnl_neigh_change().
int rtnl_neigh_change | ( | struct nl_handle * | handle, |
struct rtnl_neigh * | neigh, | ||
int | flags | ||
) |
handle | netlink handle |
neigh | neighbour to be changed |
flags | additional netlink message flags |
Builds a netlink message by calling rtnl_neigh_build_change_request(), sends the request to the kernel and waits for the next ACK to be received and thus blocks until the request has been fullfilled.
Definition at line 770 of file neigh.c.
References nl_send_auto_complete(), nl_wait_for_ack(), nlmsg_free(), and rtnl_neigh_build_change_request().