Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

int rtnl_neigh_build_add_request ( struct rtnl_neigh *  tmpl,
int  flags,
struct nl_msg **  result 
)

Build netlink request message to add a new neighbour

  • tmpl template with data of new neighbour
  • flags additional netlink message flags
  • result Pointer to store resulting message.
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:

  • Interface index (rtnl_neigh_set_ifindex())
  • State (rtnl_neigh_set_state())
  • Destination address (rtnl_neigh_set_dst())
  • Link layer address (rtnl_neigh_set_lladdr())

Returns:
0 on success or a negative error code.

Definition at line 555 of file neigh.c.

Referenced by rtnl_neigh_add().

{
      return build_neigh_msg(tmpl, RTM_NEWNEIGH, flags, result);
}


Generated by  Doxygen 1.6.0   Back to index