#include "hash.h"
#include "queue.h"
#include "filter.h"
+#include "frrstr.h"
#include "bgpd/bgpd.h"
#include "bgpd/bgp_advertise.h"
#endif
/* BGP global configuration. */
-
-DEFUN (bgp_multiple_instance_func,
- bgp_multiple_instance_cmd,
- "bgp multiple-instance",
- BGP_STR
- "Enable bgp multiple instance\n")
+#if defined(VERSION_TYPE_DEV) && (CONFDATE > 20190601)
+CPP_NOTICE("bgpd: time to remove deprecated bgp multiple-instance")
+CPP_NOTICE("This includes BGP_OPT_MULTIPLE_INSTANCE")
+#endif
+DEFUN_HIDDEN (bgp_multiple_instance_func,
+ bgp_multiple_instance_cmd,
+ "bgp multiple-instance",
+ BGP_STR
+ "Enable bgp multiple instance\n")
{
bgp_option_set(BGP_OPT_MULTIPLE_INSTANCE);
return CMD_SUCCESS;
}
-DEFUN (no_bgp_multiple_instance,
+DEFUN_HIDDEN (no_bgp_multiple_instance,
no_bgp_multiple_instance_cmd,
"no bgp multiple-instance",
NO_STR
{
int ret;
+ vty_out(vty, "This config option is deprecated, and is scheduled for removal.\n");
+ vty_out(vty, "if you are using this please let the developers know\n");
+ zlog_warn("Deprecated option: `bgp multiple-instance` being used");
ret = bgp_option_unset(BGP_OPT_MULTIPLE_INSTANCE);
if (ret < 0) {
vty_out(vty, "%% There are more than two BGP instances\n");
return CMD_SUCCESS;
}
-DEFUN (bgp_config_type,
- bgp_config_type_cmd,
- "bgp config-type <cisco|zebra>",
- BGP_STR
- "Configuration type\n"
- "cisco\n"
- "zebra\n")
+#if defined(VERSION_TYPE_DEV) && (CONFDATE > 20190601)
+CPP_NOTICE("bgpd: time to remove deprecated cli bgp config-type cisco")
+CPP_NOTICE("This includes BGP_OPT_CISCO_CONFIG")
+#endif
+DEFUN_HIDDEN (bgp_config_type,
+ bgp_config_type_cmd,
+ "bgp config-type <cisco|zebra>",
+ BGP_STR
+ "Configuration type\n"
+ "cisco\n"
+ "zebra\n")
{
int idx = 0;
- if (argv_find(argv, argc, "cisco", &idx))
+ if (argv_find(argv, argc, "cisco", &idx)) {
+ vty_out(vty, "This config option is deprecated, and is scheduled for removal.\n");
+ vty_out(vty, "if you are using this please let the developers know!\n");
+ zlog_warn("Deprecated option: `bgp config-type cisco` being used");
bgp_option_set(BGP_OPT_CONFIG_CISCO);
- else
+ } else
bgp_option_unset(BGP_OPT_CONFIG_CISCO);
return CMD_SUCCESS;
}
-DEFUN (no_bgp_config_type,
- no_bgp_config_type_cmd,
- "no bgp config-type [<cisco|zebra>]",
- NO_STR
- BGP_STR
- "Display configuration type\n"
- "cisco\n"
- "zebra\n")
+DEFUN_HIDDEN (no_bgp_config_type,
+ no_bgp_config_type_cmd,
+ "no bgp config-type [<cisco|zebra>]",
+ NO_STR
+ BGP_STR
+ "Display configuration type\n"
+ "cisco\n"
+ "zebra\n")
{
bgp_option_unset(BGP_OPT_CONFIG_CISCO);
return CMD_SUCCESS;
}
if (v6only)
- SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
+ peer_flag_set(peer, PEER_FLAG_IFPEER_V6ONLY);
/* Request zebra to initiate IPv6 RAs on this interface. We do
* this
if ((v6only && !CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))
|| (!v6only && CHECK_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY))) {
if (v6only)
- SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
+ peer_flag_set(peer, PEER_FLAG_IFPEER_V6ONLY);
else
- UNSET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY);
+ peer_flag_unset(peer, PEER_FLAG_IFPEER_V6ONLY);
/* v6only flag changed. Reset bgp seesion */
if (BGP_IS_VALID_STATE_FOR_NOTIF(peer->status)) {
bgp_session_reset(peer);
}
- if (!CHECK_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE))
- peer_flag_set(peer, PEER_FLAG_CAPABILITY_ENHE);
+ if (!CHECK_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE)) {
+ SET_FLAG(peer->flags, PEER_FLAG_CAPABILITY_ENHE);
+ SET_FLAG(peer->flags_invert, PEER_FLAG_CAPABILITY_ENHE);
+ UNSET_FLAG(peer->flags_override, PEER_FLAG_CAPABILITY_ENHE);
+ }
if (peer_group_name) {
group = peer_group_lookup(bgp, peer_group_name);
DEFUN (no_neighbor_description,
no_neighbor_description_cmd,
- "no neighbor <A.B.C.D|X:X::X:X|WORD> description [LINE]",
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> description",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
- "Neighbor specific description\n"
- "Up to 80 characters describing this neighbor\n")
+ "Neighbor specific description\n")
{
int idx_peer = 2;
struct peer *peer;
return CMD_SUCCESS;
}
+ALIAS(no_neighbor_description, no_neighbor_description_comment_cmd,
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> description LINE...",
+ NO_STR NEIGHBOR_STR NEIGHBOR_ADDR_STR2
+ "Neighbor specific description\n"
+ "Up to 80 characters describing this neighbor\n")
/* Neighbor update-source. */
static int peer_update_source_vty(struct vty *vty, const char *peer_str,
{
struct peer *peer;
struct prefix p;
+ union sockunion su;
peer = peer_and_group_lookup_vty(vty, peer_str);
if (!peer)
return CMD_WARNING;
if (source_str) {
- union sockunion su;
- int ret = str2sockunion(source_str, &su);
-
- if (ret == 0)
+ if (str2sockunion(source_str, &su) == 0)
peer_update_source_addr_set(peer, &su);
else {
if (str2prefix(source_str, &p)) {
DEFUN (neighbor_strict_capability,
neighbor_strict_capability_cmd,
- "neighbor <A.B.C.D|X:X::X:X> strict-capability-match",
+ "neighbor <A.B.C.D|X:X::X:X|WORD> strict-capability-match",
NEIGHBOR_STR
- NEIGHBOR_ADDR_STR
+ NEIGHBOR_ADDR_STR2
"Strict capability negotiation match\n")
{
- int idx_ip = 1;
- return peer_flag_set_vty(vty, argv[idx_ip]->arg,
+ int idx_peer = 1;
+
+ return peer_flag_set_vty(vty, argv[idx_peer]->arg,
PEER_FLAG_STRICT_CAP_MATCH);
}
DEFUN (no_neighbor_strict_capability,
no_neighbor_strict_capability_cmd,
- "no neighbor <A.B.C.D|X:X::X:X> strict-capability-match",
+ "no neighbor <A.B.C.D|X:X::X:X|WORD> strict-capability-match",
NO_STR
NEIGHBOR_STR
- NEIGHBOR_ADDR_STR
+ NEIGHBOR_ADDR_STR2
"Strict capability negotiation match\n")
{
- int idx_ip = 2;
- return peer_flag_unset_vty(vty, argv[idx_ip]->arg,
+ int idx_peer = 2;
+
+ return peer_flag_unset_vty(vty, argv[idx_peer]->arg,
PEER_FLAG_STRICT_CAP_MATCH);
}
BGP_UPTIME_LEN, 0, NULL));
if (peer->status == Established)
- if (peer->afc_recv[afi][pfx_rcd_safi])
+ if (peer->afc_recv[afi][safi])
vty_out(vty, " %12ld",
peer->pcount[afi]
[pfx_rcd_safi]);
if (count)
vty_out(vty, "\nTotal number of neighbors %d\n", count);
else {
- if (use_json)
- vty_out(vty,
- "{\"error\": {\"message\": \"No %s neighbor configured\"}}\n",
- afi_safi_print(afi, safi));
- else
- vty_out(vty, "No %s neighbor is configured\n",
- afi_safi_print(afi, safi));
+ vty_out(vty, "No %s neighbor is configured\n",
+ afi_safi_print(afi, safi));
}
- if (dn_count && !use_json) {
+ if (dn_count) {
vty_out(vty, "* - dynamic neighbor\n");
vty_out(vty, "%d dynamic neighbor(s), limit %d\n",
dn_count, bgp->dynamic_neighbors_limit);
json_object_int_add(json_neigh,
"bgpTimerKeepAliveIntervalMsecs",
p->v_keepalive * 1000);
-
- if (PEER_OR_GROUP_TIMER_SET(p)) {
+ if (CHECK_FLAG(p->flags, PEER_FLAG_TIMER)) {
json_object_int_add(json_neigh,
"bgpTimerConfiguredHoldTimeMsecs",
p->holdtime * 1000);
vty_out(vty,
" Hold time is %d, keepalive interval is %d seconds\n",
p->v_holdtime, p->v_keepalive);
- if (PEER_OR_GROUP_TIMER_SET(p)) {
+ if (CHECK_FLAG(p->flags, PEER_FLAG_TIMER)) {
vty_out(vty, " Configured hold time is %d",
p->holdtime);
vty_out(vty, ", keepalive interval is %d seconds\n",
"Peer group name\n")
{
char *vrf, *pg;
- vrf = pg = NULL;
int idx = 0;
vrf = argv_find(argv, argc, "VIEWVRFNAME", &idx) ? argv[idx]->arg
/* "neighbor description" commands. */
install_element(BGP_NODE, &neighbor_description_cmd);
install_element(BGP_NODE, &no_neighbor_description_cmd);
+ install_element(BGP_NODE, &no_neighbor_description_comment_cmd);
/* "neighbor update-source" commands. "*/
install_element(BGP_NODE, &neighbor_update_source_cmd);