#define VRFID_NONE_STR "-"
+DEFINE_HOOK(bgp_process,
+ (struct bgp *bgp, afi_t afi, safi_t safi,
+ struct bgp_node *bn, struct peer *peer, bool withdraw),
+ (bgp, afi, safi, bn, peer, withdraw))
+
+
struct bgp_node *bgp_afi_node_get(struct bgp_table *table, afi_t afi,
safi_t safi, struct prefix *p,
struct prefix_rd *prd)
if (!CHECK_FLAG(pi->flags, BGP_PATH_HISTORY))
bgp_path_info_delete(rn, pi); /* keep historical info */
+ hook_call(bgp_process, peer->bgp, afi, safi, rn, peer, true);
+
bgp_process(peer->bgp, rn, afi, safi);
}
pi->uptime = bgp_clock();
same_attr = attrhash_cmp(pi->attr, attr_new);
+ hook_call(bgp_process, bgp, afi, safi, rn, peer, true);
+
/* Same attribute comes in. */
if (!CHECK_FLAG(pi->flags, BGP_PATH_REMOVED)
&& attrhash_cmp(pi->attr, attr_new)
if (safi == SAFI_EVPN)
bgp_evpn_import_route(bgp, afi, safi, p, new);
+ hook_call(bgp_process, bgp, afi, safi, rn, peer, false);
+
/* Process change. */
bgp_process(bgp, rn, afi, safi);
/* This BGP update is filtered. Log the reason then update BGP
entry. */
filtered:
+ hook_call(bgp_process, bgp, afi, safi, rn, peer, true);
+
if (bgp_debug_update(peer, p, NULL, 1)) {
if (!peer->rcvd_attr_printed) {
zlog_debug("%s rcvd UPDATE w/ attr: %s", peer->host,
#ifndef _QUAGGA_BGP_ROUTE_H
#define _QUAGGA_BGP_ROUTE_H
+#include <stdbool.h>
+
+#include "hook.h"
#include "queue.h"
#include "nexthop.h"
#include "bgp_table.h"
return false;
}
+/* called before bgp_process() */
+DECLARE_HOOK(bgp_process,
+ (struct bgp *bgp, afi_t afi, safi_t safi,
+ struct bgp_node *bn, struct peer *peer, bool withdraw),
+ (bgp, afi, safi, bn, peer, withdraw))
+
/* Prototypes. */
extern void bgp_rib_remove(struct bgp_node *rn, struct bgp_path_info *pi,
struct peer *peer, afi_t afi, safi_t safi);