NLA_PUT.c

00001 #include <netlink/msg.h>
00002 #include <netlink/attr.h>
00003 
00004 void construct_attrs(struct nl_msg *msg)
00005 {
00006         NLA_PUT_STRING(msg, MY_ATTR_FOO1, "some text");
00007         NLA_PUT_U32(msg, MY_ATTR_FOO1, 0x1010);
00008         NLA_PUT_FLAG(msg, MY_ATTR_FOO3, 1);
00009 
00010         return 0;
00011 
00012 nla_put_failure:
00013         /* NLA_PUT* macros jump here in case of an error */
00014         return -EMSGSIZE;
00015 }