change the status information provided via ubus
[project/netifd.git] / interface-ip.h
1 #ifndef __INTERFACE_IP_H
2 #define __INTERFACE_IP_H
3
4 enum device_addr_flags {
5         /* address family for routes and addresses */
6         DEVADDR_INET4   = (0 << 0),
7         DEVADDR_INET6   = (1 << 0),
8         DEVADDR_FAMILY  = DEVADDR_INET4 | DEVADDR_INET6,
9
10         /* device route (no gateway) */
11         DEVADDR_DEVICE  = (1 << 1),
12 };
13
14 union if_addr {
15         struct in_addr in;
16         struct in6_addr in6;
17 };
18
19 struct device_addr {
20         struct vlist_node node;
21
22         enum device_addr_flags flags;
23
24         unsigned int mask;
25         union if_addr addr;
26 };
27
28 struct device_route {
29         struct vlist_node node;
30
31         enum device_addr_flags flags;
32         bool keep;
33
34         unsigned int mask;
35         union if_addr addr;
36         union if_addr nexthop;
37 };
38
39 void interface_ip_init(struct interface *iface);
40
41 #endif