00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef NETLINK_NETLINK_H_
00013 #define NETLINK_NETLINK_H_
00014
00015 #include <stdio.h>
00016 #include <stdint.h>
00017 #include <string.h>
00018 #include <stdlib.h>
00019 #include <sys/poll.h>
00020 #include <sys/socket.h>
00021 #include <sys/types.h>
00022 #include <sys/time.h>
00023 #include <netlink/netlink-compat.h>
00024 #include <linux/netlink.h>
00025 #include <linux/rtnetlink.h>
00026 #include <linux/genetlink.h>
00027 #include <linux/netfilter/nfnetlink.h>
00028 #include <netlink/types.h>
00029 #include <netlink/handlers.h>
00030 #include <netlink/socket.h>
00031
00032 #ifdef __cplusplus
00033 extern "C" {
00034 #endif
00035
00036 extern int nl_debug;
00037 extern struct nl_dump_params nl_debug_dp;
00038
00039
00040 extern int nl_connect(struct nl_handle *, int);
00041 extern void nl_close(struct nl_handle *);
00042
00043
00044 extern int nl_sendto(struct nl_handle *, void *, size_t);
00045 extern int nl_sendmsg(struct nl_handle *, struct nl_msg *,
00046 struct msghdr *);
00047 extern int nl_send(struct nl_handle *, struct nl_msg *);
00048 extern int nl_send_auto_complete(struct nl_handle *,
00049 struct nl_msg *);
00050 extern int nl_send_simple(struct nl_handle *, int, int,
00051 void *, size_t);
00052
00053
00054 extern int nl_recv(struct nl_handle *,
00055 struct sockaddr_nl *, unsigned char **,
00056 struct ucred **);
00057
00058 extern int nl_recvmsgs(struct nl_handle *, struct nl_cb *);
00059
00060 #define nl_recvmsgs_def(handle) nl_recvmsgs_default(handle)
00061 extern int nl_recvmsgs_default(struct nl_handle *);
00062
00063 extern int nl_wait_for_ack(struct nl_handle *);
00064
00065
00066 extern char * nl_nlfamily2str(int, char *, size_t);
00067 extern int nl_str2nlfamily(const char *);
00068
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072
00073 #endif