nla_put.c

00001 struct my_attr_struct {
00002         uint32_t a;
00003         uint32_t b;
00004 };
00005 
00006 int my_put(struct nl_msg *msg)
00007 {
00008         struct my_attr_struct obj = {
00009                 .a = 10,
00010                 .b = 20,
00011         };
00012 
00013         return nla_put(msg, ATTR_MY_STRUCT, sizeof(obj), &obj);
00014 }