2 * netlink/netlink.h Netlink Interface
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
9 * Copyright (c) 2003-2013 Thomas Graf <tgraf@suug.ch>
12 #ifndef NETLINK_NETLINK_H_
13 #define NETLINK_NETLINK_H_
20 #include <sys/socket.h>
21 #include <sys/types.h>
24 #include <netlink/netlink-compat.h>
25 #include <linux/netlink.h>
26 #include <linux/rtnetlink.h>
27 #include <linux/genetlink.h>
28 #include <linux/netfilter/nfnetlink.h>
29 #include <netlink/version.h>
30 #include <netlink/errno.h>
31 #include <netlink/types.h>
32 #include <netlink/handlers.h>
33 #include <netlink/socket.h>
34 #include <netlink/object.h>
42 struct nl_parser_param;
47 extern struct nl_dump_params nl_debug_dp;
49 /* Connection Management */
50 extern int nl_connect(struct nl_sock *, int);
51 extern void nl_close(struct nl_sock *);
54 extern int nl_sendto(struct nl_sock *, void *, size_t);
55 extern int nl_sendmsg(struct nl_sock *, struct nl_msg *,
57 extern int nl_send(struct nl_sock *, struct nl_msg *);
58 extern int nl_send_iovec(struct nl_sock *, struct nl_msg *,
59 struct iovec *, unsigned);
60 extern void nl_complete_msg(struct nl_sock *,
62 extern void nl_auto_complete(struct nl_sock *,
64 extern int nl_send_auto(struct nl_sock *, struct nl_msg *);
65 extern int nl_send_auto_complete(struct nl_sock *,
67 extern int nl_send_sync(struct nl_sock *, struct nl_msg *);
68 extern int nl_send_simple(struct nl_sock *, int, int,
72 extern int nl_recv(struct nl_sock *,
73 struct sockaddr_nl *, unsigned char **,
76 extern int nl_recvmsgs(struct nl_sock *, struct nl_cb *);
77 extern int nl_recvmsgs_report(struct nl_sock *, struct nl_cb *);
79 extern int nl_recvmsgs_default(struct nl_sock *);
81 extern int nl_wait_for_ack(struct nl_sock *);
83 extern int nl_pickup(struct nl_sock *,
84 int (*parser)(struct nl_cache_ops *,
87 struct nl_parser_param *),
89 /* Netlink Family Translations */
90 extern char * nl_nlfamily2str(int, char *, size_t);
91 extern int nl_str2nlfamily(const char *);