libnl  3.7.0
genl.h
1 /* SPDX-License-Identifier: LGPL-2.1-only */
2 /*
3  * Copyright (c) 2003-2012 Thomas Graf <tgraf@suug.ch>
4  */
5 
6 #ifndef NETLINK_GENL_H_
7 #define NETLINK_GENL_H_
8 
9 #include <netlink/netlink.h>
10 #include <netlink/msg.h>
11 #include <netlink/attr.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 extern int genl_connect(struct nl_sock *);
18 extern int genl_send_simple(struct nl_sock *, int, int,
19  int, int);
20 
21 extern void * genlmsg_put(struct nl_msg *, uint32_t, uint32_t,
22  int, int, int, uint8_t, uint8_t);
23 
24 extern int genlmsg_valid_hdr(struct nlmsghdr *, int);
25 extern int genlmsg_validate(struct nlmsghdr *, int, int,
26  const struct nla_policy *);
27 extern int genlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
28  int, const struct nla_policy *);
29 extern struct genlmsghdr *
30  genlmsg_hdr(struct nlmsghdr *);
31 extern void * genlmsg_data(const struct genlmsghdr *);
32 extern void * genlmsg_user_hdr(const struct genlmsghdr *);
33 extern void * genlmsg_user_data(const struct genlmsghdr *, const int);
34 extern int genlmsg_user_datalen(const struct genlmsghdr *,
35  const int);
36 extern int genlmsg_len(const struct genlmsghdr *);
37 extern struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int);
38 extern int genlmsg_attrlen(const struct genlmsghdr *, int);
39 
40 extern char * genl_op2name(int, int, char *, size_t);
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif
int genlmsg_validate(struct nlmsghdr *, int, int, const struct nla_policy *)
Validate Generic Netlink message including attributes.
Definition: genl.c:146
void * genlmsg_user_data(const struct genlmsghdr *, const int)
Return pointer to user data.
Definition: genl.c:254
int genlmsg_len(const struct genlmsghdr *)
Return length of message payload including user header.
Definition: genl.c:219
int genlmsg_user_datalen(const struct genlmsghdr *, const int)
Return length of user data.
Definition: genl.c:268
int genl_send_simple(struct nl_sock *, int, int, int, int)
Send a Generic Netlink message consisting only of a header.
Definition: genl.c:79
struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int)
Return pointer to message attributes.
Definition: genl.c:282
void * genlmsg_data(const struct genlmsghdr *)
Return pointer to message payload.
Definition: genl.c:380
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:186
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:343
int genl_connect(struct nl_sock *)
Connect a Generic Netlink socket.
Definition: genl.c:39
int genlmsg_attrlen(const struct genlmsghdr *, int)
Return length of message attributes.
Definition: genl.c:297
struct genlmsghdr * genlmsg_hdr(struct nlmsghdr *)
Return pointer to Generic Netlink header.
Definition: genl.c:205
void * genlmsg_user_hdr(const struct genlmsghdr *)
Return pointer to user header.
Definition: genl.c:237
int genlmsg_valid_hdr(struct nlmsghdr *, int)
Validate Generic Netlink message headers.
Definition: genl.c:112
Attribute validation policy.
Definition: attr.h:63