libnl: /data/src/libnl3/include/netlink/genl/genl.h Source File

libnl 3.10.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
14extern "C" {
15#endif
16
17extern int genl_connect(struct nl_sock *);
18extern int genl_send_simple(struct nl_sock *, int, int,
19 int, int);
20
21extern void * genlmsg_put(struct nl_msg *, uint32_t, uint32_t,
22 int, int, int, uint8_t, uint8_t);
23
24extern int genlmsg_valid_hdr(struct nlmsghdr *, int);
25extern int genlmsg_validate(struct nlmsghdr *, int, int,
26 const struct nla_policy *);
27extern int genlmsg_parse(struct nlmsghdr *, int, struct nlattr **,
28 int, const struct nla_policy *);
29extern struct genlmsghdr *
30 genlmsg_hdr(struct nlmsghdr *);
31extern void * genlmsg_data(const struct genlmsghdr *);
32extern void * genlmsg_user_hdr(const struct genlmsghdr *);
33extern void * genlmsg_user_data(const struct genlmsghdr *, const int);
34extern int genlmsg_user_datalen(const struct genlmsghdr *,
35 const int);
36extern int genlmsg_len(const struct genlmsghdr *);
37extern struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int);
38extern int genlmsg_attrlen(const struct genlmsghdr *, int);
39
40extern char * genl_op2name(int, int, char *, size_t);
41
42#ifdef __cplusplus
43}
44#endif
45
46#endif
genlmsg_hdr
struct genlmsghdr * genlmsg_hdr(struct nlmsghdr *)
Return pointer to Generic Netlink header.
Definition genl.c:211
genlmsg_validate
int genlmsg_validate(struct nlmsghdr *, int, int, const struct nla_policy *)
Validate Generic Netlink message including attributes.
Definition genl.c:152
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:349
genlmsg_attrdata
struct nlattr * genlmsg_attrdata(const struct genlmsghdr *, int)
Return pointer to message attributes.
Definition genl.c:288
genlmsg_len
int genlmsg_len(const struct genlmsghdr *)
Return length of message payload including user header.
Definition genl.c:225
genlmsg_user_datalen
int genlmsg_user_datalen(const struct genlmsghdr *, const int)
Return length of user data.
Definition genl.c:274
genlmsg_user_hdr
void * genlmsg_user_hdr(const struct genlmsghdr *)
Return pointer to user header.
Definition genl.c:243
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:83
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:192
genlmsg_user_data
void * genlmsg_user_data(const struct genlmsghdr *, const int)
Return pointer to user data.
Definition genl.c:260
genlmsg_data
void * genlmsg_data(const struct genlmsghdr *)
Return pointer to message payload.
Definition genl.c:386
genl_connect
int genl_connect(struct nl_sock *)
Connect a Generic Netlink socket.
Definition genl.c:43
genlmsg_attrlen
int genlmsg_attrlen(const struct genlmsghdr *, int)
Return length of message attributes.
Definition genl.c:303
genlmsg_valid_hdr
int genlmsg_valid_hdr(struct nlmsghdr *, int)
Validate Generic Netlink message headers.
Definition genl.c:116
nla_policy
Attribute validation policy.
Definition attr.h:63