summaryrefslogtreecommitdiff
path: root/doc/src/examples/nla_put.c
blob: 0683fa53ffa9144246a999384a8479842028abfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct my_attr_struct {
	uint32_t a;
	uint32_t b;
};

int my_put(struct nl_msg *msg)
{
	struct my_attr_struct obj = {
		.a = 10,
		.b = 20,
	};

	return nla_put(msg, ATTR_MY_STRUCT, sizeof(obj), &obj);
}