diff options
Diffstat (limited to 'zebra/rib.h')
| -rw-r--r-- | zebra/rib.h | 79 |
1 files changed, 23 insertions, 56 deletions
diff --git a/zebra/rib.h b/zebra/rib.h index 25ab68df13..cd77db4df1 100644 --- a/zebra/rib.h +++ b/zebra/rib.h @@ -169,11 +169,11 @@ typedef struct rib_dest_t_ RIB_DEST_FOREACH_ROUTE_SAFE (rib_dest_from_rnode (rn), rib, next) /* Static route information. */ -struct static_ipv4 +struct static_route { /* For linked list. */ - struct static_ipv4 *prev; - struct static_ipv4 *next; + struct static_route *prev; + struct static_route *next; /* VRF identifier. */ vrf_id_t vrf_id; @@ -186,50 +186,22 @@ struct static_ipv4 /* Flag for this static route's type. */ u_char type; -#define STATIC_IPV4_GATEWAY 1 -#define STATIC_IPV4_IFNAME 2 -#define STATIC_IPV4_BLACKHOLE 3 +#define STATIC_IPV4_GATEWAY 1 +#define STATIC_IPV4_IFNAME 2 +#define STATIC_IPV4_BLACKHOLE 3 +#define STATIC_IPV6_GATEWAY 4 +#define STATIC_IPV6_GATEWAY_IFNAME 5 +#define STATIC_IPV6_IFNAME 6 - /* Nexthop value. */ - union - { - struct in_addr ipv4; - char *ifname; - } gate; - - /* bit flags */ - u_char flags; -/* - see ZEBRA_FLAG_REJECT - ZEBRA_FLAG_BLACKHOLE - */ -}; - -#ifdef HAVE_IPV6 -/* Static route information. */ -struct static_ipv6 -{ - /* For linked list. */ - struct static_ipv6 *prev; - struct static_ipv6 *next; - - /* VRF identifier. */ - vrf_id_t vrf_id; - - /* Administrative distance. */ - u_char distance; - - /* Tag */ - u_short tag; - - /* Flag for this static route's type. */ - u_char type; -#define STATIC_IPV6_GATEWAY 1 -#define STATIC_IPV6_GATEWAY_IFNAME 2 -#define STATIC_IPV6_IFNAME 3 - - /* Nexthop value. */ - struct in6_addr ipv6; + /* + * Nexthop value. + * + * Under IPv4 addr and ifname are + * used independentyly. + * STATIC_IPV4_GATEWAY uses addr + * STATIC_IPV4_IFNAME uses ifname + */ + union g_addr addr; char *ifname; /* bit flags */ @@ -239,7 +211,7 @@ struct static_ipv6 ZEBRA_FLAG_BLACKHOLE */ }; -#endif /* HAVE_IPV6 */ + /* The following for loop allows to iterate over the nexthop * structure of routes. @@ -296,7 +268,7 @@ struct static_ipv6 #endif #endif -#if defined (HAVE_IPV6) && defined (RTADV) +#if defined (RTADV) /* Structure which hold status of router advertisement. */ struct rtadv { @@ -308,7 +280,7 @@ struct rtadv struct thread *ra_read; struct thread *ra_timer; }; -#endif /* RTADV && HAVE_IPV6 */ +#endif /* RTADV */ #ifdef HAVE_NETLINK /* Socket interface to kernel */ @@ -366,9 +338,9 @@ struct zebra_vrf struct list *rid_lo_sorted_list; struct prefix rid_user_assigned; -#if defined (HAVE_IPV6) && defined (RTADV) +#if defined (RTADV) struct rtadv rtadv; -#endif /* RTADV && HAVE_IPV6 */ +#endif /* RTADV */ }; /* @@ -438,7 +410,6 @@ extern int rib_lookup_ipv4_route (struct prefix_ipv4 *, union sockunion *, #define ZEBRA_RIB_FOUND_CONNECTED 2 #define ZEBRA_RIB_NOTFOUND 3 -#ifdef HAVE_IPV6 extern struct nexthop *nexthop_ipv6_add (struct rib *, struct in6_addr *); extern struct nexthop *nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6, unsigned int ifindex); @@ -448,7 +419,6 @@ extern struct nexthop *nexthop_ipv6_ifname_add (struct rib *rib, extern int rib_bogus_ipv6 (int type, struct prefix_ipv6 *p, struct in6_addr *gate, unsigned int ifindex, int table); -#endif /* HAVE_IPV6 */ extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id); extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t); @@ -498,7 +468,6 @@ extern int static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname, u_short tag, u_char distance, vrf_id_t vrf_id); -#ifdef HAVE_IPV6 extern int rib_add_ipv6 (int type, u_short instance, int flags, struct prefix_ipv6 *p, struct in6_addr *gate, unsigned int ifindex, vrf_id_t vrf_id, @@ -529,8 +498,6 @@ static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate, const char *ifname, u_short tag, u_char distance, vrf_id_t vrf_id); -#endif /* HAVE_IPV6 */ - extern int rib_gc_dest (struct route_node *rn); extern struct route_table *rib_tables_iter_next (rib_tables_iter_t *iter); |
