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

int rtnl_addr_build_delete_request ( struct rtnl_addr *  addr,
int  flags,
struct nl_msg **  result 
)

Build a netlink request message to request deletion of an address

  • addr Address object to be deleteted.
  • flags Additional netlink message flags.
  • result Pointer to store resulting message.
Builds a new netlink message requesting a deletion of an address. 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.

Minimal required attributes:

  • interface index (rtnl_addr_set_ifindex())
  • address family (rtnl_addr_set_family())

Optional attributes:

  • local address (rtnl_addr_set_local())
  • label (rtnl_addr_set_label(), IPv4/DECnet only)
  • peer address (rtnl_addr_set_peer(), IPv4 only)

Note:
Free the memory after usage using nlmsg_free().
Returns:
0 on success or a negative error code.

Definition at line 623 of file addr.c.

Referenced by rtnl_addr_delete().

{
      int required = ADDR_ATTR_IFINDEX | ADDR_ATTR_FAMILY;

      if ((addr->ce_mask & required) != required)
            return -NLE_MISSING_ATTR;

      return build_addr_msg(addr, RTM_DELADDR, flags, result);
}


Generated by  Doxygen 1.6.0   Back to index