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

« back to all changes in this revision

Viewing changes to doc/src/examples/nla_put.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
struct my_attr_struct {
 
2
        uint32_t a;
 
3
        uint32_t b;
 
4
};
 
5
 
 
6
int my_put(struct nl_msg *msg)
 
7
{
 
8
        struct my_attr_struct obj = {
 
9
                .a = 10,
 
10
                .b = 20,
 
11
        };
 
12
 
 
13
        return nla_put(msg, ATTR_MY_STRUCT, sizeof(obj), &obj);
 
14
}