2 * netlink/genl/mngt.h Generic Netlink Management
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation version 2.1
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
12 #ifndef NETLINK_GENL_MNGT_H_
13 #define NETLINK_GENL_MNGT_H_
15 #include <netlink/netlink.h>
16 #include <netlink/attr.h>
17 #include <netlink/list.h>
27 struct sockaddr_nl * who;
28 struct nlmsghdr * nlh;
29 struct genlmsghdr * genlhdr;
31 struct nlattr ** attrs;
36 * Generic Netlink Command
40 /** Unique command identifier */
43 /** Name/description of command */
47 * Maximum attribute identifier, must be provided if
48 * a message parser is available.
52 int (*c_msg_parser)(struct nl_cache_ops *,
54 struct genl_info *, void *);
57 * Attribute validation policy (optional)
59 struct nla_policy * c_attr_policy;
64 * Generic Netlink Operations
71 struct nl_cache_ops * o_cache_ops;
72 struct genl_cmd * o_cmds;
75 /* linked list of all genl cache operations */
76 struct nl_list_head o_list;
80 extern int genl_register(struct nl_cache_ops *);
81 extern void genl_unregister(struct nl_cache_ops *);