6 #ifndef NETLINK_NETLINK_H_
7 #define NETLINK_NETLINK_H_
14 #include <sys/socket.h>
15 #include <sys/types.h>
18 #include <netlink/netlink-compat.h>
19 #include <linux/netlink.h>
20 #include <linux/rtnetlink.h>
21 #include <linux/genetlink.h>
22 #include <linux/netfilter/nfnetlink.h>
23 #include <netinet/tcp.h>
24 #include <netlink/version.h>
25 #include <netlink/errno.h>
26 #include <netlink/types.h>
27 #include <netlink/handlers.h>
28 #include <netlink/socket.h>
29 #include <netlink/object.h>
38 struct nl_parser_param;
47 extern void nl_close(
struct nl_sock *);
50 extern int nl_sendto(
struct nl_sock *,
void *,
size_t);
51 extern int nl_sendmsg(
struct nl_sock *,
struct nl_msg *,
53 extern int nl_send(
struct nl_sock *,
struct nl_msg *);
55 struct iovec *,
unsigned);
60 extern int nl_send_auto(
struct nl_sock *,
struct nl_msg *);
63 extern int nl_send_sync(
struct nl_sock *,
struct nl_msg *);
68 extern int nl_recv(
struct nl_sock *,
69 struct sockaddr_nl *,
unsigned char **,
72 extern int nl_recvmsgs(
struct nl_sock *,
struct nl_cb *);
80 int (*parser)(
struct nl_cache_ops *,
83 struct nl_parser_param *),
86 int (*parser)(
struct nl_cache_ops *,
struct sockaddr_nl *,
87 struct nlmsghdr *,
struct nl_parser_param *),
88 struct nl_object **result,
91 extern char * nl_nlfamily2str(
int,
char *,
size_t);
92 extern int nl_str2nlfamily(
const char *);
int nl_send_iovec(struct nl_sock *, struct nl_msg *, struct iovec *, unsigned)
Transmit Netlink message (taking IO vector)
int nl_send(struct nl_sock *, struct nl_msg *)
Transmit Netlink message.
int nl_recv(struct nl_sock *, struct sockaddr_nl *, unsigned char **, struct ucred **)
Receive data from netlink socket.
int nl_recvmsgs_default(struct nl_sock *)
Receive a set of message from a netlink socket using handlers in nl_sock.
int nl_send_auto(struct nl_sock *, struct nl_msg *)
Finalize and transmit Netlink message.
void nl_complete_msg(struct nl_sock *, struct nl_msg *)
Finalize Netlink message.
int nl_send_sync(struct nl_sock *, struct nl_msg *)
Finalize and transmit Netlink message and wait for ACK or error message.
void nl_auto_complete(struct nl_sock *, struct nl_msg *)
int nl_connect(struct nl_sock *, int)
Create file descriptor and bind socket.
int nl_recvmsgs_report(struct nl_sock *, struct nl_cb *)
Receive a set of messages from a netlink socket and report parsed messages.
int nl_pickup_keep_syserr(struct nl_sock *sk, int(*parser)(struct nl_cache_ops *, struct sockaddr_nl *, struct nlmsghdr *, struct nl_parser_param *), struct nl_object **result, int *syserror)
Pickup netlink answer, parse is and return object with preserving system error.
int nl_send_auto_complete(struct nl_sock *, struct nl_msg *)
int nl_recvmsgs(struct nl_sock *, struct nl_cb *)
Receive a set of messages from a netlink socket.
int nl_pickup(struct nl_sock *, int(*parser)(struct nl_cache_ops *, struct sockaddr_nl *, struct nlmsghdr *, struct nl_parser_param *), struct nl_object **)
Pickup netlink answer, parse is and return object.
void nl_close(struct nl_sock *)
Close Netlink socket.
int nl_sendmsg(struct nl_sock *, struct nl_msg *, struct msghdr *)
Transmit Netlink message using sendmsg()
int nl_sendto(struct nl_sock *, void *, size_t)
Transmit raw data over Netlink socket.
int nl_wait_for_ack(struct nl_sock *)
Wait for ACK.
int nl_send_simple(struct nl_sock *, int, int, void *, size_t)
Construct and transmit a Netlink message.
int nl_debug
Global variable indicating the desired level of debugging output.