libnl
3.2.3
|
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 <netdb.h> 00024 #include <netlink/netlink-compat.h> 00025 #include <linux/netlink.h> 00026 #include <linux/rtnetlink.h> 00027 #include <linux/genetlink.h> 00028 #include <linux/netfilter/nfnetlink.h> 00029 #include <netlink/version.h> 00030 #include <netlink/errno.h> 00031 #include <netlink/types.h> 00032 #include <netlink/handlers.h> 00033 #include <netlink/socket.h> 00034 #include <netlink/object.h> 00035 #include <netlink/cache-api.h> 00036 00037 #ifdef __cplusplus 00038 extern "C" { 00039 #endif 00040 00041 struct ucred; 00042 00043 extern int nl_debug; 00044 extern struct nl_dump_params nl_debug_dp; 00045 00046 /* Connection Management */ 00047 extern int nl_connect(struct nl_sock *, int); 00048 extern void nl_close(struct nl_sock *); 00049 00050 /* Send */ 00051 extern int nl_sendto(struct nl_sock *, void *, size_t); 00052 extern int nl_sendmsg(struct nl_sock *, struct nl_msg *, 00053 struct msghdr *); 00054 extern int nl_send(struct nl_sock *, struct nl_msg *); 00055 extern int nl_send_iovec(struct nl_sock *, struct nl_msg *, 00056 struct iovec *, unsigned); 00057 extern void nl_complete_msg(struct nl_sock *, 00058 struct nl_msg *); 00059 extern void nl_auto_complete(struct nl_sock *, 00060 struct nl_msg *); 00061 extern int nl_send_auto(struct nl_sock *, struct nl_msg *); 00062 extern int nl_send_auto_complete(struct nl_sock *, 00063 struct nl_msg *); 00064 extern int nl_send_sync(struct nl_sock *, struct nl_msg *); 00065 extern int nl_send_simple(struct nl_sock *, int, int, 00066 void *, size_t); 00067 00068 /* Receive */ 00069 extern int nl_recv(struct nl_sock *, 00070 struct sockaddr_nl *, unsigned char **, 00071 struct ucred **); 00072 00073 extern int nl_recvmsgs(struct nl_sock *, struct nl_cb *); 00074 00075 extern int nl_recvmsgs_default(struct nl_sock *); 00076 00077 extern int nl_wait_for_ack(struct nl_sock *); 00078 00079 extern int nl_pickup(struct nl_sock *, 00080 int (*parser)(struct nl_cache_ops *, 00081 struct sockaddr_nl *, 00082 struct nlmsghdr *, 00083 struct nl_parser_param *), 00084 struct nl_object **); 00085 /* Netlink Family Translations */ 00086 extern char * nl_nlfamily2str(int, char *, size_t); 00087 extern int nl_str2nlfamily(const char *); 00088 00089 #ifdef __cplusplus 00090 } 00091 #endif 00092 00093 #endif