summaryrefslogtreecommitdiff
path: root/doc/src/examples/nla_ok.c
blob: 4485a9650933c96b2a5535677290e91c84e0ab37 (plain)
1
2
3
4
5
6
7
8
9
10
#include <netlink/msg.h>
#include <netlink/attr.h>

struct nlattr *hdr = nlmsg_attrdata(msg, 0);
int remaining = nlmsg_attrlen(msg, 0);

while (nla_ok(hdr, remaining)) {
	/* parse attribute here */
	hdr = nla_next(hdr, &remaining);
};