X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=interface-ip.h;h=197bd9a5a1c7e3304c7f3e3efc5a4128f00f425b;hp=c0a3b92d9f1f2f922ede59c7ce75147364ace303;hb=HEAD;hpb=e5faaa6aa420a4d144cd13350de971b6d855b231 diff --git a/interface-ip.h b/interface-ip.h index c0a3b92..197bd9a 100644 --- a/interface-ip.h +++ b/interface-ip.h @@ -31,8 +31,8 @@ enum device_addr_flags { /* route overrides the default interface mtu */ DEVROUTE_MTU = (1 << 4), - /* route automatically added by kernel */ - DEVADDR_KERNEL = (1 << 5), + /* route overrides the default proto type */ + DEVROUTE_PROTO = (1 << 5), /* address is off-link (no subnet-route) */ DEVADDR_OFFLINK = (1 << 6), @@ -59,6 +59,7 @@ struct device_prefix_assignment { struct list_head head; int32_t assigned; uint8_t length; + int weight; struct in6_addr addr; bool enabled; char name[]; @@ -81,48 +82,51 @@ struct device_prefix { char pclass[]; }; -struct device_addr { +struct device_route { struct vlist_node node; + struct interface *iface; + bool enabled; + bool keep; bool failed; - unsigned int policy_table; - /* ipv4 only */ - uint32_t broadcast; - uint32_t point_to_point; - - /* ipv6 only */ + union if_addr nexthop; + int mtu; + unsigned int type; + unsigned int proto; time_t valid_until; - time_t preferred_until; - char *pclass; /* must be last */ enum device_addr_flags flags; + int metric; // there can be multiple routes to the same target + unsigned int table; unsigned int mask; + unsigned int sourcemask; union if_addr addr; + union if_addr source; }; -struct device_route { +struct device_addr { struct vlist_node node; - struct interface *iface; - bool enabled; - bool keep; bool failed; + unsigned int policy_table; - union if_addr nexthop; - int mtu; - unsigned int type; + struct device_route subnet; + + /* ipv4 only */ + uint32_t broadcast; + uint32_t point_to_point; + + /* ipv6 only */ time_t valid_until; + time_t preferred_until; + char *pclass; /* must be last */ enum device_addr_flags flags; - int metric; // there can be multiple routes to the same target - unsigned int table; unsigned int mask; - unsigned int sourcemask; union if_addr addr; - union if_addr source; }; struct device_source_table {