diff options
90 files changed, 1011 insertions, 995 deletions
diff --git a/.gitignore b/.gitignore index 62aa48e22..3ad6b1de1 100644 --- a/.gitignore +++ b/.gitignore @@ -48,18 +48,18 @@ m4/*.m4 debian/autoreconf.after debian/autoreconf.before debian/files -debian/quagga-dbg.debhelper.log -debian/quagga-dbg.substvars -debian/quagga-dbg/ -debian/quagga-doc.debhelper.log -debian/quagga-doc.substvars -debian/quagga-doc/ -debian/quagga.debhelper.log -debian/quagga.postinst.debhelper -debian/quagga.postrm.debhelper -debian/quagga.prerm.debhelper -debian/quagga.substvars -debian/quagga/ +debian/frr-dbg.debhelper.log +debian/frr-dbg.substvars +debian/frr-dbg/ +debian/frr-doc.debhelper.log +debian/frr-doc.substvars +debian/frr-doc/ +debian/frr.debhelper.log +debian/frr.postinst.debhelper +debian/frr.postrm.debhelper +debian/frr.prerm.debhelper +debian/frr.substvars +debian/frr/ debian/tmp/ *.pyc *.swp diff --git a/Makefile.am b/Makefile.am index d18837c08..0092ba8c1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,9 +8,8 @@ SUBDIRS = lib qpb fpm @ZEBRA@ @LIBRFP@ @RFPTEST@ \ DIST_SUBDIRS = lib qpb fpm zebra bgpd ripd ripngd ospfd ospf6d ldpd \ isisd watchfrr vtysh ospfclient doc m4 pkgsrc redhat tests \ - solaris pimd nhrpd eigrpd @LIBRFP@ @RFPTEST@ tools snapcraft \ - babeld \ - python \ + solaris pimd nhrpd eigrpd bgpd/rfp-example/librfp \ + bgpd/rfp-example/rfptest tools snapcraft babeld python \ # end EXTRA_DIST = aclocal.m4 SERVICES REPORTING-BUGS \ diff --git a/README.NetBSD b/README.NetBSD index 6e454533e..c97e3bcb3 100755 --- a/README.NetBSD +++ b/README.NetBSD @@ -1,18 +1,18 @@ #!/bin/sh -# This file is helpful for building quagga from cvs on NetBSD, and +# This file is helpful for building FRR from cvs on NetBSD, and # probably on any system using pkgsrc. # One should have readline installed already (pkgsrc/devel/readline). MAKE=make -# Quagga is currently documented not to require GNU make, but sometimes +# FRR is currently documented not to require GNU make, but sometimes # BSD make fails. Enable this if statement as a workaround. if false; then MAKE=gmake echo "WARNING: using gmake to work around nonportable makefiles" fi -# Use /usr/quagga to be independent, and /usr/pkg to overwrite pkgsrc. +# Use /usr/frr to be independent, and /usr/pkg to overwrite pkgsrc. PREFIX=/usr/pkg case $1 in diff --git a/REPORTING-BUGS b/REPORTING-BUGS index 01f25a205..339ebc24d 100644 --- a/REPORTING-BUGS +++ b/REPORTING-BUGS @@ -16,7 +16,7 @@ Please supply the following information: 1. Your FRRouting version or if it is from git then the commit reference. Please try to report bugs against git master or the latest release. 2. FRR daemons you run e.g. bgpd or ripd and full name of your OS. Any - specific options you compiled Quagga with. + specific options you compiled FRR with. 3. Problem description. Copy and paste relative commands and their output to describe your network setup e.g. "zebra>show ip route". Please, also give your simple network layout and output of relative OS diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 831df9b68..1ae33b3a2 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -292,7 +292,7 @@ DEFUN (babel_network, if (ret < 0) { vty_out (vty, "There is same network configuration %s\n", argv[1]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -319,7 +319,7 @@ DEFUN (no_babel_network, if (ret < 0) { vty_out (vty, "can't find network %s\n",argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; diff --git a/babeld/babel_zebra.c b/babeld/babel_zebra.c index a41908285..52d7eaee8 100644 --- a/babeld/babel_zebra.c +++ b/babeld/babel_zebra.c @@ -223,10 +223,11 @@ DEFUN (babel_redistribute_type, if (type < 0) { vty_out (vty, "Invalid type %s\n", argv[1]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP, type, 0, VRF_DEFAULT); + zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP6, type, 0, VRF_DEFAULT); return CMD_SUCCESS; } @@ -244,10 +245,11 @@ DEFUN (no_babel_redistribute_type, if (type < 0) { vty_out (vty, "Invalid type %s\n", argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP, type, 0, VRF_DEFAULT); + zclient_redistribute (ZEBRA_REDISTRIBUTE_DELETE, zclient, AFI_IP6, type, 0, VRF_DEFAULT); /* perhaps should we remove xroutes having the same type... */ return CMD_SUCCESS; } @@ -279,7 +281,7 @@ DEFUN (debug_babel, vty_out (vty, "Invalid type %s\n", argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* [Babel Command] */ @@ -309,7 +311,7 @@ DEFUN (no_debug_babel, vty_out (vty, "Invalid type %s\n", argv[3]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } #endif /* NO_DEBUG */ diff --git a/bgpd/bgp_bfd.c b/bgpd/bgp_bfd.c index 546fbdeb9..bb0a0fc63 100644 --- a/bgpd/bgp_bfd.c +++ b/bgpd/bgp_bfd.c @@ -562,7 +562,7 @@ DEFUN (neighbor_bfd, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = bgp_bfd_peer_param_set (peer, BFD_DEF_MIN_RX, BFD_DEF_MIN_TX, BFD_DEF_DETECT_MULT, 1); @@ -595,7 +595,7 @@ DEFUN (neighbor_bfd_param, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (!peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if ((ret = bfd_validate_param (vty, argv[idx_number_1]->arg, argv[idx_number_2]->arg, argv[idx_number_3]->arg, &dm_val, &rx_val, &tx_val)) != CMD_SUCCESS) @@ -626,14 +626,14 @@ DEFUN_HIDDEN (neighbor_bfd_type, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (!peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (strmatch(argv[idx_hop]->text, "singlehop")) type = BFD_TYPE_SINGLEHOP; else if (strmatch(argv[idx_hop]->text, "multihop")) type = BFD_TYPE_MULTIHOP; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = bgp_bfd_peer_param_type_set (peer, type); if (ret != 0) @@ -659,7 +659,7 @@ DEFUN (no_neighbor_bfd, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = bgp_bfd_peer_param_unset(peer); if (ret != 0) @@ -685,7 +685,7 @@ DEFUN_HIDDEN (no_neighbor_bfd_type, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (!peer->bfd_info) return 0; diff --git a/bgpd/bgp_debug.c b/bgpd/bgp_debug.c index b2c91c913..e45b5ab4e 100644 --- a/bgpd/bgp_debug.c +++ b/bgpd/bgp_debug.c @@ -963,7 +963,7 @@ DEFUN (no_debug_bgp_bestpath_prefix, { prefix_free(argv_p); vty_out (vty, "%% Malformed Prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp_debug_bestpath_prefixes && !list_isempty(bgp_debug_bestpath_prefixes)) @@ -1338,7 +1338,7 @@ DEFUN (debug_bgp_update_prefix, { prefix_free(argv_p); vty_out (vty, "%% Malformed Prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } @@ -1391,7 +1391,7 @@ DEFUN (no_debug_bgp_update_prefix, { prefix_free(argv_p); vty_out (vty, "%% Malformed Prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp_debug_update_prefixes && !list_isempty(bgp_debug_update_prefixes)) @@ -1492,7 +1492,7 @@ DEFUN (debug_bgp_zebra_prefix, { prefix_free(argv_p); vty_out (vty, "%% Malformed Prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!bgp_debug_zebra_prefixes) @@ -1562,7 +1562,7 @@ DEFUN (no_debug_bgp_zebra_prefix, { prefix_free(argv_p); vty_out (vty, "%% Malformed Prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp_debug_zebra_prefixes && !list_isempty(bgp_debug_zebra_prefixes)) diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index c35da4db7..5b6b8e137 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -668,7 +668,7 @@ bgp_dump_set (struct vty *vty, struct bgp_dump *bgp_dump, if (interval == 0) { vty_out (vty, "Malformed interval string\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Setting interval string */ diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c index 8968e22b0..a61321b0e 100644 --- a/bgpd/bgp_filter.c +++ b/bgpd/bgp_filter.c @@ -459,7 +459,7 @@ DEFUN (ip_as_path, { vty_out (vty, "can't compile regexp %s\n", regstr); XFREE (MTYPE_TMP, regstr); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } asfilter = as_filter_make (regex, regstr, type); @@ -504,7 +504,7 @@ DEFUN (no_ip_as_path, if (aslist == NULL) { vty_out (vty, "ip as-path access-list %s doesn't exist\n",aslistname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check the filter type. */ @@ -515,7 +515,7 @@ DEFUN (no_ip_as_path, else { vty_out (vty, "filter type must be [permit|deny]\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Compile AS path. */ @@ -527,7 +527,7 @@ DEFUN (no_ip_as_path, { vty_out (vty, "can't compile regexp %s\n", regstr); XFREE (MTYPE_TMP, regstr); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Lookup asfilter. */ @@ -539,7 +539,7 @@ DEFUN (no_ip_as_path, if (asfilter == NULL) { vty_out (vty, "\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } as_list_filter_delete (aslist, asfilter); @@ -564,7 +564,7 @@ DEFUN (no_ip_as_path_all, { vty_out (vty, "ip as-path access-list %s doesn't exist\n", argv[idx_word]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } as_list_delete (aslist); diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9a64c62af..6fd959e30 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4274,12 +4274,12 @@ bgp_static_set (struct vty *vty, const char *ip_str, if (! ret) { vty_out (vty, "%% Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6)) { vty_out (vty,"%% Malformed prefix (link-local address)\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -4296,7 +4296,7 @@ bgp_static_set (struct vty *vty, const char *ip_str, if (bgp_static->label_index != label_index) { vty_out (vty, "%% Label index cannot be changed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check previous routes are installed into BGP. */ @@ -4368,12 +4368,12 @@ bgp_static_unset (struct vty *vty, const char *ip_str, if (! ret) { vty_out (vty, "%% Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&p.u.prefix6)) { vty_out (vty,"%% Malformed prefix (link-local address)\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -4382,7 +4382,7 @@ bgp_static_unset (struct vty *vty, const char *ip_str, if (! rn) { vty_out (vty,"%% Can't find specified static route configuration.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_static = rn->info; @@ -4580,21 +4580,21 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str if (! ret) { vty_out (vty, "%% Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); if ( (afi == AFI_L2VPN) && (bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p))) { vty_out (vty, "%% L2VPN prefix could not be forged\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (label_str) @@ -4609,12 +4609,12 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str if( esi && str2esi (esi, NULL) == 0) { vty_out (vty, "%% Malformed ESI\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if( routermac && prefix_str2mac (routermac, NULL) == 0) { vty_out (vty, "%% Malformed Router MAC\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (gwip) { @@ -4623,7 +4623,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str if (! ret) { vty_out (vty, "%% Malformed GatewayIp\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if((gw_ip.family == AF_INET && IS_EVPN_PREFIX_IPADDR_V6((struct prefix_evpn *)&p)) || @@ -4631,7 +4631,7 @@ bgp_static_set_safi (afi_t afi, safi_t safi, struct vty *vty, const char *ip_str IS_EVPN_PREFIX_IPADDR_V4((struct prefix_evpn *)&p))) { vty_out (vty, "%% GatewayIp family differs with IP prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } } @@ -4714,20 +4714,20 @@ bgp_static_unset_safi(afi_t afi, safi_t safi, struct vty *vty, const char *ip_st if (! ret) { vty_out (vty, "%% Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); if ( (afi == AFI_L2VPN) && (bgp_build_evpn_prefix ( evpn_type, ethtag!=NULL?atol(ethtag):0, &p))) { vty_out (vty, "%% L2VPN prefix could not be forged\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = str2prefix_rd (rd_str, &prd); if (! ret) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (label_str) @@ -4901,7 +4901,7 @@ DEFUN (bgp_network_mask, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, @@ -4928,7 +4928,7 @@ DEFUN (bgp_network_mask_route_map, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, @@ -4953,7 +4953,7 @@ DEFUN (bgp_network_mask_backdoor, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST, @@ -4975,7 +4975,7 @@ DEFUN (bgp_network_mask_natural, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, @@ -5000,7 +5000,7 @@ DEFUN (bgp_network_mask_natural_route_map, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, @@ -5023,7 +5023,7 @@ DEFUN (bgp_network_mask_natural_backdoor, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_set (vty, prefix_str, AFI_IP, SAFI_UNICAST, @@ -5098,7 +5098,7 @@ DEFUN (no_bgp_network_mask, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_unset (vty, prefix_str, AFI_IP, @@ -5123,7 +5123,7 @@ DEFUN (no_bgp_network_mask_natural, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_static_unset (vty, prefix_str, AFI_IP, @@ -5757,7 +5757,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str, if (!ret) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -5766,7 +5766,7 @@ bgp_aggregate_unset (struct vty *vty, const char *prefix_str, if (! rn) { vty_out (vty,"%% There is no aggregate-address configuration.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } aggregate = rn->info; @@ -5802,7 +5802,7 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str, if (!ret) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&p); @@ -5818,7 +5818,7 @@ bgp_aggregate_set (struct vty *vty, const char *prefix_str, { vty_out (vty, "Error deleting aggregate.\n"); bgp_unlock_node (rn); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -5885,7 +5885,7 @@ DEFUN (aggregate_address_mask, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_aggregate_set (vty, prefix_str, AFI_IP, bgp_node_safi (vty), summary_only, as_set); @@ -5931,7 +5931,7 @@ DEFUN (no_aggregate_address_mask, if (! ret) { vty_out (vty, "%% Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_aggregate_unset (vty, prefix_str, AFI_IP, bgp_node_safi (vty)); @@ -10095,7 +10095,7 @@ bgp_distance_set (struct vty *vty, const char *distance_str, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } distance = atoi (distance_str); @@ -10147,14 +10147,14 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rn = bgp_node_lookup (bgp_distance_table[afi][safi], (struct prefix *)&p); if (! rn) { vty_out (vty, "Can't find specified prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bdistance = rn->info; @@ -10163,7 +10163,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, if (bdistance->distance != distance) { vty_out (vty, "Distance does not match configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bdistance->access_list) diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 7f535388b..de2a8764c 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -2852,10 +2852,10 @@ bgp_route_match_add (struct vty *vty, { case RMAP_RULE_MISSING: vty_out (vty, "%% BGP Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% BGP Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2910,7 +2910,7 @@ bgp_route_match_delete (struct vty *vty, XFREE(MTYPE_ROUTE_MAP_RULE, dep_name); if (rmap_name) XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (type != RMAP_EVENT_MATCH_DELETED && dep_name) @@ -3592,7 +3592,8 @@ DEFUN (match_origin, return bgp_route_match_add (vty, "origin", "incomplete", RMAP_EVENT_MATCH_ADDED); - return CMD_WARNING; + vty_outln (vty, "%% Invalid match origin type"); + return CMD_WARNING_CONFIG_FAILED; } @@ -3887,7 +3888,7 @@ DEFUN (set_community, if (! com) { vty_out (vty, "%% Malformed communities attribute\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Set communites attribute string. */ @@ -4152,7 +4153,8 @@ DEFUN (set_origin, return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), "origin", "incomplete"); - return CMD_WARNING; + vty_outln (vty, "%% Invalid set origin type"); + return CMD_WARNING_CONFIG_FAILED; } @@ -4211,7 +4213,7 @@ DEFUN (set_aggregator_as, if (ret == 0) { vty_out (vty, "Aggregator IP address is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } argstr = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, @@ -4252,7 +4254,7 @@ DEFUN (no_set_aggregator_as, if (ret == 0) { vty_out (vty, "Aggregator IP address is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } argstr = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, @@ -4363,7 +4365,7 @@ DEFUN (set_ipv6_nexthop_global, if (!ret) { vty_out (vty, "%% Malformed nexthop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (IN6_IS_ADDR_UNSPECIFIED(&addr) || IN6_IS_ADDR_LOOPBACK(&addr) || @@ -4371,7 +4373,7 @@ DEFUN (set_ipv6_nexthop_global, IN6_IS_ADDR_LINKLOCAL(&addr)) { vty_out (vty, "%% Invalid global nexthop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return generic_set_add (vty, VTY_GET_CONTEXT(route_map_index), diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 851a22315..b5cbd3546 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -520,7 +520,7 @@ bgp_vty_return (struct vty *vty, int ret) if (str) { vty_out (vty, "%% %s\n", str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -790,7 +790,7 @@ DEFUN (no_bgp_multiple_instance, if (ret < 0) { vty_out (vty, "%% There are more than two BGP instances\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -871,13 +871,13 @@ DEFUN_NOSH (router_bgp, if (bgp == NULL) { vty_out (vty, "%% No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (listcount(bm->bgp) > 1) { vty_out (vty, "%% Multiple BGP processes are configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -902,15 +902,15 @@ DEFUN_NOSH (router_bgp, { case BGP_ERR_MULTIPLE_INSTANCE_NOT_SET: vty_out (vty, "Please specify 'bgp multiple-instance' first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_AS_MISMATCH: vty_out (vty, "BGP is already running; AS is %u\n", as); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_INSTANCE_MISMATCH: vty_out (vty, "BGP instance name and AS number mismatch\n"); vty_out (vty, "BGP instance is already running; AS is %u\n", as); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Pending: handle when user tries to change a view to vrf n vv. */ @@ -946,13 +946,13 @@ DEFUN (no_router_bgp, if (bgp == NULL) { vty_out (vty, "%% No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (listcount(bm->bgp) > 1) { vty_out (vty, "%% Multiple BGP processes are configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else @@ -967,7 +967,7 @@ DEFUN (no_router_bgp, if (! bgp) { vty_out (vty, "%% Can't find BGP instance\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1007,7 +1007,7 @@ DEFPY (no_bgp_router_id, if (! IPV4_ADDR_SAME (&bgp->router_id_static, &router_id)) { vty_out (vty, "%% BGP router-id doesn't match\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1036,7 +1036,7 @@ DEFUN (bgp_cluster_id, if (! ret) { vty_out (vty, "%% Malformed bgp cluster identifier\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_cluster_id_set (bgp, &cluster); @@ -1172,7 +1172,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths, vty_out (vty, "%% Maxpaths Specified: %d is > than multipath num specified on bgp command line %d", maxpaths, multipath_num); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = bgp_maximum_paths_set (bgp, afi, safi, peer_type, maxpaths, options); } @@ -1186,7 +1186,7 @@ bgp_maxpaths_config_vty (struct vty *vty, int peer_type, const char *mpaths, (set == 1) ? "" : "un", (peer_type == BGP_PEER_EBGP) ? "ebgp" : "ibgp", maxpaths, afi, safi); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_recalculate_all_bestpaths (bgp); @@ -1320,7 +1320,7 @@ bgp_update_delay_config_vty (struct vty *vty, const char *delay, if (update_delay < establish_wait) { vty_out (vty, "%%Failed: update-delay less than the establish-wait!\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp->v_update_delay = update_delay; @@ -1479,7 +1479,7 @@ DEFUN (no_bgp_coalesce_time, /* Maximum-paths configuration */ DEFUN (bgp_maxpaths, bgp_maxpaths_cmd, - "maximum-paths (1-255)", + "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "Number of paths\n") { @@ -1489,13 +1489,13 @@ DEFUN (bgp_maxpaths, ALIAS_HIDDEN (bgp_maxpaths, bgp_maxpaths_hidden_cmd, - "maximum-paths (1-255)", + "maximum-paths " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "Number of paths\n") DEFUN (bgp_maxpaths_ibgp, bgp_maxpaths_ibgp_cmd, - "maximum-paths ibgp (1-255)", + "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "iBGP-multipath\n" "Number of paths\n") @@ -1506,14 +1506,14 @@ DEFUN (bgp_maxpaths_ibgp, ALIAS_HIDDEN (bgp_maxpaths_ibgp, bgp_maxpaths_ibgp_hidden_cmd, - "maximum-paths ibgp (1-255)", + "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM), "Forward packets over multiple paths\n" "iBGP-multipath\n" "Number of paths\n") DEFUN (bgp_maxpaths_ibgp_cluster, bgp_maxpaths_ibgp_cluster_cmd, - "maximum-paths ibgp (1-255) equal-cluster-length", + "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM) " equal-cluster-length", "Forward packets over multiple paths\n" "iBGP-multipath\n" "Number of paths\n" @@ -1526,7 +1526,7 @@ DEFUN (bgp_maxpaths_ibgp_cluster, ALIAS_HIDDEN (bgp_maxpaths_ibgp_cluster, bgp_maxpaths_ibgp_cluster_hidden_cmd, - "maximum-paths ibgp (1-255) equal-cluster-length", + "maximum-paths ibgp " CMD_RANGE_STR(1, MULTIPATH_NUM) " equal-cluster-length", "Forward packets over multiple paths\n" "iBGP-multipath\n" "Number of paths\n" @@ -1534,7 +1534,7 @@ ALIAS_HIDDEN (bgp_maxpaths_ibgp_cluster, DEFUN (no_bgp_maxpaths, no_bgp_maxpaths_cmd, - "no maximum-paths [(1-255)]", + "no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]", NO_STR "Forward packets over multiple paths\n" "Number of paths\n") @@ -1544,14 +1544,14 @@ DEFUN (no_bgp_maxpaths, ALIAS_HIDDEN (no_bgp_maxpaths, no_bgp_maxpaths_hidden_cmd, - "no maximum-paths [(1-255)]", + "no maximum-paths [" CMD_RANGE_STR(1, MULTIPATH_NUM) "]", NO_STR "Forward packets over multiple paths\n" "Number of paths\n") DEFUN (no_bgp_maxpaths_ibgp, no_bgp_maxpaths_ibgp_cmd, - "no maximum-paths ibgp [(1-255) [equal-cluster-length]]", + "no maximum-paths ibgp [" CMD_RANGE_STR(1, MULTIPATH_NUM) " [equal-cluster-length]]", NO_STR "Forward packets over multiple paths\n" "iBGP-multipath\n" @@ -1563,7 +1563,7 @@ DEFUN (no_bgp_maxpaths_ibgp, ALIAS_HIDDEN (no_bgp_maxpaths_ibgp, no_bgp_maxpaths_ibgp_hidden_cmd, - "no maximum-paths ibgp [(1-255) [equal-cluster-length]]", + "no maximum-paths ibgp [" CMD_RANGE_STR(1, MULTIPATH_NUM) " [equal-cluster-length]]", NO_STR "Forward packets over multiple paths\n" "iBGP-multipath\n" @@ -1618,7 +1618,7 @@ DEFUN (bgp_timers, if (holdtime < 3 && holdtime != 0) { vty_out (vty, "%% hold time value must be either 0 or greater than 3\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_timers_set (bgp, keepalive, holdtime); @@ -1752,7 +1752,7 @@ DEFUN (no_bgp_deterministic_med, if (bestpath_per_as_used) { vty_out (vty, "bgp deterministic-med cannot be disabled while addpath-tx-bestpath-per-AS is in use\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } else { @@ -2445,7 +2445,7 @@ DEFUN (bgp_listen_range, if (! ret) { vty_out (vty, "%% Malformed listen range\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } afi = family2afi(range.family); @@ -2453,7 +2453,7 @@ DEFUN (bgp_listen_range, if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { vty_out (vty, "%% Malformed listen range (link-local address)\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&range); @@ -2468,7 +2468,7 @@ DEFUN (bgp_listen_range, { vty_out (vty, "%% Same listen range is attached to peer-group %s\n", existing_group->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2476,14 +2476,14 @@ DEFUN (bgp_listen_range, if (listen_range_exists (bgp, &range, 0)) { vty_out (vty, "%% Listen range overlaps with existing listen range\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } group = peer_group_lookup (bgp, peergroup); if (! group) { vty_out (vty, "%% Configure the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_group_listen_range_add(group, &range); @@ -2519,7 +2519,7 @@ DEFUN (no_bgp_listen_range, if (! ret) { vty_out (vty, "%% Malformed listen range\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } afi = family2afi(range.family); @@ -2527,7 +2527,7 @@ DEFUN (no_bgp_listen_range, if (afi == AFI_IP6 && IN6_IS_ADDR_LINKLOCAL (&range.u.prefix6)) { vty_out (vty, "%% Malformed listen range (link-local address)\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask (&range); @@ -2536,7 +2536,7 @@ DEFUN (no_bgp_listen_range, if (! group) { vty_out (vty, "%% Peer-group does not exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_group_listen_range_del(group, &range); @@ -2639,7 +2639,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, if (ret < 0) { vty_out (vty, "%% Create the peer-group or interface first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -2649,7 +2649,7 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, if (peer_address_self_check (bgp, &su)) { vty_out (vty, "%% Can not configure the local system as neighbor\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_remote_as (bgp, &su, NULL, &as, as_type, afi, safi); } @@ -2659,10 +2659,10 @@ peer_remote_as_vty (struct vty *vty, const char *peer_str, { case BGP_ERR_PEER_GROUP_MEMBER: vty_out (vty, "%% Peer-group AS %u. Cannot configure remote-as for member\n", as); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT: vty_out (vty, "%% The AS# can not be changed from %u to %s, peer-group members must be all internal or all external\n", as, as_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_vty_return (vty, ret); } @@ -2700,7 +2700,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, if (group) { vty_out (vty, "%% Name conflict with peer-group \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (as_str) @@ -2738,7 +2738,10 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, NULL); if (!peer) - return CMD_WARNING; + { + vty_outln (vty, "%% BGP failed to create peer"); + return CMD_WARNING_CONFIG_FAILED; + } if (v6only) SET_FLAG(peer->flags, PEER_FLAG_IFPEER_V6ONLY); @@ -2780,7 +2783,7 @@ peer_conf_interface_get (struct vty *vty, const char *conf_if, afi_t afi, if (! group) { vty_out (vty, "%% Configure the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_group_bind (bgp, &su, peer, group, &as); @@ -2882,12 +2885,15 @@ DEFUN (neighbor_peer_group, if (peer) { vty_out (vty, "%% Name conflict with interface: \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } group = peer_group_get (bgp, argv[idx_word]->arg); if (! group) - return CMD_WARNING; + { + vty_outln (vty, "%% BGP failed to find or create peer-group"); + return CMD_WARNING_CONFIG_FAILED; + } return CMD_SUCCESS; } @@ -2931,7 +2937,7 @@ DEFUN (no_neighbor, else { vty_out (vty, "%% Create the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else @@ -2942,7 +2948,7 @@ DEFUN (no_neighbor, if (peer_dynamic_neighbor (peer)) { vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } other = peer->doppelganger; @@ -2986,7 +2992,7 @@ DEFUN (no_neighbor_interface_config, else { vty_out (vty, "%% Create the bgp interface first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -3009,7 +3015,7 @@ DEFUN (no_neighbor_peer_group, else { vty_out (vty, "%% Create the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -3044,7 +3050,7 @@ DEFUN (no_neighbor_interface_peer_group_remote_as, else { vty_out (vty, "%% Create the peer-group or interface first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -3065,7 +3071,7 @@ DEFUN (neighbor_local_as, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; as = strtoul(argv[idx_number]->arg, NULL, 10); ret = peer_local_as_set (peer, as, 0, 0); @@ -3089,7 +3095,7 @@ DEFUN (neighbor_local_as_no_prepend, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; as = strtoul(argv[idx_number]->arg, NULL, 10); ret = peer_local_as_set (peer, as, 1, 0); @@ -3114,7 +3120,7 @@ DEFUN (neighbor_local_as_no_prepend_replace_as, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; as = strtoul(argv[idx_number]->arg, NULL, 10); ret = peer_local_as_set (peer, as, 1, 1); @@ -3138,7 +3144,7 @@ DEFUN (no_neighbor_local_as, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_local_as_unset (peer); return bgp_vty_return (vty, ret); @@ -3160,7 +3166,7 @@ DEFUN (neighbor_solo, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = update_group_adjust_soloness(peer, 1); return bgp_vty_return (vty, ret); @@ -3180,7 +3186,7 @@ DEFUN (no_neighbor_solo, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = update_group_adjust_soloness(peer, 0); return bgp_vty_return (vty, ret); @@ -3201,7 +3207,7 @@ DEFUN (neighbor_password, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_password_set (peer, argv[idx_line]->arg); return bgp_vty_return (vty, ret); @@ -3222,7 +3228,7 @@ DEFUN (no_neighbor_password, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_password_unset (peer); return bgp_vty_return (vty, ret); @@ -3242,7 +3248,7 @@ DEFUN (neighbor_activate, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_activate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); return bgp_vty_return (vty, ret); @@ -3270,7 +3276,7 @@ DEFUN (no_neighbor_activate, /* Lookup peer. */ peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_deactivate (peer, bgp_node_afi (vty), bgp_node_safi (vty)); return bgp_vty_return (vty, ret); @@ -3310,7 +3316,7 @@ DEFUN (neighbor_set_peer_group, if (!peer) { vty_out (vty, "%% Malformed address or name: %s\n", argv[idx_peer]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else @@ -3318,7 +3324,7 @@ DEFUN (neighbor_set_peer_group, if (peer_address_self_check (bgp, &su)) { vty_out (vty, "%% Can not configure the local system as neighbor\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Disallow for dynamic neighbor. */ @@ -3326,7 +3332,7 @@ DEFUN (neighbor_set_peer_group, if (peer && peer_dynamic_neighbor (peer)) { vty_out (vty, "%% Operation not allowed on a dynamic neighbor\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -3334,7 +3340,7 @@ DEFUN (neighbor_set_peer_group, if (! group) { vty_out (vty, "%% Configure the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_group_bind (bgp, &su, peer, group, &as); @@ -3342,7 +3348,7 @@ DEFUN (neighbor_set_peer_group, if (ret == BGP_ERR_PEER_GROUP_PEER_TYPE_DIFFERENT) { vty_out (vty, "%% Peer with AS %u cannot be in this peer-group, members must be all internal or all external\n", as); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_vty_return (vty, ret); @@ -3374,13 +3380,13 @@ DEFUN (no_neighbor_set_peer_group, peer = peer_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; group = peer_group_lookup (bgp, argv[idx_word]->arg); if (! group) { vty_out (vty, "%% Configure the peer-group first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = peer_group_unbind (bgp, peer, group); @@ -3406,7 +3412,7 @@ peer_flag_modify_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* * If 'neighbor <interface>', then this is for directly connected peers, @@ -3415,7 +3421,7 @@ peer_flag_modify_vty (struct vty *vty, const char *ip_str, if (peer->conf_if && (flag == PEER_FLAG_DISABLE_CONNECTED_CHECK)) { vty_out (vty, "%s is directly connected peer, cannot accept disable-" "connected-check\n", ip_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!set && flag == PEER_FLAG_SHUTDOWN) @@ -3483,7 +3489,7 @@ DEFUN (neighbor_shutdown_msg, char *message; if (!peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; message = argv_concat (argv, argc, 4); peer_tx_shutdown_message_set (peer, message); XFREE (MTYPE_TMP, message); @@ -3607,7 +3613,7 @@ peer_af_flag_modify_vty (struct vty *vty, const char *peer_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, peer_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (set) ret = peer_af_flag_set (peer, afi, safi, flag); @@ -3655,7 +3661,10 @@ DEFUN (neighbor_capability_orf_prefix, else if (strmatch (argv[idx_send_recv]->text, "both")) flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; else - return CMD_WARNING; + { + vty_outln (vty, "%% BGP invalid orf prefix-list option"); + return CMD_WARNING_CONFIG_FAILED; + } return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), flag); @@ -3697,7 +3706,10 @@ DEFUN (no_neighbor_capability_orf_prefix, else if (strmatch (argv[idx_send_recv]->text, "both")) flag = PEER_FLAG_ORF_PREFIX_SM|PEER_FLAG_ORF_PREFIX_RM; else - return CMD_WARNING; + { + vty_outln (vty, "%% BGP invalid orf prefix-list option"); + return CMD_WARNING_CONFIG_FAILED; + } return peer_af_flag_unset_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), flag); @@ -4244,7 +4256,7 @@ DEFUN (neighbor_route_reflector_client, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), @@ -4293,7 +4305,7 @@ DEFUN (neighbor_route_server_client, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), PEER_FLAG_RSERVER_CLIENT); @@ -4455,7 +4467,7 @@ peer_ebgp_multihop_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (peer->conf_if) return bgp_vty_return (vty, BGP_ERR_INVALID_FOR_DIRECT_PEER); @@ -4475,7 +4487,7 @@ peer_ebgp_multihop_unset_vty (struct vty *vty, const char *ip_str) peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return bgp_vty_return (vty, peer_ebgp_multihop_unset (peer)); } @@ -4560,7 +4572,7 @@ DEFUN (neighbor_description, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; str = argv_concat(argv, argc, idx_line); @@ -4585,7 +4597,7 @@ DEFUN (no_neighbor_description, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; peer_description_unset (peer); @@ -4603,7 +4615,7 @@ peer_update_source_vty (struct vty *vty, const char *peer_str, peer = peer_and_group_lookup_vty (vty, peer_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (peer->conf_if) return CMD_WARNING; @@ -4620,7 +4632,7 @@ peer_update_source_vty (struct vty *vty, const char *peer_str, if (str2prefix (source_str, &p)) { vty_out (vty, "%% Invalid update-source, remove prefix length \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } else peer_update_source_if_set (peer, source_str); @@ -4673,7 +4685,7 @@ peer_default_originate_set_vty (struct vty *vty, const char *peer_str, peer = peer_and_group_lookup_vty (vty, peer_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (set) ret = peer_default_originate_set (peer, afi, safi, rmap); @@ -4764,7 +4776,7 @@ peer_port_vty (struct vty *vty, const char *ip_str, int afi, peer = peer_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (! port_str) { @@ -4821,7 +4833,7 @@ peer_weight_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; weight = strtoul(weight_str, NULL, 10); @@ -4838,7 +4850,7 @@ peer_weight_unset_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_weight_unset (peer, afi, safi); return bgp_vty_return (vty, ret); @@ -4950,7 +4962,7 @@ peer_timers_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; keepalive = strtoul(keep_str, NULL, 10); holdtime = strtoul(hold_str, NULL, 10); @@ -4968,7 +4980,7 @@ peer_timers_unset_vty (struct vty *vty, const char *ip_str) peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_timers_unset (peer); @@ -5015,7 +5027,7 @@ peer_timers_connect_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; connect = strtoul(time_str, NULL, 10); @@ -5032,7 +5044,7 @@ peer_timers_connect_unset_vty (struct vty *vty, const char *ip_str) peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_timers_connect_unset (peer); @@ -5078,7 +5090,7 @@ peer_advertise_interval_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (time_str) routeadv = strtoul(time_str, NULL, 10); @@ -5146,7 +5158,10 @@ DEFUN (bgp_set_route_map_delay_timer, return CMD_SUCCESS; } else - return CMD_WARNING; + { + vty_outln (vty, "%% BGP invalid route-map delay-timer"); + return CMD_WARNING_CONFIG_FAILED; + } } DEFUN (no_bgp_set_route_map_delay_timer, @@ -5173,7 +5188,10 @@ peer_interface_vty (struct vty *vty, const char *ip_str, const char *str) peer = peer_lookup_vty (vty, ip_str); if (! peer || peer->conf_if) - return CMD_WARNING; + { + vty_outln (vty, "%% BGP invalid peer %s", ip_str); + return CMD_WARNING_CONFIG_FAILED; + } if (str) peer_interface_set (peer, str); @@ -5232,7 +5250,7 @@ DEFUN (neighbor_distribute_list, peer = peer_and_group_lookup_vty (vty, pstr); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ direct = strmatch (inout, "in") ? FILTER_IN : FILTER_OUT; @@ -5275,7 +5293,7 @@ DEFUN (no_neighbor_distribute_list, peer = peer_and_group_lookup_vty (vty, pstr); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ direct = strmatch (inout, "in") ? FILTER_IN : FILTER_OUT; @@ -5309,7 +5327,7 @@ peer_prefix_list_set_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "i", 1) == 0) @@ -5332,7 +5350,7 @@ peer_prefix_list_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "i", 1) == 0) @@ -5411,7 +5429,7 @@ peer_aslist_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "i", 1) == 0) @@ -5435,7 +5453,7 @@ peer_aslist_unset_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "i", 1) == 0) @@ -5515,7 +5533,7 @@ peer_route_map_set_vty (struct vty *vty, const char *ip_str, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "in", 2) == 0) @@ -5538,7 +5556,7 @@ peer_route_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Check filter direction. */ if (strncmp (direct_str, "in", 2) == 0) @@ -5616,7 +5634,7 @@ peer_unsuppress_map_set_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_unsuppress_map_set (peer, afi, safi, name_str); @@ -5633,7 +5651,7 @@ peer_unsuppress_map_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_unsuppress_map_unset (peer, afi, safi); @@ -5699,7 +5717,7 @@ peer_maximum_prefix_set_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; max = strtoul(num_str, NULL, 10); if (threshold_str) @@ -5726,7 +5744,7 @@ peer_maximum_prefix_unset_vty (struct vty *vty, const char *ip_str, afi_t afi, peer = peer_and_group_lookup_vty (vty, ip_str); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_maximum_prefix_unset (peer, afi, safi); @@ -5945,7 +5963,7 @@ DEFUN (neighbor_allowas_in, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (argc <= idx_number_origin) allow_num = 3; @@ -5988,7 +6006,7 @@ DEFUN (no_neighbor_allowas_in, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ret = peer_allowas_in_unset (peer, bgp_node_afi (vty), bgp_node_safi (vty)); @@ -6021,7 +6039,7 @@ DEFUN (neighbor_ttl_security, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; gtsm_hops = strtoul(argv[idx_number]->arg, NULL, 10); @@ -6032,7 +6050,7 @@ DEFUN (neighbor_ttl_security, if (peer->conf_if && (gtsm_hops > 1)) { vty_out (vty, "%s is directly connected peer, hops cannot exceed 1\n", argv[idx_peer]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_vty_return (vty, peer_ttl_security_hops_set (peer, gtsm_hops)); @@ -6053,7 +6071,7 @@ DEFUN (no_neighbor_ttl_security, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return bgp_vty_return (vty, peer_ttl_security_hops_unset (peer)); } @@ -6070,7 +6088,7 @@ DEFUN (neighbor_addpath_tx_all_paths, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), @@ -6118,7 +6136,7 @@ DEFUN (neighbor_addpath_tx_bestpath_per_as, peer = peer_and_group_lookup_vty (vty, argv[idx_peer]->arg); if (! peer) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return peer_af_flag_set_vty (vty, argv[idx_peer]->arg, bgp_node_afi (vty), bgp_node_safi (vty), @@ -9908,7 +9926,7 @@ DEFUN (bgp_redistribute_ipv4, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_redist_add(bgp, AFI_IP, type, 0); return bgp_redistribute_set (bgp, AFI_IP, type, 0); @@ -9938,7 +9956,7 @@ DEFUN (bgp_redistribute_ipv4_rmap, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } red = bgp_redist_add(bgp, AFI_IP, type, 0); @@ -9973,7 +9991,7 @@ DEFUN (bgp_redistribute_ipv4_metric, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10012,7 +10030,7 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10054,7 +10072,7 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10344,7 +10362,7 @@ DEFUN (no_bgp_redistribute_ipv4, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_redistribute_unset (bgp, AFI_IP, type, 0); } @@ -10374,7 +10392,7 @@ DEFUN (bgp_redistribute_ipv6, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } bgp_redist_add(bgp, AFI_IP6, type, 0); @@ -10399,7 +10417,7 @@ DEFUN (bgp_redistribute_ipv6_rmap, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } red = bgp_redist_add(bgp, AFI_IP6, type, 0); @@ -10426,7 +10444,7 @@ DEFUN (bgp_redistribute_ipv6_metric, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10457,7 +10475,7 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10489,7 +10507,7 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = strtoul(argv[idx_number]->arg, NULL, 10); @@ -10518,7 +10536,7 @@ DEFUN (no_bgp_redistribute_ipv6, if (type < 0) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_redistribute_unset (bgp, AFI_IP6, type, 0); @@ -11775,7 +11793,7 @@ DEFUN (ip_community_list_standard, { /* Display error string. */ community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -11815,7 +11833,7 @@ DEFUN (no_ip_community_list_standard_all, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -11854,7 +11872,7 @@ DEFUN (ip_community_list_expanded_all, { /* Display error string. */ community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -11894,7 +11912,7 @@ DEFUN (no_ip_community_list_expanded_all, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -12002,7 +12020,7 @@ lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv, if (reject_all_digit_name && all_digit (cl_name)) { vty_out (vty, "%% Community name cannot have all digits\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } idx = 0; @@ -12024,7 +12042,7 @@ lcommunity_list_set_vty (struct vty *vty, int argc, struct cmd_token **argv, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -12072,7 +12090,7 @@ lcommunity_list_unset_vty (struct vty *vty, int argc, struct cmd_token **argv, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -12356,7 +12374,7 @@ DEFUN (ip_extcommunity_list_standard, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -12393,7 +12411,7 @@ DEFUN (ip_extcommunity_list_name_expanded, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -12433,7 +12451,7 @@ DEFUN (no_ip_extcommunity_list_standard_all, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -12473,7 +12491,7 @@ DEFUN (no_ip_extcommunity_list_expanded_all, if (ret < 0) { community_list_perror (vty, ret); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 71a4d4317..a45dedd02 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -1823,7 +1823,7 @@ bgp_redistribute_set (struct bgp *bgp, afi_t afi, int type, u_short instance) * know of this instance. */ if (!bgp_install_info_to_zebra (bgp)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (BGP_DEBUG (zebra, ZEBRA)) zlog_debug("Tx redistribute add VRF %u afi %d %s %d", diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 7432ed19a..a0a86136f 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -2251,7 +2251,7 @@ peer_group_get (struct bgp *bgp, const char *name) SET_FLAG (group->conf->sflags, PEER_STATUS_GROUP); listnode_add_sort (bgp->group, group); - return 0; + return group; } static void diff --git a/bgpd/rfapi/bgp_rfapi_cfg.c b/bgpd/rfapi/bgp_rfapi_cfg.c index 90d195d50..d04b186df 100644 --- a/bgpd/rfapi/bgp_rfapi_cfg.c +++ b/bgpd/rfapi/bgp_rfapi_cfg.c @@ -300,7 +300,7 @@ DEFUN (vnc_advertise_un_method, if (!bgp->rfapi_cfg) { vty_out (vty, "VNC not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } @@ -348,7 +348,7 @@ set_ecom_list ( vty_out (vty, "Malformed community-list value\n"); if (ecom) ecommunity_free (&ecom); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ecom) @@ -436,13 +436,13 @@ DEFUN (vnc_defaults_rd, if (!argv[1]->arg[8] || *end) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } memset (&prd, 0, sizeof (prd)); @@ -461,7 +461,7 @@ DEFUN (vnc_defaults_rd, if (!ret) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -492,14 +492,14 @@ DEFUN (vnc_defaults_l2rd, if (!argv[1]->arg[0] || *end) { vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ((value_l < 1) || (value_l > 0xff)) { vty_out (vty, "%% Malformed l2 nve id (must be greater than 0 and less than %u\n", 0x100); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } bgp->rfapi_cfg->flags |= BGP_VNC_CONFIG_L2RD; @@ -536,7 +536,7 @@ DEFUN (vnc_defaults_responselifetime, h = bgp->rfapi; if (!h) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (strmatch(argv[1]->text, "infinite")) { @@ -801,20 +801,20 @@ DEFUN (vnc_redistribute_rh_roo_localadmin, if (!bgp->rfapi_cfg) { vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } localadmin = strtoul (argv[4]->arg, &endptr, 0); if (!argv[4]->arg[0] || *endptr) { vty_out (vty, "%% Malformed value\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (localadmin > 0xffff) { vty_out (vty, "%% Value out of range (0-%d)\n", 0xffff); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->resolve_nve_roo_local_admin == localadmin) @@ -857,7 +857,7 @@ DEFUN (vnc_redistribute_mode, if (!bgp->rfapi_cfg) { vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } @@ -877,7 +877,7 @@ DEFUN (vnc_redistribute_mode, default: vty_out (vty, "unknown redistribute mode\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (newmode != bgp->rfapi_cfg->redist_mode) @@ -912,13 +912,13 @@ DEFUN (vnc_redistribute_protocol, if (!bgp->rfapi_cfg) { vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[2]->arg, argv[3]->arg, &afi, &type)) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (type == ZEBRA_ROUTE_BGP_DIRECT_EXT) @@ -960,13 +960,13 @@ DEFUN (vnc_no_redistribute_protocol, if (!bgp->rfapi_cfg) { vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[3]->arg, argv[4]->arg, &afi, &type)) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } VNC_REDIST_DISABLE (bgp, afi, type); @@ -1001,13 +1001,13 @@ DEFUN (vnc_redistribute_bgp_exterior, if (!bgp->rfapi_cfg) { vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rfapi_str2route_type (argv[2]->arg, "bgp-direct-to-nve-groups", &afi, &type)) { vty_out (vty, "%% Invalid route type\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->redist_bgp_exterior_view_name) @@ -1033,7 +1033,7 @@ DEFUN (vnc_redistribute_nvegroup, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vnc_redistribute_prechange (bgp); @@ -1066,7 +1066,7 @@ DEFUN (vnc_redistribute_no_nvegroup, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vnc_redistribute_prechange (bgp); @@ -1096,7 +1096,7 @@ DEFUN (vnc_redistribute_lifetime, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vnc_redistribute_prechange (bgp); @@ -1136,7 +1136,7 @@ DEFUN (vnc_redist_bgpdirect_no_prefixlist, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "bgp-direct")) @@ -1189,7 +1189,7 @@ DEFUN (vnc_redist_bgpdirect_prefixlist, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[2]->text, "bgp-direct")) @@ -1239,7 +1239,7 @@ DEFUN (vnc_redist_bgpdirect_no_routemap, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "bgp-direct")) @@ -1279,7 +1279,7 @@ DEFUN (vnc_redist_bgpdirect_routemap, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[2]->text, "bgp-direct")) @@ -1324,7 +1324,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1332,7 +1332,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_prefixlist, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "ipv4")) @@ -1373,7 +1373,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1381,7 +1381,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_prefixlist, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[2]->text, "ipv4")) @@ -1420,7 +1420,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1428,7 +1428,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_no_routemap, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vnc_redistribute_prechange (bgp); @@ -1456,7 +1456,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1464,7 +1464,7 @@ DEFUN (vnc_nve_group_redist_bgpdirect_routemap, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vnc_redistribute_prechange (bgp); @@ -1505,7 +1505,7 @@ DEFUN (vnc_export_mode, if (!bgp->rfapi_cfg) { vty_out (vty, "VNC not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[2]->arg[0] == 'b') @@ -1527,7 +1527,7 @@ DEFUN (vnc_export_mode, break; default: vty_out (vty, "Invalid mode specified\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (newmode == oldmode) @@ -1551,7 +1551,7 @@ DEFUN (vnc_export_mode, * export to zebra with RH mode is not yet implemented */ vty_out (vty,"Changing modes for zebra export not implemented yet\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; oldmode = bgp->rfapi_cfg->flags & BGP_VNC_CONFIG_EXPORT_ZEBRA_MODE_BITS; bgp->rfapi_cfg->flags &= ~BGP_VNC_CONFIG_EXPORT_ZEBRA_MODE_BITS; @@ -1591,7 +1591,7 @@ DEFUN (vnc_export_mode, break; default: vty_out (vty, "Invalid mode\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1626,7 +1626,7 @@ DEFUN (vnc_export_nvegroup, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg_new = bgp_rfapi_cfg_match_byname (bgp, argv[5]->arg, RFAPI_GROUP_CFG_NVE); @@ -1728,7 +1728,7 @@ DEFUN (vnc_no_export_nvegroup, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[2]->arg[0] == 'b') @@ -1789,7 +1789,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1797,7 +1797,7 @@ DEFUN (vnc_nve_group_export_no_prefixlist, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "ipv4")) @@ -1858,7 +1858,7 @@ DEFUN (vnc_nve_group_export_prefixlist, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1866,7 +1866,7 @@ DEFUN (vnc_nve_group_export_prefixlist, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[2]->text, "ipv4")) @@ -1915,7 +1915,7 @@ DEFUN (vnc_nve_group_export_no_routemap, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1923,7 +1923,7 @@ DEFUN (vnc_nve_group_export_no_routemap, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[2]->arg[0] == 'b') @@ -1974,7 +1974,7 @@ DEFUN (vnc_nve_group_export_routemap, if (!bgp->rfapi_cfg) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -1982,7 +1982,7 @@ DEFUN (vnc_nve_group_export_routemap, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[1]->arg[0] == 'b') @@ -2025,7 +2025,7 @@ DEFUN (vnc_nve_export_no_prefixlist, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[4]->text, "ipv4")) @@ -2086,7 +2086,7 @@ DEFUN (vnc_nve_export_prefixlist, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "ipv4")) @@ -2133,7 +2133,7 @@ DEFUN (vnc_nve_export_no_routemap, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[3]->arg[0] == 'b') @@ -2184,7 +2184,7 @@ DEFUN (vnc_nve_export_routemap, if (!(hc = bgp->rfapi_cfg)) { vty_out (vty, "rfapi not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[2]->arg[0] == 'b') @@ -2431,7 +2431,7 @@ DEFUN_NOSH (vnc_nve_group, { /* Error out of memory */ vty_out (vty, "Can't allocate memory for NVE group\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Copy defaults from struct rfapi_cfg */ @@ -2645,7 +2645,7 @@ bgp_rfapi_delete_named_nve_group ( { if (vty) vty_out (vty, "No NVE group named \"%s\"\n",rfg_name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2735,20 +2735,20 @@ DEFUN (vnc_nve_group_prefix, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!str2prefix (argv[2]->arg, &p)) { vty_out (vty, "Malformed prefix \"%s\"\n", argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } afi = family2afi (p.family); if (!afi) { vty_out (vty, "Unsupported address family\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[1]->arg[0] == 'u') @@ -2776,7 +2776,7 @@ DEFUN (vnc_nve_group_prefix, vty_out (vty, "nve group \"%s\" already has \"%s\" prefix %s\n", ((struct rfapi_nve_group_cfg *) (rn->info))->name, argv[1]->arg, argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } else { @@ -2854,7 +2854,7 @@ DEFUN (vnc_nve_group_rt_import, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = set_ecom_list (vty, argc - 2, argv + 2, &rfg->rt_import_list); @@ -2920,7 +2920,7 @@ DEFUN (vnc_nve_group_rt_export, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->rfg_redist == rfg) @@ -2958,7 +2958,7 @@ DEFUN (vnc_nve_group_rt_both, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = set_ecom_list (vty, argc - 2, argv + 2, &rfg->rt_import_list); @@ -3039,7 +3039,7 @@ DEFUN (vnc_nve_group_l2rd, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[1]->text, "auto:vn")) @@ -3055,14 +3055,14 @@ DEFUN (vnc_nve_group_l2rd, if (!argv[1]->arg[0] || *end) { vty_out (vty, "%% Malformed l2 nve ID \"%s\"\n",argv[1]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ((value_l < 1) || (value_l > 0xff)) { vty_out (vty, "%% Malformed l2 nve id (must be greater than 0 and less than %u\n", 0x100); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg->l2rd = value; @@ -3086,7 +3086,7 @@ DEFUN (vnc_nve_group_no_l2rd, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg->l2rd = 0; @@ -3111,7 +3111,7 @@ DEFUN (vnc_nve_group_rd, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!strncmp (argv[1]->arg, "auto:vn:", 8)) @@ -3127,13 +3127,13 @@ DEFUN (vnc_nve_group_rd, if (!argv[1]->arg[8] || *end) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } memset (&prd, 0, sizeof (prd)); @@ -3152,7 +3152,7 @@ DEFUN (vnc_nve_group_rd, if (!ret) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -3187,7 +3187,7 @@ DEFUN (vnc_nve_group_responselifetime, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[1]->text, "infinite")) @@ -3256,7 +3256,7 @@ DEFUN_NOSH (vnc_vrf_policy, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Search for name */ @@ -3269,7 +3269,7 @@ DEFUN_NOSH (vnc_vrf_policy, { /* Error out of memory */ vty_out (vty, "Can't allocate memory for NVE group\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } /* @@ -3293,7 +3293,7 @@ DEFUN (vnc_no_vrf_policy, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_rfapi_delete_named_nve_group (vty, bgp, argv[2]->arg, RFAPI_GROUP_CFG_VRF); } @@ -3312,7 +3312,7 @@ DEFUN (vnc_vrf_policy_label, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3320,7 +3320,7 @@ DEFUN (vnc_vrf_policy_label, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } label = strtoul(argv[1]->arg, NULL, 10); @@ -3353,7 +3353,7 @@ DEFUN (vnc_vrf_policy_no_label, { /* Not in list anymore */ vty_out (vty, "Current VRF group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->rfg_redist == rfg) @@ -3388,7 +3388,7 @@ DEFUN (vnc_vrf_policy_nexthop, { /* Not in list anymore */ vty_out (vty, "Current VRF no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->rfg_redist == rfg) @@ -3438,7 +3438,7 @@ DEFUN (vnc_vrf_policy_rt_import, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3446,7 +3446,7 @@ DEFUN (vnc_vrf_policy_rt_import, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = set_ecom_list (vty, argc-2, argv+2, &rfg->rt_import_list); @@ -3510,7 +3510,7 @@ DEFUN (vnc_vrf_policy_rt_export, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3518,7 +3518,7 @@ DEFUN (vnc_vrf_policy_rt_export, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (bgp->rfapi_cfg->rfg_redist == rfg) @@ -3554,7 +3554,7 @@ DEFUN (vnc_vrf_policy_rt_both, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3562,7 +3562,7 @@ DEFUN (vnc_vrf_policy_rt_both, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = set_ecom_list (vty, argc-2, argv+2, &rfg->rt_import_list); @@ -3642,7 +3642,7 @@ DEFUN (vnc_vrf_policy_rd, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3650,7 +3650,7 @@ DEFUN (vnc_vrf_policy_rd, { /* Not in list anymore */ vty_out (vty, "Current NVE group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!strncmp (argv[1]->arg, "auto:nh:", 8)) @@ -3666,13 +3666,13 @@ DEFUN (vnc_vrf_policy_rd, if (!*(argv[1]->arg + 5) || *end) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (value32 > 0xffff) { vty_out (vty, "%% Malformed rd (must be less than %u\n", 0x0ffff); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } memset (&prd, 0, sizeof (prd)); @@ -3691,7 +3691,7 @@ DEFUN (vnc_vrf_policy_rd, if (!ret) { vty_out (vty, "%% Malformed rd\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -3743,7 +3743,7 @@ DEFUN_NOSH (vnc_l2_group, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Search for name */ @@ -3756,7 +3756,7 @@ DEFUN_NOSH (vnc_l2_group, { /* Error out of memory */ vty_out (vty, "Can't allocate memory for L2 group\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg->name = strdup (argv[1]->arg); /* add to tail of list */ @@ -3809,7 +3809,7 @@ bgp_rfapi_delete_named_l2_group ( { if (vty) vty_out (vty, "No L2 group named \"%s\"\n",rfg_name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -3834,7 +3834,7 @@ DEFUN (vnc_no_l2_group, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return bgp_rfapi_delete_named_l2_group (vty, bgp, argv[3]->arg); } @@ -3852,7 +3852,7 @@ DEFUN (vnc_l2_group_lni, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3860,7 +3860,7 @@ DEFUN (vnc_l2_group_lni, { /* Not in list anymore */ vty_out (vty, "Current L2 group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg->logical_net_id = strtoul(argv[1]->arg, NULL, 10); @@ -3881,7 +3881,7 @@ DEFUN (vnc_l2_group_labels, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3889,7 +3889,7 @@ DEFUN (vnc_l2_group_labels, { /* Not in list anymore */ vty_out (vty, "Current L2 group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ll = rfg->labels; @@ -3925,7 +3925,7 @@ DEFUN (vnc_l2_group_no_labels, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3933,14 +3933,14 @@ DEFUN (vnc_l2_group_no_labels, { /* Not in list anymore */ vty_out (vty, "Current L2 group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ll = rfg->labels; if (ll == NULL) { vty_out (vty, "Label no longer associated with group\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } argc-=2; @@ -3988,7 +3988,7 @@ DEFUN (vnc_l2_group_rt, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make sure it's still in list */ @@ -3996,7 +3996,7 @@ DEFUN (vnc_l2_group_rt, { /* Not in list anymore */ vty_out (vty, "Current L2 group no longer exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (do_import) diff --git a/bgpd/rfapi/rfapi.c b/bgpd/rfapi/rfapi.c index 1b44cf6c0..89f69637f 100644 --- a/bgpd/rfapi/rfapi.c +++ b/bgpd/rfapi/rfapi.c @@ -3102,12 +3102,12 @@ DEFUN ( if (!str2prefix (argv[5]->arg, &pfx)) { vty_out (vty, "Malformed address \"%s\"\n", argv[5]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { vty_out (vty, "Invalid address \"%s\"\n", argv[5]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv[4]->arg[0] == 'u') @@ -3232,7 +3232,7 @@ DEFUN (debug_rfapi_close_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = rfapi_close (handle); @@ -3259,7 +3259,7 @@ DEFUN (debug_rfapi_close_rfd, if (*endptr != '\0' || (uintptr_t) handle == UINTPTR_MAX) { vty_out (vty, "Invalid value: %s\n", argv[4]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rc = rfapi_close (handle); @@ -3313,7 +3313,7 @@ DEFUN (debug_rfapi_register_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3322,12 +3322,12 @@ DEFUN (debug_rfapi_register_vn_un, if (!str2prefix (argv[8]->arg, &pfx)) { vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3402,7 +3402,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3411,12 +3411,12 @@ DEFUN (debug_rfapi_register_vn_un_l2o, if (!str2prefix (argv[8]->arg, &pfx)) { vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3435,7 +3435,7 @@ DEFUN (debug_rfapi_register_vn_un_l2o, if ((rc = rfapiStr2EthAddr (argv[12]->arg, &optary[opt_next].v.l2addr.macaddr))) { vty_out (vty, "Bad mac address \"%s\"\n", argv[12]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } optary[opt_next].type = RFAPI_VN_OPTION_TYPE_L2ADDR; if (opt_next) @@ -3498,7 +3498,7 @@ DEFUN (debug_rfapi_unregister_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3507,12 +3507,12 @@ DEFUN (debug_rfapi_unregister_vn_un, if (!str2prefix (argv[8]->arg, &pfx)) { vty_out (vty, "Malformed prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pfx.family != AF_INET && pfx.family != AF_INET6) { vty_out (vty, "Bad family for prefix \"%s\"\n", argv[8]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &hpfx); @@ -3569,7 +3569,7 @@ DEFUN (debug_rfapi_query_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3643,14 +3643,14 @@ DEFUN (debug_rfapi_query_vn_un_l2o, return rc; #else vty_out (vty, "%% This command is broken.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; #endif if (rfapi_find_handle_vty (vty, &vn, &un, &handle)) { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[4]->arg, argv[6]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3660,7 +3660,7 @@ DEFUN (debug_rfapi_query_vn_un_l2o, if (rfapiStr2EthAddr (argv[10]->arg, &l2o_buf.macaddr)) { vty_out (vty, "Bad mac address \"%s\"\n", argv[10]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } l2o_buf.logical_net_id = strtoul(argv[8]->arg, NULL, 10); @@ -3752,7 +3752,7 @@ DEFUN (debug_rfapi_query_done_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[5]->arg, argv[7]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3787,14 +3787,14 @@ DEFUN (debug_rfapi_show_import, if (!bgp) { vty_out (vty, "No BGP instance\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } h = bgp->rfapi; if (!h) { vty_out (vty, "No RFAPI instance\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* @@ -3890,7 +3890,7 @@ DEFUN (debug_rfapi_show_import_vn_un, { vty_out (vty, "can't locate handle matching vn=%s, un=%s\n", argv[5]->arg, argv[7]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfd = (struct rfapi_descriptor *) handle; @@ -3920,12 +3920,12 @@ DEFUN (debug_rfapi_response_omit_self, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!bgp->rfapi_cfg) { vty_out (vty, "VNC not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch(argv[3]->text, "on")) diff --git a/bgpd/rfapi/rfapi_vty.c b/bgpd/rfapi/rfapi_vty.c index 1b55fbbda..3b7d08f91 100644 --- a/bgpd/rfapi/rfapi_vty.c +++ b/bgpd/rfapi/rfapi_vty.c @@ -2207,7 +2207,7 @@ register_add ( struct rfapi_vn_option *opt = NULL; int opt_next = 0; - int rc = CMD_WARNING; + int rc = CMD_WARNING_CONFIG_FAILED; char *endptr; struct bgp *bgp; struct rfapi *h; @@ -2221,7 +2221,7 @@ register_add ( { if (vty) vty_out (vty, "BGP not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } h = bgp->rfapi; @@ -2230,7 +2230,7 @@ register_add ( { if (vty) vty_out (vty, "RFAPI not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } for (; argc; --argc, ++argv) @@ -2240,12 +2240,12 @@ register_add ( if (arg_lnh) { vty_out (vty,"local-next-hop specified more than once\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc <= 1) { vty_out (vty,"Missing parameter for local-next-hop\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ++argv, --argc; arg_lnh = argv[0]->arg; @@ -2255,12 +2255,12 @@ register_add ( if (arg_lnh_cost) { vty_out (vty,"local-cost specified more than once\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc <= 1) { vty_out (vty,"Missing parameter for local-cost\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ++argv, --argc; arg_lnh_cost = argv[0]->arg; @@ -2288,7 +2288,7 @@ register_add ( break; default: vty_out (vty,"Internal error, unknown VN address family\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2411,7 +2411,7 @@ register_add ( { vty_out (vty, "Missing \"vni\" parameter (mandatory with mac)\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } optary[opt_next].v.l2addr.logical_net_id = strtoul(arg_vni, NULL, 10); @@ -2473,7 +2473,7 @@ register_add ( { vty_out (vty, "Can't open session for this NVE: %s\n", rfapi_error_str(rc)); - rc = CMD_WARNING; + rc = CMD_WARNING_CONFIG_FAILED; goto fail; } } @@ -2519,7 +2519,7 @@ register_add ( vty_out (vty, "Registration failed.\n"); vty_out (vty, "Confirm that either the VN or UN address matches a configured NVE group.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; fail: vnc_zlog_debug_verbose ("%s: fail, rc=%d", __func__, rc); @@ -5006,12 +5006,12 @@ vnc_add_vrf_prefix (struct vty *vty, if (!bgp) { vty_out (vty, "No BGP process is configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!bgp->rfapi || !bgp->rfapi_cfg) { vty_out (vty, "VRF support not configured\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfg = bgp_rfapi_cfg_match_byname (bgp, arg_vrf, RFAPI_GROUP_CFG_VRF); @@ -5020,31 +5020,31 @@ vnc_add_vrf_prefix (struct vty *vty, { vty_out (vty, "VRF \"%s\" appears not to be configured.\n", arg_vrf); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!rfg->rt_export_list || !rfg->rfapi_import_table) { vty_out (vty, "VRF \"%s\" is missing RT import/export RT configuration.\n", arg_vrf); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!rfg->rd.family && !arg_rd) { vty_out (vty, "VRF \"%s\" isn't configured with an RD, so RD must be provided.\n", arg_vrf); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rfg->label > MPLS_LABEL_MAX && !arg_label) { vty_out (vty, "VRF \"%s\" isn't configured with a default labels, so a label must be provided.\n", arg_vrf); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!str2prefix (arg_prefix, &pfx)) { vty_out (vty, "Malformed prefix \"%s\"\n", arg_prefix); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rfapiQprefix2Rprefix (&pfx, &rpfx); memset (optary, 0, sizeof (optary)); @@ -5058,7 +5058,7 @@ vnc_add_vrf_prefix (struct vty *vty, { vty_out (vty, "Malformed RD \"%s\"\n", arg_rd); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } if (rfg->label <= MPLS_LABEL_MAX || arg_label) @@ -5086,7 +5086,7 @@ vnc_add_vrf_prefix (struct vty *vty, { vty_out (vty, "%% Invalid local-preference value \"%s\"\n", arg_pref); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } rpfx.cost = 255 - (pref & 255) ; @@ -5150,7 +5150,7 @@ vnc_add_vrf_prefix (struct vty *vty, vnc_zlog_debug_verbose ("%s: rfapi_register failed", __func__); vty_out (vty, "Add failed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (add_vrf_prefix_rd_label_pref, diff --git a/bgpd/rfapi/vnc_debug.c b/bgpd/rfapi/vnc_debug.c index 21627a20a..1f9e1b10f 100644 --- a/bgpd/rfapi/vnc_debug.c +++ b/bgpd/rfapi/vnc_debug.c @@ -86,7 +86,7 @@ DEFUN (debug_bgp_vnc, } } vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_debug_bgp_vnc, @@ -125,7 +125,7 @@ DEFUN (no_debug_bgp_vnc, } } vty_out (vty, "Unknown debug flag: %s\n", argv[3]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } diff --git a/bgpd/rfapi/vnc_zebra.c b/bgpd/rfapi/vnc_zebra.c index 6a8b4a83f..de1249ff2 100644 --- a/bgpd/rfapi/vnc_zebra.c +++ b/bgpd/rfapi/vnc_zebra.c @@ -1036,7 +1036,7 @@ vnc_redistribute_set (struct bgp *bgp, afi_t afi, int type) { if (!bgp->rfapi_cfg) { - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Set flag to BGP instance. */ @@ -1046,7 +1046,7 @@ vnc_redistribute_set (struct bgp *bgp, afi_t afi, int type) /* Return if already redistribute flag is set. */ if (zclient_vnc->redist[afi][type]) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; vrf_bitmap_set (zclient_vnc->redist[afi][type], VRF_DEFAULT); @@ -1054,7 +1054,7 @@ vnc_redistribute_set (struct bgp *bgp, afi_t afi, int type) /* Return if zebra connection is not established. */ if (zclient_vnc->sock < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (BGP_DEBUG (zebra, ZEBRA)) vnc_zlog_debug_verbose ("Zebra send: redistribute add %s", zebra_route_string (type)); @@ -1074,7 +1074,7 @@ vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type) if (!bgp->rfapi_cfg) { vnc_zlog_debug_verbose ("%s: return (no rfapi_cfg)", __func__); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Unset flag from BGP instance. */ @@ -1082,7 +1082,7 @@ vnc_redistribute_unset (struct bgp *bgp, afi_t afi, int type) /* Return if zebra connection is disabled. */ if (!zclient_vnc->redist[afi][type]) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; zclient_vnc->redist[afi][type] = 0; if (bgp->rfapi_cfg->redist[AFI_IP][type] == 0 diff --git a/buildtest.sh b/buildtest.sh index cbe6962a4..b4b02d10b 100755 --- a/buildtest.sh +++ b/buildtest.sh @@ -1,7 +1,7 @@ #!/bin/bash # written 2012-2013 by David Lamparter, placed in Public Domain. # -# builds some git commit of Quagga in some different configurations +# builds some git commit of FRR in some different configurations # usage: buildtest.sh [commit [configurations...]] basecfg="--prefix=/usr --enable-user=frr --enable-group=frr --enable-vty-group=frr --enable-configfile-mask=0660 --enable-logfile-mask=0640 --enable-vtysh --sysconfdir=/etc/frr --enable-exampledir=/etc/frr/samples --localstatedir=/var/run/frr --libdir=/usr/lib64/frr --enable-rtadv --disable-static --enable-isisd --enable-multipath=0 --enable-pimd --enable-werror" diff --git a/configure.ac b/configure.ac index 03951503c..cbda2fc84 100755 --- a/configure.ac +++ b/configure.ac @@ -127,7 +127,7 @@ dnl autoconf 2.59 appears not to support AC_PROG_SED dnl AC_PROG_SED AC_CHECK_PROG([SED],[sed],[sed],[/bin/false]) -dnl try and enable CFLAGS that are useful for Quagga +dnl try and enable CFLAGS that are useful for FRR dnl - specifically, options to control warnings AC_USE_SYSTEM_EXTENSIONS @@ -249,7 +249,7 @@ AX_PTHREAD([ CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" ], [ - AC_MSG_FAILURE([This Quagga version needs pthreads]) + AC_MSG_FAILURE([This FRR version needs pthreads]) ]) dnl -------------- @@ -283,7 +283,7 @@ AC_ARG_WITH(vtysh_pager, AS_HELP_STRING([--with-vtysh-pager=PAGER], [control what pager is compiled in as default]), VTYSH_PAGER=$withval, VTYSH_PAGER="more") AC_ARG_ENABLE(vtysh, - AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for Quagga])) + AS_HELP_STRING([--disable-vtysh], [do not build integrated vty shell for FRR])) AC_ARG_ENABLE(doc, AS_HELP_STRING([--disable-doc], [do not build docs])) AC_ARG_ENABLE(zebra, @@ -939,7 +939,7 @@ AM_CONDITIONAL(VTYSH, test "x$VTYSH" = "xvtysh") dnl ---------- dnl PAM module dnl -dnl Quagga detects the PAM library it is built against by checking for a +dnl FRR detects the PAM library it is built against by checking for a dnl functional pam_misc.h (Linux-PAM) or openpam.h (OpenPAM) header. pam_misc.h dnl is known to #include pam_appl.h, the standard header of a PAM library, and dnl openpam.h doesn't do that, although depends on the header too. Hence a @@ -1759,10 +1759,10 @@ dnl -------------------------------------- AM_PROG_LEX AC_MSG_CHECKING(version of flex) -quagga_ac_flex_version="$(eval $LEX -V | grep flex | head -n 1)" -quagga_ac_flex_version="${quagga_ac_flex_version##* }" -AC_MSG_RESULT([$quagga_ac_flex_version]) -AX_COMPARE_VERSION([$quagga_ac_flex_version], [lt], [2.5.20], [ +frr_ac_flex_version="$(eval $LEX -V | grep flex | head -n 1)" +frr_ac_flex_version="${frr_ac_flex_version##* }" +AC_MSG_RESULT([$frr_ac_flex_version]) +AX_COMPARE_VERSION([$frr_ac_flex_version], [lt], [2.5.20], [ LEX="$SHELL $missing_dir/missing flex" if test -f "${srcdir}/lib/command_lex.c" -a -f "${srcdir}/lib/command_lex.h"; then AC_MSG_WARN([using pregenerated flex output files]) @@ -1776,38 +1776,38 @@ AX_COMPARE_VERSION([$quagga_ac_flex_version], [lt], [2.5.20], [ AC_PROG_YACC dnl thanks GNU bison for this b*llshit... AC_MSG_CHECKING(version of bison) -quagga_ac_bison_version="$(eval $YACC -V | grep bison | head -n 1)" -quagga_ac_bison_version="${quagga_ac_bison_version##* }" -quagga_ac_bison_missing="false" -case "x${quagga_ac_bison_version}" in +frr_ac_bison_version="$(eval $YACC -V | grep bison | head -n 1)" +frr_ac_bison_version="${frr_ac_bison_version##* }" +frr_ac_bison_missing="false" +case "x${frr_ac_bison_version}" in x2.7*) BISON_OPENBRACE='"' BISON_CLOSEBRACE='"' BISON_VERBOSE='' - AC_MSG_RESULT([$quagga_ac_bison_version - 2.7 or older]) + AC_MSG_RESULT([$frr_ac_bison_version - 2.7 or older]) ;; x2.*|x1.*) - AC_MSG_RESULT([$quagga_ac_bison_version]) + AC_MSG_RESULT([$frr_ac_bison_version]) AC_MSG_WARN([installed bison is too old. Please install GNU bison 2.7.x or newer.]) - quagga_ac_bison_missing="true" + frr_ac_bison_missing="true" ;; x) AC_MSG_RESULT([none]) AC_MSG_WARN([could not determine bison version. Please install GNU bison 2.7.x or newer.]) - quagga_ac_bison_missing="true" + frr_ac_bison_missing="true" ;; *) BISON_OPENBRACE='{' BISON_CLOSEBRACE='}' BISON_VERBOSE='-Dparse.error=verbose' - AC_MSG_RESULT([$quagga_ac_bison_version - 3.0 or newer]) + AC_MSG_RESULT([$frr_ac_bison_version - 3.0 or newer]) ;; esac AC_SUBST(BISON_OPENBRACE) AC_SUBST(BISON_CLOSEBRACE) AC_SUBST(BISON_VERBOSE) -if $quagga_ac_bison_missing; then +if $frr_ac_bison_missing; then YACC="$SHELL $missing_dir/missing bison -y" if test -f "${srcdir}/lib/command_parse.c" -a -f "${srcdir}/lib/command_parse.h"; then AC_MSG_WARN([using pregenerated bison output files]) @@ -1969,10 +1969,11 @@ AC_CACHE_VAL(ac_cv_htonl_works, ) AC_MSG_RESULT($ac_cv_htonl_works) -AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile +AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile ripngd/Makefile bgpd/Makefile ospfd/Makefile watchfrr/Makefile ospf6d/Makefile ldpd/Makefile isisd/Makefile vtysh/Makefile doc/Makefile ospfclient/Makefile tests/Makefile m4/Makefile + bgpd/rfp-example/rfptest/Makefile bgpd/rfp-example/librfp/Makefile babeld/Makefile pimd/Makefile eigrpd/Makefile @@ -1982,7 +1983,7 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile pkgsrc/Makefile python/Makefile fpm/Makefile - redhat/frr.spec + redhat/frr.spec snapcraft/Makefile snapcraft/snapcraft.yaml lib/version.h @@ -2007,19 +2008,12 @@ AC_CONFIG_FILES([Makefile lib/Makefile qpb/Makefile zebra/Makefile ripd/Makefile pkgsrc/ripd.sh pkgsrc/ripngd.sh pkgsrc/zebra.sh pkgsrc/eigrpd.sh]) -if test "${enable_bgp_vnc}" != "no"; then - if test "${with_rfp_path}" = "bgpd/rfp-example" ; then - AC_CONFIG_FILES([bgpd/rfp-example/rfptest/Makefile bgpd/rfp-example/librfp/Makefile]) - else - AC_CONFIG_FILES([${with_rfp_path}/rfptest/Makefile ${with_rfp_path}/librfp/Makefile]) - fi -fi AC_CONFIG_FILES([solaris/Makefile]) AC_CONFIG_FILES([vtysh/extract.pl],[chmod +x vtysh/extract.pl]) -## Hack, but working solution to avoid rebuilding of quagga.info. +## Hack, but working solution to avoid rebuilding of frr.info. ## It's already in CVS until texinfo 4.7 is more common. AC_OUTPUT diff --git a/doc/appendix.texi b/doc/appendix.texi index 3904c5f0c..2e1c9deb1 100644 --- a/doc/appendix.texi +++ b/doc/appendix.texi @@ -1,7 +1,7 @@ @node Packet Binary Dump Format @appendix Packet Binary Dump Format - Quagga can dump routing protocol packet into file with a binary format + FRR can dump routing protocol packet into file with a binary format (@pxref{Dump BGP packets and table}). It seems to be better that we share the MRT's header format for diff --git a/doc/babeld.texi b/doc/babeld.texi index 6b4cca1e1..2dfb5f8c0 100644 --- a/doc/babeld.texi +++ b/doc/babeld.texi @@ -1,7 +1,7 @@ @c -*-texinfo-*- -@c This is part of the Quagga Manual. +@c This is part of the FRR Manual. @c @value{COPYRIGHT_STR} -@c See file quagga.texi for copying conditions. +@c See file frr.texi for copying conditions. @node Babel @chapter Babel @@ -14,7 +14,7 @@ perform reliable link quality estimation on wireless links. Babel is a double-stack routing protocol, meaning that a single Babel instance is able to perform routing for both IPv4 and IPv6. -Quagga implements Babel as described in RFC6126. +FRR implements Babel as described in RFC6126. @menu * Configuring babeld:: diff --git a/doc/ospfclient.8.in b/doc/ospfclient.8.in index fb996a541..a304beffd 100644 --- a/doc/ospfclient.8.in +++ b/doc/ospfclient.8.in @@ -1,5 +1,5 @@ .\" This file was originally generated by help2man 1.36. -.TH OSPFCLIENT "1" "July 2010" +.TH OSPFCLIENT "8" "July 2010" .SH NAME ospfclient \- an example ospf-api client .SH SYNOPSIS diff --git a/eigrpd/eigrp_routemap.c b/eigrpd/eigrp_routemap.c index 671456914..1d85e7646 100644 --- a/eigrpd/eigrp_routemap.c +++ b/eigrpd/eigrp_routemap.c @@ -155,10 +155,10 @@ eigrp_route_match_add (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } return CMD_SUCCESS; @@ -177,10 +177,10 @@ eigrp_route_match_delete (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } return CMD_SUCCESS; @@ -200,7 +200,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: /* rip, ripng and other protocols share the set metric command but only values from 0 to 16 are valid for rip and ripng @@ -208,7 +208,7 @@ eigrp_route_set_add (struct vty *vty, struct route_map_index *index, other protocols. Do not return an error */ if (strcmp(command, "metric")) { vty_out (vty, "%% Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } } @@ -229,10 +229,10 @@ eigrp_route_set_delete (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } return CMD_SUCCESS; @@ -1125,7 +1125,7 @@ DEFUN (set_ip_nexthop, if (ret < 0) { vty_out (vty, "%% Malformed next-hop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return eigrp_route_set_add (vty, vty->index, "ip next-hop", argv[0]); diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c index 5fceb8514..49fb729ca 100644 --- a/eigrpd/eigrp_vty.c +++ b/eigrpd/eigrp_vty.c @@ -236,7 +236,7 @@ DEFUN (no_router_eigrp, if (eigrp->AS != atoi (argv[3]->arg)) { vty_out (vty,"%% Attempting to deconfigure non-existent AS\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } eigrp_finish_final (eigrp); @@ -394,7 +394,7 @@ DEFUN (eigrp_network, if (ret == 0) { vty_out (vty, "There is already same network statement.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -418,7 +418,7 @@ DEFUN (no_eigrp_network, if (ret == 0) { vty_out (vty,"Can't find specified network configuration.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -866,7 +866,7 @@ str2auth_type (const char *str, struct interface *ifp) { /* Sanity check. */ if (str == NULL) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if(strncmp(str, "md5",3) == 0) { @@ -879,7 +879,7 @@ str2auth_type (const char *str, struct interface *ifp) return CMD_SUCCESS; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (eigrp_authentication_mode, @@ -1032,7 +1032,7 @@ DEFUN (eigrp_redistribute_source_metric, argv_find (argv, argc, "redistribute", &idx); source = proto_redistnum(AFI_IP, argv[idx+1]->arg); if (source < 0 ) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Get metrics values */ @@ -1061,7 +1061,7 @@ DEFUN (no_eigrp_redistribute_source_metric, argv_find (argv, argc, "redistribute", &idx); source = proto_redistnum(AFI_IP, argv[idx+1]->arg); if (source < 0 ) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Get metrics values */ diff --git a/isisd/isis_redist.c b/isisd/isis_redist.c index 9846686ef..b3f29fd20 100644 --- a/isisd/isis_redist.c +++ b/isisd/isis_redist.c @@ -581,27 +581,27 @@ DEFUN (isis_redistribute, family = str2family(argv[idx_afi]->text); if (family < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; afi = family2afi(family); if (!afi) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; type = proto_redistnum(afi, argv[idx_protocol]->text); if (type < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (!strcmp("level-1", argv[idx_level]->arg)) level = 1; else if (!strcmp("level-2", argv[idx_level]->arg)) level = 2; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if ((area->is_type & level) != level) { vty_out (vty, "Node is not a level-%d IS\n", level); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } metric = 0xffffffff; @@ -610,7 +610,7 @@ DEFUN (isis_redistribute, if (argc > idx_metric_rmap + 1) { if (argv[idx_metric_rmap + 1]->arg[0] == '\0') - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (strmatch(argv[idx_metric_rmap]->text, "metric")) { @@ -618,7 +618,7 @@ DEFUN (isis_redistribute, metric = strtoul(argv[idx_metric_rmap + 1]->arg, &endp, 10); if (*endp != '\0') - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } else { @@ -652,15 +652,15 @@ DEFUN (no_isis_redistribute, family = str2family(argv[idx_afi]->arg); if (family < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; afi = family2afi(family); if (!afi) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; type = proto_redistnum(afi, argv[idx_protocol]->text); if (type < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; level = strmatch ("level-1", argv[idx_level]->text) ? 1 : 2; @@ -696,14 +696,14 @@ DEFUN (isis_default_originate, family = str2family(argv[idx_afi]->text); if (family < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; level = strmatch ("level-1", argv[idx_level]->text) ? 1 : 2; if ((area->is_type & level) != level) { vty_out (vty, "Node is not a level-%d IS\n", level); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc > idx_always && strmatch (argv[idx_always]->text, "always")) @@ -750,14 +750,14 @@ DEFUN (no_isis_default_originate, family = str2family(argv[idx_afi]->text); if (family < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (strmatch ("level-1", argv[idx_level]->text)) level = 1; else if (strmatch ("level-2", argv[idx_level]->text)) level = 2; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; isis_redist_unset(area, level, family, DEFAULT_ROUTE); return 0; diff --git a/isisd/isis_te.c b/isisd/isis_te.c index e26bb6e46..271545744 100644 --- a/isisd/isis_te.c +++ b/isisd/isis_te.c @@ -1174,7 +1174,7 @@ DEFUN (isis_mpls_te_router_addr, if (! inet_aton (argv[idx_ipv4]->arg, &value)) { vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } isisMplsTE.router_id.s_addr = value.s_addr; diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index 784f29f0e..157962dad 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -93,7 +93,7 @@ DEFUN (ip_router_isis, if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP) { vty_out (vty, "Couldn't bring up interface, please check log.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } diff --git a/ldpd/ldp_debug.c b/ldpd/ldp_debug.c index 269b01406..c9c7160ae 100644 --- a/ldpd/ldp_debug.c +++ b/ldpd/ldp_debug.c @@ -43,7 +43,7 @@ ldp_vty_debug(struct vty *vty, int disable, const char *type_str, { if (strcmp(type_str, "discovery") == 0) { if (dir_str == NULL) - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); if (dir_str[0] == 'r') { if (disable) @@ -68,7 +68,7 @@ ldp_vty_debug(struct vty *vty, int disable, const char *type_str, DEBUG_ON(event, EVENT); } else if (strcmp(type_str, "messages") == 0) { if (dir_str == NULL) - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); if (dir_str[0] == 'r') { if (disable) { diff --git a/ldpd/ldp_vty_conf.c b/ldpd/ldp_vty_conf.c index 0443d62ca..4e900ca93 100644 --- a/ldpd/ldp_vty_conf.c +++ b/ldpd/ldp_vty_conf.c @@ -434,7 +434,7 @@ ldp_vty_address_family(struct vty *vty, int disable, const char *af_str) af = AF_INET6; af_conf = &vty_conf->ipv6; } else - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); if (disable) { af_conf->flags &= ~F_LDPD_AF_ENABLED; @@ -474,7 +474,7 @@ ldp_vty_disc_holdtime(struct vty *vty, int disable, const char *hello_type_str, secs = strtol(seconds_str, &ep, 10); if (*ep != '\0' || secs < MIN_HOLDTIME || secs > MAX_HOLDTIME) { vty_out (vty, "%% Invalid holdtime\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (hello_type_str[0] == 'h') @@ -569,7 +569,7 @@ ldp_vty_disc_interval(struct vty *vty, int disable, const char *hello_type_str, if (*ep != '\0' || secs < MIN_HELLO_INTERVAL || secs > MAX_HELLO_INTERVAL) { vty_out (vty, "%% Invalid interval\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (hello_type_str[0] == 'h') @@ -687,7 +687,7 @@ ldp_vty_nbr_session_holdtime(struct vty *vty, int disable, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } secs = strtol(seconds_str, &ep, 10); @@ -847,11 +847,11 @@ ldp_vty_neighbor_targeted(struct vty *vty, int disable, const char *addr_str) if (inet_pton(af, addr_str, &addr) != 1 || bad_addr(af, &addr)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (af == AF_INET6 && IN6_IS_SCOPE_EMBED(&addr.v6)) { vty_out (vty, "%% Address can not be link-local\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } tnbr = tnbr_find(vty_conf, af, &addr); @@ -1069,7 +1069,7 @@ ldp_vty_neighbor_password(struct vty *vty, int disable, const char *lsr_id_str, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } nbrp = nbr_params_find(vty_conf, lsr_id); @@ -1115,7 +1115,7 @@ ldp_vty_neighbor_ttl_security(struct vty *vty, int disable, if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (hops_str) { @@ -1227,7 +1227,7 @@ ldp_vty_l2vpn_mtu(struct vty *vty, int disable, const char *mtu_str) mtu = strtol(mtu_str, &ep, 10); if (*ep != '\0' || mtu < MIN_L2VPN_MTU || mtu > MAX_L2VPN_MTU) { vty_out (vty, "%% Invalid MTU\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (disable) @@ -1374,7 +1374,7 @@ ldp_vty_l2vpn_pw_nbr_addr(struct vty *vty, int disable, const char *addr_str) if (ldp_get_address(addr_str, &af, &addr) == -1 || bad_addr(af, &addr)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (disable) { @@ -1401,7 +1401,7 @@ ldp_vty_l2vpn_pw_nbr_id(struct vty *vty, int disable, const char *lsr_id_str) if (inet_pton(AF_INET, lsr_id_str, &lsr_id) != 1 || bad_addr_v4(lsr_id)) { vty_out (vty, "%% Malformed address\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (disable) @@ -1424,7 +1424,7 @@ ldp_vty_l2vpn_pw_pwid(struct vty *vty, int disable, const char *pwid_str) pwid = strtol(pwid_str, &ep, 10); if (*ep != '\0' || pwid < MIN_PWID_ID || pwid > MAX_PWID_ID) { vty_out (vty, "%% Invalid pw-id\n"); - return (CMD_WARNING); + return (CMD_WARNING_CONFIG_FAILED); } if (disable) diff --git a/lib/agentx.c b/lib/agentx.c index a2e737fed..30c03e6cf 100644 --- a/lib/agentx.c +++ b/lib/agentx.c @@ -197,7 +197,7 @@ DEFUN (no_agentx, { if (!agentx_enabled) return CMD_SUCCESS; vty_out (vty, "SNMP AgentX support cannot be disabled once enabled\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } void diff --git a/lib/command.c b/lib/command.c index c9fbaf47b..99e6b6e00 100644 --- a/lib/command.c +++ b/lib/command.c @@ -1150,7 +1150,7 @@ DEFUN (config_terminal, else { vty_out (vty, "VTY configuration is locked by other VTY\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } @@ -1720,7 +1720,7 @@ DEFUN (config_hostname, if (!isalpha((int) word->arg[0])) { vty_out (vty, "Please specify string starting with alphabet\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return cmd_hostname_set (word->arg); @@ -1761,7 +1761,7 @@ DEFUN (config_password, { vty_out (vty, "Please specify string starting with alphanumeric\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.password) @@ -1810,7 +1810,7 @@ DEFUN (config_enable_password, else { vty_out (vty, "Unknown encryption type.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1818,7 +1818,7 @@ DEFUN (config_enable_password, { vty_out (vty, "Please specify string starting with alphanumeric\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.enable) @@ -2132,14 +2132,14 @@ set_log_file(struct vty *vty, const char *fname, int loglevel) if (getcwd (cwd, MAXPATHLEN) == NULL) { zlog_err ("config_log_file: Unable to alloc mem!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ( (p = XMALLOC (MTYPE_TMP, strlen (cwd) + strlen (fname) + 2)) == NULL) { zlog_err ("config_log_file: Unable to alloc mem!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } sprintf (p, "%s/%s", cwd, fname); fullpath = p; @@ -2155,7 +2155,7 @@ set_log_file(struct vty *vty, const char *fname, int loglevel) if (!ret) { vty_out (vty, "can't open logfile %s\n", fname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (host.logfile) @@ -2369,7 +2369,7 @@ cmd_banner_motd_file (const char *file) host.motdfile = XSTRDUP (MTYPE_HOST, file); } else - success = CMD_WARNING; + success = CMD_WARNING_CONFIG_FAILED; return success; } @@ -2388,7 +2388,7 @@ DEFUN (banner_motd_file, if (cmd == CMD_ERR_NO_FILE) vty_out (vty, "%s does not exist", filename); - else if (cmd == CMD_WARNING) + else if (cmd == CMD_WARNING_CONFIG_FAILED) vty_out (vty, "%s must be in %s", filename, SYSCONFDIR); return cmd; diff --git a/lib/command.h b/lib/command.h index 927c04006..4a261499d 100644 --- a/lib/command.h +++ b/lib/command.h @@ -178,6 +178,7 @@ struct cmd_node #define CMD_SUCCESS_DAEMON 10 #define CMD_ERR_NO_FILE 11 #define CMD_SUSPEND 12 +#define CMD_WARNING_CONFIG_FAILED 13 /* Argc max counts. */ #define CMD_ARGC_MAX 25 @@ -293,6 +294,7 @@ struct cmd_node */ #define CMD_CREATE_STR(s) CMD_CREATE_STR_HELPER(s) #define CMD_CREATE_STR_HELPER(s) #s +#define CMD_RANGE_STR(a,s) "(" CMD_CREATE_STR(a) "-" CMD_CREATE_STR(s) ")" /* Common descriptions. */ #define SHOW_STR "Show running system information\n" diff --git a/lib/distribute.c b/lib/distribute.c index 691b67e83..34ccfb4c7 100644 --- a/lib/distribute.c +++ b/lib/distribute.c @@ -350,7 +350,7 @@ DEFUN (no_distribute_list, if (! ret) { vty_out (vty, "distribute list doesn't exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } diff --git a/lib/filter.c b/lib/filter.c index 9967308f6..c1e922f5b 100644 --- a/lib/filter.c +++ b/lib/filter.c @@ -577,7 +577,7 @@ vty_access_list_remark_unset (struct vty *vty, afi_t afi, const char *name) if (! access) { vty_out (vty, "%% access-list %s doesn't exist\n",name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (access->remark) @@ -616,21 +616,21 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str, else { vty_out (vty, "%% filter type must be permit or deny\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (addr_str, &addr); if (ret <= 0) { vty_out (vty,"%%Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (addr_mask_str, &addr_mask); if (ret <= 0) { vty_out (vty,"%%Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (extended) @@ -639,14 +639,14 @@ filter_set_cisco (struct vty *vty, const char *name_str, const char *type_str, if (ret <= 0) { vty_out (vty,"%%Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (mask_mask_str, &mask_mask); if (ret <= 0) { vty_out (vty,"%%Inconsistent address and mask\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1259,7 +1259,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, vty_out (vty, "%% ACL name %s is invalid: length exceeds " "%d characters\n", name_str, ACL_NAMSIZ); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check of filter type. */ @@ -1270,7 +1270,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, else { vty_out (vty, "filter type must be [permit|deny]\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check string format of prefix and prefixlen. */ @@ -1280,7 +1280,7 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, if (ret <= 0) { vty_out (vty,"IP address prefix/prefixlen is malformed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else if (afi == AFI_IP6) @@ -1289,11 +1289,11 @@ filter_set_zebra (struct vty *vty, const char *name_str, const char *type_str, if (ret <= 0) { vty_out (vty,"IPv6 address prefix/prefixlen is malformed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; mfilter = filter_new (); mfilter->type = type; @@ -1425,7 +1425,7 @@ DEFUN (no_access_list_all, if (access == NULL) { vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_acl]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } master = access->master; @@ -1602,7 +1602,7 @@ DEFUN (no_ipv6_access_list_all, if (access == NULL) { vty_out (vty, "%% access-list %s doesn't exist\n",argv[idx_word]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } master = access->master; diff --git a/lib/grammar_sandbox.c b/lib/grammar_sandbox.c index f6bc3e772..81c2ca5c3 100644 --- a/lib/grammar_sandbox.c +++ b/lib/grammar_sandbox.c @@ -50,6 +50,12 @@ init_cmdgraph (struct vty *, struct graph **); /** shim interface commands **/ struct graph *nodegraph = NULL, *nodegraph_free = NULL; +#define check_nodegraph() \ + do { if (!nodegraph) { \ + vty_outln(vty, "nodegraph not initialized"); \ + return CMD_WARNING; \ + } } while (0) + DEFUN (grammar_test, grammar_test_cmd, "grammar parse LINE...", @@ -57,6 +63,8 @@ DEFUN (grammar_test, "parse a command\n" "command to pass to new parser\n") { + check_nodegraph(); + int idx_command = 2; // make a string from tokenized command line char *command = argv_concat (argv, argc, idx_command); @@ -85,6 +93,8 @@ DEFUN (grammar_test_complete, "attempt to complete input on DFA\n" "command to complete\n") { + check_nodegraph(); + int idx_command = 2; char *cmdstr = argv_concat (argv, argc, idx_command); if (!cmdstr) @@ -143,6 +153,8 @@ DEFUN (grammar_test_match, "attempt to match input on DFA\n" "command to match\n") { + check_nodegraph(); + int idx_command = 2; if (argv[2]->arg[0] == '#') return CMD_SUCCESS; @@ -209,6 +221,8 @@ DEFUN (grammar_test_doc, "Test function for docstring\n" "Command end\n") { + check_nodegraph(); + // create cmd_element with docstring struct cmd_element *cmd = XCALLOC (MTYPE_CMD_TOKENS, sizeof (struct cmd_element)); cmd->string = XSTRDUP (MTYPE_CMD_TOKENS, "test docstring <example|selector follow> (1-255) end VARIABLE [OPTION|set lol] . VARARG"); @@ -243,12 +257,10 @@ DEFUN (grammar_test_show, "print current accumulated DFA\n" "include docstrings\n") { - struct graph_node *stack[MAXDEPTH]; + check_nodegraph(); - if (!nodegraph) - vty_out(vty, "nodegraph uninitialized\r\n"); - else - pretty_print_graph (vty, vector_slot (nodegraph->nodes, 0), 0, argc >= 3, stack, 0); + struct graph_node *stack[MAXDEPTH]; + pretty_print_graph (vty, vector_slot (nodegraph->nodes, 0), 0, argc >= 3, stack, 0); return CMD_SUCCESS; } @@ -259,14 +271,12 @@ DEFUN (grammar_test_dot, "print current graph for dot\n" ".dot filename\n") { + check_nodegraph(); + struct graph_node *stack[MAXDEPTH]; struct graph_node *visited[MAXDEPTH*MAXDEPTH]; size_t vpos = 0; - if (!nodegraph) { - vty_out(vty, "nodegraph uninitialized\r\n"); - return CMD_SUCCESS; - } FILE *ofd = fopen(argv[2]->arg, "w"); if (!ofd) { vty_out(vty, "%s: %s\r\n", argv[2]->arg, strerror(errno)); @@ -389,7 +399,7 @@ DEFUN (grammar_findambig, if (!scan && !nodegraph) { vty_out(vty, "nodegraph uninitialized\r\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } do { @@ -432,7 +442,7 @@ DEFUN (grammar_findambig, if (scan) nodegraph = NULL; - return ambig == 0 ? CMD_SUCCESS : CMD_WARNING; + return ambig == 0 ? CMD_SUCCESS : CMD_WARNING_CONFIG_FAILED; } DEFUN (grammar_init_graph, @@ -466,7 +476,7 @@ DEFUN (grammar_access, if (!cnode) { vty_out (vty, "%% no such node\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vty_out (vty, "node %d\n", (int)cnode->node); @@ -476,8 +486,6 @@ DEFUN (grammar_access, /* this is called in vtysh.c to set up the testing shim */ void grammar_sandbox_init(void) { - init_cmdgraph (NULL, &nodegraph); - // install all enable elements install_element (ENABLE_NODE, &grammar_test_cmd); install_element (ENABLE_NODE, &grammar_test_show_cmd); diff --git a/lib/hash.c b/lib/hash.c index 166bc7a26..47f336c1e 100644 --- a/lib/hash.c +++ b/lib/hash.c @@ -87,13 +87,8 @@ hash_alloc_intern (void *arg) } #define hash_update_ssq(hz, old, new) \ - do { \ - long double res; \ - res = powl(old, 2.0); \ - hz->stats.ssq -= (uint64_t) res;\ - res = powl(new, 2.0); \ - hz->stats.ssq += (uint64_t) res; \ - } while (0); \ + atomic_fetch_add_explicit(&hz->stats.ssq, (new + old)*(new - old),\ + memory_order_relaxed); /* Expand hash if the chain length exceeds the threshold. */ static void hash_expand (struct hash *hash) @@ -428,6 +423,13 @@ DEFUN(show_hash_stats, long double ssq; // ssq casted to long double pthread_mutex_lock (&_hashes_mtx); + if (!_hashes) + { + pthread_mutex_unlock (&_hashes_mtx); + vty_outln (vty, "No hash tables in use."); + return CMD_SUCCESS; + } + for (ALL_LIST_ELEMENTS_RO (_hashes, ln, h)) { if (!h->name) @@ -482,6 +484,5 @@ DEFUN(show_hash_stats, void hash_cmd_init () { - _hashes = list_new(); install_element (ENABLE_NODE, &show_hash_stats_cmd); } diff --git a/lib/hash.h b/lib/hash.h index 01d2b1ddc..3b2671afa 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -53,9 +53,9 @@ struct hash_backet struct hashstats { /* number of empty hash buckets */ - _Atomic int empty; + _Atomic uint_fast32_t empty; /* sum of squares of bucket length */ - _Atomic uint64_t ssq; + _Atomic uint_fast32_t ssq; }; struct hash @@ -693,7 +693,7 @@ DEFUN (interface, vty_out (vty, "%% Interface name %s is invalid: length exceeds " "%d characters\n", ifname, INTERFACE_NAMSIZ); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /*Pending: need proper vrf name based lookup/(possible creation of VRF) @@ -710,7 +710,7 @@ DEFUN (interface, if (!ifp) { vty_out (vty, "%% interface %s not in %s\n", ifname, vrfname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } VTY_PUSH_CONTEXT (INTERFACE_NODE, ifp); @@ -740,13 +740,13 @@ DEFUN_NOSH (no_interface, if (ifp == NULL) { vty_out (vty, "%% Interface %s does not exist\n", ifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) { vty_out (vty, "%% Only inactive interfaces can be deleted\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_delete(ifp); diff --git a/lib/if_rmap.c b/lib/if_rmap.c index 49f9da524..a0c40d5af 100644 --- a/lib/if_rmap.c +++ b/lib/if_rmap.c @@ -229,7 +229,7 @@ DEFUN (if_rmap, else { vty_out (vty, "route-map direction must be [in|out]\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_rmap_set (argv[idx_ifname]->arg, type, argv[idx_rmap_name]->arg); @@ -260,14 +260,14 @@ DEFUN (no_if_rmap, else { vty_out (vty, "route-map direction must be [in|out]\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = if_rmap_unset (argv[idx_ifname]->arg, type, argv[idx_routemap_name]->arg); if (! ret) { vty_out (vty, "route-map doesn't exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } diff --git a/lib/keychain.c b/lib/keychain.c index 9b7b0877e..f768933b7 100644 --- a/lib/keychain.c +++ b/lib/keychain.c @@ -272,7 +272,7 @@ DEFUN (no_key_chain, if (! keychain) { vty_out (vty, "Can't find keychain %s\n", argv[idx_word]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } keychain_delete (keychain); @@ -315,7 +315,7 @@ DEFUN (no_key, if (! key) { vty_out (vty, "Can't find key %d\n", index); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } key_delete (keychain, key); @@ -478,20 +478,20 @@ key_lifetime_set (struct vty *vty, struct key_range *krange, if (time_start < 0) { vty_out (vty, "Malformed time value\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } time_end = key_str2time (etime_str, eday_str, emonth_str, eyear_str); if (time_end < 0) { vty_out (vty, "Malformed time value\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (time_end <= time_start) { vty_out (vty, "Expire time is not later than start time\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } krange->start = time_start; @@ -513,7 +513,7 @@ key_lifetime_duration_set (struct vty *vty, struct key_range *krange, if (time_start < 0) { vty_out (vty, "Malformed time value\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } krange->start = time_start; @@ -535,7 +535,7 @@ key_lifetime_infinite_set (struct vty *vty, struct key_range *krange, if (time_start < 0) { vty_out (vty, "Malformed time value\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } krange->start = time_start; diff --git a/lib/module.c b/lib/module.c index c7dd5538c..140fd87b9 100644 --- a/lib/module.c +++ b/lib/module.c @@ -110,7 +110,7 @@ struct frrmod_runtime *frrmod_load(const char *spec, dlclose(handle); if (err) snprintf(err, err_len, - "\"%s\" is not a Quagga module: %s", + "\"%s\" is not an FRR module: %s", name, dlerror()); return NULL; } @@ -317,7 +317,7 @@ DEFUN_NOSH (ns_netns, char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg); if (!pathname) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ns_id = strtoul (argv[idx_number]->arg, NULL, 10); ns = ns_get (ns_id); @@ -326,7 +326,7 @@ DEFUN_NOSH (ns_netns, { vty_out (vty, "NS %u is already configured with NETNS %s\n", ns->ns_id, ns->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!ns->name) @@ -336,7 +336,7 @@ DEFUN_NOSH (ns_netns, { vty_out (vty, "Can not associate NS %u with NETNS %s\n", ns->ns_id, ns->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -358,7 +358,7 @@ DEFUN (no_ns_netns, char *pathname = ns_netns_pathname (vty, argv[idx_name]->arg); if (!pathname) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ns_id = strtoul(argv[idx_number]->arg, NULL, 10); ns = ns_lookup (ns_id); @@ -372,7 +372,7 @@ DEFUN (no_ns_netns, if (ns->name && strcmp (ns->name, pathname) != 0) { vty_out (vty, "Incorrect NETNS file name\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ns_disable (ns); diff --git a/lib/plist.c b/lib/plist.c index 0c04b6247..96c60a489 100644 --- a/lib/plist.c +++ b/lib/plist.c @@ -884,7 +884,7 @@ vty_invalid_prefix_range (struct vty *vty, const char *prefix) { vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value\n", prefix); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } static int @@ -921,7 +921,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, else { vty_out (vty, "%% prefix type must be permit or deny\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* "any" is special token for matching any IPv4 addresses. */ @@ -941,7 +941,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { vty_out (vty, "%% Malformed IPv4 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make a copy to verify prefix matches mask length */ @@ -963,7 +963,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { vty_out (vty, "%% Malformed IPv6 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* make a copy to verify prefix matches mask length */ @@ -974,7 +974,7 @@ vty_prefix_list_install (struct vty *vty, afi_t afi, const char *name, case AFI_L2VPN: default: vty_out (vty, "%% Unrecognized AFI (%d)\n", afi); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; break; } @@ -1043,7 +1043,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (! plist) { vty_out (vty, "%% Can't find specified prefix-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Only prefix-list name specified, delete the entire prefix-list. */ @@ -1058,7 +1058,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if ((typestr == NULL) || (prefix == NULL)) { vty_out (vty, "%% Both prefix and type required\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check sequence number. */ @@ -1079,7 +1079,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, else { vty_out (vty, "%% prefix type must be permit or deny\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* "any" is special token for matching any IPv4 addresses. */ @@ -1097,7 +1097,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { vty_out (vty, "%% Malformed IPv4 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } else if (afi == AFI_IP6) @@ -1114,7 +1114,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (ret <= 0) { vty_out (vty, "%% Malformed IPv6 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1124,7 +1124,7 @@ vty_prefix_list_uninstall (struct vty *vty, afi_t afi, const char *name, if (pentry == NULL) { vty_out (vty, "%% Can't find specified prefix-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Install new filter to the access_list. */ @@ -1142,7 +1142,7 @@ vty_prefix_list_desc_unset (struct vty *vty, afi_t afi, const char *name) if (! plist) { vty_out (vty, "%% Can't find specified prefix-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (plist->desc) @@ -1944,18 +1944,18 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp, /* ge and le value check */ if (orfp->ge && orfp->ge <= orfp->p.prefixlen) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (orfp->le && orfp->le <= orfp->p.prefixlen) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (orfp->le && orfp->ge > orfp->le) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (orfp->ge && orfp->le == (afi == AFI_IP ? 32 : 128)) orfp->le = 0; plist = prefix_list_get (afi, 1, name); if (! plist) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (set) { @@ -1966,7 +1966,7 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp, if (prefix_entry_dup_check (plist, pentry)) { prefix_list_entry_free (pentry); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } prefix_list_entry_add (plist, pentry); @@ -1978,7 +1978,7 @@ prefix_bgp_orf_set (char *name, afi_t afi, struct orf_prefix *orfp, orfp->seq, orfp->le, orfp->ge); if (! pentry) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; prefix_list_entry_delete (plist, pentry, 1); } diff --git a/lib/routemap.c b/lib/routemap.c index 5e5f804bf..9ceaa1115 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -522,11 +522,11 @@ generic_match_add (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -579,7 +579,7 @@ generic_match_delete (struct vty *vty, struct route_map_index *index, XFREE(MTYPE_ROUTE_MAP_RULE, dep_name); if (rmap_name) XFREE(MTYPE_ROUTE_MAP_NAME, rmap_name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (type != RMAP_EVENT_MATCH_DELETED && dep_name) @@ -606,11 +606,11 @@ generic_set_add (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } return CMD_SUCCESS; @@ -629,11 +629,11 @@ generic_set_delete (struct vty *vty, struct route_map_index *index, { case RMAP_RULE_MISSING: vty_out (vty, "%% [%s] Can't find rule.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% [%s] Argument form is unsupported or malformed.\n", frr_protonameinst); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } return CMD_SUCCESS; @@ -2360,14 +2360,14 @@ DEFUN (set_ip_nexthop, if (ret < 0) { vty_out (vty, "%% Malformed nexthop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (su.sin.sin_addr.s_addr == 0 || IPV4_CLASS_DE(su.sin.sin_addr.s_addr)) { vty_out (vty, "%% nexthop address cannot be 0.0.0.0, multicast or reserved\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rmap_match_set_hook.set_ip_nexthop) @@ -2417,12 +2417,12 @@ DEFUN (set_ipv6_nexthop_local, if (!ret) { vty_out (vty, "%% Malformed nexthop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!IN6_IS_ADDR_LINKLOCAL(&addr)) { vty_out (vty, "%% Invalid link-local nexthop address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (rmap_match_set_hook.set_ipv6_nexthop_local) @@ -2578,7 +2578,7 @@ DEFUN (no_route_map_all, if (map == NULL) { vty_out (vty, "%% Could not find route-map %s\n", mapname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } route_map_delete (map); @@ -2613,7 +2613,7 @@ DEFUN (no_route_map, if (map == NULL) { vty_out (vty, "%% Could not find route-map %s\n", mapname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Lookup route map index. */ @@ -2622,7 +2622,7 @@ DEFUN (no_route_map, { vty_out (vty, "%% Could not find route-map entry %s %s\n", mapname, prefstr); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Delete index from route map. */ @@ -2649,7 +2649,7 @@ DEFUN (rmap_onmatch_next, { /* Under a deny clause, match means it's finished. No need to set next */ vty_out (vty,"on-match next not supported under route-map deny\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } index->exitpolicy = RMAP_NEXT; } @@ -2690,7 +2690,7 @@ DEFUN (rmap_onmatch_goto, { /* Under a deny clause, match means it's finished. No need to go anywhere */ vty_out (vty,"on-match goto not supported under route-map deny\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (num) @@ -2702,7 +2702,7 @@ DEFUN (rmap_onmatch_goto, { /* Can't allow you to do that, Dave */ vty_out (vty, "can't jump backwards in route-maps\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } else { diff --git a/lib/smux.c b/lib/smux.c index 64b406bd6..d7d99cc8a 100644 --- a/lib/smux.c +++ b/lib/smux.c @@ -1279,7 +1279,7 @@ smux_peer_oid (struct vty *vty, const char *oid_str, const char *passwd_str) if (ret != 0) { vty_out (vty, "object ID malformed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (smux_oid) @@ -1339,7 +1339,7 @@ DEFUN (smux_peer, return CMD_SUCCESS; } else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (smux_peer_password, @@ -1357,7 +1357,7 @@ DEFUN (smux_peer_password, return CMD_SUCCESS; } else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_smux_peer, diff --git a/lib/thread.c b/lib/thread.c index 710ecc2a0..2c87c099d 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -564,6 +564,12 @@ thread_master_free_unused (struct thread_master *m) void thread_master_free (struct thread_master *m) { + pthread_mutex_lock (&masters_mtx); + { + listnode_delete (masters, m); + } + pthread_mutex_unlock (&masters_mtx); + thread_array_free (m, m->read); thread_array_free (m, m->write); thread_queue_free (m, m->timer); @@ -476,7 +476,7 @@ DEFUN_NOSH (vrf, vty_out (vty, "%% VRF name %s is invalid: length exceeds " "%d characters\n", vrfname, VRF_NAMSIZ); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vrfp = vrf_get (VRF_UNKNOWN, vrfname); @@ -502,13 +502,13 @@ DEFUN_NOSH (no_vrf, if (vrfp == NULL) { vty_out (vty, "%% VRF %s does not exist\n", vrfname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (CHECK_FLAG (vrfp->status, VRF_ACTIVE)) { vty_out (vty, "%% Only inactive VRFs can be deleted\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vrf_delete(vrfp); @@ -2202,7 +2202,7 @@ vtysh_read (struct thread *thread) if (ret == CMD_SUSPEND) break; - /* warning: watchquagga hardcodes this result write */ + /* warning: watchfrr hardcodes this result write */ header[3] = ret; buffer_put(vty->obuf, header, 4); @@ -2801,7 +2801,7 @@ DEFUN (no_vty_access_class, if (! vty_accesslist_name || (argc == 3 && strcmp(vty_accesslist_name, accesslist))) { vty_out (vty,"Access-class is not currently applied to vty\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } XFREE(MTYPE_VTY, vty_accesslist_name); @@ -2844,7 +2844,7 @@ DEFUN (no_vty_ipv6_access_class, (argc == 4 && strcmp(vty_ipv6_accesslist_name, accesslist))) { vty_out (vty,"IPv6 access-class is not currently applied to vty\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } XFREE(MTYPE_VTY, vty_ipv6_accesslist_name); diff --git a/lib/zebra.h b/lib/zebra.h index 901a49073..7f2609c12 100644 --- a/lib/zebra.h +++ b/lib/zebra.h @@ -126,7 +126,7 @@ typedef unsigned char u_int8_t; #define __APPLE_USE_RFC_3542 #endif -#include "lib/openbsd-tree.h" +#include "openbsd-tree.h" #include <netinet/in.h> #include <netinet/in_systm.h> diff --git a/nhrpd/nhrp_vty.c b/nhrpd/nhrp_vty.c index 2c680d108..af7fb0a50 100644 --- a/nhrpd/nhrp_vty.c +++ b/nhrpd/nhrp_vty.c @@ -85,7 +85,7 @@ static int nhrp_vty_return(struct vty *vty, int ret) vty_out (vty, "%% %s\n", str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED;; } static int toggle_flag( @@ -105,7 +105,7 @@ static int toggle_flag( } vty_out (vty, "%% Invalid value %s\n", name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED;; } #ifndef NO_DEBUG diff --git a/ospf6d/ospf6_area.c b/ospf6d/ospf6_area.c index 102eb5e0e..8e6408bf4 100644 --- a/ospf6d/ospf6_area.c +++ b/ospf6d/ospf6_area.c @@ -969,7 +969,7 @@ DEFUN (ospf6_area_stub, if (!ospf6_area_stub_set (ospf6, area)) { vty_out (vty,"First deconfigure all virtual link through this area\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf6_area_no_summary_unset (ospf6, area); @@ -994,7 +994,7 @@ DEFUN (ospf6_area_stub_no_summary, if (!ospf6_area_stub_set (ospf6, area)) { vty_out (vty,"First deconfigure all virtual link through this area\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf6_area_no_summary_set (ospf6, area); diff --git a/ospf6d/ospf6_asbr.c b/ospf6d/ospf6_asbr.c index 038ac53d6..867d8bb64 100644 --- a/ospf6d/ospf6_asbr.c +++ b/ospf6d/ospf6_asbr.c @@ -694,7 +694,7 @@ DEFUN (ospf6_redistribute, char *proto = argv[argc - 1]->text; type = proto_redistnum(AFI_IP6, proto); if (type < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ospf6_asbr_redistribute_unset (type); ospf6_asbr_redistribute_set (type); @@ -716,7 +716,7 @@ DEFUN (ospf6_redistribute_routemap, char *proto = argv[idx_protocol]->text; type = proto_redistnum(AFI_IP6, proto); if (type < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ospf6_asbr_redistribute_unset (type); ospf6_asbr_routemap_set (type, argv[idx_word]->arg); @@ -739,7 +739,7 @@ DEFUN (no_ospf6_redistribute, char *proto = argv[idx_protocol]->text; type = proto_redistnum(AFI_IP6, proto); if (type < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ospf6_asbr_redistribute_unset (type); @@ -1090,7 +1090,7 @@ route_map_command_status (struct vty *vty, int ret) vty_out (vty, "OSPF6 route-map add set failed.\n"); break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* add "set metric-type" */ diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index adfc14879..d647b94df 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1137,7 +1137,7 @@ DEFUN (ipv6_ospf6_ifmtu, { vty_out (vty, "%s's ospf6 ifmtu cannot go beyond physical mtu (%d)\n", ifp->name, ifp->mtu6); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (oi->ifmtu < ifmtu) @@ -1241,7 +1241,7 @@ DEFUN (ipv6_ospf6_cost, if (lcost > UINT32_MAX) { vty_out (vty, "Cost %ld is out of range\n", lcost); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (oi->cost == lcost) @@ -1298,7 +1298,7 @@ DEFUN (auto_cost_reference_bandwidth, if (refbw < 1 || refbw > 4294967) { vty_out (vty, "reference-bandwidth value is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* If reference bandwidth is changed. */ diff --git a/ospf6d/ospf6_zebra.c b/ospf6d/ospf6_zebra.c index b609b4bb2..ddd2f3f1b 100644 --- a/ospf6d/ospf6_zebra.c +++ b/ospf6d/ospf6_zebra.c @@ -683,7 +683,7 @@ ospf6_distance_set (struct vty *vty, struct ospf6 *o, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } distance = atoi (distance_str); @@ -731,14 +731,14 @@ ospf6_distance_unset (struct vty *vty, struct ospf6 *o, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (o->distance_table, (struct prefix *) &p); if (!rn) { vty_out (vty, "Cant't find specified prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } odistance = rn->info; diff --git a/ospfd/ospf_ri.c b/ospfd/ospf_ri.c index bb745d0c2..0f1ef35e4 100644 --- a/ospfd/ospf_ri.c +++ b/ospfd/ospf_ri.c @@ -1183,7 +1183,7 @@ DEFUN (router_info, { vty_out (vty, "%% specified Area ID %s is invalid\n", area); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } scope = OSPF_OPAQUE_AREA_LSA; } @@ -1197,7 +1197,7 @@ DEFUN (router_info, if ((ospf_router_info_register (scope)) != 0) { zlog_warn ("Enable to register Router Information callbacks. Abort!"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } OspfRI.status = enabled; @@ -1274,12 +1274,12 @@ DEFUN (pce_address, struct ospf_pce_info *pi = &OspfRI.pce_info; if (!ospf_ri_enabled (vty)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (!inet_aton (argv[idx_ipv4]->arg, &value)) { vty_out (vty, "Please specify PCE Address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ntohs (pi->pce_address.header.type) == 0 @@ -1326,12 +1326,12 @@ DEFUN (pce_path_scope, struct ospf_pce_info *pi = &OspfRI.pce_info; if (!ospf_ri_enabled (vty)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &scope) != 1) { vty_out (vty, "pce_path_scope: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ntohl (pi->pce_scope.header.type) == 0 || scope != pi->pce_scope.value) @@ -1380,12 +1380,12 @@ DEFUN (pce_domain, struct ri_pce_subtlv_domain *domain; if (!ospf_ri_enabled (vty)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { vty_out (vty, "pce_domain: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check if the domain is not already in the domain list */ @@ -1422,7 +1422,7 @@ DEFUN (no_pce_domain, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { vty_out (vty, "no_pce_domain: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Unset corresponding PCE domain */ @@ -1451,12 +1451,12 @@ DEFUN (pce_neigbhor, struct ri_pce_subtlv_neighbor *neighbor; if (!ospf_ri_enabled (vty)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { vty_out (vty, "pce_neighbor: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check if the domain is not already in the domain list */ @@ -1493,7 +1493,7 @@ DEFUN (no_pce_neighbor, if (sscanf (argv[idx_number]->arg, "%d", &as) != 1) { vty_out (vty, "no_pce_neighbor: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Unset corresponding PCE domain */ @@ -1519,12 +1519,12 @@ DEFUN (pce_cap_flag, struct ospf_pce_info *pce = &OspfRI.pce_info; if (!ospf_ri_enabled (vty)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (sscanf (argv[idx_bitpattern]->arg, "0x%x", &cap) != 1) { vty_out (vty, "pce_cap_flag: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ntohl (pce->pce_cap_flag.header.type) == 0 diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 89fd7971f..f6387b759 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -151,7 +151,7 @@ DEFUN_NOSH (router_ospf, if (!ospf) { vty_out (vty, "There isn't active ospf instance \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc > 2) @@ -214,7 +214,7 @@ DEFUN (ospf_router_id, if (!ret) { vty_out (vty, "Please specify Router ID by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf->router_id_static = router_id; @@ -249,7 +249,7 @@ DEFUN_HIDDEN (ospf_router_id_old, if (!ret) { vty_out (vty, "Please specify Router ID by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf->router_id_static = router_id; @@ -390,7 +390,7 @@ DEFUN (ospf_passive_interface, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -459,7 +459,7 @@ DEFUN (no_ospf_passive_interface, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -509,13 +509,13 @@ DEFUN (ospf_network_area, if (ospf->instance) { vty_out (vty, "The network command is not supported in multi-instance ospf\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ospf->if_ospf_cli_count > 0) { vty_out (vty, "Please remove all ip ospf area x.x.x.x commands first.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get network prefix and Area ID. */ @@ -526,7 +526,7 @@ DEFUN (ospf_network_area, if (ret == 0) { vty_out (vty, "There is already same network statement.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -552,7 +552,7 @@ DEFUN (no_ospf_network_area, if (ospf->instance) { vty_out (vty, "The network command is not supported in multi-instance ospf\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get network prefix and Area ID. */ @@ -563,7 +563,7 @@ DEFUN (no_ospf_network_area, if (ret == 0) { vty_out (vty, "Can't find specified network area configuration.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -868,7 +868,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, { vty_out (vty, "OSPF: Key %d already exists\n", vl_config->crypto_key_id); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ck = ospf_crypt_key_new (); ck->key_id = vl_config->crypto_key_id; @@ -886,7 +886,7 @@ ospf_vl_set_security (struct ospf_vl_data *vl_data, { vty_out (vty, "OSPF: Key %d does not exist\n", vl_config->crypto_key_id); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf_crypt_key_delete (IF_DEF_PARAMS (ifp)->auth_crypt, vl_config->crypto_key_id); @@ -940,7 +940,7 @@ ospf_vl_set (struct ospf *ospf, struct ospf_vl_config_data *vl_config) vl_data = ospf_find_vl_data (ospf, vl_config); if (!vl_data) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* Process this one first as it can have a fatal result, which can only logically occur if the virtual link exists already @@ -1029,14 +1029,14 @@ DEFUN (ospf_area_vlink, if (ret < 0) { vty_out (vty, "OSPF area ID is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (argv[idx_ipv4]->arg, &vl_config.vl_peer); if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc <=4) @@ -1097,7 +1097,7 @@ DEFUN (ospf_area_vlink, { vl_config.crypto_key_id = strtol (argv[i]->arg, NULL, 10); if (vl_config.crypto_key_id < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; i++; if (i < argc) { @@ -1148,21 +1148,21 @@ DEFUN (no_ospf_area_vlink, if (ret < 0) { vty_out (vty, "OSPF area ID is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } area = ospf_area_lookup_by_area_id (ospf, vl_config.area_id); if (!area) { vty_out (vty, "Area does not exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (argv[idx_ipv4]->arg, &vl_config.vl_peer); if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc <=5) @@ -1212,11 +1212,11 @@ DEFUN (no_ospf_area_vlink, { vl_config.crypto_key_id = strtol (argv[i]->arg, NULL, 10); if (vl_config.crypto_key_id < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; vl_config.md5_key = NULL; } else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; break; } @@ -1247,14 +1247,14 @@ DEFUN (ospf_area_vlink_intervals, if (ret < 0) { vty_out (vty, "OSPF area ID is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (router_id, &vl_config.vl_peer); if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } for (int idx = 4; idx < argc; idx++) @@ -1293,14 +1293,14 @@ DEFUN (no_ospf_area_vlink_intervals, if (ret < 0) { vty_out (vty, "OSPF area ID is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = inet_aton (router_id, &vl_config.vl_peer); if (! ret) { vty_out (vty, "Please specify valid Router ID as a.b.c.d\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } for (int idx = 5; idx < argc; idx++) @@ -1350,7 +1350,7 @@ DEFUN (ospf_area_shortcut, else if (strncmp (argv[idx_enable_disable]->arg, "e", 1) == 0) mode = OSPF_SHORTCUT_ENABLE; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ospf_area_shortcut_set (ospf, area, mode); @@ -1410,7 +1410,7 @@ DEFUN (ospf_area_stub, if (ret == 0) { vty_out (vty, "First deconfigure all virtual link through this area\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf_area_no_summary_unset (ospf, area_id); @@ -1439,7 +1439,7 @@ DEFUN (ospf_area_stub_no_summary, if (ret == 0) { vty_out (vty, "%% Area cannot be stub as it contains a virtual link\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf_area_no_summary_set (ospf, area_id); @@ -1505,7 +1505,7 @@ ospf_area_nssa_cmd_handler (struct vty *vty, int argc, struct cmd_token **argv, if (ret == 0) { vty_out (vty, "%% Area cannot be nssa as it contains a virtual link\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argc > 3) @@ -1644,7 +1644,7 @@ DEFUN (ospf_area_default_cost, if (area->external_routing == OSPF_AREA_DEFAULT) { vty_out (vty, "The area is neither stub, nor NSSA\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } area->default_cost = cost; @@ -1687,7 +1687,7 @@ DEFUN (no_ospf_area_default_cost, if (area->external_routing == OSPF_AREA_DEFAULT) { vty_out (vty, "The area is neither stub, nor NSSA\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } area->default_cost = 1; @@ -2016,7 +2016,7 @@ DEFUN (ospf_abr_type, else if (strncmp (argv[idx_vendor]->arg, "st", 2) == 0) abr_type = OSPF_ABR_STAND; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* If ABR type value is changed, schedule ABR task. */ if (ospf->abr_type != abr_type) @@ -2052,7 +2052,7 @@ DEFUN (no_ospf_abr_type, else if (strncmp (argv[idx_vendor]->arg, "st", 2) == 0) abr_type = OSPF_ABR_STAND; else - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; /* If ABR type value is changed, schedule ABR task. */ if (ospf->abr_type == abr_type) @@ -2191,7 +2191,7 @@ DEFUN (ospf_timers_min_ls_interval, if (argc < 5) { vty_out (vty, "Insufficient arguments\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } interval = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2233,7 +2233,7 @@ DEFUN (ospf_timers_min_ls_arrival, if (argc < 4) { vty_out (vty, "Insufficient arguments\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } arrival = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2278,7 +2278,7 @@ DEFUN (ospf_timers_throttle_spf, if (argc < 6) { vty_out (vty, "Insufficient arguments\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } delay = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2321,7 +2321,7 @@ DEFUN (ospf_timers_lsa, if (argc < 4) { vty_out (vty, "Insufficient number of arguments\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } minarrival = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2535,7 +2535,7 @@ DEFUN (ospf_auto_cost_reference_bandwidth, if (refbw < 1 || refbw > 4294967) { vty_out (vty, "reference-bandwidth value is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* If reference bandwidth is changed. */ @@ -2594,7 +2594,7 @@ DEFUN (ospf_write_multiplier, if (write_oi_count < 1 || write_oi_count > 100) { vty_out (vty, "write-multiplier value is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf->write_oi_count = write_oi_count; @@ -5493,7 +5493,7 @@ DEFUN (ip_ospf_authentication_args, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -5517,7 +5517,7 @@ DEFUN (ip_ospf_authentication_args, } vty_out (vty, "You shouldn't get here!\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (ip_ospf_authentication, @@ -5542,7 +5542,7 @@ DEFUN (ip_ospf_authentication, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -5583,14 +5583,14 @@ DEFUN (no_ip_ospf_authentication_args, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); if (params == NULL) { vty_out (vty, "Ip Address specified is unknown\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params->auth_type = OSPF_AUTH_NOTSET; UNSET_IF_PARAM (params, auth_type); @@ -5613,7 +5613,7 @@ DEFUN (no_ip_ospf_authentication_args, else { vty_out (vty, "Unexpected input encountered\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* * Here we have a case where the user has entered @@ -5672,14 +5672,14 @@ DEFUN (no_ip_ospf_authentication, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); if (params == NULL) { vty_out (vty, "Ip Address specified is unknown\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params->auth_type = OSPF_AUTH_NOTSET; @@ -5751,7 +5751,7 @@ DEFUN (ip_ospf_authentication_key, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -5796,7 +5796,7 @@ DEFUN (no_ip_ospf_authentication_key, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -5857,7 +5857,7 @@ DEFUN (ip_ospf_message_digest_key, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -5868,7 +5868,7 @@ DEFUN (ip_ospf_message_digest_key, if (ospf_crypt_key_lookup (params->auth_crypt, key_id) != NULL) { vty_out (vty, "OSPF: Key %d already exists\n", key_id); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ck = ospf_crypt_key_new (); @@ -5923,7 +5923,7 @@ DEFUN (no_ip_ospf_message_digest_key, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -5936,7 +5936,7 @@ DEFUN (no_ip_ospf_message_digest_key, if (ck == NULL) { vty_out (vty, "OSPF: Key %d does not exist\n", key_id); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf_crypt_key_delete (params->auth_crypt, key_id); @@ -5990,7 +5990,7 @@ DEFUN (ip_ospf_cost, if(!inet_aton(ifaddr, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6044,7 +6044,7 @@ DEFUN (no_ip_ospf_cost, if (!inet_aton(ifaddr, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6115,7 +6115,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6141,7 +6141,7 @@ ospf_vty_dead_interval_set (struct vty *vty, const char *interval_str, else { vty_out (vty, "Please specify dead-interval or hello-multiplier\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } SET_IF_PARAM (params, v_wait); @@ -6240,7 +6240,7 @@ DEFUN (no_ip_ospf_dead_interval, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6318,7 +6318,7 @@ DEFUN (ip_ospf_hello_interval, if(!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6364,7 +6364,7 @@ DEFUN (no_ip_ospf_hello_interval, if(!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6415,7 +6415,7 @@ DEFUN (ip_ospf_network, if (old_type == OSPF_IFTYPE_LOOPBACK) { vty_out (vty, "This is a loopback interface. Can't set network type.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (argv_find (argv, argc, "broadcast", &idx)) @@ -6543,7 +6543,7 @@ DEFUN (ip_ospf_priority, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6604,7 +6604,7 @@ DEFUN (no_ip_ospf_priority, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6674,7 +6674,7 @@ DEFUN (ip_ospf_retransmit_interval, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6720,7 +6720,7 @@ DEFUN (no_ip_ospf_retransmit_interval, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6776,7 +6776,7 @@ DEFUN (ip_ospf_transmit_delay, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); @@ -6821,7 +6821,7 @@ DEFUN (no_ip_ospf_transmit_delay, if (!inet_aton(argv[idx]->arg, &addr)) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_lookup_if_params (ifp, addr); @@ -6898,20 +6898,20 @@ DEFUN (ip_ospf_area, if (ret < 0) { vty_out (vty, "Please specify area by A.B.C.D|<0-4294967295>\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (memcmp (ifp->name, "VLINK", 5) == 0) { vty_out (vty, "Cannot enable OSPF on a virtual link.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = IF_DEF_PARAMS (ifp); - if (OSPF_IF_PARAM_CONFIGURED(params, if_area)) + if (OSPF_IF_PARAM_CONFIGURED(params, if_area) && !IPV4_ADDR_SAME(¶ms->if_area, &area_id)) { vty_out (vty, "Must remove previous area config before changing ospf area \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } // Check if we have an address arg and proccess it @@ -6923,7 +6923,7 @@ DEFUN (ip_ospf_area, { vty_out (vty, "Must remove previous area/address config before changing ospf area"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ospf_if_update_params ((ifp), (addr)); } @@ -6933,7 +6933,7 @@ DEFUN (ip_ospf_area, if (rn->info != NULL) { vty_out (vty, "Please remove all network commands first.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -6986,7 +6986,7 @@ DEFUN (no_ip_ospf_area, if (!OSPF_IF_PARAM_CONFIGURED(params, if_area)) { vty_out (vty, "Can't find specified interface area configuration.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } UNSET_IF_PARAM (params, if_area); @@ -7027,19 +7027,19 @@ DEFUN (ospf_redistribute_source, /* Get distribute source. */ source = proto_redistnum(AFI_IP, argv[idx_protocol]->text); if (source < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; red = ospf_redist_add(ospf, source, 0); /* Get metric value. */ if (argv_find (argv, argc, "(0-16777214)", &idx)) { if (!str2metric (argv[idx]->arg, &metric)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get metric type. */ else if (argv_find (argv, argc, "(1-2)", &idx)) { if (!str2metric_type (argv[idx]->arg, &type)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get route-map */ else if (argv_find (argv, argc, "WORD", &idx)) { @@ -7071,7 +7071,7 @@ DEFUN (no_ospf_redistribute_source, source = proto_redistnum(AFI_IP, argv[idx_protocol]->text); if (source < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; red = ospf_redist_lookup(ospf, source, 0); if (!red) @@ -7118,25 +7118,25 @@ DEFUN (ospf_redistribute_instance_source, if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance) { vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance)) { vty_out (vty, "Same instance OSPF redistribution not allowed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get metric value. */ if (argv_find (argv, argc, "metric", &idx)) if (!str2metric (argv[idx+1]->arg, &metric)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; idx = 3; /* Get metric type. */ if (argv_find (argv, argc, "metric-type", &idx)) if (!str2metric_type (argv[idx+1]->arg, &type)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; red = ospf_redist_add(ospf, source, instance); @@ -7181,13 +7181,13 @@ DEFUN (no_ospf_redistribute_instance_source, if ((source == ZEBRA_ROUTE_OSPF) && !ospf->instance) { vty_out (vty, "Instance redistribution in non-instanced OSPF not allowed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if ((source == ZEBRA_ROUTE_OSPF) && (ospf->instance == instance)) { vty_out (vty, "Same instance OSPF redistribution not allowed\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } red = ospf_redist_lookup(ospf, source, instance); @@ -7215,7 +7215,7 @@ DEFUN (ospf_distribute_list_out, /* Get distribute source. */ source = proto_redistnum(AFI_IP, proto); if (source < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return ospf_distribute_list_out_set (ospf, source, argv[idx_word]->arg); } @@ -7236,7 +7236,7 @@ DEFUN (no_ospf_distribute_list_out, char *proto = argv[argc - 1]->text; source = proto_redistnum(AFI_IP, proto); if (source < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; return ospf_distribute_list_out_unset (ospf, source, argv[idx_word]->arg); } @@ -7270,12 +7270,12 @@ DEFUN (ospf_default_information_originate, /* Get metric value */ else if (argv_find (argv, argc, "(0-16777214)", &idx)) { if (!str2metric (argv[idx]->arg, &metric)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get metric type. */ else if (argv_find (argv, argc, "(1-2)", &idx)) { if (!str2metric_type (argv[idx]->arg, &type)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get route-map */ else if (argv_find (argv, argc, "WORD", &idx)) @@ -7337,7 +7337,7 @@ DEFUN (ospf_default_metric, int metric = -1; if (!str2metric (argv[idx_number]->arg, &metric)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; ospf->default_metric = metric; @@ -7549,7 +7549,7 @@ DEFUN (ip_ospf_mtu_ignore, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); ospf_if_update_params (ifp, addr); @@ -7591,7 +7591,7 @@ DEFUN (no_ip_ospf_mtu_ignore, if (!ret) { vty_out (vty, "Please specify interface address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } params = ospf_get_if_params (ifp, addr); ospf_if_update_params (ifp, addr); @@ -7680,7 +7680,7 @@ DEFUN (ospf_max_metric_router_lsa_startup, if (argc != 1) { vty_out (vty, "%% Must supply stub-router period"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } seconds = strtoul(argv[idx_number]->arg, NULL, 10); @@ -7736,7 +7736,7 @@ DEFUN (ospf_max_metric_router_lsa_shutdown, if (argc != 1) { vty_out (vty, "%% Must supply stub-router shutdown period"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } seconds = strtoul(argv[idx_number]->arg, NULL, 10); diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c index fa628f81e..e262bd8aa 100644 --- a/ospfd/ospf_zebra.c +++ b/ospfd/ospf_zebra.c @@ -1446,7 +1446,7 @@ ospf_distance_set (struct vty *vty, struct ospf *ospf, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } distance = atoi (distance_str); @@ -1494,14 +1494,14 @@ ospf_distance_unset (struct vty *vty, struct ospf *ospf, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (ospf->distance_table, (struct prefix *) &p); if (!rn) { vty_out (vty, "Can't find specified prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } odistance = rn->info; diff --git a/pimd/pim_cmd.c b/pimd/pim_cmd.c index 94f7d1534..88c43104c 100644 --- a/pimd/pim_cmd.c +++ b/pimd/pim_cmd.c @@ -3754,45 +3754,45 @@ pim_rp_cmd_worker (struct vty *vty, const char *rp, const char *group, const cha if (result == PIM_MALLOC_FAIL) { vty_out (vty, "%% Out of memory\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_BAD_ADDRESS) { vty_out (vty, "%% Bad group address specified: %s\n", group); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_BAD_ADDRESS) { vty_out (vty, "%% Bad RP address specified: %s\n", rp); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_NO_PATH) { vty_out (vty, "%% No Path to RP address specified: %s\n", rp); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_OVERLAP) { vty_out (vty, "%% Group range specified cannot overlap\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_GROUP_PFXLIST_OVERLAP) { vty_out (vty, "%% This group is already covered by a RP prefix-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_PFXLIST_IN_USE) { vty_out (vty, "%% The same prefix-list cannot be applied to multiple RPs\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4040,19 +4040,19 @@ pim_no_rp_cmd_worker (struct vty *vty, const char *rp, const char *group, if (result == PIM_GROUP_BAD_ADDRESS) { vty_out (vty, "%% Bad group address specified: %s\n", group); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_BAD_ADDRESS) { vty_out (vty, "%% Bad RP address specified: %s\n", rp); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (result == PIM_RP_NOT_FOUND) { vty_out (vty, "%% Unable to find specified RP\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4110,7 +4110,7 @@ pim_ssm_cmd_worker (struct vty *vty, const char *plist) vty_out (vty, "%% ssm range config failed\n"); } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (ip_pim_ssm_prefix_list, @@ -4155,7 +4155,7 @@ DEFUN (no_ip_pim_ssm_prefix_list_name, vty_out (vty, "%% pim ssm prefix-list %s doesn't exist\n", argv[0]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } static void @@ -4276,14 +4276,14 @@ DEFUN (ip_ssmpingd, if (result <= 0) { vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_ssmpingd_start(source_addr); if (result) { vty_out (vty, "%% Failure starting ssmpingd for source %s: %d\n", source_str, result); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4306,14 +4306,14 @@ DEFUN (no_ip_ssmpingd, if (result <= 0) { vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_ssmpingd_stop(source_addr); if (result) { vty_out (vty, "%% Failure stopping ssmpingd for source %s: %d\n", source_str, result); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4387,7 +4387,7 @@ pim_cmd_igmp_start (struct vty *vty, struct interface *ifp) { vty_out (vty, "Could not enable IGMP on interface %s\n", ifp->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } need_startup = 1; } @@ -4472,7 +4472,7 @@ DEFUN (interface_ip_igmp_join, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", group_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Source address */ @@ -4481,14 +4481,14 @@ DEFUN (interface_ip_igmp_join, if (result <= 0) { vty_out (vty, "Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_if_igmp_join_add(ifp, group_addr, source_addr); if (result) { vty_out (vty, "%% Failure joining IGMP group %s source %s on interface %s: %d\n", group_str, source_str, ifp->name, result); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4519,7 +4519,7 @@ DEFUN (interface_no_ip_igmp_join, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", group_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Source address */ @@ -4528,14 +4528,14 @@ DEFUN (interface_no_ip_igmp_join, if (result <= 0) { vty_out (vty, "Bad source address %s: errno=%d: %s\n", source_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_if_igmp_join_del(ifp, group_addr, source_addr); if (result) { vty_out (vty, "%% Failure leaving IGMP group %s source %s on interface %s: %d\n", group_str, source_str, ifp->name, result); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -4704,20 +4704,20 @@ DEFUN (interface_ip_igmp_query_interval, vty_out (vty, "General query interval %d lower than minimum %d\n", query_interval, IGMP_QUERY_INTERVAL_MIN); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (query_interval > IGMP_QUERY_INTERVAL_MAX) { vty_out (vty, "General query interval %d higher than maximum %d\n", query_interval, IGMP_QUERY_INTERVAL_MAX); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (query_interval_dsec <= pim_ifp->igmp_query_max_response_time_dsec) { vty_out (vty, "Can't set general query interval %d dsec <= query max response time %d dsec.\n", query_interval_dsec,pim_ifp->igmp_query_max_response_time_dsec); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } change_query_interval(pim_ifp, query_interval); @@ -4747,7 +4747,7 @@ DEFUN (interface_no_ip_igmp_query_interval, "Can't set default general query interval %d dsec <= query max response time %d dsec.\n", default_query_interval_dsec, pim_ifp->igmp_query_max_response_time_dsec); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } change_query_interval(pim_ifp, IGMP_GENERAL_QUERY_INTERVAL); @@ -4845,7 +4845,7 @@ DEFUN (interface_ip_igmp_query_max_response_time, vty_out (vty, "Can't set query max response time %d sec >= general query interval %d sec\n", query_max_response_time,pim_ifp->igmp_default_query_interval); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } change_query_max_response_time(pim_ifp, query_max_response_time); @@ -4905,7 +4905,7 @@ DEFUN_HIDDEN (interface_ip_igmp_query_max_response_time_dsec, vty_out (vty, "Can't set query max response time %d dsec >= general query interval %d dsec\n", query_max_response_time_dsec,default_query_interval_dsec); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } change_query_max_response_time(pim_ifp, query_max_response_time_dsec); @@ -4947,7 +4947,7 @@ DEFUN (interface_ip_pim_drprio, if (!pim_ifp) { vty_out (vty, "Please enable PIM on interface, first\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } old_dr_prio = pim_ifp->pim_dr_priority; @@ -4976,7 +4976,7 @@ DEFUN (interface_no_ip_pim_drprio, if (!pim_ifp) { vty_out (vty, "Pim not enabled on this interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pim_ifp->pim_dr_priority != PIM_DEFAULT_DR_PRIORITY) { @@ -5019,7 +5019,7 @@ DEFUN_HIDDEN (interface_ip_pim_ssm, if (!pim_cmd_interface_add(ifp)) { vty_out (vty, "Could not enable PIM SM on interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } vty_out(vty, "WARN: Enabled PIM SM on interface; configure PIM SSM " @@ -5037,7 +5037,7 @@ DEFUN (interface_ip_pim_sm, VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_add(ifp)) { vty_out (vty, "Could not enable PIM SM on interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } pim_if_create_pimreg(); @@ -5082,7 +5082,7 @@ DEFUN_HIDDEN (interface_no_ip_pim_ssm, VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_delete(ifp)) { vty_out (vty, "Unable to delete interface information\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5099,7 +5099,7 @@ DEFUN (interface_no_ip_pim_sm, VTY_DECLVAR_CONTEXT(interface, ifp); if (!pim_cmd_interface_delete(ifp)) { vty_out (vty, "Unable to delete interface information\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5128,7 +5128,7 @@ DEFUN (interface_ip_mroute, if (!oif) { vty_out (vty, "No such interface name %s\n", oifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } grp_str = argv[idx_ipv4]->arg; @@ -5136,14 +5136,14 @@ DEFUN (interface_ip_mroute, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_addr.s_addr = INADDR_ANY; if (pim_static_add(iif, oif, grp_addr, src_addr)) { vty_out (vty, "Failed to add route\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5175,7 +5175,7 @@ DEFUN (interface_ip_mroute_source, if (!oif) { vty_out (vty, "No such interface name %s\n", oifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } grp_str = argv[idx_ipv4]->arg; @@ -5183,7 +5183,7 @@ DEFUN (interface_ip_mroute_source, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_str = argv[idx_ipv4_2]->arg; @@ -5191,12 +5191,12 @@ DEFUN (interface_ip_mroute_source, if (result <= 0) { vty_out (vty, "Bad source address %s: errno=%d: %s\n", src_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pim_static_add(iif, oif, grp_addr, src_addr)) { vty_out (vty, "Failed to add route\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5226,7 +5226,7 @@ DEFUN (interface_no_ip_mroute, if (!oif) { vty_out (vty, "No such interface name %s\n", oifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } grp_str = argv[idx_ipv4]->arg; @@ -5234,14 +5234,14 @@ DEFUN (interface_no_ip_mroute, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_addr.s_addr = INADDR_ANY; if (pim_static_del(iif, oif, grp_addr, src_addr)) { vty_out (vty, "Failed to remove route\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5274,7 +5274,7 @@ DEFUN (interface_no_ip_mroute_source, if (!oif) { vty_out (vty, "No such interface name %s\n", oifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } grp_str = argv[idx_ipv4]->arg; @@ -5282,7 +5282,7 @@ DEFUN (interface_no_ip_mroute_source, if (result <= 0) { vty_out (vty, "Bad group address %s: errno=%d: %s\n", grp_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_str = argv[idx_ipv4_2]->arg; @@ -5290,12 +5290,12 @@ DEFUN (interface_no_ip_mroute_source, if (result <= 0) { vty_out (vty, "Bad source address %s: errno=%d: %s\n", src_str, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (pim_static_del(iif, oif, grp_addr, src_addr)) { vty_out (vty, "Failed to remove route\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -5320,7 +5320,7 @@ DEFUN (interface_ip_pim_hello, if (!pim_cmd_interface_add(ifp)) { vty_out (vty, "Could not enable PIM SM on interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -5350,7 +5350,7 @@ DEFUN (interface_no_ip_pim_hello, if (!pim_ifp) { vty_out (vty, "Pim not enabled on this interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } pim_ifp->pim_hello_period = PIM_DEFAULT_HELLO_PERIOD; @@ -5881,7 +5881,7 @@ interface_pim_use_src_cmd_worker(struct vty *vty, const char *source) if (result <= 0) { vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", source, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_update_source_set(ifp, source_addr); @@ -5898,7 +5898,7 @@ interface_pim_use_src_cmd_worker(struct vty *vty, const char *source) vty_out (vty, "%% Source set failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN (interface_pim_use_source, @@ -6021,14 +6021,14 @@ ip_msdp_peer_cmd_worker (struct vty *vty, const char *peer, const char *local) if (result <= 0) { vty_out (vty, "%% Bad peer address %s: errno=%d: %s\n", peer, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = inet_pton(AF_INET, local, &local_addr); if (result <= 0) { vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", local, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_msdp_peer_add(peer_addr, local_addr, "default", NULL/* mp_p */); @@ -6048,7 +6048,7 @@ ip_msdp_peer_cmd_worker (struct vty *vty, const char *peer, const char *local) vty_out (vty, "%% peer add failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN_HIDDEN (ip_msdp_peer, @@ -6074,7 +6074,7 @@ ip_no_msdp_peer_cmd_worker (struct vty *vty, const char *peer) if (result <= 0) { vty_out (vty, "%% Bad peer address %s: errno=%d: %s\n", peer, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_msdp_peer_del(peer_addr); @@ -6088,7 +6088,7 @@ ip_no_msdp_peer_cmd_worker (struct vty *vty, const char *peer) vty_out (vty, "%% peer del failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN_HIDDEN (no_ip_msdp_peer, @@ -6113,7 +6113,7 @@ ip_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const char if (result <= 0) { vty_out (vty, "%% Bad member address %s: errno=%d: %s\n", mbr, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_msdp_mg_mbr_add(mg, mbr_ip); @@ -6133,7 +6133,7 @@ ip_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const char vty_out (vty, "%% member add failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN (ip_msdp_mesh_group_member, @@ -6159,7 +6159,7 @@ ip_no_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const c if (result <= 0) { vty_out (vty, "%% Bad member address %s: errno=%d: %s\n", mbr, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_msdp_mg_mbr_del(mg, mbr_ip); @@ -6176,7 +6176,7 @@ ip_no_msdp_mesh_group_member_cmd_worker(struct vty *vty, const char *mg, const c vty_out (vty, "%% mesh-group member del failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN (no_ip_msdp_mesh_group_member, no_ip_msdp_mesh_group_member_cmd, @@ -6202,7 +6202,7 @@ ip_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg, const char if (result <= 0) { vty_out (vty, "%% Bad source address %s: errno=%d: %s\n", src, errno, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } result = pim_msdp_mg_src_add(mg, src_ip); @@ -6219,7 +6219,7 @@ ip_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg, const char vty_out (vty, "%% source add failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } @@ -6252,7 +6252,7 @@ ip_no_msdp_mesh_group_source_cmd_worker(struct vty *vty, const char *mg) vty_out (vty, "%% mesh-group source del failed\n"); } - return result?CMD_WARNING:CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } static int @@ -6271,7 +6271,7 @@ ip_no_msdp_mesh_group_cmd_worker(struct vty *vty, const char *mg) vty_out (vty, "%% mesh-group source del failed\n"); } - return result ? CMD_WARNING : CMD_SUCCESS; + return result ? CMD_WARNING_CONFIG_FAILED : CMD_SUCCESS; } DEFUN (no_ip_msdp_mesh_group_source, diff --git a/ripd/rip_debug.c b/ripd/rip_debug.c index a88837d90..04252a85f 100644 --- a/ripd/rip_debug.c +++ b/ripd/rip_debug.c @@ -68,7 +68,7 @@ DEFUN (debug_rip_events, "RIP events\n") { rip_debug_event = RIP_DEBUG_EVENT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_rip_packet, @@ -110,7 +110,7 @@ DEFUN (debug_rip_zebra, "RIP and ZEBRA communication\n") { rip_debug_zebra = RIP_DEBUG_ZEBRA; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_debug_rip_events, @@ -174,7 +174,7 @@ DEFUN (no_debug_rip_zebra, "RIP and ZEBRA communication\n") { rip_debug_zebra = 0; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Debug node. */ diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index bff8a4ce2..357856e1e 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1168,7 +1168,7 @@ static int rip_passive_nondefault_set (struct vty *vty, const char *ifname) { if (rip_passive_nondefault_lookup (ifname) >= 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; vector_set (Vrip_passive_nondefault, strdup (ifname)); @@ -1185,7 +1185,7 @@ rip_passive_nondefault_unset (struct vty *vty, const char *ifname) i = rip_passive_nondefault_lookup (ifname); if (i < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; str = vector_slot (Vrip_passive_nondefault, i); free (str); @@ -1235,7 +1235,7 @@ DEFUN (rip_network, { vty_out (vty, "There is a same network configuration %s\n", argv[idx_ipv4_word]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -1265,7 +1265,7 @@ DEFUN (no_rip_network, { vty_out (vty, "Can't find network configuration %s\n", argv[idx_ipv4_word]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -1287,7 +1287,7 @@ DEFUN (rip_neighbor, if (ret <= 0) { vty_out (vty, "Please specify address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip_neighbor_add (&p); @@ -1312,7 +1312,7 @@ DEFUN (no_rip_neighbor, if (ret <= 0) { vty_out (vty, "Please specify address by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip_neighbor_delete (&p); @@ -1351,7 +1351,7 @@ DEFUN (ip_rip_receive_version, break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (ip_rip_receive_version_1, @@ -1422,7 +1422,7 @@ DEFUN (ip_rip_send_version, ri->ri_send = RI_RIP_VERSION_2; return CMD_SUCCESS; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (ip_rip_send_version_1, @@ -1535,7 +1535,7 @@ DEFUN (ip_rip_authentication_mode, if (auth_type != RIP_AUTH_MD5) { vty_out (vty, "auth length argument only valid for md5\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (strmatch ("rfc", authlen)) ri->md5_auth_len = RIP_AUTH_MD5_SIZE; @@ -1593,13 +1593,13 @@ DEFUN (ip_rip_authentication_string, { vty_out (vty, "%% RIPv2 authentication string must be shorter than 16\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ri->key_chain) { vty_out (vty, "%% key-chain configuration exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ri->auth_str) @@ -1652,7 +1652,7 @@ DEFUN (ip_rip_authentication_key_chain, if (ri->auth_str) { vty_out (vty,"%% authentication string configuration exists\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ri->key_chain) diff --git a/ripd/rip_offset.c b/ripd/rip_offset.c index 97b405607..63f93d139 100644 --- a/ripd/rip_offset.c +++ b/ripd/rip_offset.c @@ -118,7 +118,7 @@ rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str, else { vty_out (vty, "Invalid direction: %s\n", direct_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check metric. */ @@ -126,7 +126,7 @@ rip_offset_list_set (struct vty *vty, const char *alist, const char *direct_str, if (metric < 0 || metric > 16) { vty_out (vty, "Invalid metric: %s\n", metric_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get offset-list structure with interface name. */ @@ -157,7 +157,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, else { vty_out (vty, "Invalid direction: %s\n", direct_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check metric. */ @@ -165,7 +165,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, if (metric < 0 || metric > 16) { vty_out (vty, "Invalid metric: %s\n", metric_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get offset-list structure with interface name. */ @@ -189,7 +189,7 @@ rip_offset_list_unset (struct vty *vty, const char *alist, else { vty_out (vty, "Can't find offset-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index c7923df4a..dffa9db7c 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -349,7 +349,7 @@ DEFUN (rip_redistribute_type, vty_out (vty, "Invalid type %s\n",argv[1]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_rip_redistribute_type, @@ -375,7 +375,7 @@ DEFUN (no_rip_redistribute_type, vty_out (vty, "Invalid type %s\n",argv[2]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (rip_redistribute_type_routemap, @@ -402,7 +402,7 @@ DEFUN (rip_redistribute_type_routemap, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_rip_redistribute_type_routemap, @@ -422,7 +422,7 @@ DEFUN (no_rip_redistribute_type_routemap, if (strmatch (redist_type[i].str, argv[idx_protocol]->text)) { if (rip_routemap_unset (redist_type[i].type,argv[idx_word]->arg)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; rip_redistribute_unset (redist_type[i].type); return CMD_SUCCESS; } @@ -430,7 +430,7 @@ DEFUN (no_rip_redistribute_type_routemap, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (rip_redistribute_type_metric, @@ -460,7 +460,7 @@ DEFUN (rip_redistribute_type_metric, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_rip_redistribute_type_metric, @@ -480,7 +480,7 @@ DEFUN (no_rip_redistribute_type_metric, if (strmatch (redist_type[i].str, argv[idx_protocol]->text)) { if (rip_metric_unset (redist_type[i].type, atoi(argv[idx_number]->arg))) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; rip_redistribute_unset (redist_type[i].type); return CMD_SUCCESS; } @@ -488,7 +488,7 @@ DEFUN (no_rip_redistribute_type_metric, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (rip_redistribute_type_metric_routemap, @@ -522,7 +522,7 @@ DEFUN (rip_redistribute_type_metric_routemap, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } @@ -546,11 +546,11 @@ DEFUN (no_rip_redistribute_type_metric_routemap, if (strmatch (redist_type[i].str, argv[idx_protocol]->text)) { if (rip_metric_unset (redist_type[i].type, atoi(argv[idx_number]->arg))) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; if (rip_routemap_unset (redist_type[i].type, argv[idx_word]->arg)) { rip_redistribute_metric_set(redist_type[i].type, atoi(argv[idx_number]->arg)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip_redistribute_unset (redist_type[i].type); return CMD_SUCCESS; @@ -559,7 +559,7 @@ DEFUN (no_rip_redistribute_type_metric_routemap, vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Default information originate. */ diff --git a/ripd/ripd.c b/ripd/ripd.c index c93d16647..8578dc3d2 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -2815,7 +2815,7 @@ DEFUN_NOSH (router_rip, if (ret < 0) { zlog_info ("Can't create RIP"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } VTY_PUSH_CONTEXT(RIP_NODE, rip); @@ -2848,7 +2848,7 @@ DEFUN (rip_version, if (version != RIPv1 && version != RIPv2) { vty_out (vty, "invalid rip version %d\n",version); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip->version_send = version; rip->version_recv = version; @@ -2886,7 +2886,7 @@ DEFUN (rip_route, if (ret < 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv4 (&p); @@ -2897,7 +2897,7 @@ DEFUN (rip_route, { vty_out (vty, "There is already same static route.\n"); route_unlock_node (node); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } node->info = (void *)1; @@ -2923,7 +2923,7 @@ DEFUN (no_rip_route, if (ret < 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv4 (&p); @@ -2932,7 +2932,7 @@ DEFUN (no_rip_route, if (! node) { vty_out (vty, "Can't find route %s.\n",argv[idx_ipv4_prefixlen]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip_redistribute_delete (ZEBRA_ROUTE_RIP, RIP_ROUTE_STATIC, &p, 0); @@ -3015,21 +3015,21 @@ DEFUN (rip_timers, if (update > RIP_TIMER_MAX || update < RIP_TIMER_MIN || *endptr != '\0') { vty_out (vty, "update timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } timeout = strtoul (argv[idx_number_2]->arg, &endptr, 10); if (timeout > RIP_TIMER_MAX || timeout < RIP_TIMER_MIN || *endptr != '\0') { vty_out (vty, "timeout timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } garbage = strtoul (argv[idx_number_3]->arg, &endptr, 10); if (garbage > RIP_TIMER_MAX || garbage < RIP_TIMER_MIN || *endptr != '\0') { vty_out (vty, "garbage timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Set each timer value. */ @@ -3103,7 +3103,7 @@ rip_distance_set (struct vty *vty, const char *distance_str, const char *ip_str, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } distance = atoi (distance_str); @@ -3149,14 +3149,14 @@ rip_distance_unset (struct vty *vty, const char *distance_str, if (ret == 0) { vty_out (vty, "Malformed prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (rip_distance_table, (struct prefix *)&p); if (! rn) { vty_out (vty, "Can't find specified prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rdistance = rn->info; @@ -3387,7 +3387,7 @@ DEFUN (rip_allow_ecmp, if (rip->ecmp) { vty_out (vty, "ECMP is already enabled.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip->ecmp = 1; @@ -3404,7 +3404,7 @@ DEFUN (no_rip_allow_ecmp, if (!rip->ecmp) { vty_out (vty, "ECMP is already disabled.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rip->ecmp = 0; diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c index f08265600..3bc9b4b21 100644 --- a/ripngd/ripng_debug.c +++ b/ripngd/ripng_debug.c @@ -69,7 +69,7 @@ DEFUN (debug_ripng_events, "Debug option set for ripng events\n") { ripng_debug_event = RIPNG_DEBUG_EVENT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_ripng_packet, @@ -112,7 +112,7 @@ DEFUN (debug_ripng_zebra, "Debug option set for ripng and zebra communication\n") { ripng_debug_zebra = RIPNG_DEBUG_ZEBRA; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (no_debug_ripng_events, @@ -176,7 +176,7 @@ DEFUN (no_debug_ripng_zebra, "Debug option set for ripng and zebra communication\n") { ripng_debug_zebra = 0; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Debug node. */ diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 2abf2f9a9..e4b45c54a 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -858,7 +858,7 @@ static int ripng_passive_interface_set (struct vty *vty, const char *ifname) { if (ripng_passive_interface_lookup (ifname) >= 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; vector_set (Vripng_passive_interface, strdup (ifname)); @@ -875,7 +875,7 @@ ripng_passive_interface_unset (struct vty *vty, const char *ifname) i = ripng_passive_interface_lookup (ifname); if (i < 0) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; str = vector_slot (Vripng_passive_interface, i); free (str); @@ -962,7 +962,7 @@ DEFUN (ripng_network, { vty_out (vty, "There is same network configuration %s\n", argv[idx_if_or_addr]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -991,7 +991,7 @@ DEFUN (no_ripng_network, if (ret < 0) { vty_out (vty, "can't find network %s\n",argv[idx_if_or_addr]->arg); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c index e0ca0666b..81e892d7d 100644 --- a/ripngd/ripng_offset.c +++ b/ripngd/ripng_offset.c @@ -126,7 +126,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist, else { vty_out (vty, "Invalid direction: %s\n", direct_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check metric. */ @@ -134,7 +134,7 @@ ripng_offset_list_set (struct vty *vty, const char *alist, if (metric < 0 || metric > 16) { vty_out (vty, "Invalid metric: %s\n", metric_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get offset-list structure with interface name. */ @@ -165,7 +165,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, else { vty_out (vty, "Invalid direction: %s\n", direct_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check metric. */ @@ -173,7 +173,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, if (metric < 0 || metric > 16) { vty_out (vty, "Invalid metric: %s\n", metric_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Get offset-list structure with interface name. */ @@ -197,7 +197,7 @@ ripng_offset_list_unset (struct vty *vty, const char *alist, else { vty_out (vty, "Can't find offset-list\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; } diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c index 725336aff..b49de9902 100644 --- a/ripngd/ripng_zebra.c +++ b/ripngd/ripng_zebra.c @@ -338,7 +338,7 @@ DEFUN (ripng_redistribute_type, if (type < 0) { vty_out (vty, "Invalid type %s\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zclient_redistribute (ZEBRA_REDISTRIBUTE_ADD, zclient, AFI_IP6, type, 0, VRF_DEFAULT); @@ -364,7 +364,7 @@ DEFUN (no_ripng_redistribute_type, if (type < 0) { vty_out (vty, "Invalid type %s\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng_redistribute_metric_unset (type); @@ -392,7 +392,7 @@ DEFUN (ripng_redistribute_type_metric, if (type < 0) { vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng_redistribute_metric_set (type, metric); @@ -418,7 +418,7 @@ DEFUN (ripng_redistribute_type_routemap, if (type < 0) { vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng_redistribute_routemap_set (type, argv[idx_word]->text); @@ -449,7 +449,7 @@ DEFUN (ripng_redistribute_type_metric_routemap, if (type < 0) { vty_out (vty, "Invalid type %s\n", argv[idx_protocol]->text); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng_redistribute_metric_set (type, metric); diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 0b1faae03..8b4c3e850 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -2225,7 +2225,7 @@ DEFUN_NOSH (router_ripng, if (ret < 0) { zlog_warn ("can't create RIPng"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2259,7 +2259,7 @@ DEFUN (ripng_route, if (ret <= 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&p); @@ -2268,7 +2268,7 @@ DEFUN (ripng_route, { vty_out (vty, "There is already same static route.\n"); route_unlock_node (rp); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rp->info = (void *)1; @@ -2293,7 +2293,7 @@ DEFUN (no_ripng_route, if (ret <= 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&p); @@ -2301,7 +2301,7 @@ DEFUN (no_ripng_route, if (! rp) { vty_out (vty, "Can't find static route.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng_redistribute_delete (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0); @@ -2328,7 +2328,7 @@ DEFUN (ripng_aggregate_address, if (ret <= 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check aggregate alredy exist or not. */ @@ -2337,7 +2337,7 @@ DEFUN (ripng_aggregate_address, { vty_out (vty, "There is already same aggregate route.\n"); route_unlock_node (node); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } node->info = (void *)1; @@ -2362,14 +2362,14 @@ DEFUN (no_ripng_aggregate_address, if (ret <= 0) { vty_out (vty, "Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } rn = route_node_lookup (ripng->aggregate, &p); if (! rn) { vty_out (vty, "Can't find aggregate route.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } route_unlock_node (rn); rn->info = NULL; @@ -2424,7 +2424,7 @@ DEFUN (ripng_update_timer, if (update == ULONG_MAX || *endptr != '\0') { vty_out (vty, "update timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng->update_time = update; @@ -2459,7 +2459,7 @@ DEFUN (ripng_timeout_timer, if (timeout == ULONG_MAX || *endptr != '\0') { vty_out (vty, "timeout timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng->timeout_time = timeout; @@ -2492,7 +2492,7 @@ DEFUN (ripng_garbage_timer, if (garbage == ULONG_MAX || *endptr != '\0') { vty_out (vty, "garbage timer value error\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng->garbage_time = garbage; @@ -2677,7 +2677,7 @@ DEFUN (ripng_allow_ecmp, if (ripng->ecmp) { vty_out (vty, "ECMP is already enabled.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng->ecmp = 1; @@ -2694,7 +2694,7 @@ DEFUN (no_ripng_allow_ecmp, if (!ripng->ecmp) { vty_out (vty, "ECMP is already disabled.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ripng->ecmp = 0; diff --git a/snapcraft/.gitignore b/snapcraft/.gitignore index e050ff0c8..ac7860290 100644 --- a/snapcraft/.gitignore +++ b/snapcraft/.gitignore @@ -2,5 +2,5 @@ snapcraft.yaml parts prime stage -quagga*.snap +frr*.snap !*/Makefile diff --git a/solaris/.gitignore b/solaris/.gitignore index 63afe3fdb..a2c7946e7 100644 --- a/solaris/.gitignore +++ b/solaris/.gitignore @@ -14,7 +14,7 @@ depend.dev depend.doc depend.libs depend.smf -quagga.init +frr.init *.pkg *.pkg.gz *~ diff --git a/tests/Makefile.am b/tests/Makefile.am index 559d76970..8f612c45a 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -148,7 +148,9 @@ EXTRA_DIST = \ lib/test_stream.refout \ lib/test_table.py \ lib/test_timer_correctness.py \ - lib/test_ttable.py + lib/test_ttable.py \ + lib/test_ttable.refout \ + # end .PHONY: tests.xml tests.xml: $(check_PROGRAMS) diff --git a/tools/Makefile.am b/tools/Makefile.am index dd32d0dab..e5a118972 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -11,6 +11,6 @@ permutations_LDADD = ../lib/libfrr.la sbin_SCRIPTS = frr-reload.py frr -EXTRA_DIST += frr.service frr-reload.py frr +EXTRA_DIST += frr.service frr-reload.py frr etc ssd_SOURCES = start-stop-daemon.c diff --git a/tools/frr-reload.py b/tools/frr-reload.py index a7a04be63..bfdc08ab4 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -812,7 +812,7 @@ def compare_context_objects(newconf, running): delete_bgpd = True lines_to_del.append((running_ctx_keys, None)) - # We cannot do 'no interface' in quagga, and so deal with it + # We cannot do 'no interface' in FRR, and so deal with it elif running_ctx_keys[0].startswith('interface'): for line in running_ctx.lines: lines_to_del.append((running_ctx_keys, line)) @@ -1010,7 +1010,7 @@ if __name__ == '__main__': # the "neighbor 1.1.1.1 route-map FOO out" line...so we compare the # configs again to put this line back. - # There are many keywords in quagga that can only appear one time under + # There are many keywords in FRR that can only appear one time under # a context, take "bgp router-id" for example. If the config that we are # reloading against has the following: # @@ -1038,7 +1038,7 @@ if __name__ == '__main__': lines_to_add.extend(lines_to_add_first_pass) # Only do deletes on the first pass. The reason being if we - # configure a bgp neighbor via "neighbor swp1 interface" quagga + # configure a bgp neighbor via "neighbor swp1 interface" FRR # will automatically add: # # interface swp1 diff --git a/tools/multiple-bgpd.sh b/tools/multiple-bgpd.sh index 20a92a916..6dee1bafc 100644 --- a/tools/multiple-bgpd.sh +++ b/tools/multiple-bgpd.sh @@ -10,8 +10,8 @@ PREFIX=192.168.145. #PREFIX=3ffe:123:456:: ADDRPLEN=32 CONFBASE=/tmp -PIDBASE=/var/run/quagga -CHOWNSTR=quagga:quagga +PIDBASE=/var/run/frr +CHOWNSTR=frr:frr for H in `seq 1 ${NUM}` ; do CONF="${CONFBASE}"/bgpd${H}.conf diff --git a/tools/vty_index.cocci b/tools/vty_index.cocci index 8290e80b9..eabbaa1aa 100644 --- a/tools/vty_index.cocci +++ b/tools/vty_index.cocci @@ -141,7 +141,7 @@ fn << rule11.fn; @@ print "R11 removing vty-index argument on %s(...)" % (fn) -#/* find type of the argument - note args are mostly unnamed in Quagga :( */ +#/* find type of the argument - note args are mostly unnamed in FRR :( */ @ rule12 @ identifier rule11.fn; identifier T, argname; diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index fe84e7ecb..958ef3b82 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -291,6 +291,7 @@ vtysh_execute_func (const char *line, int pager) * Changing vty->node is enough to try it just out without actual walkup in * the vtysh. */ while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON && ret != CMD_WARNING + && ret != CMD_WARNING_CONFIG_FAILED && vty->node > CONFIG_NODE) { vty->node = node_parent(vty->node); @@ -350,6 +351,7 @@ vtysh_execute_func (const char *line, int pager) switch (ret) { case CMD_WARNING: + case CMD_WARNING_CONFIG_FAILED: if (vty->type == VTY_FILE) fprintf (stdout,"Warning...\n"); break; @@ -553,6 +555,7 @@ vtysh_mark_file (const char *filename) * Changing vty->node is enough to try it just out without actual walkup in * the vtysh. */ while (ret != CMD_SUCCESS && ret != CMD_SUCCESS_DAEMON && ret != CMD_WARNING + && ret != CMD_WARNING_CONFIG_FAILED && vty->node > CONFIG_NODE) { vty->node = node_parent(vty->node); @@ -594,12 +597,13 @@ vtysh_mark_file (const char *filename) switch (ret) { case CMD_WARNING: + case CMD_WARNING_CONFIG_FAILED: if (vty->type == VTY_FILE) fprintf (stderr,"line %d: Warning...: %s\n", lineno, vty->buf); fclose(confp); vty_close(vty); XFREE(MTYPE_VTYSH_CMD, vty_buf_copy); - return CMD_WARNING; + return ret; case CMD_ERR_AMBIGUOUS: fprintf (stderr,"line %d: %% Ambiguous command: %s\n", lineno, vty->buf); fclose(confp); @@ -674,9 +678,10 @@ vtysh_config_from_file (struct vty *vty, FILE *fp) switch (ret) { case CMD_WARNING: + case CMD_WARNING_CONFIG_FAILED: if (vty->type == VTY_FILE) fprintf (stderr,"line %d: Warning[%d]...: %s\n", lineno, vty->node, vty->buf); - retcode = CMD_WARNING; /* once we have an error, we remember & return that */ + retcode = ret; /* once we have an error, we remember & return that */ break; case CMD_ERR_AMBIGUOUS: fprintf (stderr,"line %d: %% Ambiguous command[%d]: %s\n", lineno, vty->node, vty->buf); @@ -2445,20 +2450,10 @@ DEFUNSH (VTYSH_ALL, DEFUNSH (VTYSH_ALL, vtysh_config_password, vtysh_password_cmd, - "password [(8-8)] WORD", + "password [(8-8)] LINE", "Assign the terminal connection password\n" "Specifies a HIDDEN password will follow\n" - "The HIDDEN line password string\n") -{ - return CMD_SUCCESS; -} - -DEFUNSH (VTYSH_ALL, - vtysh_password_text, - vtysh_password_text_cmd, - "password LINE", - "Assign the terminal connection password\n" - "The UNENCRYPTED (cleartext) line password\n") + "The password string\n") { return CMD_SUCCESS; } @@ -2466,22 +2461,11 @@ DEFUNSH (VTYSH_ALL, DEFUNSH (VTYSH_ALL, vtysh_config_enable_password, vtysh_enable_password_cmd, - "enable password (8-8) WORD", + "enable password [(8-8)] LINE", "Modify enable password parameters\n" "Assign the privileged level password\n" "Specifies a HIDDEN password will follow\n" - "The HIDDEN 'enable' password string\n") -{ - return CMD_SUCCESS; -} - -DEFUNSH (VTYSH_ALL, - vtysh_enable_password_text, - vtysh_enable_password_text_cmd, - "enable password LINE", - "Modify enable password parameters\n" - "Assign the privileged level password\n" - "The UNENCRYPTED (cleartext) 'enable' password\n") + "The 'enable' password string\n") { return CMD_SUCCESS; } @@ -2633,7 +2617,7 @@ vtysh_write_config_integrated(void) { fprintf (stdout,"%% Error: failed to open configuration file %s: %s\n", quagga_config, safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } fd = fileno (fp); @@ -2735,7 +2719,7 @@ DEFUN (vtysh_write_memory, /* If integrated frr.conf explicitely set. */ if (want_config_integrated()) { - ret = CMD_WARNING; + ret = CMD_WARNING_CONFIG_FAILED; for (i = 0; i < array_size(vtysh_client); i++) if (vtysh_client[i].flag == VTYSH_WATCHFRR) break; @@ -3037,7 +3021,7 @@ vtysh_connect (struct vtysh_client *vclient) { fprintf (stderr, "vtysh_connect(%s): stat = %s\n", path, safe_strerror(errno)); - exit(1); + exit (1); } if (ret >= 0) @@ -3630,8 +3614,6 @@ vtysh_init_vty (void) install_element (CONFIG_NODE, &no_vtysh_service_password_encrypt_cmd); install_element (CONFIG_NODE, &vtysh_password_cmd); - install_element (CONFIG_NODE, &vtysh_password_text_cmd); install_element (CONFIG_NODE, &vtysh_enable_password_cmd); - install_element (CONFIG_NODE, &vtysh_enable_password_text_cmd); install_element (CONFIG_NODE, &no_vtysh_enable_password_cmd); } diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 3ff4a4096..53d58668d 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -1294,7 +1294,7 @@ int main(int argc, char **argv) if (watchfrr_di.daemon_mode) { zlog_set_level(ZLOG_DEST_SYSLOG, MIN(gs.loglevel, LOG_DEBUG)); if (daemon (0, 0) < 0) { - fprintf(stderr, "Watchquagga daemon failed: %s", + fprintf(stderr, "Watchfrr daemon failed: %s", strerror(errno)); exit (1); } diff --git a/zebra/Makefile.am b/zebra/Makefile.am index 541496174..f70d603d3 100644 --- a/zebra/Makefile.am +++ b/zebra/Makefile.am @@ -85,7 +85,7 @@ EXTRA_DIST = if_ioctl.c if_ioctl_solaris.c if_netlink.c \ client : client_main.o ../lib/libfrr.la $(CC) -g -o client client_main.o ../liblzebra.la $(LIBS) $(LIB_IPV6) -quaggaconfdir = $(sysconfdir) +frrconfdir = $(sysconfdir) examplesdir = $(exampledir) dist_examples_DATA = zebra.conf.sample diff --git a/zebra/debug.c b/zebra/debug.c index 5abd11142..f99e06bbb 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -93,7 +93,7 @@ DEFUN (debug_zebra_events, "Debug option set for zebra events\n") { zebra_debug_event = ZEBRA_DEBUG_EVENT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_nht, @@ -104,7 +104,7 @@ DEFUN (debug_zebra_nht, "Debug option set for zebra next hop tracking\n") { zebra_debug_nht = ZEBRA_DEBUG_NHT; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_mpls, @@ -115,7 +115,7 @@ DEFUN (debug_zebra_mpls, "Debug option set for zebra MPLS LSPs\n") { zebra_debug_mpls = ZEBRA_DEBUG_MPLS; - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } DEFUN (debug_zebra_packet, diff --git a/zebra/interface.c b/zebra/interface.c index d7b2ebfe4..39125a392 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1480,7 +1480,7 @@ DEFUN (multicast, if (ret < 0) { vty_out (vty, "Can't set multicast flag\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1506,7 +1506,7 @@ DEFUN (no_multicast, if (ret < 0) { vty_out (vty, "Can't unset multicast flag\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1572,7 +1572,7 @@ DEFUN (shutdown_if, if (ret < 0) { vty_out (vty, "Can't shutdown interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); } @@ -1598,7 +1598,7 @@ DEFUN (no_shutdown_if, if (ret < 0) { vty_out (vty, "Can't up interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if_refresh (ifp); @@ -1630,7 +1630,7 @@ DEFUN (bandwidth_if, if (bandwidth < 1 || bandwidth > 100000) { vty_out (vty, "Bandwidth is invalid\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifp->bandwidth = bandwidth; @@ -1754,7 +1754,7 @@ DEFUN (link_params_enable, if (IS_ZEBRA_DEBUG_EVENT) zlog_debug ("Link-params: failed to init TE link parameters %s", ifp->name); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* force protocols to update LINK STATE due to parameters change */ @@ -1832,7 +1832,7 @@ DEFUN (link_params_maxbw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_out (vty, "link_params_maxbw: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that Maximum bandwidth is not lower than other bandwidth parameters */ @@ -1851,7 +1851,7 @@ DEFUN (link_params_maxbw, { vty_out (vty, "Maximum Bandwidth could not be lower than others bandwidth\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Maximum Bandwidth if needed */ @@ -1875,7 +1875,7 @@ DEFUN (link_params_max_rsv_bw, { vty_out (vty, "link_params_max_rsv_bw: fscanf: %s\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -1884,7 +1884,7 @@ DEFUN (link_params_max_rsv_bw, vty_out (vty, "Maximum Reservable Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Maximum Reservable Bandwidth if needed */ @@ -1912,14 +1912,14 @@ DEFUN (link_params_unrsv_bw, { vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_out (vty, "link_params_unrsv_bw: fscanf: %s\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -1928,7 +1928,7 @@ DEFUN (link_params_unrsv_bw, vty_out (vty, "UnReserved Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Unreserved Bandwidth if needed */ @@ -1952,7 +1952,7 @@ DEFUN (link_params_admin_grp, { vty_out (vty, "link_params_admin_grp: fscanf: %s\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Administrative Group if needed */ @@ -1995,7 +1995,7 @@ DEFUN (link_params_inter_as, if (!inet_aton (argv[idx_ipv4]->arg, &addr)) { vty_out (vty, "Please specify Router-Addr by A.B.C.D\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } as = strtoul(argv[idx_number]->arg, NULL, 10); @@ -2070,7 +2070,7 @@ DEFUN (link_params_delay, { vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", iflp->min_delay, iflp->max_delay); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update delay if value is not set or change */ if (IS_PARAM_UNSET(iflp, LP_DELAY)|| iflp->av_delay != delay) @@ -2095,7 +2095,7 @@ DEFUN (link_params_delay, { vty_out (vty, "Average delay should be comprise between Min (%d) and Max (%d) delay\n", low, high); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Delays if needed */ if (IS_PARAM_UNSET(iflp, LP_DELAY) @@ -2191,7 +2191,7 @@ DEFUN (link_params_pkt_loss, { vty_out (vty, "link_params_pkt_loss: fscanf: %s\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (fval > MAX_PKT_LOSS) @@ -2231,7 +2231,7 @@ DEFUN (link_params_res_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_out (vty, "link_params_res_bw: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2240,7 +2240,7 @@ DEFUN (link_params_res_bw, vty_out (vty, "Residual Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Residual Bandwidth if needed */ @@ -2277,7 +2277,7 @@ DEFUN (link_params_ava_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_out (vty, "link_params_ava_bw: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2286,7 +2286,7 @@ DEFUN (link_params_ava_bw, vty_out (vty, "Available Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Residual Bandwidth if needed */ @@ -2323,7 +2323,7 @@ DEFUN (link_params_use_bw, if (sscanf (argv[idx_bandwidth]->arg, "%g", &bw) != 1) { vty_out (vty, "link_params_use_bw: fscanf: %s\n",safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check that bandwidth is not greater than maximum bandwidth parameter */ @@ -2332,7 +2332,7 @@ DEFUN (link_params_use_bw, vty_out (vty, "Utilised Bandwidth could not be greater than Maximum Bandwidth (%g)\n", iflp->max_bw); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Update Utilized Bandwidth if needed */ @@ -2372,13 +2372,13 @@ ip_address_install (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_out (vty, "%% Malformed address \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ipv4_martian(&cp.prefix)) { vty_out (vty, "%% Invalid address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifc = connected_check (ifp, (struct prefix *) &cp); @@ -2430,7 +2430,7 @@ ip_address_install (struct vty *vty, struct interface *ifp, { vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); @@ -2456,7 +2456,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_out (vty, "%% Malformed address \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check current interface address. */ @@ -2464,12 +2464,12 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, if (! ifc) { vty_out (vty, "%% Can't find address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is not configured address. */ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED); @@ -2479,7 +2479,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, { listnode_delete (ifp->connected, ifc); connected_free (ifc); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is real route. */ @@ -2488,7 +2488,7 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, { vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); /* we will receive a kernel notification about this route being removed. @@ -2572,13 +2572,13 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_out (vty, "%% Malformed address \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (ipv6_martian(&cp.prefix)) { vty_out (vty, "%% Invalid address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifc = connected_check (ifp, (struct prefix *) &cp); @@ -2626,7 +2626,7 @@ ipv6_address_install (struct vty *vty, struct interface *ifp, { vty_out (vty, "%% Can't set interface IP address: %s.\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } SET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); @@ -2665,7 +2665,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, if (ret <= 0) { vty_out (vty, "%% Malformed address \n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Check current interface address. */ @@ -2673,12 +2673,12 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, if (! ifc) { vty_out (vty, "%% Can't find address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is not configured address. */ if (! CHECK_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED)) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; UNSET_FLAG (ifc->conf, ZEBRA_IFC_CONFIGURED); @@ -2688,7 +2688,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, { listnode_delete (ifp->connected, ifc); connected_free (ifc); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* This is real route. */ @@ -2697,7 +2697,7 @@ ipv6_address_uninstall (struct vty *vty, struct interface *ifp, { vty_out (vty, "%% Can't unset interface IP address: %s.\n", safe_strerror(errno)); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } UNSET_FLAG (ifc->conf, ZEBRA_IFC_QUEUED); diff --git a/zebra/irdp_interface.c b/zebra/irdp_interface.c index 3c727ecb7..323e94818 100644 --- a/zebra/irdp_interface.c +++ b/zebra/irdp_interface.c @@ -480,7 +480,7 @@ DEFUN (ip_irdp_minadvertinterval, else { vty_out (vty, "%% MinAdvertInterval must be less than or equal to " "MaxAdvertInterval\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -507,7 +507,7 @@ DEFUN (ip_irdp_maxadvertinterval, else { vty_out (vty, "%% MaxAdvertInterval must be greater than or equal to " "MinAdvertInterval\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -561,7 +561,7 @@ DEFUN (ip_irdp_address_preference, irdp=&zi->irdp; ret = inet_aton(argv[idx_ipv4]->arg, &ip); - if(!ret) return CMD_WARNING; + if(!ret) return CMD_WARNING_CONFIG_FAILED; pref = atoi(argv[idx_number]->arg); @@ -603,7 +603,7 @@ DEFUN (no_ip_irdp_address_preference, ret = inet_aton(argv[idx_ipv4]->arg, &ip); if (!ret) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; for (ALL_LIST_ELEMENTS (irdp->AdvPrefList, node, nnode, adv)) { diff --git a/zebra/router-id.c b/zebra/router-id.c index 7e3e28631..e23178cb7 100644 --- a/zebra/router-id.c +++ b/zebra/router-id.c @@ -226,7 +226,7 @@ DEFUN (router_id, rid.u.prefix4.s_addr = inet_addr (argv[idx_ipv4]->arg); if (!rid.u.prefix4.s_addr) - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; rid.prefixlen = 32; rid.family = AF_INET; diff --git a/zebra/rtadv.c b/zebra/rtadv.c index c4fe4ac84..589ecc949 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -879,7 +879,7 @@ DEFUN (ipv6_nd_suppress_ra, { vty_out (vty, "Cannot configure IPv6 Router Advertisements on this interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ipv6_nd_suppress_ra_set (ifp, RA_SUPPRESS); @@ -903,7 +903,7 @@ DEFUN (no_ipv6_nd_suppress_ra, { vty_out (vty, "Cannot configure IPv6 Router Advertisements on this interface\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ipv6_nd_suppress_ra_set (ifp, RA_ENABLE); @@ -933,7 +933,7 @@ DEFUN (ipv6_nd_ra_interval_msec, { vty_out (vty, "This ra-interval would conflict with configured ra-lifetime!\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zif->rtadv.MaxRtrAdvInterval % 1000) @@ -970,7 +970,7 @@ DEFUN (ipv6_nd_ra_interval, { vty_out (vty, "This ra-interval would conflict with configured ra-lifetime!\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zif->rtadv.MaxRtrAdvInterval % 1000) @@ -1038,7 +1038,7 @@ DEFUN (ipv6_nd_ra_lifetime, { vty_out (vty, "This ra-lifetime would conflict with configured ra-interval\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zif->rtadv.AdvDefaultLifetime = lifetime; @@ -1334,7 +1334,7 @@ DEFUN (ipv6_nd_prefix, if (!ret) { vty_out (vty, "Malformed IPv6 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ rp.AdvOnLinkFlag = !offlink; @@ -1350,7 +1350,7 @@ DEFUN (ipv6_nd_prefix, if (rp.AdvPreferredLifetime > rp.AdvValidLifetime) { vty_out (vty, "Invalid preferred lifetime\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -1387,7 +1387,7 @@ DEFUN (no_ipv6_nd_prefix, if (!ret) { vty_out (vty, "Malformed IPv6 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } apply_mask_ipv6 (&rp.prefix); /* RFC4861 4.6.2 */ @@ -1395,7 +1395,7 @@ DEFUN (no_ipv6_nd_prefix, if (!ret) { vty_out (vty, "Non-existant IPv6 prefix\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; diff --git a/zebra/zebra_mpls_vty.c b/zebra/zebra_mpls_vty.c index 41e3aac9a..938e8ef7c 100644 --- a/zebra/zebra_mpls_vty.c +++ b/zebra/zebra_mpls_vty.c @@ -54,20 +54,20 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!mpls_enabled) { vty_out (vty,"%% MPLS not turned on in kernel, ignoring command\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } zvrf = vrf_info_lookup(VRF_DEFAULT); if (!zvrf) { vty_out (vty, "%% Default VRF does not exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!inlabel_str) { vty_out (vty, "%% No Label Information\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } out_label = MPLS_IMP_NULL_LABEL; /* as initialization */ @@ -75,7 +75,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!IS_MPLS_UNRESERVED_LABEL(label)) { vty_out (vty, "%% Invalid label\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -83,12 +83,12 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, if (!gate_str) { vty_out (vty, "%% No Nexthop Information\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!outlabel_str) { vty_out (vty, "%% No Outgoing label Information\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -109,7 +109,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, else { vty_out (vty, "%% Invalid nexthop\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } } @@ -134,7 +134,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, &gate, 0)) { vty_out (vty,"%% Label value not consistent\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } #endif /* HAVE_CUMULUS */ @@ -148,7 +148,7 @@ zebra_mpls_transit_lsp (struct vty *vty, int add_cmd, const char *inlabel_str, { vty_out (vty, "%% LSP cannot be %s\n", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -219,7 +219,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!zvrf) { vty_out (vty, "%% Default VRF does not exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } memset(&p, 0, sizeof(struct prefix)); @@ -227,7 +227,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (ret <= 0) { vty_out (vty, "%% Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -235,7 +235,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!label_str) { vty_out (vty, "%% No label binding specified\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!strcmp(label_str, "implicit-null")) @@ -253,12 +253,12 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, if (!IS_MPLS_UNRESERVED_LABEL(label)) { vty_out (vty, "%% Invalid label\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (zebra_mpls_label_already_bound (zvrf, label)) { vty_out (vty,"%% Label already bound to a FEC\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -271,7 +271,7 @@ zebra_mpls_bind (struct vty *vty, int add_cmd, const char *prefix, { vty_out (vty, "%% FEC to label binding cannot be %s\n", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -943,7 +943,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!zvrf) { vty_out (vty, "%% Default VRF does not exist\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) @@ -951,7 +951,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, if (!start_label_str || !end_label_str) { vty_out (vty, "%% Labels not specified\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } start_label = atoi(start_label_str); @@ -960,12 +960,12 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, !IS_MPLS_UNRESERVED_LABEL(end_label)) { vty_out (vty, "%% Invalid label\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (end_label < start_label) { vty_out (vty,"%% End label is less than Start label\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ret = zebra_mpls_label_block_add (zvrf, start_label, end_label); @@ -977,7 +977,7 @@ zebra_mpls_global_block (struct vty *vty, int add_cmd, { vty_out (vty, "%% Global label block could not be %s\n", add_cmd ? "added" : "deleted"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; diff --git a/zebra/zebra_routemap.c b/zebra/zebra_routemap.c index ab1643e50..a7b47165d 100644 --- a/zebra/zebra_routemap.c +++ b/zebra/zebra_routemap.c @@ -74,10 +74,10 @@ zebra_route_match_add(struct vty *vty, { case RMAP_RULE_MISSING: vty_out (vty, "%% Zebra Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% Zebra Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -122,10 +122,10 @@ zebra_route_match_delete (struct vty *vty, { case RMAP_RULE_MISSING: vty_out (vty, "%% Zebra Can't find rule.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; case RMAP_COMPILE_ERROR: vty_out (vty, "%% Zebra Argument is malformed.\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -303,7 +303,7 @@ DEFUN (match_source_protocol, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return zebra_route_match_add (vty, "source-protocol", proto, RMAP_EVENT_MATCH_ADDED); } @@ -351,7 +351,7 @@ DEFUN (set_src, if (inet_pton(AF_INET6, argv[idx_ip]->arg, &src.ipv6) != 1) { vty_out (vty, "%% not a valid IPv4/v6 address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } p.family = family = AF_INET6; @@ -368,7 +368,7 @@ DEFUN (set_src, if (!zebra_check_addr(&p)) { vty_out (vty, "%% not a valid source IPv4/v6 address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) @@ -387,7 +387,7 @@ DEFUN (set_src, if (!pif) { vty_out (vty, "%% not a local address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } VTY_DECLVAR_CONTEXT (route_map_index, index); @@ -460,7 +460,7 @@ DEFUN (ip_protocol, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP][i]) { @@ -501,7 +501,7 @@ DEFUN (no_ip_protocol, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!proto_rm[AFI_IP][i]) @@ -567,7 +567,7 @@ DEFUN (ipv6_protocol, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (proto_rm[AFI_IP6][i]) { @@ -607,7 +607,7 @@ DEFUN (no_ipv6_protocol, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!proto_rm[AFI_IP6][i]) return CMD_SUCCESS; @@ -673,7 +673,7 @@ DEFUN (ip_protocol_nht_rmap, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP][i]) { @@ -708,7 +708,7 @@ DEFUN (no_ip_protocol_nht_rmap, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (!nht_rm[AFI_IP][i]) @@ -771,7 +771,7 @@ DEFUN (ipv6_protocol_nht_rmap, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i]) XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP6][i]); @@ -802,13 +802,13 @@ DEFUN (no_ipv6_protocol_nht_rmap, if (i < 0) { vty_out (vty, "invalid protocol name \"%s\"\n", proto); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i] && rmap && strcmp(rmap, nht_rm[AFI_IP6][i])) { vty_out (vty, "invalid route-map \"%s\"\n", rmap); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (nht_rm[AFI_IP6][i]) diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 6aaf7c86f..0ed832fb5 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -80,7 +80,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (ret <= 0) { vty_out (vty, "%% Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Cisco like mask notation. */ @@ -90,7 +90,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (ret == 0) { vty_out (vty, "%% Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } p.prefixlen = ip_masklen (mask); } @@ -114,7 +114,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (!zvrf) { vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Labels */ @@ -124,7 +124,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, { vty_out (vty, "%% MPLS not turned on in kernel, ignoring command\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, snh_label.label); @@ -143,7 +143,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, MPLS_MAX_LABELS); break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -153,7 +153,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, if (flag_str) { vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) static_add_route (AFI_IP, safi, type, &p, NULL, NULL, ifindex, ifname, @@ -177,7 +177,7 @@ zebra_static_ipv4 (struct vty *vty, safi_t safi, int add_cmd, break; default: vty_out (vty, "%% Malformed flag %s \n", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -287,7 +287,7 @@ DEFUN (ip_multicast_mode, else { vty_out (vty, "Invalid mode specified\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -1992,7 +1992,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret <= 0) { vty_out (vty, "%% Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (src_str) @@ -2001,7 +2001,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret <= 0 || src.family != AF_INET6) { vty_out (vty, "%% Malformed source address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } src_p = (struct prefix_ipv6*)&src; } @@ -2029,7 +2029,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!zvrf) { vty_out (vty, "%% vrf %s is not defined\n", vrf_id_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } /* Labels */ @@ -2040,7 +2040,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, { vty_out (vty, "%% MPLS not turned on in kernel, ignoring command\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } int rc = mpls_str2label (label_str, &snh_label.num_labels, snh_label.label); @@ -2059,7 +2059,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, MPLS_MAX_LABELS); break; } - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2069,7 +2069,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (flag_str) { vty_out (vty, "%% can not have flag %s with Null0\n", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } if (add_cmd) static_add_route (AFI_IP6, SAFI_UNICAST, type, &p, src_p, NULL, ifindex, ifname, @@ -2093,7 +2093,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, break; default: vty_out (vty, "%% Malformed flag %s \n", flag_str); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } } @@ -2104,7 +2104,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (ret != 1) { vty_out (vty, "%% Malformed address\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } type = STATIC_IPV6_GATEWAY_IFINDEX; gate = &gate_addr; @@ -2112,7 +2112,7 @@ static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str, if (!ifp) { vty_out (vty, "%% Malformed Interface name %s\n", ifname); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } ifindex = ifp->ifindex; } diff --git a/zebra/zserv.c b/zebra/zserv.c index d64ce8155..e3c8ea0dd 100644 --- a/zebra/zserv.c +++ b/zebra/zserv.c @@ -2812,7 +2812,7 @@ DEFUN (ip_forwarding, if (ret == 0) { vty_out (vty, "Can't turn on IP forwarding\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -2834,7 +2834,7 @@ DEFUN (no_ip_forwarding, if (ret != 0) { vty_out (vty, "Can't turn off IP forwarding\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -2985,7 +2985,7 @@ DEFUN (ipv6_forwarding, if (ret == 0) { vty_out (vty, "Can't turn on IPv6 forwarding\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; @@ -3007,7 +3007,7 @@ DEFUN (no_ipv6_forwarding, if (ret != 0) { vty_out (vty, "Can't turn off IPv6 forwarding\n"); - return CMD_WARNING; + return CMD_WARNING_CONFIG_FAILED; } return CMD_SUCCESS; |