]>
Commit | Line | Data |
---|---|---|
cc6119a0 CB |
1 | #ifndef _LXC_NETNS_IFADDRS_H |
2 | #define _LXC_NETNS_IFADDRS_H | |
3 | ||
4 | #ifdef __cplusplus | |
5 | extern "C" { | |
6 | #endif | |
7 | ||
8 | #include <features.h> | |
da5efb6f | 9 | #include <linux/if_link.h> |
cc6119a0 CB |
10 | #include <linux/types.h> |
11 | #include <netinet/in.h> | |
12 | #include <stdbool.h> | |
13 | #include <sys/socket.h> | |
14 | ||
a3aba110 CB |
15 | #include "netns_ifaddrs.h" |
16 | ||
cc6119a0 CB |
17 | struct netns_ifaddrs { |
18 | struct netns_ifaddrs *ifa_next; | |
19 | ||
20 | /* Can - but shouldn't be - NULL. */ | |
21 | char *ifa_name; | |
22 | ||
23 | /* This field is not present struct ifaddrs. */ | |
24 | int ifa_ifindex; | |
25 | ||
26 | unsigned ifa_flags; | |
27 | ||
28 | /* This field is not present struct ifaddrs. */ | |
29 | int ifa_mtu; | |
30 | ||
31 | /* This field is not present struct ifaddrs. */ | |
32 | int ifa_prefixlen; | |
33 | ||
34 | struct sockaddr *ifa_addr; | |
35 | struct sockaddr *ifa_netmask; | |
36 | union { | |
37 | struct sockaddr *ifu_broadaddr; | |
38 | struct sockaddr *ifu_dstaddr; | |
39 | } ifa_ifu; | |
40 | ||
da5efb6f CB |
41 | /* These fields are not present struct ifaddrs. */ |
42 | int ifa_stats_type; | |
3ccf815f CB |
43 | #if HAVE_STRUCT_RTNL_LINK_STATS64 |
44 | struct rtnl_link_stats64 ifa_stats; | |
45 | #else | |
46 | struct rtnl_link_stats ifa_stats; | |
47 | #endif | |
cc6119a0 CB |
48 | }; |
49 | ||
50 | #define __ifa_broadaddr ifa_ifu.ifu_broadaddr | |
51 | #define __ifa_dstaddr ifa_ifu.ifu_dstaddr | |
52 | ||
53 | extern void netns_freeifaddrs(struct netns_ifaddrs *); | |
54 | extern int netns_getifaddrs(struct netns_ifaddrs **ifap, __s32 netns_id, | |
55 | bool *netnsid_aware); | |
56 | ||
57 | #ifdef __cplusplus | |
58 | } | |
59 | #endif | |
60 | ||
61 | #endif /* _LXC_NETNS_IFADDRS_H */ |