libnl 1.1.4
mngt.h
1/*
2 * netlink/genl/mngt.h Generic Netlink Management
3 *
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
7 * of the License.
8 *
9 * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
10 */
11
12#ifndef NETLINK_GENL_MNGT_H_
13#define NETLINK_GENL_MNGT_H_
14
15#include <netlink/netlink.h>
16#include <netlink/attr.h>
17#include <netlink/list.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23struct nl_cache_ops;
24
25/**
26 * @ingroup genl_mngt
27 * Generic Netlink Command
28 */
30{
31 /** Unique command identifier */
32 int c_id;
33
34 /** Name/description of command */
35 char * c_name;
36
37 /**
38 * Maximum attribute identifier, must be provided if
39 * a message parser is available.
40 */
42
43 int (*c_msg_parser)(struct nl_cache_ops *,
44 struct genl_cmd *,
45 struct genl_info *, void *);
46
47 /**
48 * Attribute validation policy (optional)
49 */
51};
52
53/**
54 * @ingroup genl_mngt
55 * Generic Netlink Operations
56 */
58{
59 int o_family;
60 int o_id;
61 char * o_name;
62 struct nl_cache_ops * o_cache_ops;
63 struct genl_cmd * o_cmds;
64 int o_ncmds;
65
66 /* linked list of all genl cache operations */
67 struct nl_list_head o_list;
68};
69
70
71extern int genl_register(struct nl_cache_ops *);
72extern void genl_unregister(struct nl_cache_ops *);
73
74#ifdef __cplusplus
75}
76#endif
77
78#endif
int genl_register(struct nl_cache_ops *)
Register generic netlink operations.
Definition: mngt.c:172
void genl_unregister(struct nl_cache_ops *)
Unregister generic netlink operations.
Definition: mngt.c:214
Generic Netlink Command.
Definition: mngt.h:30
struct nla_policy * c_attr_policy
Attribute validation policy (optional)
Definition: mngt.h:50
int c_id
Unique command identifier.
Definition: mngt.h:32
char * c_name
Name/description of command.
Definition: mngt.h:35
int c_maxattr
Maximum attribute identifier, must be provided if a message parser is available.
Definition: mngt.h:41
Generic Netlink Operations.
Definition: mngt.h:58
Cache Operations.
Definition: cache-api.h:164
attribute validation policy
Definition: attr.h:73