libnl 1.1
include/netlink/netlink.h
00001 /*
00002  * netlink/netlink.h            Netlink Interface
00003  *
00004  *      This library is free software; you can redistribute it and/or
00005  *      modify it under the terms of the GNU Lesser General Public
00006  *      License as published by the Free Software Foundation version 2.1
00007  *      of the License.
00008  *
00009  * Copyright (c) 2003-2006 Thomas Graf <tgraf@suug.ch>
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 /* Connection Management */
00040 extern int                      nl_connect(struct nl_handle *, int);
00041 extern void                     nl_close(struct nl_handle *);
00042 
00043 /* Send */
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 /* Receive */
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 /* Netlink Family Translations */
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