summaryrefslogtreecommitdiff
path: root/zebra/rib.h
diff options
context:
space:
mode:
authorFeng Lu <lu.feng@6wind.com>2015-05-22 11:40:10 +0200
committerVipin Kumar <vipin@cumulusnetworks.com>2015-10-30 00:57:27 -0700
commitcd80d74fb275fe68247891d071075f450d4ec41c (patch)
treef9d14517c439e1971a11402ef64f832be828271e /zebra/rib.h
parenta31c5886dda74cab102671d3712fa2070e50d8ed (diff)
zebra: maintain RTADV per VRF
This moves the global variable "rtadv" into the "struct zebra_vrf", so that RTADV feature can work per VRF. * rtadv.c/rtadv.h: Add a proper parameter to the functions so that the entity of the "struct zebra_vrf" and interfaces can be obtained from the specified VRF. The old rtadv_init() is splitted into: - rtadv_cmd_init(): it installs the RTADV commands; is called from main(); - new rtadv_init(): it creates the socket; is called from zebra_vrf_enable(). rtadv_terminate() is added to stop the threads, close the socket and clear the counters. It is called from zebra_vrf_disable(). rtadv_make_socket() now calls vrf_socket() to create a socket in the VRF. * interface.h and rib.h: define the macro RTADV. * main.c: according changes, refer to rtadv.c. Signed-off-by: Feng Lu <lu.feng@6wind.com> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Acked-by: Vincent JARDIN <vincent.jardin@6wind.com> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> Conflicts: zebra/interface.h zebra/rib.h zebra/rtadv.c zebra/rtadv.h
Diffstat (limited to 'zebra/rib.h')
-rw-r--r--zebra/rib.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/zebra/rib.h b/zebra/rib.h
index 60a39d4727..f18b311d47 100644
--- a/zebra/rib.h
+++ b/zebra/rib.h
@@ -287,6 +287,29 @@ struct static_ipv6
: ((tnexthop) = (nexthop)->next)) \
: (((recursing) = 0),((tnexthop) = (tnexthop)->next)))
+/* Router advertisement feature. */
+#ifndef RTADV
+#if (defined(LINUX_IPV6) && (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME)
+ #ifdef HAVE_RTADV
+ #define RTADV
+ #endif
+#endif
+#endif
+
+#if defined (HAVE_IPV6) && defined (RTADV)
+/* Structure which hold status of router advertisement. */
+struct rtadv
+{
+ int sock;
+
+ int adv_if_count;
+ int adv_msec_if_count;
+
+ struct thread *ra_read;
+ struct thread *ra_timer;
+};
+#endif /* RTADV && HAVE_IPV6 */
+
/* Routing table instance. */
struct zebra_vrf
{
@@ -325,6 +348,10 @@ struct zebra_vrf
struct list *rid_all_sorted_list;
struct list *rid_lo_sorted_list;
struct prefix rid_user_assigned;
+
+#if defined (HAVE_IPV6) && defined (RTADV)
+ struct rtadv rtadv;
+#endif /* RTADV && HAVE_IPV6 */
};
/*