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

struct nl_msg* nlmsg_convert ( struct nlmsghdr hdr  )  [read]

Convert a netlink message received from a netlink socket to a nl_msg

  • hdr Netlink message received from netlink socket.
Allocates a new netlink message and copies all of the data pointed to by hdr into the new message object.

Newly allocated netlink message or NULL.

Definition at line 487 of file msg.c.

References nlmsg_free(), and nlmsghdr::nlmsg_len.

      struct nl_msg *nm;

      nm = __nlmsg_alloc(NLMSG_ALIGN(hdr->nlmsg_len));
      if (!nm)
            goto errout;

      memcpy(nm->nm_nlh, hdr, hdr->nlmsg_len);

      return nm;
      return NULL;

Generated by  Doxygen 1.6.0   Back to index