libnl 3.5.0

genl.h
1 /*
2 * netlink/genl/genl.h Generic Netlink
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-2012 Thomas Graf <tgraf@suug.ch>
10 */
11
12 #ifndef NETLINK_GENL_H_
13 #define NETLINK_GENL_H_
14
15 #include <netlink/netlink.h>
16 #include <netlink/msg.h>
17 #include <netlink/attr.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 extern int genl_connect(struct nl_sock *);
24 extern int genl_send_simple(struct nl_sock *, int, int,
25 int, int);
26
27 extern void * genlmsg_put(struct nl_msg *, uint32_t, uint32_t,
28 int, int, int, uint8_t, uint8_t);
29
30 extern int genlmsg_valid_hdr(struct nlmsghdr *, int);
31 extern int genlmsg_validate(struct nlmsghdr *, int, int,
32 const struct nla_policy *);
33 extern int genlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
34 int, const struct nla_policy *);
35 extern struct genlmsghdr *
36 genlmsg_hdr(struct nlmsghdr *);
37 extern void * genlmsg_data(const struct genlmsghdr *);
38 extern void * genlmsg_user_hdr(const struct genlmsghdr *);
39 extern void * genlmsg_user_data(const struct genlmsghdr *, const int);
40 extern int genlmsg_user_datalen(const struct genlmsghdr *,
41 const int);
42 extern int genlmsg_len(const struct genlmsghdr *);
43 extern struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int);
44 extern int genlmsg_attrlen(const struct genlmsghdr *, int);
45
46 extern char * genl_op2name(int, int, char *, size_t);
47
48 #ifdef __cplusplus
49 }
50 #endif
51
52 #endif
genlmsg_user_hdr
void * genlmsg_user_hdr(const struct genlmsghdr *)
Return pointer to user header.
Definition: genl.c:244
genlmsg_parse
int genlmsg_parse(struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy)
Parse Generic Netlink message including attributes.
Definition: genl.c:193
nla_policy
Attribute validation policy.
Definition: attr.h:69
genl_connect
int genl_connect(struct nl_sock *)
Connect a Generic Netlink socket.
Definition: genl.c:46
genlmsg_validate
int genlmsg_validate(struct nlmsghdr *, int, int, const struct nla_policy *)
Validate Generic Netlink message including attributes.
Definition: genl.c:153
genlmsg_put
void * genlmsg_put(struct nl_msg *, uint32_t, uint32_t, int, int, int, uint8_t, uint8_t)
Add Generic Netlink headers to Netlink message.
Definition: genl.c:350
genlmsg_user_datalen
int genlmsg_user_datalen(const struct genlmsghdr *, const int)
Return length of user data.
Definition: genl.c:275
genl_send_simple
int genl_send_simple(struct nl_sock *, int, int, int, int)
Send a Generic Netlink message consisting only of a header.
Definition: genl.c:86
genlmsg_attrdata
struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int)
Return pointer to message attributes.
Definition: genl.c:289
genlmsg_hdr
struct genlmsghdr * genlmsg_hdr(struct nlmsghdr *)
Return pointer to Generic Netlink header.
Definition: genl.c:212
genlmsg_attrlen
int genlmsg_attrlen(const struct genlmsghdr *, int)
Return length of message attributes.
Definition: genl.c:304
genlmsg_data
void * genlmsg_data(const struct genlmsghdr *)
Return pointer to message payload.
Definition: genl.c:387
genlmsg_len
int genlmsg_len(const struct genlmsghdr *)
Return length of message payload including user header.
Definition: genl.c:226
genlmsg_valid_hdr
int genlmsg_valid_hdr(struct nlmsghdr *, int)
Validate Generic Netlink message headers.
Definition: genl.c:119
genlmsg_user_data
void * genlmsg_user_data(const struct genlmsghdr *, const int)
Return pointer to user data.
Definition: genl.c:261