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-2006 Thomas Graf <tgraf@suug.ch>
19 #include <sys/types.h>
20 #include <sys/socket.h>
21 #include <netlink/types.h>
22 #include <netlink/netlink-compat.h>
23 #include <netlink/netlink-kernel.h>
24 #include <netlink/rtnetlink-kernel.h>
25 #include <netlink/handlers.h>
32 extern struct nl_handle * nl_handle_alloc(void);
33 extern struct nl_handle * nl_handle_alloc_nondefault(enum nl_cb_kind);
34 extern void nl_handle_destroy(struct nl_handle *);
35 extern void nl_join_groups(struct nl_handle *, int);
36 extern void nl_disable_sequence_check(struct nl_handle *);
38 extern int nl_join_group(struct nl_handle *, int);
39 extern int nl_set_passcred(struct nl_handle *, int);
41 /* Access Functions */
42 extern pid_t nl_handle_get_pid(struct nl_handle *);
43 extern void nl_handle_set_pid(struct nl_handle *, pid_t);
44 extern pid_t nl_handle_get_peer_pid(struct nl_handle *);
45 extern void nl_handle_set_peer_pid(struct nl_handle *, pid_t);
46 extern int nl_handle_get_fd(struct nl_handle *);
47 extern struct sockaddr_nl * nl_handle_get_local_addr(struct nl_handle *);
48 extern struct sockaddr_nl * nl_handle_get_peer_addr(struct nl_handle *);
49 extern struct nl_cb * nl_handle_get_cb(struct nl_handle *);
51 /* Connection Management */
52 extern int nl_connect(struct nl_handle *, int);
53 extern void nl_close(struct nl_handle *);
56 extern int nl_sendto(struct nl_handle *, void *, size_t);
57 extern int nl_sendmsg(struct nl_handle *, struct nl_msg *,
59 extern int nl_send(struct nl_handle *, struct nl_msg *);
60 extern int nl_send_auto_complete(struct nl_handle *,
62 extern int nl_send_simple(struct nl_handle *, int, int,
66 extern int nl_recv(struct nl_handle *,
67 struct sockaddr_nl *, unsigned char **,
70 extern int nl_recvmsgs(struct nl_handle *, struct nl_cb *);
71 extern int nl_recvmsgs_def(struct nl_handle *);
73 extern int nl_wait_for_ack(struct nl_handle *);
75 /* Netlink Family Translations */
76 extern char * nl_nlfamily2str(int, char *, size_t);
77 extern int nl_str2nlfamily(const char *);