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

int nlmsg_append ( struct nl_msg *  n,
void *  data,
size_t  len,
int  pad 

Append data to tail of a netlink message

  • n netlink message
  • data data to add
  • len length of data
  • pad Number of bytes to align data to.
Extends the netlink message as needed and appends the data of given length to the message.

0 on success or a negative error code

Definition at line 549 of file msg.c.

References nlmsg_reserve().

Referenced by flnl_lookup_build_request(), nl_send_simple(), rtnl_link_build_change_request(), rtnl_neightbl_build_change_request(), and rtnl_qdisc_build_delete_request().

      void *tmp;

      tmp = nlmsg_reserve(n, len, pad);
      if (tmp == NULL)
            return nl_errno(ENOMEM);

      memcpy(tmp, data, len);
      NL_DBG(2, "msg %p: Appended %zu bytes with padding %d\n", n, len, pad);

      return 0;

Generated by  Doxygen 1.6.0   Back to index