From 49f76097fc191761db8482aa3bf6e6322c52c647 Mon Sep 17 00:00:00 2001 From: Feng Lu Date: Fri, 22 May 2015 11:40:10 +0200 Subject: 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 Reviewed-by: Alain Ritoux Signed-off-by: Nicolas Dichtel Acked-by: Vincent JARDIN Signed-off-by: David Lamparter --- zebra/rtadv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'zebra/rtadv.h') diff --git a/zebra/rtadv.h b/zebra/rtadv.h index 1e1aec9a..76f98cf2 100644 --- a/zebra/rtadv.h +++ b/zebra/rtadv.h @@ -100,6 +100,8 @@ extern const char *rtadv_pref_strs[]; #endif /* RTADV */ -extern void rtadv_init (void); +extern void rtadv_init (struct zebra_vrf *); +extern void rtadv_terminate (struct zebra_vrf *); +extern void rtadv_cmd_init (void); #endif /* _ZEBRA_RTADV_H */ -- cgit v1.2.3