source: MondoRescue/branches/2.2.9/mindi-busybox/networking/libiproute/libnetlink.h@ 2725

Last change on this file since 2725 was 2725, checked in by Bruno Cornec, 13 years ago
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File size: 1.8 KB
RevLine 
[1765]1/* vi: set sw=4 ts=4: */
[2725]2#ifndef LIBNETLINK_H
3#define LIBNETLINK_H 1
[821]4
[1765]5#include <linux/types.h>
6/* We need linux/types.h because older kernels use __u32 etc
7 * in linux/[rt]netlink.h. 2.6.19 seems to be ok, though */
[821]8#include <linux/netlink.h>
9#include <linux/rtnetlink.h>
10
[2725]11PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
12
13struct rtnl_handle {
14 int fd;
15 struct sockaddr_nl local;
16 struct sockaddr_nl peer;
17 uint32_t seq;
18 uint32_t dump;
[821]19};
20
[2725]21extern void xrtnl_open(struct rtnl_handle *rth) FAST_FUNC;
22#define rtnl_close(rth) (close((rth)->fd))
23extern int xrtnl_wilddump_request(struct rtnl_handle *rth, int fam, int type) FAST_FUNC;
24extern int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) FAST_FUNC;
[1765]25extern int xrtnl_dump_filter(struct rtnl_handle *rth,
[2725]26 int (*filter)(const struct sockaddr_nl*, struct nlmsghdr *n, void*) FAST_FUNC,
27 void *arg1) FAST_FUNC;
28
29/* bbox doesn't use parameters no. 3, 4, 6, 7, stub them out */
30#define rtnl_talk(rtnl, n, peer, groups, answer, junk, jarg) \
31 rtnl_talk(rtnl, n, answer)
[821]32extern int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, pid_t peer,
[2725]33 unsigned groups, struct nlmsghdr *answer,
34 int (*junk)(struct sockaddr_nl *,struct nlmsghdr *n, void *),
35 void *jarg) FAST_FUNC;
[821]36
[2725]37extern int rtnl_send(struct rtnl_handle *rth, char *buf, int) FAST_FUNC;
[821]38
39
[2725]40extern int addattr32(struct nlmsghdr *n, int maxlen, int type, uint32_t data) FAST_FUNC;
41extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen) FAST_FUNC;
42extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, uint32_t data) FAST_FUNC;
43extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen) FAST_FUNC;
[821]44
[2725]45extern void parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len) FAST_FUNC;
46
47POP_SAVED_FUNCTION_VISIBILITY
48
49#endif
Note: See TracBrowser for help on using the repository browser.