1
#include <netlink/msg.h>
9
/* Allocate a message with the default maximum message size */
13
* Add header with message type MY_MSGTYPE, the flag NLM_F_CREATE,
14
* let library fill port and sequence number, and reserve room for
17
hdr = nlmsg_put(msg, NL_AUTO_PORT, NL_AUTO_SEQ, MY_MSGTYPE, sizeof(hdr), NLM_F_CREATE);
19
/* Copy own header into newly reserved payload section */
20
memcpy(nlmsg_data(hdr), &hdr, sizeof(hdr));
23
* The message will now look like this:
24
* +-------------------+- - -+----------------+- - -+
25
* | struct nlmsghdr | Pad | struct myhdr | Pad |
26
* +-------------------+-----+----------------+- - -+
28
* +--------+---------+
30
* +--------+---------+