summaryrefslogtreecommitdiffstats
path: root/bgpd/bgpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'bgpd/bgpd.c')
-rw-r--r--bgpd/bgpd.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c
index f4a16d6ba..291483a86 100644
--- a/bgpd/bgpd.c
+++ b/bgpd/bgpd.c
@@ -63,6 +63,10 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
#include "bgpd/bgp_damp.h"
#include "bgpd/bgp_mplsvpn.h"
#include "bgpd/bgp_encap.h"
+#if ENABLE_BGP_VNC
+#include "bgp_rfapi_cfg.h"
+#include "rfapi_backend.h"
+#endif
#include "bgpd/bgp_advertise.h"
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_vty.h"
@@ -1127,7 +1131,7 @@ peer_unlock_with_caller (const char *name, struct peer *peer)
}
/* Allocate new peer object, implicitely locked. */
-static struct peer *
+struct peer *
peer_new (struct bgp *bgp)
{
afi_t afi;
@@ -2885,6 +2889,12 @@ bgp_create (as_t *as, const char *name, enum bgp_instance_type inst_type)
bgp->as = *as;
+#if ENABLE_BGP_VNC
+ bgp->rfapi = bgp_rfapi_new(bgp);
+ assert(bgp->rfapi);
+ assert(bgp->rfapi_cfg);
+#endif /* ENABLE_BGP_VNC */
+
if (name)
{
bgp->name = XSTRDUP(MTYPE_BGP, name);
@@ -3165,6 +3175,11 @@ bgp_delete (struct bgp *bgp)
/* TODO - Other memory may need to be freed - e.g., NHT */
+#if ENABLE_BGP_VNC
+ rfapi_delete(bgp);
+ bgp_cleanup_routes(); /* rfapi cleanup can create route entries! */
+#endif
+
/* Remove visibility via the master list - there may however still be
* routes to be processed still referencing the struct bgp.
*/
@@ -5233,6 +5248,9 @@ peer_distribute_update (struct access_list *access)
}
}
}
+#if ENABLE_BGP_VNC
+ vnc_prefix_list_update(bgp);
+#endif
}
}
@@ -7337,6 +7355,12 @@ bgp_config_write (struct vty *vty)
/* ENCAPv6 configuration. */
write += bgp_config_write_family (vty, bgp, AFI_IP6, SAFI_ENCAP);
+#if ENABLE_BGP_VNC
+ write += bgp_rfapi_cfg_write(vty, bgp);
+#endif
+
+ vty_out (vty, " exit%s", VTY_NEWLINE);
+
write++;
}
return write;
@@ -7407,6 +7431,10 @@ bgp_init (void)
/* Init zebra. */
bgp_zebra_init(bm->master);
+#if ENABLE_BGP_VNC
+ vnc_zebra_init (bm->master);
+#endif
+
/* BGP VTY commands installation. */
bgp_vty_init ();
@@ -7419,6 +7447,9 @@ bgp_init (void)
bgp_scan_vty_init();
bgp_mplsvpn_init ();
bgp_encap_init ();
+#if ENABLE_BGP_VNC
+ rfapi_init ();
+#endif
/* Access list initialize. */
access_list_init ();