Revert "bgpd: optimal router reflection cli and fsm changes"

This reverts commit 70cd87ca02.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2023-01-17 18:14:27 +02:00
parent 405e1c848f
commit cfd01fc0ac
14 changed files with 2 additions and 1561 deletions

View File

@ -73,7 +73,6 @@ unsigned long conf_bgp_debug_graceful_restart;
unsigned long conf_bgp_debug_evpn_mh;
unsigned long conf_bgp_debug_bfd;
unsigned long conf_bgp_debug_cond_adv;
unsigned long conf_bgp_debug_optimal_route_reflection;
unsigned long term_bgp_debug_as4;
unsigned long term_bgp_debug_neighbor_events;
@ -95,7 +94,6 @@ unsigned long term_bgp_debug_graceful_restart;
unsigned long term_bgp_debug_evpn_mh;
unsigned long term_bgp_debug_bfd;
unsigned long term_bgp_debug_cond_adv;
unsigned long term_bgp_debug_optimal_route_reflection;
struct list *bgp_debug_neighbor_events_peers = NULL;
struct list *bgp_debug_keepalive_peers = NULL;
@ -1987,33 +1985,6 @@ DEFPY (debug_bgp_evpn_mh,
return CMD_SUCCESS;
}
DEFPY (debug_bgp_optimal_route_reflection,
debug_bgp_optimal_route_reflection_cmd,
"[no$no] debug bgp optimal-route-reflection",
NO_STR
DEBUG_STR
BGP_STR
BGP_ORR_DEBUG)
{
if (vty->node == CONFIG_NODE) {
if (no)
DEBUG_OFF(optimal_route_reflection, ORR);
else
DEBUG_ON(optimal_route_reflection, ORR);
} else {
if (no) {
TERM_DEBUG_OFF(optimal_route_reflection, ORR);
vty_out(vty,
"BGP Optimal Route Reflection debugging is off\n");
} else {
TERM_DEBUG_ON(optimal_route_reflection, ORR);
vty_out(vty,
"BGP Optimal Route Reflection debugging is on\n");
}
}
return CMD_SUCCESS;
}
DEFUN (debug_bgp_labelpool,
debug_bgp_labelpool_cmd,
"debug bgp labelpool",
@ -2152,7 +2123,6 @@ DEFUN (no_debug_bgp,
TERM_DEBUG_OFF(evpn_mh, EVPN_MH_RT);
TERM_DEBUG_OFF(bfd, BFD_LIB);
TERM_DEBUG_OFF(cond_adv, COND_ADV);
TERM_DEBUG_OFF(optimal_route_reflection, ORR);
vty_out(vty, "All possible debugging has been turned off\n");
@ -2249,10 +2219,6 @@ DEFUN_NOSH (show_debugging_bgp,
vty_out(vty,
" BGP conditional advertisement debugging is on\n");
if (BGP_DEBUG(optimal_route_reflection, ORR))
vty_out(vty,
" BGP Optimal Route Reflection debugging is on\n");
cmd_show_lib_debugs(vty);
return CMD_SUCCESS;
@ -2386,11 +2352,6 @@ static int bgp_config_write_debug(struct vty *vty)
if (CONF_BGP_DEBUG(cond_adv, COND_ADV)) {
vty_out(vty, "debug bgp conditional-advertisement\n");
write++
}
if (CONF_BGP_DEBUG(optimal_route_reflection, ORR)) {
vty_out(vty, "debug bgp optimal-route-reflection\n");
write++;
}
@ -2526,10 +2487,6 @@ void bgp_debug_init(void)
/* debug bgp conditional advertisement */
install_element(ENABLE_NODE, &debug_bgp_cond_adv_cmd);
install_element(CONFIG_NODE, &debug_bgp_cond_adv_cmd);
/* debug bgp optimal route reflection */
install_element(ENABLE_NODE, &debug_bgp_optimal_route_reflection_cmd);
install_element(CONFIG_NODE, &debug_bgp_optimal_route_reflection_cmd);
}
/* Return true if this prefix is on the per_prefix_list of prefixes to debug

View File

@ -81,7 +81,6 @@ extern unsigned long conf_bgp_debug_graceful_restart;
extern unsigned long conf_bgp_debug_evpn_mh;
extern unsigned long conf_bgp_debug_bfd;
extern unsigned long conf_bgp_debug_cond_adv;
extern unsigned long conf_bgp_debug_optimal_route_reflection;
extern unsigned long term_bgp_debug_as4;
extern unsigned long term_bgp_debug_neighbor_events;
@ -101,7 +100,6 @@ extern unsigned long term_bgp_debug_graceful_restart;
extern unsigned long term_bgp_debug_evpn_mh;
extern unsigned long term_bgp_debug_bfd;
extern unsigned long term_bgp_debug_cond_adv;
extern unsigned long term_bgp_debug_optimal_route_reflection;
extern struct list *bgp_debug_neighbor_events_peers;
extern struct list *bgp_debug_keepalive_peers;
@ -140,7 +138,6 @@ struct bgp_debug_filter {
#define BGP_DEBUG_PBR_ERROR 0x02
#define BGP_DEBUG_EVPN_MH_ES 0x01
#define BGP_DEBUG_EVPN_MH_RT 0x02
#define BGP_DEBUG_ORR 0x01
#define BGP_DEBUG_PACKET_SEND 0x01
#define BGP_DEBUG_PACKET_SEND_DETAIL 0x02

View File

@ -1339,9 +1339,6 @@ void bgp_fsm_change_status(struct peer *peer, enum bgp_fsm_status status)
&& bgp_update_delay_applicable(peer->bgp))
bgp_update_delay_process_status_change(peer);
/* BGP ORR : Update Active Root */
bgp_peer_update_orr_active_roots(peer);
if (bgp_debug_neighbor_events(peer))
zlog_debug("%s fd %d went from %s to %s", peer->host, peer->fd,
lookup_msg(bgp_status_msg, peer->ostatus, NULL),

View File

@ -176,6 +176,4 @@ const char *print_peer_gr_cmd(enum peer_gr_command pr_gr_cmd);
const char *print_global_gr_mode(enum global_mode gl_mode);
const char *print_global_gr_cmd(enum global_gr_command gl_gr_cmd);
int bgp_peer_reg_with_nht(struct peer *peer);
extern void bgp_peer_update_orr_active_roots(struct peer *peer);
#endif /* _QUAGGA_BGP_FSM_H */

View File

@ -134,12 +134,8 @@ DEFINE_MTYPE(BGPD, BGP_EVPN_VRF_IMPORT_RT, "BGP EVPN VRF Import RT");
DEFINE_MTYPE(BGPD, BGP_SRV6_L3VPN, "BGP prefix-sid srv6 l3vpn servcie");
DEFINE_MTYPE(BGPD, BGP_SRV6_VPN, "BGP prefix-sid srv6 vpn service");
DEFINE_MTYPE(BGPD, BGP_SRV6_SID, "BGP srv6 segment-id");
DEFINE_MTYPE(BGPD, BGP_SRV6_FUNCTION, "BGP srv6 function");
DEFINE_MTYPE(BGPD, EVPN_REMOTE_IP, "BGP EVPN Remote IP hash entry");
DEFINE_MTYPE(BGPD, BGP_NOTIFICATION, "BGP Notification Message");
DEFINE_MTYPE(BGPD, BGP_ORR_GROUP, "BGP Optimal Route Reflection Group");
DEFINE_MTYPE(BGPD, BGP_ORR_GROUP_NAME,
"BGP Optimal Route Reflection Group Name");

View File

@ -137,7 +137,5 @@ DECLARE_MTYPE(BGP_SRV6_FUNCTION);
DECLARE_MTYPE(EVPN_REMOTE_IP);
DECLARE_MTYPE(BGP_NOTIFICATION);
DECLARE_MTYPE(BGP_ORR_GROUP);
DECLARE_MTYPE(BGP_ORR_GROUP_NAME);
#endif /* _QUAGGA_BGP_MEMORY_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,98 +0,0 @@
/*
* BGP Optimal Route Reflection
* Copyright (C) 2021 Samsung R&D Institute India - Bangalore.
* Madhurilatha Kuruganti
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; see the file COPYING; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _FRR_BGP_ORR_H
#define _FRR_BGP_ORR_H
#include <zebra.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Macro to log debug message */
#define bgp_orr_debug(...) \
do { \
if (BGP_DEBUG(optimal_route_reflection, ORR)) \
zlog_debug("[BGP-ORR] " __VA_ARGS__); \
} while (0)
/* BGP ORR Message Type */
enum bgp_orr_msg_type {
BGP_ORR_IMSG_INVALID = 0,
/* ORR group update */
BGP_ORR_IMSG_GROUP_CREATE = 1,
BGP_ORR_IMSG_GROUP_DELETE,
BGP_ORR_IMSG_GROUP_UPDATE,
/* ORR group update on a BGP RR Client */
BGP_ORR_IMSG_SET_ORR_ON_PEER = 4,
BGP_ORR_IMSG_UNSET_ORR_ON_PEER,
/* ORR IGP Metric Update from IGP from requested Location */
BGP_ORR_IMSG_IGP_METRIC_UPDATE = 6,
/* ORR Group Related Information display */
BGP_ORR_IMSG_SHOW_ORR = 7,
BGP_ORR_IMSG_SHOW_ORR_GROUP,
/* Invalid Message Type*/
BGP_ORR_IMSG_MAX
};
extern void bgp_config_write_orr(struct vty *vty, struct bgp *bgp, afi_t afi,
safi_t safi);
extern int bgp_afi_safi_orr_group_set_vty(struct vty *vty, afi_t afi,
safi_t safi, const char *name,
const char *primary_str,
const char *secondary_str,
const char *tertiary_str, bool set);
extern int peer_orr_group_set_vty(struct vty *vty, const char *ip_str,
afi_t afi, safi_t safi,
const char *orr_group_name, bool set);
extern bool peer_orr_rrclient_check(struct peer *peer, afi_t afi, safi_t safi);
extern int bgp_show_orr(struct vty *vty, struct bgp *bgp, afi_t afi,
safi_t safi, const char *orr_group_name,
uint8_t show_flags);
extern int bgp_afi_safi_orr_group_set(struct bgp *bgp, afi_t afi, safi_t safi,
const char *name, struct peer *primary,
struct peer *secondary,
struct peer *tertiary);
extern int bgp_afi_safi_orr_group_unset(struct bgp *bgp, afi_t afi, safi_t safi,
const char *name);
extern void bgp_peer_update_orr_active_roots(struct peer *peer);
extern int bgg_orr_message_process(enum bgp_orr_msg_type msg_type, void *msg);
extern struct bgp_orr_group *bgp_orr_group_lookup_by_name(struct bgp *bgp,
afi_t afi,
safi_t safi,
const char *name);
extern void bgp_orr_cleanup(struct bgp *bgp);
#ifdef __cplusplus
}
#endif
#endif /* _FRR_BGP_ORR_H */

View File

@ -72,7 +72,6 @@
#include "bgpd/bgp_addpath.h"
#include "bgpd/bgp_mac.h"
#include "bgpd/bgp_network.h"
#include "bgpd/bgp_orr.h"
#include "bgpd/bgp_trace.h"
#include "bgpd/bgp_rpki.h"
@ -566,7 +565,6 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
enum bgp_path_selection_reason *reason)
{
const struct prefix *new_p;
struct prefix exist_p;
struct attr *newattr, *existattr;
enum bgp_peer_sort new_sort;
enum bgp_peer_sort exist_sort;
@ -599,11 +597,6 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
bool new_origin, exist_origin;
struct bgp_path_info *bpi_ultimate;
struct bgp_orr_group *orr_group = NULL;
struct listnode *node;
struct bgp_orr_igp_metric *igp_metric = NULL;
struct list *orr_group_igp_metric_info = NULL;
*paths_eq = 0;
/* 0. Null check. */
@ -1139,49 +1132,6 @@ static int bgp_path_info_cmp(struct bgp *bgp, struct bgp_path_info *new,
if (exist->extra)
existm = exist->extra->igpmetric;
if (new->peer->orr_group_name[afi][safi]) {
ret = str2prefix(new->peer->host, &exist_p);
orr_group = bgp_orr_group_lookup_by_name(
bgp, afi, safi, new->peer->orr_group_name[afi][safi]);
if (orr_group) {
orr_group_igp_metric_info = orr_group->igp_metric_info;
if (orr_group_igp_metric_info) {
for (ALL_LIST_ELEMENTS_RO(
orr_group_igp_metric_info, node,
igp_metric)) {
if (ret &&
prefix_cmp(&exist_p,
&igp_metric->prefix) ==
0) {
newm = igp_metric->igp_metric;
break;
}
}
}
}
}
if (exist->peer->orr_group_name[afi][safi]) {
ret = str2prefix(exist->peer->host, &exist_p);
orr_group = bgp_orr_group_lookup_by_name(
bgp, afi, safi, exist->peer->orr_group_name[afi][safi]);
if (orr_group) {
orr_group_igp_metric_info = orr_group->igp_metric_info;
if (orr_group_igp_metric_info) {
for (ALL_LIST_ELEMENTS_RO(
orr_group_igp_metric_info, node,
igp_metric)) {
if (ret &&
prefix_cmp(&exist_p,
&igp_metric->prefix) ==
0) {
existm = igp_metric->igp_metric;
break;
}
}
}
}
}
if (newm < existm) {
if (debug && peer_sort_ret < 0)
zlog_debug(
@ -12677,7 +12627,6 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
|alias ALIAS_NAME\
|A.B.C.D/M longer-prefixes\
|X:X::X:X/M longer-prefixes\
|optimal-route-reflection [WORD$orr_group_name]\
|detail-routes$detail_routes\
] [json$uj [detail$detail_json] | wide$wide]",
SHOW_STR IP_STR BGP_STR BGP_INSTANCE_HELP_STR BGP_AFI_HELP_STR
@ -12727,8 +12676,6 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
"Display route and more specific routes\n"
"IPv6 prefix\n"
"Display route and more specific routes\n"
"Display Optimal Route Reflection RR Clients\n"
"ORR Group name\n"
"Display detailed version of all routes\n"
JSON_STR
"Display detailed version of JSON output\n"
@ -12746,7 +12693,6 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
uint16_t show_flags = 0;
enum rpki_states rpki_target_state = RPKI_NOT_BEING_USED;
struct prefix p;
bool orr_group = false;
if (uj) {
argc--;
@ -12924,18 +12870,12 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
output_arg = &p;
}
if (argv_find(argv, argc, "optimal-route-reflection", &idx))
orr_group = true;
if (!all) {
/* show bgp: AFI_IP6, show ip bgp: AFI_IP */
if (community)
return bgp_show_community(vty, bgp, community,
exact_match, afi, safi,
show_flags);
else if (orr_group)
return bgp_show_orr(vty, bgp, afi, safi, orr_group_name,
show_flags);
else
return bgp_show(vty, bgp, afi, safi, sh_type,
output_arg, show_flags,
@ -12981,11 +12921,6 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
vty, abgp, community,
exact_match, afi, safi,
show_flags);
else if (orr_group)
bgp_show_orr(vty, bgp, afi,
safi,
orr_group_name,
show_flags);
else
bgp_show(vty, abgp, afi, safi,
sh_type, output_arg,
@ -13025,11 +12960,6 @@ DEFPY(show_ip_bgp, show_ip_bgp_cmd,
vty, abgp, community,
exact_match, afi, safi,
show_flags);
else if (orr_group)
bgp_show_orr(vty, bgp, afi,
safi,
orr_group_name,
show_flags);
else
bgp_show(vty, abgp, afi, safi,
sh_type, output_arg,

View File

@ -78,8 +78,6 @@
#ifdef ENABLE_BGP_VNC
#include "bgpd/rfapi/bgp_rfapi_cfg.h"
#endif
#include "bgpd/bgp_orr.h"
FRR_CFG_DEFAULT_BOOL(BGP_IMPORT_CHECK,
{
@ -948,9 +946,6 @@ int bgp_vty_return(struct vty *vty, enum bgp_create_error_code ret)
case BGP_ERR_INVALID_INTERNAL_ROLE:
str = "External roles can be set only on eBGP session";
break;
case BGP_ERR_PEER_ORR_CONFIGURED:
str = "Deconfigure optimal-route-reflection on this peer first.";
break;
}
if (str) {
vty_out(vty, "%% %s\n", str);
@ -6254,43 +6249,6 @@ ALIAS_HIDDEN(no_neighbor_route_reflector_client,
NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2
"Configure a neighbor as Route Reflector client\n")
/* optimal-route-reflection Root Routers configuration */
DEFPY (optimal_route_reflection,
optimal_route_reflection_cmd,
"[no$no] optimal-route-reflection WORD$orr_group [<A.B.C.D|X:X::X:X>$primary [<A.B.C.D|X:X::X:X>$secondary [<A.B.C.D|X:X::X:X>$tertiary]]]",
NO_STR
"Create ORR group and assign root router(s)\n"
"ORR Group name\n"
"Primary Root address\n"
"Primary Root IPv6 address\n"
"Secondary Root address\n"
"Secondary Root IPv6 address\n"
"Tertiary Root address\n"
"Tertiary Root IPv6 address\n")
{
if (!no && !primary) {
vty_out(vty, "%% Specify Primary Root address\n");
return CMD_WARNING_CONFIG_FAILED;
}
return bgp_afi_safi_orr_group_set_vty(
vty, bgp_node_afi(vty), bgp_node_safi(vty), orr_group,
primary_str, secondary_str, tertiary_str, !no);
}
/* neighbor optimal-route-reflection group*/
DEFPY (neighbor_optimal_route_reflection,
neighbor_optimal_route_reflection_cmd,
"[no$no] neighbor <A.B.C.D|X:X::X:X|WORD>$neighbor optimal-route-reflection WORD$orr_group",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Apply ORR group configuration to the neighbor\n"
"ORR group name\n")
{
return peer_orr_group_set_vty(vty, neighbor, bgp_node_afi(vty),
bgp_node_safi(vty), orr_group, !no);
}
/* neighbor route-server-client. */
DEFUN (neighbor_route_server_client,
neighbor_route_server_client_cmd,
@ -12742,11 +12700,6 @@ static void bgp_show_peer_afi(struct vty *vty, struct peer *p, afi_t afi,
if (CHECK_FLAG(p->af_flags[afi][safi],
PEER_FLAG_RSERVER_CLIENT))
vty_out(vty, " Route-Server Client\n");
if (peer_af_flag_check(p, afi, safi, PEER_FLAG_ORR_GROUP))
vty_out(vty, " ORR group (configured) : %s\n",
p->orr_group_name[afi][safi]);
if (CHECK_FLAG(p->af_flags[afi][safi], PEER_FLAG_SOFT_RECONFIG))
vty_out(vty,
" Inbound soft reconfiguration allowed\n");
@ -17780,10 +17733,6 @@ static void bgp_config_write_peer_af(struct vty *vty, struct bgp *bgp,
: "");
}
}
if (peer_af_flag_check(peer, afi, safi, PEER_FLAG_ORR_GROUP))
vty_out(vty, " neighbor %s optimal-route-reflection %s\n",
peer->host, peer->orr_group_name[afi][safi]);
}
static void bgp_vpn_config_write(struct vty *vty, struct bgp *bgp, afi_t afi,
@ -17890,9 +17839,6 @@ static void bgp_config_write_family(struct vty *vty, struct bgp *bgp, afi_t afi,
}
}
/* Optimal Route Reflection */
bgp_config_write_orr(vty, bgp, afi, safi);
vty_endframe(vty, " exit-address-family\n");
}
@ -19458,34 +19404,6 @@ void bgp_vty_init(void)
install_element(BGP_EVPN_NODE, &neighbor_route_reflector_client_cmd);
install_element(BGP_EVPN_NODE, &no_neighbor_route_reflector_client_cmd);
/* "optimal-route-reflection" commands */
install_element(BGP_IPV4_NODE, &optimal_route_reflection_cmd);
install_element(BGP_IPV4M_NODE, &optimal_route_reflection_cmd);
install_element(BGP_IPV4L_NODE, &optimal_route_reflection_cmd);
install_element(BGP_IPV6_NODE, &optimal_route_reflection_cmd);
install_element(BGP_IPV6M_NODE, &optimal_route_reflection_cmd);
install_element(BGP_IPV6L_NODE, &optimal_route_reflection_cmd);
install_element(BGP_VPNV4_NODE, &optimal_route_reflection_cmd);
install_element(BGP_VPNV6_NODE, &optimal_route_reflection_cmd);
install_element(BGP_FLOWSPECV4_NODE, &optimal_route_reflection_cmd);
install_element(BGP_FLOWSPECV6_NODE, &optimal_route_reflection_cmd);
install_element(BGP_EVPN_NODE, &optimal_route_reflection_cmd);
/* "neighbor optimal-route-reflection" commands */
install_element(BGP_IPV4_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_IPV4M_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_IPV4L_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_IPV6_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_IPV6M_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_IPV6L_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_VPNV4_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_VPNV6_NODE, &neighbor_optimal_route_reflection_cmd);
install_element(BGP_FLOWSPECV4_NODE,
&neighbor_optimal_route_reflection_cmd);
install_element(BGP_FLOWSPECV6_NODE,
&neighbor_optimal_route_reflection_cmd);
install_element(BGP_EVPN_NODE, &neighbor_optimal_route_reflection_cmd);
/* "neighbor route-server" commands.*/
install_element(BGP_NODE, &neighbor_route_server_client_hidden_cmd);
install_element(BGP_NODE, &no_neighbor_route_server_client_hidden_cmd);

View File

@ -67,13 +67,10 @@
#include "bgpd/bgp_trace.h"
#include "bgpd/bgp_community.h"
#include "bgpd/bgp_lcommunity.h"
#include "bgpd/bgp_orr.h"
/* All information about zebra. */
struct zclient *zclient = NULL;
static int bgp_opaque_msg_handler(ZAPI_CALLBACK_ARGS);
/* hook to indicate vrf status change for SNMP */
DEFINE_HOOK(bgp_vrf_status_changed, (struct bgp *bgp, struct interface *ifp),
(bgp, ifp));
@ -3417,7 +3414,6 @@ static zclient_handler *const bgp_handlers[] = {
[ZEBRA_SRV6_LOCATOR_DELETE] = bgp_zebra_process_srv6_locator_delete,
[ZEBRA_SRV6_MANAGER_GET_LOCATOR_CHUNK] =
bgp_zebra_process_srv6_locator_chunk,
[ZEBRA_OPAQUE_MESSAGE] = bgp_opaque_msg_handler,
};
static int bgp_if_new_hook(struct interface *ifp)
@ -3870,34 +3866,3 @@ int bgp_zebra_srv6_manager_release_locator_chunk(const char *name)
{
return srv6_manager_release_locator_chunk(zclient, name);
}
/*
* ORR messages between processes
*/
static int bgp_opaque_msg_handler(ZAPI_CALLBACK_ARGS)
{
struct stream *s;
struct zapi_opaque_msg info;
struct orr_igp_metric_info table;
int ret = 0;
s = zclient->ibuf;
if (zclient_opaque_decode(s, &info) != 0) {
bgp_orr_debug("%s: opaque decode failed", __func__);
return -1;
}
switch (info.type) {
case ORR_IGP_METRIC_UPDATE:
STREAM_GET(&table, s, sizeof(table));
ret = bgg_orr_message_process(BGP_ORR_IMSG_IGP_METRIC_UPDATE,
(void *)&table);
break;
default:
break;
}
stream_failure:
return ret;
}

View File

@ -92,7 +92,6 @@
#include "bgpd/bgp_evpn_private.h"
#include "bgpd/bgp_evpn_mh.h"
#include "bgpd/bgp_mac.h"
#include "bgpd/bgp_orr.h"
#include "bgp_trace.h"
DEFINE_MTYPE_STATIC(BGPD, PEER_TX_SHUTDOWN_MSG, "Peer shutdown message (TX)");
@ -1896,8 +1895,6 @@ bool bgp_afi_safi_peer_exists(struct bgp *bgp, afi_t afi, safi_t safi)
/* Change peer's AS number. */
void peer_as_change(struct peer *peer, as_t as, int as_specified)
{
afi_t afi;
safi_t safi;
enum bgp_peer_sort origtype, newtype;
/* Stop peer. */
@ -1936,11 +1933,6 @@ void peer_as_change(struct peer *peer, as_t as, int as_specified)
/* reflector-client reset */
if (newtype != BGP_PEER_IBGP) {
FOREACH_AFI_SAFI (afi, safi)
UNSET_FLAG(peer->af_flags[afi][safi],
PEER_FLAG_ORR_GROUP);
UNSET_FLAG(peer->af_flags[AFI_IP][SAFI_UNICAST],
PEER_FLAG_REFLECTOR_CLIENT);
UNSET_FLAG(peer->af_flags[AFI_IP][SAFI_MULTICAST],
@ -3932,8 +3924,6 @@ void bgp_free(struct bgp *bgp)
ecommunity_free(&bgp->vpn_policy[afi].rtlist[dir]);
}
bgp_orr_cleanup(bgp);
XFREE(MTYPE_BGP, bgp->name);
XFREE(MTYPE_BGP, bgp->name_pretty);
XFREE(MTYPE_BGP, bgp->snmp_stats);
@ -4738,11 +4728,6 @@ static int peer_af_flag_modify(struct peer *peer, afi_t afi, safi_t safi,
if (flag & PEER_FLAG_REFLECTOR_CLIENT && ptype != BGP_PEER_IBGP)
return BGP_ERR_NOT_INTERNAL_PEER;
/* Do not remove reflector client when ORR is configured on this peer */
if (flag & PEER_FLAG_REFLECTOR_CLIENT && !set &&
peer_orr_rrclient_check(peer, afi, safi))
return BGP_ERR_PEER_ORR_CONFIGURED;
/* Special check for remove-private-AS. */
if (flag & PEER_FLAG_REMOVE_PRIVATE_AS && ptype == BGP_PEER_IBGP)
return BGP_ERR_REMOVE_PRIVATE_AS;

View File

@ -47,7 +47,6 @@
#include "bgp_io.h"
#include "lib/bfd.h"
#include "lib/orr_msg.h"
#define BGP_MAX_HOSTNAME 64 /* Linux max, is larger than most other sys */
#define BGP_PEER_MAX_HASH_SIZE 16384
@ -201,40 +200,6 @@ struct bgp_redist {
struct bgp_rmap rmap;
};
struct bgp_orr_igp_metric {
struct prefix prefix;
uint32_t igp_metric;
};
struct bgp_orr_group {
/* Name of this ORR group */
char *name;
/* Address Family Identifiers */
afi_t afi;
safi_t safi;
/* Pointer to BGP */
struct bgp *bgp;
/* Root Routers of the group */
struct peer *primary;
struct peer *secondary;
struct peer *tertiary;
/* Active Root Router of the group */
struct peer *active;
/* RR clients belong to this group */
struct list *rr_client_list;
/* IGP metric data from active root */
struct list *igp_metric_info;
/* Route table calculated from active root for this group */
struct bgp_table *route_table;
};
enum vpn_policy_direction {
BGP_VPN_POLICY_DIR_FROMVPN = 0,
BGP_VPN_POLICY_DIR_TOVPN = 1,
@ -831,10 +796,6 @@ struct bgp {
bool allow_martian;
/* BGP optimal route reflection group and Root Router configuration */
uint32_t orr_group_count;
struct list *orr_group[AFI_MAX][SAFI_MAX];
QOBJ_FIELDS;
};
DECLARE_QOBJ_TYPE(bgp);
@ -1480,11 +1441,7 @@ struct peer {
#define PEER_FLAG_MAX_PREFIX_FORCE (1ULL << 28)
#define PEER_FLAG_DISABLE_ADDPATH_RX (1ULL << 29)
#define PEER_FLAG_SOO (1ULL << 30)
#define PEER_FLAG_ORR_GROUP (1ULL << 31) /* Optimal-Route-Reflection */
#define PEER_FLAG_ACCEPT_OWN (1ULL << 32)
/* BGP Optimal Route Reflection Group name */
char *orr_group_name[AFI_MAX][SAFI_MAX];
#define PEER_FLAG_ACCEPT_OWN (1ULL << 31)
enum bgp_addpath_strat addpath_type[AFI_MAX][SAFI_MAX];
@ -2103,10 +2060,7 @@ enum bgp_create_error_code {
/*BGP Open Policy ERRORS */
BGP_ERR_INVALID_ROLE_NAME = -35,
BGP_ERR_INVALID_INTERNAL_ROLE = -36,
/* BGP ORR ERRORS */
BGP_ERR_PEER_ORR_CONFIGURED = -37,
BGP_ERR_INVALID_INTERNAL_ROLE = -36
};
/*
@ -2158,7 +2112,6 @@ extern struct peer_group *peer_group_lookup_dynamic_neighbor(struct bgp *,
extern struct peer *peer_lookup_dynamic_neighbor(struct bgp *,
union sockunion *);
extern bool peer_orr_rrclient_check(struct peer *peer, afi_t afi, safi_t safi);
/*
* Peers are incredibly easy to memory leak
* due to the various ways that they are actually used
@ -2411,12 +2364,6 @@ extern void bgp_shutdown_disable(struct bgp *bgp);
extern void bgp_close(void);
extern void bgp_free(struct bgp *);
void bgp_gr_apply_running_config(void);
extern int bgp_afi_safi_orr_group_set(struct bgp *bgp, afi_t afi, safi_t safi,
const char *name, struct peer *primary,
struct peer *secondary,
struct peer *tertiary);
extern int bgp_afi_safi_orr_group_unset(struct bgp *bgp, afi_t afi, safi_t safi,
const char *name);
/* BGP GR */
int bgp_global_gr_init(struct bgp *bgp);

View File

@ -76,7 +76,6 @@ bgpd_libbgp_a_SOURCES = \
bgpd/bgp_vty.c \
bgpd/bgp_zebra.c \
bgpd/bgpd.c \
bgpd/bgp_orr.c \
bgpd/bgp_trace.c \
# end
@ -160,7 +159,6 @@ noinst_HEADERS += \
bgpd/bgp_vty.h \
bgpd/bgp_zebra.h \
bgpd/bgpd.h \
bgpd/bgp_orr.h \
bgpd/bgp_trace.h \
\
bgpd/rfapi/bgp_rfapi_cfg.h \