~ubuntu-branches/ubuntu/trusty/libnl3/trusty

« back to all changes in this revision

Viewing changes to doc/src/examples/nla_ok.c

  • Committer: Bazaar Package Importer
  • Author(s): Heiko Stuebner
  • Date: 2011-05-21 19:25:13 UTC
  • Revision ID: james.westby@ubuntu.com-20110521192513-1ieyu9w9kym4bt16
Tags: upstream-3.0
ImportĀ upstreamĀ versionĀ 3.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <netlink/msg.h>
 
2
#include <netlink/attr.h>
 
3
 
 
4
struct nlattr *hdr = nlmsg_attrdata(msg, 0);
 
5
int remaining = nlmsg_attrlen(msg, 0);
 
6
 
 
7
while (nla_ok(hdr, remaining)) {
 
8
        /* parse attribute here */
 
9
        hdr = nla_next(hdr, &remaining);
 
10
};