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

struct nlmsghdr* nlmsg_put ( struct nl_msg *  n,
uint32_t  pid,
uint32_t  seq,
int  type,
int  payload,
int  flags 
) [read]

nlmsg_put - Add a netlink message header

  • n netlink message
  • pid netlink process id
  • seq sequence number of message
  • type message type
  • payload length of message payload
  • flags message flags

Definition at line 469 of file msg.c.

References nlmsg_data(), nlmsghdr::nlmsg_flags, nlmsghdr::nlmsg_len, nlmsg_msg_size(), nlmsg_padlen(), nlmsghdr::nlmsg_pid, nlmsghdr::nlmsg_seq, and nlmsghdr::nlmsg_type.

{
      struct nlmsghdr *nlh;

      if (n->nm_nlh->nlmsg_len < NLMSG_HDRLEN)
            BUG();

      nlh = (struct nlmsghdr *) n->nm_nlh;
      nlh->nlmsg_type = type;
      nlh->nlmsg_len = nlmsg_msg_size(payload);
      nlh->nlmsg_flags = flags;
      nlh->nlmsg_pid = pid;
      nlh->nlmsg_seq = seq;

      memset((unsigned char *) nlmsg_data(nlh) + payload, 0,
             nlmsg_padlen(payload));

      return nlh;
}


Generated by  Doxygen 1.6.0   Back to index