12 #ifndef NETLINK_NETLINK_H_
13 #define NETLINK_NETLINK_H_
20 #include <sys/socket.h>
21 #include <sys/types.h>
23 #include <netlink/netlink-compat.h>
24 #include <linux/netlink.h>
25 #include <linux/rtnetlink.h>
26 #include <linux/genetlink.h>
27 #include <linux/netfilter/nfnetlink.h>
28 #include <netlink/types.h>
29 #include <netlink/handlers.h>
30 #include <netlink/socket.h>
40 extern int nl_connect(
struct nl_handle *,
int);
41 extern void nl_close(
struct nl_handle *);
44 extern int nl_sendto(
struct nl_handle *,
void *,
size_t);
45 extern int nl_sendmsg(
struct nl_handle *,
struct nl_msg *,
47 extern int nl_send(
struct nl_handle *,
struct nl_msg *);
54 extern int nl_recv(
struct nl_handle *,
58 extern int nl_recvmsgs(
struct nl_handle *,
struct nl_cb *);
60 #define nl_recvmsgs_def(handle) nl_recvmsgs_default(handle)
66 extern char * nl_nlfamily2str(
int,
char *,
size_t);
67 extern int nl_str2nlfamily(
const char *);
int nl_recvmsgs(struct nl_handle *, struct nl_cb *)
Receive a set of messages from a netlink socket.
int nl_sendto(struct nl_handle *, void *, size_t)
Send raw data over netlink socket.
int nl_sendmsg(struct nl_handle *, struct nl_msg *, struct msghdr *)
Send netlink message with control over sendmsg() message header.
int nl_wait_for_ack(struct nl_handle *)
Wait for ACK.
int nl_send(struct nl_handle *, struct nl_msg *)
Send netlink message.
int nl_recvmsgs_default(struct nl_handle *)
Receive a set of message from a netlink socket using handlers in nl_handle.
int nl_send_auto_complete(struct nl_handle *, struct nl_msg *)
Send netlink message and check & extend header values as needed.
int nl_send_simple(struct nl_handle *, int, int, void *, size_t)
Send simple netlink message using nl_send_auto_complete()
int nl_connect(struct nl_handle *, int)
Create and connect netlink socket.
int nl_recv(struct nl_handle *, struct sockaddr_nl *, unsigned char **, struct ucred **)
Receive data from netlink socket.
void nl_close(struct nl_handle *)
Close/Disconnect netlink socket.