Revision 9a158361 nest/iface.h
nest/iface.h | ||
---|---|---|
15 | 15 |
|
16 | 16 |
struct proto; |
17 | 17 |
|
18 |
struct ifa { /* Interface address */ |
|
19 |
node n; |
|
20 |
struct iface *iface; /* Interface this address belongs to */ |
|
21 |
ip_addr ip; /* IP address of this host */ |
|
22 |
ip_addr prefix; /* Network prefix */ |
|
23 |
unsigned pxlen; /* Prefix length */ |
|
24 |
ip_addr brd; /* Broadcast address */ |
|
25 |
ip_addr opposite; /* Opposite end of a point-to-point link */ |
|
26 |
unsigned scope; /* Interface address scope */ |
|
27 |
unsigned flags; /* Analogous to iface->flags */ |
|
28 |
}; |
|
29 |
|
|
18 | 30 |
struct iface { |
19 | 31 |
node n; |
20 | 32 |
char name[16]; |
21 | 33 |
unsigned flags; |
22 | 34 |
unsigned mtu; |
23 | 35 |
unsigned index; /* OS-dependent interface index */ |
24 |
ip_addr ip; /* IP address of this host (0=unset) */ |
|
25 |
ip_addr prefix; /* Network prefix */ |
|
26 |
unsigned pxlen; /* Prefix length */ |
|
27 |
ip_addr brd; /* Broadcast address */ |
|
28 |
ip_addr opposite; /* Opposite end of a point-to-point link */ |
|
36 |
list addrs; /* Addresses assigned to this interface */ |
|
37 |
struct ifa *addr; /* Primary address */ |
|
29 | 38 |
struct neighbor *neigh; /* List of neighbors on this interface */ |
30 | 39 |
}; |
31 | 40 |
|
32 |
#define IF_UP 1 /* IF_LINK_UP, not IF_IGNORE and IP address known */
|
|
41 |
#define IF_UP 1 /* IF_LINK_UP and IP address known */ |
|
33 | 42 |
#define IF_MULTIACCESS 2 |
34 | 43 |
#define IF_UNNUMBERED 4 |
35 | 44 |
#define IF_BROADCAST 8 |
36 |
#define IF_MULTICAST 16 |
|
37 |
#define IF_TUNNEL 32 |
|
38 |
#define IF_ADMIN_DOWN 64 |
|
39 |
#define IF_LOOPBACK 128 |
|
40 |
#define IF_IGNORE 256 |
|
41 |
#define IF_LINK_UP 512 |
|
45 |
#define IF_MULTICAST 0x10 |
|
46 |
#define IF_TUNNEL 0x20 |
|
47 |
#define IF_ADMIN_DOWN 0x40 |
|
48 |
#define IF_LOOPBACK 0x80 |
|
49 |
#define IF_IGNORE 0x100 /* Not to be used by routing protocols (loopbacks etc.) */ |
|
50 |
#define IF_LINK_UP 0x200 |
|
51 |
|
|
52 |
#define IA_PRIMARY 0x10000 /* This address is primary */ |
|
53 |
#define IA_SECONDARY 0x20000 /* This address has been reported as secondary by the kernel */ |
|
54 |
#define IA_FLAGS 0xff0000 |
|
55 |
|
|
56 |
#define IF_JUST_CREATED 0x10000000 /* Send creation event as soon as possible */ |
|
57 |
#define IF_TMP_DOWN 0x20000000 /* Temporary shutdown due to interface reconfiguration */ |
|
42 | 58 |
#define IF_UPDATED 0x40000000 /* Touched in last scan */ |
43 | 59 |
|
44 | 60 |
/* Interface change events */ |
45 | 61 |
|
46 | 62 |
#define IF_CHANGE_UP 1 |
47 | 63 |
#define IF_CHANGE_DOWN 2 |
48 |
#define IF_CHANGE_FLAGS 4 /* Can be converted to down/up internally */
|
|
49 |
#define IF_CHANGE_MTU 8
|
|
50 |
#define IF_CHANGE_CREATE 16 /* Seen this interface for the first time */
|
|
64 |
#define IF_CHANGE_MTU 4
|
|
65 |
#define IF_CHANGE_CREATE 8 /* Seen this interface for the first time */
|
|
66 |
#define IF_CHANGE_TOO_MUCH 0x40000000 /* Used internally */
|
|
51 | 67 |
|
52 | 68 |
void if_init(void); |
53 | 69 |
void if_dump(struct iface *); |
54 | 70 |
void if_dump_all(void); |
55 |
void if_update(struct iface *); |
|
71 |
void ifa_dump(struct ifa *); |
|
72 |
struct iface *if_update(struct iface *); |
|
73 |
struct ifa *ifa_update(struct ifa *); |
|
74 |
void ifa_delete(struct ifa *); |
|
56 | 75 |
void if_start_update(void); |
57 | 76 |
void if_end_update(void); |
77 |
void if_end_partial_update(struct iface *); |
|
58 | 78 |
void if_feed_baby(struct proto *); |
59 | 79 |
struct iface *if_find_by_index(unsigned); |
80 |
struct iface *if_find_by_name(char *); |
|
60 | 81 |
|
61 | 82 |
/* |
62 | 83 |
* Neighbor Cache. We hold (direct neighbor, protocol) pairs we've seen |
Also available in: Unified diff