Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

libnetlink.h

Go to the documentation of this file.
00001 #ifndef __LIBNETLINK_H__
00002 #define __LIBNETLINK_H__ 1
00003 
00004 #include <asm/types.h>
00005 #include <linux/netlink.h>
00006 #include <linux/rtnetlink.h>
00007 
00008 struct rtnl_handle
00009 {
00010         int                     fd;
00011         struct sockaddr_nl      local;
00012         struct sockaddr_nl      peer;
00013         __u32                   seq;
00014         __u32                   dump;
00015 };
00016 
00017 extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions);
00018 extern void rtnl_close(struct rtnl_handle *rth);
00019 extern int rtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type);
00020 extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len);
00021 extern int rtnl_dump_filter(struct rtnl_handle *rth,
00022                             int (*filter)(struct sockaddr_nl *, struct nlmsghdr *n, void *),
00023                             void *arg1,
00024                             int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
00025                             void *arg2);
00026 extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
00027                      unsigned groups, struct nlmsghdr *answer,
00028                      int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
00029                      void *jarg);
00030 extern int rtnl_send(struct rtnl_handle *rth, char *buf, int);
00031 
00032 
00033 extern int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
00034 extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen);
00035 extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data);
00036 extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen);
00037 
00038 extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
00039 
00040 extern int rtnl_listen(struct rtnl_handle *, int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
00041                        void *jarg);
00042 extern int rtnl_from_file(FILE *, int (*handler)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
00043                        void *jarg);
00044 
00045 #endif /* __LIBNETLINK_H__ */
00046 
00047 

Generated on Mon Dec 27 21:55:22 2004 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1