Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga into cmaster

This commit is contained in:
Donald Sharp 2015-11-27 08:58:52 -08:00
commit cbdee2350a
28 changed files with 1285 additions and 407 deletions

View File

@ -494,6 +494,17 @@ DEFUN (no_neighbor_bfd,
return CMD_SUCCESS;
}
ALIAS (no_neighbor_bfd,
no_neighbor_bfd_val_cmd,
NO_NEIGHBOR_CMD2 "bfd " BFD_CMD_DETECT_MULT_RANGE BFD_CMD_MIN_RX_RANGE BFD_CMD_MIN_TX_RANGE,
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Disables BFD support\n"
"Detect Multiplier\n"
"Required min receive interval\n"
"Desired min transmit interval\n")
void
bgp_bfd_init(void)
{
@ -505,4 +516,5 @@ bgp_bfd_init(void)
install_element (BGP_NODE, &neighbor_bfd_cmd);
install_element (BGP_NODE, &neighbor_bfd_param_cmd);
install_element (BGP_NODE, &no_neighbor_bfd_cmd);
install_element (BGP_NODE, &no_neighbor_bfd_val_cmd);
}

View File

@ -312,16 +312,16 @@ community_list_entry_lookup (struct community_list *list, const void *arg,
switch (entry->style)
{
case COMMUNITY_LIST_STANDARD:
if (community_cmp (entry->u.com, arg))
if (entry->direct == direct && community_cmp (entry->u.com, arg))
return entry;
break;
case EXTCOMMUNITY_LIST_STANDARD:
if (ecommunity_cmp (entry->u.ecom, arg))
if (entry->direct == direct && ecommunity_cmp (entry->u.ecom, arg))
return entry;
break;
case COMMUNITY_LIST_EXPANDED:
case EXTCOMMUNITY_LIST_EXPANDED:
if (strcmp (entry->config, arg) == 0)
if (entry->direct == direct && strcmp (entry->config, arg) == 0)
return entry;
break;
default:
@ -765,17 +765,15 @@ community_list_set (struct community_list_handler *ch,
return 0;
}
/* Unset community-list. When str is NULL, delete all of
community-list entry belongs to the specified name. */
/* Unset community-list */
int
community_list_unset (struct community_list_handler *ch,
const char *name, const char *str,
int direct, int style)
int direct, int style, int delete_all)
{
struct community_entry *entry = NULL;
struct community_list *list;
struct community *com = NULL;
regex_t *regex = NULL;
/* Lookup community list. */
list = community_list_lookup (ch, name, COMMUNITY_LIST_MASTER);
@ -783,7 +781,7 @@ community_list_unset (struct community_list_handler *ch,
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
/* Delete all of entry belongs to this community-list. */
if (!str)
if (delete_all)
{
community_list_delete (list);
route_map_notify_dependencies(name, RMAP_EVENT_CLIST_DELETED);
@ -791,23 +789,19 @@ community_list_unset (struct community_list_handler *ch,
}
if (style == COMMUNITY_LIST_STANDARD)
com = community_str2com (str);
else
regex = bgp_regcomp (str);
if (! com && ! regex)
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
{
if (str)
com = community_str2com (str);
}
if (com)
entry = community_list_entry_lookup (list, com, direct);
{
entry = community_list_entry_lookup (list, com, direct);
community_free (com);
}
else
entry = community_list_entry_lookup (list, str, direct);
if (com)
community_free (com);
if (regex)
bgp_regex_free (regex);
if (!entry)
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
@ -894,12 +888,11 @@ extcommunity_list_set (struct community_list_handler *ch,
int
extcommunity_list_unset (struct community_list_handler *ch,
const char *name, const char *str,
int direct, int style)
int direct, int style, int delete_all)
{
struct community_entry *entry = NULL;
struct community_list *list;
struct ecommunity *ecom = NULL;
regex_t *regex = NULL;
/* Lookup extcommunity list. */
list = community_list_lookup (ch, name, EXTCOMMUNITY_LIST_MASTER);
@ -907,7 +900,7 @@ extcommunity_list_unset (struct community_list_handler *ch,
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;
/* Delete all of entry belongs to this extcommunity-list. */
if (!str)
if (delete_all)
{
community_list_delete (list);
route_map_notify_dependencies(name, RMAP_EVENT_ECLIST_DELETED);
@ -915,23 +908,19 @@ extcommunity_list_unset (struct community_list_handler *ch,
}
if (style == EXTCOMMUNITY_LIST_STANDARD)
ecom = ecommunity_str2com (str, 0, 1);
else
regex = bgp_regcomp (str);
if (! ecom && ! regex)
return COMMUNITY_LIST_ERR_MALFORMED_VAL;
{
if (str)
ecom = ecommunity_str2com (str, 0, 1);
}
if (ecom)
entry = community_list_entry_lookup (list, ecom, direct);
{
entry = community_list_entry_lookup (list, ecom, direct);
ecommunity_free (&ecom);
}
else
entry = community_list_entry_lookup (list, str, direct);
if (ecom)
ecommunity_free (&ecom);
if (regex)
bgp_regex_free (regex);
if (!entry)
return COMMUNITY_LIST_ERR_CANT_FIND_LIST;

View File

@ -132,13 +132,13 @@ extern int community_list_set (struct community_list_handler *ch,
int style);
extern int community_list_unset (struct community_list_handler *ch,
const char *name, const char *str,
int direct, int style);
int direct, int style, int delete_all);
extern int extcommunity_list_set (struct community_list_handler *ch,
const char *name, const char *str,
int direct, int style);
extern int extcommunity_list_unset (struct community_list_handler *ch,
const char *name, const char *str,
int direct, int style);
int direct, int style, int delete_all);
extern struct community_list_master *
community_list_master_lookup (struct community_list_handler *, int);

View File

@ -260,6 +260,12 @@ ecommunity_cmp (const void *arg1, const void *arg2)
{
const struct ecommunity *ecom1 = arg1;
const struct ecommunity *ecom2 = arg2;
if (ecom1 == NULL && ecom2 == NULL)
return 1;
if (ecom1 == NULL || ecom2 == NULL)
return 0;
return (ecom1->size == ecom2->size
&& memcmp (ecom1->val, ecom2->val, ecom1->size * ECOMMUNITY_SIZE) == 0);

View File

@ -12990,6 +12990,14 @@ ALIAS (bgp_damp_unset,
"Value to start suppressing a route\n"
"Maximum duration to suppress a stable route\n")
ALIAS (bgp_damp_unset,
bgp_damp_unset3_cmd,
"no bgp dampening <1-45>",
NO_STR
"BGP Specific commands\n"
"Enable route-flap dampening\n"
"Half-life time for the penalty\n")
DEFUN (show_ip_bgp_dampened_paths,
show_ip_bgp_dampened_paths_cmd,
"show ip bgp dampened-paths",
@ -14030,11 +14038,13 @@ bgp_route_init (void)
install_element (BGP_NODE, &bgp_damp_set3_cmd);
install_element (BGP_NODE, &bgp_damp_unset_cmd);
install_element (BGP_NODE, &bgp_damp_unset2_cmd);
install_element (BGP_NODE, &bgp_damp_unset3_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_set_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_set2_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_set3_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_unset_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_unset2_cmd);
install_element (BGP_IPV4_NODE, &bgp_damp_unset3_cmd);
}
void

View File

@ -570,6 +570,15 @@ DEFUN (no_bgp_config_type,
return CMD_SUCCESS;
}
ALIAS (no_bgp_config_type,
no_bgp_config_type_val_cmd,
"no bgp config-type (cisco|zebra)",
NO_STR
BGP_STR
"Configuration type\n"
"cisco\n"
"zebra\n")
DEFUN (no_synchronization,
no_synchronization_cmd,
"no synchronization",
@ -846,13 +855,21 @@ DEFUN (no_bgp_cluster_id,
}
ALIAS (no_bgp_cluster_id,
no_bgp_cluster_id_arg_cmd,
no_bgp_cluster_id_ip_cmd,
"no bgp cluster-id A.B.C.D",
NO_STR
BGP_STR
"Configure Route-Reflector Cluster-id\n"
"Route-Reflector Cluster-id in IP address format\n")
ALIAS (no_bgp_cluster_id,
no_bgp_cluster_id_decimal_cmd,
"no bgp cluster-id <1-4294967295>",
NO_STR
BGP_STR
"Configure Route-Reflector Cluster-id\n"
"Route-Reflector Cluster-id as 32 bit quantity\n")
DEFUN (bgp_confederation_identifier,
bgp_confederation_identifier_cmd,
"bgp confederation identifier " CMD_AS_RANGE,
@ -2264,6 +2281,15 @@ DEFUN (no_bgp_default_subgroup_pkt_queue_max,
return CMD_SUCCESS;
}
ALIAS (no_bgp_default_subgroup_pkt_queue_max,
no_bgp_default_subgroup_pkt_queue_max_val_cmd,
"no bgp default subgroup-pkt-queue-max <20-100>",
NO_STR
"BGP specific commands\n"
"Configure BGP defaults\n"
"subgroup-pkt-queue-max\n"
"Configure subgroup packet queue max\n")
DEFUN (bgp_rr_allow_outbound_policy,
bgp_rr_allow_outbound_policy_cmd,
"bgp route-reflector allow-outbound-policy",
@ -2344,6 +2370,14 @@ DEFUN (no_bgp_listen_limit,
return CMD_SUCCESS;
}
ALIAS (no_bgp_listen_limit,
no_bgp_listen_limit_val_cmd,
"no bgp listen limit " DYNAMIC_NEIGHBOR_LIMIT_RANGE,
NO_STR
"BGP specific commands\n"
"Configure BGP defaults\n"
"maximum number of BGP Dynamic Neighbors that can be created\n"
"Configure Dynamic Neighbors listen limit value\n")
/*
* Check if this listen range is already configured. Check for exact
@ -3025,6 +3059,15 @@ DEFUN (no_neighbor_password,
return bgp_vty_return (vty, ret);
}
ALIAS (no_neighbor_password,
no_neighbor_password_val_cmd,
NO_NEIGHBOR_CMD2 "password LINE",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"Set a password\n"
"The password\n")
DEFUN (neighbor_activate,
neighbor_activate_cmd,
NEIGHBOR_CMD2 "activate",
@ -4639,6 +4682,16 @@ DEFUN (no_neighbor_timers,
return peer_timers_unset_vty (vty, argv[0]);
}
ALIAS (no_neighbor_timers,
no_neighbor_timers_val_cmd,
NO_NEIGHBOR_CMD2 "timers <0-65535> <0-65535>",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"BGP per neighbor timers\n"
"Keepalive interval\n"
"Holdtime\n")
static int
peer_timers_connect_set_vty (struct vty *vty, const char *ip_str,
const char *time_str)
@ -5389,7 +5442,7 @@ ALIAS (no_neighbor_maximum_prefix,
ALIAS (no_neighbor_maximum_prefix,
no_neighbor_maximum_prefix_threshold_cmd,
NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> warning-only",
NO_NEIGHBOR_CMD2 "maximum-prefix <1-4294967295> <1-100>",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
@ -5496,6 +5549,15 @@ DEFUN (no_neighbor_allowas_in,
return bgp_vty_return (vty, ret);
}
ALIAS (no_neighbor_allowas_in,
no_neighbor_allowas_in_val_cmd,
NO_NEIGHBOR_CMD2 "allowas-in <1-10>",
NO_STR
NEIGHBOR_STR
NEIGHBOR_ADDR_STR2
"allow local ASN appears in aspath attribute\n"
"Number of occurances of AS number\n")
DEFUN (neighbor_ttl_security,
neighbor_ttl_security_cmd,
NEIGHBOR_CMD2 "ttl-security hops <1-254>",
@ -11910,7 +11972,7 @@ bgp_vty_init (void)
/* "bgp config-type" commands. */
install_element (CONFIG_NODE, &bgp_config_type_cmd);
install_element (CONFIG_NODE, &no_bgp_config_type_cmd);
install_element (CONFIG_NODE, &no_bgp_config_type_val_cmd);
/* Dummy commands (Currently not supported) */
install_element (BGP_NODE, &no_synchronization_cmd);
@ -11934,7 +11996,8 @@ bgp_vty_init (void)
install_element (BGP_NODE, &bgp_cluster_id_cmd);
install_element (BGP_NODE, &bgp_cluster_id32_cmd);
install_element (BGP_NODE, &no_bgp_cluster_id_cmd);
install_element (BGP_NODE, &no_bgp_cluster_id_arg_cmd);
install_element (BGP_NODE, &no_bgp_cluster_id_ip_cmd);
install_element (BGP_NODE, &no_bgp_cluster_id_decimal_cmd);
/* "bgp confederation" commands. */
install_element (BGP_NODE, &bgp_confederation_identifier_cmd);
@ -12083,6 +12146,7 @@ bgp_vty_init (void)
/* "bgp default subgroup-pkt-queue-max" commands. */
install_element (BGP_NODE, &bgp_default_subgroup_pkt_queue_max_cmd);
install_element (BGP_NODE, &no_bgp_default_subgroup_pkt_queue_max_cmd);
install_element (BGP_NODE, &no_bgp_default_subgroup_pkt_queue_max_val_cmd);
/* bgp ibgp-allow-policy-mods command */
install_element (BGP_NODE, &bgp_rr_allow_outbound_policy_cmd);
@ -12091,6 +12155,7 @@ bgp_vty_init (void)
/* "bgp listen limit" commands. */
install_element (BGP_NODE, &bgp_listen_limit_cmd);
install_element (BGP_NODE, &no_bgp_listen_limit_cmd);
install_element (BGP_NODE, &no_bgp_listen_limit_val_cmd);
/* "bgp listen range" commands. */
install_element (BGP_NODE, &bgp_listen_range_cmd);
@ -12124,6 +12189,7 @@ bgp_vty_init (void)
/* "neighbor password" commands. */
install_element (BGP_NODE, &neighbor_password_cmd);
install_element (BGP_NODE, &no_neighbor_password_cmd);
install_element (BGP_NODE, &no_neighbor_password_val_cmd);
/* "neighbor activate" commands. */
install_element (BGP_NODE, &neighbor_activate_cmd);
@ -12585,6 +12651,7 @@ bgp_vty_init (void)
/* "neighbor timers" commands. */
install_element (BGP_NODE, &neighbor_timers_cmd);
install_element (BGP_NODE, &no_neighbor_timers_cmd);
install_element (BGP_NODE, &no_neighbor_timers_val_cmd);
/* "neighbor timers connect" commands. */
install_element (BGP_NODE, &neighbor_timers_connect_cmd);
@ -12754,21 +12821,27 @@ bgp_vty_init (void)
install_element (BGP_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_NODE, &no_neighbor_allowas_in_val_cmd);
install_element (BGP_IPV4_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_IPV4_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_IPV4_NODE, &no_neighbor_allowas_in_val_cmd);
install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_IPV4M_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_IPV4M_NODE, &no_neighbor_allowas_in_val_cmd);
install_element (BGP_IPV6_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_IPV6_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_IPV6_NODE, &no_neighbor_allowas_in_val_cmd);
install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_IPV6M_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_IPV6M_NODE, &no_neighbor_allowas_in_val_cmd);
install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_cmd);
install_element (BGP_VPNV4_NODE, &neighbor_allowas_in_arg_cmd);
install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_cmd);
install_element (BGP_VPNV4_NODE, &no_neighbor_allowas_in_val_cmd);
/* address-family commands. */
install_element (BGP_NODE, &address_family_ipv4_cmd);
@ -13307,7 +13380,7 @@ community_list_set_vty (struct vty *vty, int argc, const char **argv,
/* Communiyt-list entry delete. */
static int
community_list_unset_vty (struct vty *vty, int argc, const char **argv,
int style)
int style, int delete_all)
{
int ret;
int direct = 0;
@ -13332,7 +13405,7 @@ community_list_unset_vty (struct vty *vty, int argc, const char **argv,
}
/* Unset community list. */
ret = community_list_unset (bgp_clist, argv[0], str, direct, style);
ret = community_list_unset (bgp_clist, argv[0], str, direct, style, delete_all);
/* Free temporary community list string allocated by
argv_concat(). */
@ -13433,9 +13506,23 @@ DEFUN (no_ip_community_list_standard_all,
COMMUNITY_LIST_STR
"Community list number (standard)\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1);
}
DEFUN (no_ip_community_list_standard_direction,
no_ip_community_list_standard_direction_cmd,
"no ip community-list <1-99> (deny|permit)",
NO_STR
IP_STR
COMMUNITY_LIST_STR
"Community list number (standard)\n"
"Specify community to reject\n"
"Specify community to accept\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_community_list_expanded_all,
no_ip_community_list_expanded_all_cmd,
"no ip community-list <100-500>",
@ -13444,7 +13531,7 @@ DEFUN (no_ip_community_list_expanded_all,
COMMUNITY_LIST_STR
"Community list number (expanded)\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1);
}
DEFUN (no_ip_community_list_name_standard_all,
@ -13456,7 +13543,7 @@ DEFUN (no_ip_community_list_name_standard_all,
"Add a standard community-list entry\n"
"Community list name\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 1);
}
DEFUN (no_ip_community_list_name_expanded_all,
@ -13468,7 +13555,7 @@ DEFUN (no_ip_community_list_name_expanded_all,
"Add an expanded community-list entry\n"
"Community list name\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 1);
}
DEFUN (no_ip_community_list_standard,
@ -13482,7 +13569,7 @@ DEFUN (no_ip_community_list_standard,
"Specify community to accept\n"
COMMUNITY_VAL_STR)
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_community_list_expanded,
@ -13496,7 +13583,7 @@ DEFUN (no_ip_community_list_expanded,
"Specify community to accept\n"
"An ordered list as a regular-expression\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0);
}
DEFUN (no_ip_community_list_name_standard,
@ -13511,7 +13598,21 @@ DEFUN (no_ip_community_list_name_standard,
"Specify community to accept\n"
COMMUNITY_VAL_STR)
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_community_list_name_standard_brief,
no_ip_community_list_name_standard_brief_cmd,
"no ip community-list standard WORD (deny|permit)",
NO_STR
IP_STR
COMMUNITY_LIST_STR
"Specify a standard community-list\n"
"Community list name\n"
"Specify community to reject\n"
"Specify community to accept\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_community_list_name_expanded,
@ -13526,7 +13627,7 @@ DEFUN (no_ip_community_list_name_expanded,
"Specify community to accept\n"
"An ordered list as a regular-expression\n")
{
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED);
return community_list_unset_vty (vty, argc, argv, COMMUNITY_LIST_EXPANDED, 0);
}
static void
@ -13657,7 +13758,7 @@ extcommunity_list_set_vty (struct vty *vty, int argc, const char **argv,
static int
extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
int style)
int style, int delete_all)
{
int ret;
int direct = 0;
@ -13682,7 +13783,7 @@ extcommunity_list_unset_vty (struct vty *vty, int argc, const char **argv,
}
/* Unset community list. */
ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style);
ret = extcommunity_list_unset (bgp_clist, argv[0], str, direct, style, delete_all);
/* Free temporary community list string allocated by
argv_concat(). */
@ -13783,7 +13884,20 @@ DEFUN (no_ip_extcommunity_list_standard_all,
EXTCOMMUNITY_LIST_STR
"Extended Community list number (standard)\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1);
}
DEFUN (no_ip_extcommunity_list_standard_direction,
no_ip_extcommunity_list_standard_direction_cmd,
"no ip extcommunity-list <1-99> (deny|permit)",
NO_STR
IP_STR
EXTCOMMUNITY_LIST_STR
"Extended Community list number (standard)\n"
"Specify community to reject\n"
"Specify community to accept\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_extcommunity_list_expanded_all,
@ -13794,7 +13908,7 @@ DEFUN (no_ip_extcommunity_list_expanded_all,
EXTCOMMUNITY_LIST_STR
"Extended Community list number (expanded)\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1);
}
DEFUN (no_ip_extcommunity_list_name_standard_all,
@ -13806,7 +13920,7 @@ DEFUN (no_ip_extcommunity_list_name_standard_all,
"Specify standard extcommunity-list\n"
"Extended Community list name\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 1);
}
DEFUN (no_ip_extcommunity_list_name_expanded_all,
@ -13818,7 +13932,7 @@ DEFUN (no_ip_extcommunity_list_name_expanded_all,
"Specify expanded extcommunity-list\n"
"Extended Community list name\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 1);
}
DEFUN (no_ip_extcommunity_list_standard,
@ -13832,7 +13946,7 @@ DEFUN (no_ip_extcommunity_list_standard,
"Specify community to accept\n"
EXTCOMMUNITY_VAL_STR)
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_extcommunity_list_expanded,
@ -13846,7 +13960,7 @@ DEFUN (no_ip_extcommunity_list_expanded,
"Specify community to accept\n"
"An ordered list as a regular-expression\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0);
}
DEFUN (no_ip_extcommunity_list_name_standard,
@ -13861,7 +13975,21 @@ DEFUN (no_ip_extcommunity_list_name_standard,
"Specify community to accept\n"
EXTCOMMUNITY_VAL_STR)
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_extcommunity_list_name_standard_brief,
no_ip_extcommunity_list_name_standard_brief_cmd,
"no ip extcommunity-list standard WORD (deny|permit)",
NO_STR
IP_STR
EXTCOMMUNITY_LIST_STR
"Specify standard extcommunity-list\n"
"Extended Community list name\n"
"Specify community to reject\n"
"Specify community to accept\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_STANDARD, 0);
}
DEFUN (no_ip_extcommunity_list_name_expanded,
@ -13876,7 +14004,7 @@ DEFUN (no_ip_extcommunity_list_name_expanded,
"Specify community to accept\n"
"An ordered list as a regular-expression\n")
{
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED);
return extcommunity_list_unset_vty (vty, argc, argv, EXTCOMMUNITY_LIST_EXPANDED, 0);
}
static void
@ -14052,12 +14180,14 @@ community_list_vty (void)
install_element (CONFIG_NODE, &ip_community_list_name_standard2_cmd);
install_element (CONFIG_NODE, &ip_community_list_name_expanded_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_standard_all_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_standard_direction_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_expanded_all_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_name_standard_all_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_all_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_standard_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_expanded_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_name_standard_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_name_standard_brief_cmd);
install_element (CONFIG_NODE, &no_ip_community_list_name_expanded_cmd);
install_element (VIEW_NODE, &show_ip_community_list_cmd);
install_element (VIEW_NODE, &show_ip_community_list_arg_cmd);
@ -14072,12 +14202,14 @@ community_list_vty (void)
install_element (CONFIG_NODE, &ip_extcommunity_list_name_standard2_cmd);
install_element (CONFIG_NODE, &ip_extcommunity_list_name_expanded_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_all_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_direction_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_all_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_all_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_all_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_standard_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_expanded_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_standard_brief_cmd);
install_element (CONFIG_NODE, &no_ip_extcommunity_list_name_expanded_cmd);
install_element (VIEW_NODE, &show_ip_extcommunity_list_cmd);
install_element (VIEW_NODE, &show_ip_extcommunity_list_arg_cmd);

View File

@ -6336,8 +6336,9 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
}
/* advertisement-interval */
if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV) &&
! peer_group_active (peer))
if (CHECK_FLAG (peer->config, PEER_CONFIG_ROUTEADV)
&& peer->v_routeadv != BGP_DEFAULT_EBGP_ROUTEADV
&& ! peer_group_active (peer))
{
vty_out (vty, " neighbor %s advertisement-interval %d%s",
addr, peer->v_routeadv, VTY_NEWLINE);
@ -6345,6 +6346,7 @@ bgp_config_write_peer_global (struct vty *vty, struct bgp *bgp,
/* timers */
if (CHECK_FLAG (peer->config, PEER_CONFIG_TIMER)
&& (peer->keepalive != BGP_DEFAULT_KEEPALIVE || peer->holdtime != BGP_DEFAULT_HOLDTIME)
&& ! peer_group_active (peer))
{
vty_out (vty, " neighbor %s timers %d %d%s", addr,

View File

@ -1,20 +1,20 @@
/* A generic nexthop structure
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of GNU Zebra.
* This file is part of Quagga.
*
* GNU Zebra is free software; you can redistribute it and/or modify it
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* GNU Zebra is distributed in the hope that it will be useful, but
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
@ -98,3 +98,71 @@ nexthop_type_to_str (enum nexthop_types_t nh_type)
return desc[nh_type];
}
struct nexthop *
nexthop_new (void)
{
return XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
}
/* Add nexthop to the end of a nexthop list. */
void
nexthop_add (struct nexthop **target, struct nexthop *nexthop)
{
struct nexthop *last;
for (last = *target; last && last->next; last = last->next)
;
if (last)
last->next = nexthop;
else
*target = nexthop;
nexthop->prev = last;
}
void
copy_nexthops (struct nexthop **tnh, struct nexthop *nh)
{
struct nexthop *nexthop;
struct nexthop *nh1;
for (nh1 = nh; nh1; nh1 = nh1->next)
{
nexthop = nexthop_new();
nexthop->flags = nh->flags;
nexthop->type = nh->type;
nexthop->ifindex = nh->ifindex;
if (nh->ifname)
nexthop->ifname = XSTRDUP(0, nh->ifname);
memcpy(&(nexthop->gate), &(nh->gate), sizeof(union g_addr));
memcpy(&(nexthop->src), &(nh->src), sizeof(union g_addr));
nexthop_add(tnh, nexthop);
if (CHECK_FLAG(nh1->flags, NEXTHOP_FLAG_RECURSIVE))
copy_nexthops(&nexthop->resolved, nh1->resolved);
}
}
/* Free nexthop. */
void
nexthop_free (struct nexthop *nexthop)
{
if (nexthop->ifname)
XFREE (0, nexthop->ifname);
if (nexthop->resolved)
nexthops_free(nexthop->resolved);
XFREE (MTYPE_NEXTHOP, nexthop);
}
/* Frees a list of nexthops */
void
nexthops_free (struct nexthop *nexthop)
{
struct nexthop *nh, *next;
for (nh = nexthop; nh; nh = next)
{
next = nh->next;
nexthop_free (nh);
}
}

View File

@ -1,21 +1,22 @@
/*
* Nexthop structure definition.
* Copyright (C) 1997, 98, 99, 2001 Kunihiro Ishiguro
* Copyright (C) 2013 Cumulus Networks, Inc.
*
* This file is part of GNU Zebra.
* This file is part of Quagga.
*
* GNU Zebra is free software; you can redistribute it and/or modify it
* Quagga is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* GNU Zebra is distributed in the hope that it will be useful, but
* Quagga is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GNU Zebra; see the file COPYING. If not, write to the Free
* along with Quagga; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
@ -77,13 +78,6 @@ struct nexthop
struct nexthop *resolved;
};
#define nexthop_new() \
({ \
struct nexthop *n = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); \
n; \
})
extern int zebra_rnh_ip_default_route;
extern int zebra_rnh_ipv6_default_route;
@ -97,6 +91,13 @@ nh_resolve_via_default(int family)
return 0;
}
struct nexthop *nexthop_new (void);
void nexthop_add (struct nexthop **target, struct nexthop *nexthop);
void copy_nexthops (struct nexthop **tnh, struct nexthop *nh);
void nexthop_free (struct nexthop *nexthop);
void nexthops_free (struct nexthop *nexthop);
extern const char *nexthop_type_to_str (enum nexthop_types_t nh_type);
extern int nexthop_same_no_recurse (struct nexthop *next1, struct nexthop *next2);

View File

@ -158,9 +158,19 @@ do { \
char *endptr = NULL; \
errno = 0; \
(V) = strtoul ((STR), &endptr, 10); \
if (*(STR) == '-' || *endptr != '\0' || errno) \
if (*(STR) == '-') \
{ \
vty_out (vty, "%% Invalid %s value%s", NAME, VTY_NEWLINE); \
vty_out (vty, "%% Invalid %s value (dash)%s", NAME, VTY_NEWLINE); \
return CMD_WARNING; \
} \
if (*endptr != '\0') \
{ \
vty_out (vty, "%% Invalid %s value (%s)%s", NAME, endptr, VTY_NEWLINE); \
return CMD_WARNING; \
} \
if (errno) \
{ \
vty_out (vty, "%% Invalid %s value (error %d)%s", NAME, errno, VTY_NEWLINE); \
return CMD_WARNING; \
} \
} while (0)
@ -171,9 +181,19 @@ do { \
char *endptr = NULL; \
errno = 0; \
(V) = strtoull ((STR), &endptr, 10); \
if (*(STR) == '-' || *endptr != '\0' || errno) \
if (*(STR) == '-') \
{ \
vty_out (vty, "%% Invalid %s value%s", NAME, VTY_NEWLINE); \
vty_out (vty, "%% Invalid %s value (dash)%s", NAME, VTY_NEWLINE); \
return CMD_WARNING; \
} \
if (*endptr != '\0') \
{ \
vty_out (vty, "%% Invalid %s value (%s)%s", NAME, endptr, VTY_NEWLINE); \
return CMD_WARNING; \
} \
if (errno) \
{ \
vty_out (vty, "%% Invalid %s value (error %d)%s", NAME, errno, VTY_NEWLINE); \
return CMD_WARNING; \
} \
} while (0)

View File

@ -535,11 +535,11 @@ ALIAS (area_range,
DEFUN (no_area_range,
no_area_range_cmd,
"no area A.B.C.D range X:X::X:X/M",
NO_STR
"OSPF area parameters\n"
OSPF6_AREA_ID_STR
"Configured address range\n"
"Specify IPv6 prefix\n"
)
"Specify IPv6 prefix\n")
{
int ret;
struct ospf6_area *oa;
@ -584,6 +584,37 @@ DEFUN (no_area_range,
return CMD_SUCCESS;
}
ALIAS (no_area_range,
no_area_range_advertise_cmd,
"no area A.B.C.D range X:X::X:X/M (advertise|not-advertise)",
NO_STR
"OSPF area parameters\n"
OSPF6_AREA_ID_STR
"Configured address range\n"
"Specify IPv6 prefix\n")
ALIAS (no_area_range,
no_area_range_cost_cmd,
"no area (A.B.C.D|<0-4294967295>) range X:X::X:X/M cost <0-16777215>",
NO_STR
"OSPF area parameters\n"
OSPF6_AREA_ID_STR
"Summarize routes matching address/mask (border routers only)\n"
"Area range prefix\n"
"User specified metric for this range\n"
"Advertised metric for this range\n")
ALIAS (no_area_range,
no_area_range_advertise_cost_cmd,
"no area (A.B.C.D|<0-4294967295>) range X:X::X:X/M advertise cost <0-16777215>",
NO_STR
"OSPF area parameters\n"
OSPF6_AREA_ID_STR
"Summarize routes matching address/mask (border routers only)\n"
"Area range prefix\n"
"User specified metric for this range\n"
"Advertised metric for this range\n")
void
ospf6_area_config_write (struct vty *vty)
{
@ -598,7 +629,20 @@ ospf6_area_config_write (struct vty *vty)
range = ospf6_route_next (range))
{
prefix2str (&range->prefix, buf, sizeof (buf));
vty_out (vty, " area %s range %s%s", oa->name, buf, VNL);
vty_out (vty, " area %s range %s", oa->name, buf);
if (CHECK_FLAG (range->flag, OSPF6_ROUTE_DO_NOT_ADVERTISE))
{
vty_out (vty, " not-advertise");
}
else
{
// "advertise" is the default so we do not display it
if (range->path.u.cost_config != OSPF_AREA_RANGE_COST_UNSPEC)
vty_out (vty, " cost %d", range->path.u.cost_config);
}
vty_out (vty, "%s", VNL);
}
if (IS_AREA_STUB (oa))
{
@ -1054,6 +1098,9 @@ ospf6_area_init (void)
install_element (OSPF6_NODE, &area_range_cost_cmd);
install_element (OSPF6_NODE, &area_range_advertise_cost_cmd);
install_element (OSPF6_NODE, &no_area_range_cmd);
install_element (OSPF6_NODE, &no_area_range_advertise_cmd);
install_element (OSPF6_NODE, &no_area_range_cost_cmd);
install_element (OSPF6_NODE, &no_area_range_advertise_cost_cmd);
install_element (OSPF6_NODE, &ospf6_area_stub_no_summary_cmd);
install_element (OSPF6_NODE, &ospf6_area_stub_cmd);
install_element (OSPF6_NODE, &no_ospf6_area_stub_no_summary_cmd);

View File

@ -1370,6 +1370,14 @@ DEFUN (no_auto_cost_reference_bandwidth,
return CMD_SUCCESS;
}
ALIAS (no_auto_cost_reference_bandwidth,
no_auto_cost_reference_bandwidth_val_cmd,
"no auto-cost reference-bandwidth <1-4294967>",
NO_STR
"Calculate OSPF interface cost according to bandwidth\n"
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
DEFUN (ipv6_ospf6_hellointerval,
ipv6_ospf6_hellointerval_cmd,
"ipv6 ospf6 hello-interval <1-65535>",
@ -1933,6 +1941,7 @@ ospf6_interface_init (void)
/* reference bandwidth commands */
install_element (OSPF6_NODE, &auto_cost_reference_bandwidth_cmd);
install_element (OSPF6_NODE, &no_auto_cost_reference_bandwidth_cmd);
install_element (OSPF6_NODE, &no_auto_cost_reference_bandwidth_val_cmd);
}
/* Clear the specified interface structure */

View File

@ -911,6 +911,17 @@ DEFUN (no_ospf6_timers_throttle_spf,
OSPF_SPF_MAX_HOLDTIME_DEFAULT);
}
ALIAS (no_ospf6_timers_throttle_spf,
no_ospf6_timers_throttle_spf_val_cmd,
"no timers throttle spf <0-600000> <0-600000> <0-600000>",
NO_STR
"Adjust routing timers\n"
"Throttling adaptive timer\n"
"OSPF6 SPF timers\n"
"Delay (msec) from first change received till SPF calculation\n"
"Initial hold time (msec) between consecutive SPF calculations\n"
"Maximum hold time (msec)\n")
int
config_write_ospf6_debug_spf (struct vty *vty)
{
@ -958,4 +969,5 @@ ospf6_spf_init (void)
{
install_element (OSPF6_NODE, &ospf6_timers_throttle_spf_cmd);
install_element (OSPF6_NODE, &no_ospf6_timers_throttle_spf_cmd);
install_element (OSPF6_NODE, &no_ospf6_timers_throttle_spf_val_cmd);
}

View File

@ -424,6 +424,17 @@ DEFUN (no_ip_ospf_bfd,
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_bfd,
no_ip_ospf_bfd_param_cmd,
"no ip ospf bfd " BFD_CMD_DETECT_MULT_RANGE BFD_CMD_MIN_RX_RANGE BFD_CMD_MIN_TX_RANGE,
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Enables BFD support\n"
"Detect Multiplier\n"
"Required min receive interval\n"
"Desired min transmit interval\n")
void
ospf_bfd_init(void)
{
@ -435,4 +446,5 @@ ospf_bfd_init(void)
install_element (INTERFACE_NODE, &ip_ospf_bfd_cmd);
install_element (INTERFACE_NODE, &ip_ospf_bfd_param_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_bfd_param_cmd);
}

View File

@ -1417,8 +1417,8 @@ ospf_mpls_te_config_write_router (struct vty *vty)
{
if (OspfMplsTE.status == enabled)
{
vty_out (vty, " mpls-te%s", VTY_NEWLINE);
vty_out (vty, " mpls-te router-address %s%s",
vty_out (vty, " mpls-te%s", VTY_NEWLINE);
vty_out (vty, " mpls-te router-address %s%s",
inet_ntoa (OspfMplsTE.router_addr.value), VTY_NEWLINE);
}
return;
@ -1536,6 +1536,13 @@ DEFUN (no_mpls_te,
return CMD_SUCCESS;
}
ALIAS (no_mpls_te,
no_mpls_te_val_cmd,
"no mpls-te on",
NO_STR
"Configure MPLS-TE parameters\n"
"Disable the MPLS-TE functionality\n")
DEFUN (mpls_te_router_addr,
mpls_te_router_addr_cmd,
"mpls-te router-address A.B.C.D",
@ -1908,6 +1915,7 @@ ospf_mpls_te_register_vty (void)
install_element (OSPF_NODE, &mpls_te_cmd);
install_element (OSPF_NODE, &no_mpls_te_cmd);
install_element (OSPF_NODE, &no_mpls_te_val_cmd);
install_element (OSPF_NODE, &mpls_te_on_cmd);
install_element (OSPF_NODE, &mpls_te_router_addr_cmd);

View File

@ -1321,7 +1321,7 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_param1_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_TIME_PARAM)
@ -1338,8 +1338,8 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_param2_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_TIME_PARAM
@ -1359,9 +1359,9 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_param3_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_TIME_PARAM
@ -1384,10 +1384,10 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_param4_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval)",
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535> "
"(hello-interval|retransmit-interval|transmit-delay|dead-interval) <1-65535>",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_TIME_PARAM
@ -1402,6 +1402,14 @@ ALIAS (ospf_area_vlink,
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_ALL)
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authtype_args_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication|) (message-digest|null)",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_ALL)
ALIAS (ospf_area_vlink,
ospf_area_vlink_authtype_cmd,
"area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
@ -1427,7 +1435,7 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_md5_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(message-digest-key|) <1-255>",
"(message-digest-key|) <1-255> md5 KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTH_MD5)
@ -1442,7 +1450,7 @@ ALIAS (ospf_area_vlink,
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authkey_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication-key|)",
"(authentication-key|) AUTH_KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTH_SIMPLE)
@ -1456,6 +1464,16 @@ ALIAS (ospf_area_vlink,
VLINK_HELPSTR_AUTHTYPE_ALL
VLINK_HELPSTR_AUTH_SIMPLE)
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authtype_args_authkey_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication|) (message-digest|null) "
"(authentication-key|) AUTH_KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_ALL
VLINK_HELPSTR_AUTH_SIMPLE)
ALIAS (ospf_area_vlink,
ospf_area_vlink_authtype_authkey_cmd,
"area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
@ -1469,7 +1487,7 @@ ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authtype_authkey_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication|) "
"(authentication-key|)",
"(authentication-key|) AUTH_KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_SIMPLE
@ -1484,6 +1502,16 @@ ALIAS (ospf_area_vlink,
VLINK_HELPSTR_AUTHTYPE_ALL
VLINK_HELPSTR_AUTH_MD5)
ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authtype_args_md5_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication|) (message-digest|null) "
"(message-digest-key|) <1-255> md5 KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_ALL
VLINK_HELPSTR_AUTH_MD5)
ALIAS (ospf_area_vlink,
ospf_area_vlink_authtype_md5_cmd,
"area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
@ -1497,7 +1525,7 @@ ALIAS (no_ospf_area_vlink,
no_ospf_area_vlink_authtype_md5_cmd,
"no area (A.B.C.D|<0-4294967295>) virtual-link A.B.C.D "
"(authentication|) "
"(message-digest-key|)",
"(message-digest-key|) <1-255> md5 KEY",
NO_STR
VLINK_HELPSTR_IPADDR
VLINK_HELPSTR_AUTHTYPE_SIMPLE
@ -1813,28 +1841,18 @@ DEFUN (no_ospf_area_nssa,
return CMD_SUCCESS;
}
DEFUN (no_ospf_area_nssa_no_summary,
ALIAS (no_ospf_area_nssa,
no_ospf_area_nssa_no_summary_cmd,
"no area (A.B.C.D|<0-4294967295>) nssa no-summary",
"no area (A.B.C.D|<0-4294967295>) nssa (translate-candidate|translate-never|translate-always|) {no-summary}",
NO_STR
"OSPF area parameters\n"
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n"
"Configure OSPF area as nssa\n"
"Configure NSSA-ABR for translate election (default)\n"
"Configure NSSA-ABR to never translate\n"
"Configure NSSA-ABR to always translate\n"
"Do not inject inter-area routes into nssa\n")
{
struct ospf *ospf = vty->index;
struct in_addr area_id;
int format;
if (!ospf)
return CMD_SUCCESS;
VTY_GET_OSPF_AREA_ID_NO_BB ("NSSA", area_id, format, argv[0]);
ospf_area_no_summary_unset (ospf, area_id);
return CMD_SUCCESS;
}
DEFUN (ospf_area_default_cost,
ospf_area_default_cost_cmd,
@ -2437,7 +2455,7 @@ DEFUN (ospf_timers_min_ls_interval,
"Adjust routing timers\n"
"Throttling adaptive timer\n"
"LSA delay between transmissions\n"
NO_STR
"All LSA types\n"
"Delay (msec) between sending LSAs\n")
{
struct ospf *ospf = vty->index;
@ -2462,7 +2480,8 @@ DEFUN (no_ospf_timers_min_ls_interval,
NO_STR
"Adjust routing timers\n"
"Throttling adaptive timer\n"
"LSA delay between transmissions\n")
"LSA delay between transmissions\n"
"All LSA types\n")
{
struct ospf *ospf = vty->index;
ospf->min_ls_interval = OSPF_MIN_LS_INTERVAL;
@ -2470,6 +2489,16 @@ DEFUN (no_ospf_timers_min_ls_interval,
return CMD_SUCCESS;
}
ALIAS (no_ospf_timers_min_ls_interval,
no_ospf_timers_min_ls_interval_val_cmd,
"no timers throttle lsa all <0-5000>",
NO_STR
"Adjust routing timers\n"
"Throttling adaptive timer\n"
"LSA delay between transmissions\n"
"All LSA types\n"
"Delay (msec) between sending LSAs\n")
DEFUN (ospf_timers_min_ls_arrival,
ospf_timers_min_ls_arrival_cmd,
"timers lsa arrival <0-1000>",
@ -2508,6 +2537,15 @@ DEFUN (no_ospf_timers_min_ls_arrival,
return CMD_SUCCESS;
}
ALIAS (no_ospf_timers_min_ls_arrival,
no_ospf_timers_min_ls_arrival_val_cmd,
"no timers lsa arrival <0-1000>",
NO_STR
"Adjust routing timers\n"
"Throttling link state advertisement delays\n"
"OSPF minimum arrival interval delay\n"
"Delay (msec) between accepted LSAs\n")
DEFUN (ospf_timers_throttle_spf,
ospf_timers_throttle_spf_cmd,
"timers throttle spf <0-600000> <0-600000> <0-600000>",
@ -2549,7 +2587,7 @@ DEFUN (no_ospf_timers_throttle_spf,
ALIAS (no_ospf_timers_throttle_spf,
no_ospf_timers_throttle_spf_val_cmd,
"no timers throttle spf <0-60000> <0-60000> <0-60000>",
"no timers throttle spf <0-600000> <0-600000> <0-600000>",
NO_STR
"Adjust routing timers\n"
"Throttling adaptive timer\n"
@ -2753,6 +2791,17 @@ ALIAS (no_ospf_neighbor,
"Dead Neighbor Polling interval\n"
"Seconds\n")
ALIAS (no_ospf_neighbor,
no_ospf_neighbor_poll_interval_priority_cmd,
"no neighbor A.B.C.D poll-interval <1-65535> priority <0-255>",
NO_STR
NEIGHBOR_STR
"Neighbor IP address\n"
"Dead Neighbor Polling interval\n"
"Seconds\n"
"OSPF priority of non-broadcast neighbor\n"
"Priority\n")
ALIAS (no_ospf_neighbor,
no_ospf_neighbor_priority_pollinterval_cmd,
"no neighbor A.B.C.D priority <0-255> poll-interval <1-65535>",
@ -2764,7 +2813,6 @@ ALIAS (no_ospf_neighbor,
"Dead Neighbor Polling interval\n"
"Seconds\n")
DEFUN (ospf_refresh_timer, ospf_refresh_timer_cmd,
"refresh timer <10-1800>",
"Adjust refresh parameters\n"
@ -2877,6 +2925,14 @@ DEFUN (no_ospf_auto_cost_reference_bandwidth,
return CMD_SUCCESS;
}
ALIAS (no_ospf_auto_cost_reference_bandwidth,
no_ospf_auto_cost_reference_bandwidth_val_cmd,
"no auto-cost reference-bandwidth <1-4294967>",
NO_STR
"Calculate OSPF interface cost according to bandwidth\n"
"Use reference bandwidth method to assign OSPF cost\n"
"The reference bandwidth in terms of Mbits per second\n")
DEFUN (ospf_write_multiplier,
ospf_write_multiplier_cmd,
"ospf write-multiplier <1-100>",
@ -2909,10 +2965,11 @@ ALIAS (ospf_write_multiplier,
DEFUN (no_ospf_write_multiplier,
no_ospf_write_multiplier_cmd,
"no ospf write-multiplier",
"no ospf write-multiplier <1-100>",
NO_STR
"OSPF specific commands\n"
"Write multiplier\n")
"Write multiplier\n"
"Maximum number of interface serviced per write\n")
{
struct ospf *ospf = vty->index;
@ -2929,6 +2986,13 @@ ALIAS (no_ospf_write_multiplier,
NO_STR
"Write multiplier\n")
ALIAS (no_ospf_write_multiplier,
no_write_multiplier_val_cmd,
"no write-multiplier <1-100>",
NO_STR
"Write multiplier\n"
"Maximum number of interface serviced per write\n")
const char *ospf_abr_type_descr_str[] =
{
"Unknown",
@ -6123,6 +6187,12 @@ DEFUN (no_ip_ospf_authentication_args,
* we need to find if we have any ip addresses underneath it that
* correspond to the associated type.
*/
if (params->auth_type == auth_type)
{
params->auth_type = OSPF_AUTH_NOTSET;
UNSET_IF_PARAM (params, auth_type);
}
for (rn = route_top (IF_OIFS_PARAMS (ifp)); rn; rn = route_next (rn))
{
if ((params = rn->info))
@ -6204,10 +6274,19 @@ DEFUN (no_ip_ospf_authentication,
* We should remove all authentication types from
* the interface.
*/
if ((params->auth_type == OSPF_AUTH_NULL) ||
(params->auth_type == OSPF_AUTH_CRYPTOGRAPHIC) ||
(params->auth_type == OSPF_AUTH_SIMPLE))
{
params->auth_type = OSPF_AUTH_NOTSET;
UNSET_IF_PARAM (params, auth_type);
}
for (rn = route_top (IF_OIFS_PARAMS (ifp)); rn; rn = route_next (rn))
{
if ((params = rn->info))
{
if ((params->auth_type == OSPF_AUTH_NULL) ||
(params->auth_type == OSPF_AUTH_CRYPTOGRAPHIC) ||
(params->auth_type == OSPF_AUTH_SIMPLE))
@ -6266,7 +6345,6 @@ DEFUN (ip_ospf_authentication_key,
ospf_if_update_params (ifp, addr);
}
memset (params->auth_simple, 0, OSPF_AUTH_SIMPLE_SIZE + 1);
strncpy ((char *) params->auth_simple, argv[0], OSPF_AUTH_SIMPLE_SIZE);
SET_IF_PARAM (params, auth_simple);
@ -6290,25 +6368,25 @@ ALIAS (ip_ospf_authentication_key,
"The OSPF password (key)")
DEFUN (no_ip_ospf_authentication_key,
no_ip_ospf_authentication_key_addr_cmd,
"no ip ospf authentication-key A.B.C.D",
no_ip_ospf_authentication_key_authkey_addr_cmd,
"no ip ospf authentication-key AUTH_KEY A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Authentication password (key)\n"
"Address of interface")
"The OSPF password (key)")
{
struct interface *ifp;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
int ret;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 1)
if (argc == 2)
{
ret = inet_aton(argv[0], &addr);
ret = inet_aton(argv[1], &addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
@ -6333,6 +6411,14 @@ DEFUN (no_ip_ospf_authentication_key,
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_authentication_key,
no_ip_ospf_authentication_key_authkey_cmd,
"no ip ospf authentication-key AUTH_KEY",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Authentication password (key)\n")
ALIAS (no_ip_ospf_authentication_key,
no_ip_ospf_authentication_key_cmd,
"no ip ospf authentication-key",
@ -6348,6 +6434,23 @@ ALIAS (no_ip_ospf_authentication_key,
"OSPF interface commands\n"
"Authentication password (key)\n")
ALIAS (no_ip_ospf_authentication_key,
no_ospf_authentication_key_authkey_cmd,
"no ospf authentication-key AUTH_KEY",
NO_STR
"OSPF interface commands\n"
"Authentication password (key)\n"
"The OSPF password (key)\n")
ALIAS (no_ip_ospf_authentication_key,
no_ospf_authentication_key_authkey_ip_cmd,
"no ospf authentication-key AUTH_KEY A.B.C.D",
NO_STR
"OSPF interface commands\n"
"Authentication password (key)\n"
"The OSPF password (key)\n"
"Address of interface")
DEFUN (ip_ospf_message_digest_key,
ip_ospf_message_digest_key_addr_cmd,
"ip ospf message-digest-key <1-255> md5 KEY A.B.C.D",
@ -6420,6 +6523,73 @@ ALIAS (ip_ospf_message_digest_key,
"Use MD5 algorithm\n"
"The OSPF password (key)")
DEFUN (no_ip_ospf_message_digest_key_md5,
no_ip_ospf_message_digest_key_md5_addr_cmd,
"no ip ospf message-digest-key <1-255> md5 KEY A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Message digest authentication password (key)\n"
"Key ID\n"
"Use MD5 algorithm\n"
"The OSPF password (key)"
"Address of interface")
{
struct interface *ifp;
struct crypt_key *ck;
int key_id;
struct in_addr addr;
int ret;
struct ospf_if_params *params;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 3)
{
ret = inet_aton(argv[2], &addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
VTY_NEWLINE);
return CMD_WARNING;
}
params = ospf_lookup_if_params (ifp, addr);
if (params == NULL)
return CMD_SUCCESS;
}
key_id = strtol (argv[0], NULL, 10);
ck = ospf_crypt_key_lookup (params->auth_crypt, key_id);
if (ck == NULL)
{
vty_out (vty, "OSPF: Key %d does not exist%s", key_id, VTY_NEWLINE);
return CMD_WARNING;
}
ospf_crypt_key_delete (params->auth_crypt, key_id);
if (params != IF_DEF_PARAMS (ifp))
{
ospf_free_if_params (ifp, addr);
ospf_if_update_params (ifp, addr);
}
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_message_digest_key_md5,
no_ip_ospf_message_digest_key_md5_cmd,
"no ip ospf message-digest-key <1-255> md5 KEY",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Message digest authentication password (key)\n"
"Key ID\n"
"Use MD5 algorithm\n"
"The OSPF password (key)")
DEFUN (no_ip_ospf_message_digest_key,
no_ip_ospf_message_digest_key_addr_cmd,
"no ip ospf message-digest-key <1-255> A.B.C.D",
@ -6961,6 +7131,29 @@ ALIAS (no_ip_ospf_dead_interval,
"OSPF interface commands\n"
"Interval after which a neighbor is declared dead\n")
ALIAS (no_ip_ospf_dead_interval,
no_ip_ospf_dead_interval_minimal_addr_cmd,
"no ip ospf dead-interval minimal hello-multiplier <1-10> A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Interval after which a neighbor is declared dead\n"
"Minimal 1s dead-interval with fast sub-second hellos\n"
"Hello multiplier factor\n"
"Number of Hellos to send each second\n"
"Address of interface\n")
ALIAS (no_ip_ospf_dead_interval,
no_ip_ospf_dead_interval_minimal_cmd,
"no ip ospf dead-interval minimal hello-multiplier <1-10>",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Interval after which a neighbor is declared dead\n"
"Minimal 1s dead-interval with fast sub-second hellos\n"
"Hello multiplier factor\n"
"Number of Hellos to send each second\n")
DEFUN (ip_ospf_hello_interval,
ip_ospf_hello_interval_addr_cmd,
"ip ospf hello-interval <1-65535> A.B.C.D",
@ -7086,10 +7279,11 @@ ALIAS (no_ip_ospf_hello_interval,
ALIAS (no_ip_ospf_hello_interval,
no_ospf_hello_interval_cmd,
"no ospf hello-interval",
"no ospf hello-interval <1-65535>",
NO_STR
"OSPF interface commands\n"
"Time between HELLO packets\n")
"Time between HELLO packets\n"
"Seconds\n")
DEFUN (ip_ospf_network,
ip_ospf_network_cmd,
@ -7191,6 +7385,18 @@ DEFUN (no_ip_ospf_network,
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_network,
no_ip_ospf_network_val_cmd,
"no ip ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Network type\n"
"Specify OSPF broadcast multi-access network\n"
"Specify OSPF NBMA network\n"
"Specify OSPF point-to-multipoint network\n"
"Specify OSPF point-to-point network\n")
ALIAS (no_ip_ospf_network,
no_ospf_network_cmd,
"no ospf network",
@ -7198,6 +7404,17 @@ ALIAS (no_ip_ospf_network,
"OSPF interface commands\n"
"Network type\n")
ALIAS (no_ip_ospf_network,
no_ospf_network_val_cmd,
"no ospf network (broadcast|non-broadcast|point-to-multipoint|point-to-point)",
NO_STR
"OSPF interface commands\n"
"Network type\n"
"Specify OSPF broadcast multi-access network\n"
"Specify OSPF NBMA network\n"
"Specify OSPF point-to-multipoint network\n"
"Specify OSPF point-to-point network\n")
DEFUN (ip_ospf_priority,
ip_ospf_priority_addr_cmd,
"ip ospf priority <0-255> A.B.C.D",
@ -7277,11 +7494,12 @@ ALIAS (ip_ospf_priority,
DEFUN (no_ip_ospf_priority,
no_ip_ospf_priority_addr_cmd,
"no ip ospf priority A.B.C.D",
"no ip ospf priority <0-255> A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Router priority\n"
"Priority\n"
"Address of interface")
{
struct interface *ifp = vty->index;
@ -7293,9 +7511,9 @@ DEFUN (no_ip_ospf_priority,
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 1)
if (argc == 2)
{
ret = inet_aton(argv[0], &addr);
ret = inet_aton(argv[1], &addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
@ -7337,18 +7555,20 @@ DEFUN (no_ip_ospf_priority,
ALIAS (no_ip_ospf_priority,
no_ip_ospf_priority_cmd,
"no ip ospf priority",
"no ip ospf priority <0-255>",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Router priority\n")
"Router priority\n"
"Priority\n")
ALIAS (no_ip_ospf_priority,
no_ospf_priority_cmd,
"no ospf priority",
"no ospf priority <0-255>",
NO_STR
"OSPF interface commands\n"
"Router priority\n")
"Router priority\n"
"Priority\n")
DEFUN (ip_ospf_retransmit_interval,
@ -7425,13 +7645,19 @@ DEFUN (no_ip_ospf_retransmit_interval,
struct in_addr addr;
int ret;
struct ospf_if_params *params;
int addr_index;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 1)
if (argc >= 1)
{
ret = inet_aton(argv[0], &addr);
if (argc == 1)
addr_index = 0;
else
addr_index = 1;
ret = inet_aton(argv[addr_index], &addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
@ -7456,6 +7682,16 @@ DEFUN (no_ip_ospf_retransmit_interval,
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_retransmit_interval,
no_ip_ospf_retransmit_interval_sec_addr_cmd,
"no ip ospf retransmit-interval <3-65535> A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Time between retransmitting lost link state advertisements\n"
"Seconds\n"
"Address of interface")
ALIAS (no_ip_ospf_retransmit_interval,
no_ip_ospf_retransmit_interval_cmd,
"no ip ospf retransmit-interval",
@ -7471,6 +7707,28 @@ ALIAS (no_ip_ospf_retransmit_interval,
"OSPF interface commands\n"
"Time between retransmitting lost link state advertisements\n")
DEFUN (no_ip_ospf_retransmit_interval_sec,
no_ip_ospf_retransmit_interval_sec_cmd,
"no ip ospf retransmit-interval <3-65535>",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Time between retransmitting lost link state advertisements\n"
"Seconds\n")
{
struct interface *ifp = vty->index;
struct ospf_if_params *params;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
UNSET_IF_PARAM (params, retransmit_interval);
params->retransmit_interval = OSPF_RETRANSMIT_INTERVAL_DEFAULT;
return CMD_SUCCESS;
}
DEFUN (ip_ospf_transmit_delay,
ip_ospf_transmit_delay_addr_cmd,
"ip ospf transmit-delay <1-65535> A.B.C.D",
@ -7544,13 +7802,19 @@ DEFUN (no_ip_ospf_transmit_delay,
struct in_addr addr;
int ret;
struct ospf_if_params *params;
int addr_index;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
if (argc == 1)
if (argc >= 1)
{
ret = inet_aton(argv[0], &addr);
if (argc == 1)
addr_index = 0;
else
addr_index = 1;
ret = inet_aton(argv[addr_index], &addr);
if (!ret)
{
vty_out (vty, "Please specify interface address by A.B.C.D%s",
@ -7575,6 +7839,16 @@ DEFUN (no_ip_ospf_transmit_delay,
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_transmit_delay,
no_ip_ospf_transmit_delay_sec_addr_cmd,
"no ip ospf transmit-delay <1-65535> A.B.C.D",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Link state transmit delay\n"
"Seconds\n"
"Address of interface")
ALIAS (no_ip_ospf_transmit_delay,
no_ip_ospf_transmit_delay_cmd,
"no ip ospf transmit-delay",
@ -7590,6 +7864,28 @@ ALIAS (no_ip_ospf_transmit_delay,
"OSPF interface commands\n"
"Link state transmit delay\n")
DEFUN (no_ip_ospf_transmit_delay_sec,
no_ip_ospf_transmit_delay_sec_cmd,
"no ip ospf transmit-delay <1-65535>",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Link state transmit delay\n"
"Seconds\n"
"Address of interface")
{
struct interface *ifp = vty->index;
struct ospf_if_params *params;
ifp = vty->index;
params = IF_DEF_PARAMS (ifp);
UNSET_IF_PARAM (params, transmit_delay);
params->transmit_delay = OSPF_TRANSMIT_DELAY_DEFAULT;
return CMD_SUCCESS;
}
DEFUN (ip_ospf_area,
ip_ospf_area_cmd,
"ip ospf area (A.B.C.D|<0-4294967295>)",
@ -7684,9 +7980,6 @@ DEFUN (no_ip_ospf_area,
struct ospf_if_params *params;
u_short instance = 0;
if (argc)
VTY_GET_INTEGER ("Instance", instance, argv[0]);
if ((ospf = ospf_lookup_instance (instance)) == NULL)
return CMD_SUCCESS;
@ -7703,6 +7996,16 @@ DEFUN (no_ip_ospf_area,
}
ALIAS (no_ip_ospf_area,
no_ip_ospf_area_val_cmd,
"no ip ospf area (A.B.C.D|<0-4294967295>)",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Disable OSPF on this interface\n"
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
DEFUN (no_ip_ospf_instance_area,
no_ip_ospf_instance_area_cmd,
"no ip ospf <1-65535> area",
NO_STR
@ -7710,6 +8013,39 @@ ALIAS (no_ip_ospf_area,
"OSPF interface commands\n"
"Instance ID\n"
"Disable OSPF on this interface\n")
{
struct interface *ifp = vty->index;
struct ospf *ospf;
struct ospf_if_params *params;
u_short instance = 0;
VTY_GET_INTEGER ("Instance", instance, argv[0]);
if ((ospf = ospf_lookup_instance (instance)) == NULL)
return CMD_SUCCESS;
params = IF_DEF_PARAMS (ifp);
if (!OSPF_IF_PARAM_CONFIGURED(params, if_area))
{
vty_out (vty, "Can't find specified inteface area configuration.%s", VTY_NEWLINE);
return CMD_WARNING;
}
ospf_interface_unset (ifp);
ospf->if_ospf_cli_count--;
return CMD_SUCCESS;
}
ALIAS (no_ip_ospf_instance_area,
no_ip_ospf_instance_area_val_cmd,
"no ip ospf <1-65535> area (A.B.C.D|<0-4294967295>)",
NO_STR
"IP Information\n"
"OSPF interface commands\n"
"Instance ID\n"
"Disable OSPF on this interface\n"
"OSPF area ID in IP address format\n"
"OSPF area ID as a decimal value\n")
DEFUN (ospf_redistribute_source,
ospf_redistribute_source_cmd,
@ -7764,10 +8100,18 @@ DEFUN (ospf_redistribute_source,
DEFUN (no_ospf_redistribute_source,
no_ospf_redistribute_source_cmd,
"no redistribute " QUAGGA_REDIST_STR_OSPFD,
"no redistribute " QUAGGA_REDIST_STR_OSPFD
" {metric <0-16777214>|metric-type (1|2)|route-map WORD}",
NO_STR
REDIST_STR
QUAGGA_REDIST_HELP_STR_OSPFD)
QUAGGA_REDIST_HELP_STR_OSPFD
"Metric for redistributed routes\n"
"OSPF default metric\n"
"OSPF exterior metric type for redistributed routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
struct ospf *ospf = vty->index;
int source;
@ -8006,10 +8350,19 @@ DEFUN (ospf_default_information_originate,
DEFUN (no_ospf_default_information_originate,
no_ospf_default_information_originate_cmd,
"no default-information originate",
"no default-information originate"
"{always|metric <0-16777214>|metric-type (1|2)|route-map WORD}",
NO_STR
"Control distribution of default information\n"
"Distribute a default route\n")
"Distribute a default route\n"
"Always advertise default route\n"
"OSPF default metric\n"
"OSPF metric\n"
"OSPF metric type for default routes\n"
"Set OSPF External Type 1 metrics\n"
"Set OSPF External Type 2 metrics\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
struct ospf *ospf = vty->index;
struct prefix_ipv4 p;
@ -8117,14 +8470,16 @@ DEFUN (no_ospf_distance,
DEFUN (no_ospf_distance_ospf,
no_ospf_distance_ospf_cmd,
"no distance ospf {intra-area|inter-area|external}",
"no distance ospf {intra-area <1-255>|inter-area <1-255>|external <1-255>}",
NO_STR
"Define an administrative distance\n"
"OSPF Administrative distance\n"
"OSPF Distance\n"
"Intra-area routes\n"
"Distance for intra-area routes\n"
"Inter-area routes\n"
"External routes\n")
"Distance for inter-area routes\n"
"External routes\n"
"Distance for external routes\n")
{
struct ospf *ospf = vty->index;
@ -8157,7 +8512,7 @@ DEFUN (no_ospf_distance_ospf,
DEFUN (ospf_distance_ospf,
ospf_distance_ospf_cmd,
"distance ospf "
"{intra-area <1-255>|inter-area <1-255>|external <1-255>}",
"(intra-area <1-255>|inter-area <1-255>|external <1-255>)",
"Define an administrative distance\n"
"OSPF Administrative distance\n"
"Intra-area routes\n"
@ -8450,11 +8805,12 @@ DEFUN (ospf_max_metric_router_lsa_startup,
DEFUN (no_ospf_max_metric_router_lsa_startup,
no_ospf_max_metric_router_lsa_startup_cmd,
"no max-metric router-lsa on-startup",
"no max-metric router-lsa on-startup <5-86400>",
NO_STR
"OSPF maximum / infinite-distance metric\n"
"Advertise own Router-LSA with infinite distance (stub router)\n"
"Automatically advertise stub Router-LSA on startup of OSPF\n")
"Automatically advertise stub Router-LSA on startup of OSPF\n"
"Time (seconds) to advertise self as stub-router\n")
{
struct listnode *ln;
struct ospf_area *area;
@ -8509,11 +8865,12 @@ DEFUN (ospf_max_metric_router_lsa_shutdown,
DEFUN (no_ospf_max_metric_router_lsa_shutdown,
no_ospf_max_metric_router_lsa_shutdown_cmd,
"no max-metric router-lsa on-shutdown",
"no max-metric router-lsa on-shutdown <5-100>",
NO_STR
"OSPF maximum / infinite-distance metric\n"
"Advertise own Router-LSA with infinite distance (stub router)\n"
"Advertise stub-router prior to full shutdown of OSPF\n")
"Advertise stub-router prior to full shutdown of OSPF\n"
"Time (seconds) to wait till full shutdown\n")
{
struct ospf *ospf = vty->index;
@ -9706,7 +10063,8 @@ ospf_vty_if_init (void)
install_element (INTERFACE_NODE, &no_ip_ospf_authentication_cmd);
install_element (INTERFACE_NODE, &ip_ospf_authentication_key_addr_cmd);
install_element (INTERFACE_NODE, &ip_ospf_authentication_key_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_authentication_key_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_authentication_key_authkey_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_authentication_key_authkey_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_authentication_key_cmd);
/* "ip ospf message-digest-key" commands. */
@ -9714,6 +10072,8 @@ ospf_vty_if_init (void)
install_element (INTERFACE_NODE, &ip_ospf_message_digest_key_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_message_digest_key_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_message_digest_key_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_message_digest_key_md5_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_message_digest_key_md5_cmd);
/* "ip ospf cost" commands. */
install_element (INTERFACE_NODE, &ip_ospf_cost_u32_inet4_cmd);
@ -9748,34 +10108,43 @@ ospf_vty_if_init (void)
/* "ip ospf network" commands. */
install_element (INTERFACE_NODE, &ip_ospf_network_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_network_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_network_val_cmd);
/* "ip ospf priority" commands. */
install_element (INTERFACE_NODE, &ip_ospf_priority_addr_cmd);
install_element (INTERFACE_NODE, &ip_ospf_priority_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_priority_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_priority_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_priority_addr_cmd);
/* "ip ospf retransmit-interval" commands. */
install_element (INTERFACE_NODE, &ip_ospf_retransmit_interval_addr_cmd);
install_element (INTERFACE_NODE, &ip_ospf_retransmit_interval_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_retransmit_interval_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_retransmit_interval_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_retransmit_interval_sec_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_retransmit_interval_sec_cmd);
/* "ip ospf transmit-delay" commands. */
install_element (INTERFACE_NODE, &ip_ospf_transmit_delay_addr_cmd);
install_element (INTERFACE_NODE, &ip_ospf_transmit_delay_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_transmit_delay_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_transmit_delay_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_transmit_delay_sec_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_transmit_delay_sec_cmd);
/* "ip ospf area" commands. */
install_element (INTERFACE_NODE, &ip_ospf_area_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_area_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_area_val_cmd);
install_element (INTERFACE_NODE, &ip_ospf_instance_area_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_instance_area_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_instance_area_val_cmd);
/* These commands are compatibitliy for previous version. */
install_element (INTERFACE_NODE, &ospf_authentication_key_cmd);
install_element (INTERFACE_NODE, &no_ospf_authentication_key_cmd);
install_element (INTERFACE_NODE, &no_ospf_authentication_key_authkey_cmd);
install_element (INTERFACE_NODE, &no_ospf_authentication_key_authkey_ip_cmd);
install_element (INTERFACE_NODE, &ospf_message_digest_key_cmd);
install_element (INTERFACE_NODE, &no_ospf_message_digest_key_cmd);
install_element (INTERFACE_NODE, &ospf_cost_u32_cmd);
@ -9786,10 +10155,13 @@ ospf_vty_if_init (void)
install_element (INTERFACE_NODE, &no_ospf_cost_inet4_cmd);
install_element (INTERFACE_NODE, &ospf_dead_interval_cmd);
install_element (INTERFACE_NODE, &no_ospf_dead_interval_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_dead_interval_minimal_addr_cmd);
install_element (INTERFACE_NODE, &no_ip_ospf_dead_interval_minimal_cmd);
install_element (INTERFACE_NODE, &ospf_hello_interval_cmd);
install_element (INTERFACE_NODE, &no_ospf_hello_interval_cmd);
install_element (INTERFACE_NODE, &ospf_network_cmd);
install_element (INTERFACE_NODE, &no_ospf_network_cmd);
install_element (INTERFACE_NODE, &no_ospf_network_val_cmd);
install_element (INTERFACE_NODE, &ospf_priority_cmd);
install_element (INTERFACE_NODE, &no_ospf_priority_cmd);
install_element (INTERFACE_NODE, &ospf_retransmit_interval_cmd);
@ -9966,6 +10338,7 @@ ospf_vty_init (void)
install_element (OSPF_NODE, &no_ospf_area_vlink_param4_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_args_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_args_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_cmd);
@ -9976,10 +10349,12 @@ ospf_vty_init (void)
install_element (OSPF_NODE, &no_ospf_area_vlink_authkey_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_args_authkey_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_args_authkey_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_authkey_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_authkey_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_args_md5_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_args_md5_cmd);
install_element (OSPF_NODE, &ospf_area_vlink_authtype_md5_cmd);
install_element (OSPF_NODE, &no_ospf_area_vlink_authtype_md5_cmd);
@ -10020,8 +10395,10 @@ ospf_vty_init (void)
/* LSA timers commands */
install_element (OSPF_NODE, &ospf_timers_min_ls_interval_cmd);
install_element (OSPF_NODE, &no_ospf_timers_min_ls_interval_cmd);
install_element (OSPF_NODE, &no_ospf_timers_min_ls_interval_val_cmd);
install_element (OSPF_NODE, &ospf_timers_min_ls_arrival_cmd);
install_element (OSPF_NODE, &no_ospf_timers_min_ls_arrival_cmd);
install_element (OSPF_NODE, &no_ospf_timers_min_ls_arrival_val_cmd);
install_element (OSPF_NODE, &ospf_timers_lsa_cmd);
install_element (OSPF_NODE, &no_ospf_timers_lsa_cmd);
install_element (OSPF_NODE, &no_ospf_timers_lsa_val_cmd);
@ -10042,6 +10419,7 @@ ospf_vty_init (void)
/* reference bandwidth commands */
install_element (OSPF_NODE, &ospf_auto_cost_reference_bandwidth_cmd);
install_element (OSPF_NODE, &no_ospf_auto_cost_reference_bandwidth_cmd);
install_element (OSPF_NODE, &no_ospf_auto_cost_reference_bandwidth_val_cmd);
/* "neighbor" commands. */
install_element (OSPF_NODE, &ospf_neighbor_cmd);
@ -10052,12 +10430,15 @@ ospf_vty_init (void)
install_element (OSPF_NODE, &no_ospf_neighbor_cmd);
install_element (OSPF_NODE, &no_ospf_neighbor_priority_cmd);
install_element (OSPF_NODE, &no_ospf_neighbor_poll_interval_cmd);
install_element (OSPF_NODE, &no_ospf_neighbor_poll_interval_priority_cmd);
install_element (OSPF_NODE, &no_ospf_neighbor_priority_pollinterval_cmd);
/* write multiplier commands */
install_element (OSPF_NODE, &ospf_write_multiplier_cmd);
install_element (OSPF_NODE, &no_ospf_write_multiplier_cmd);
install_element (OSPF_NODE, &write_multiplier_cmd);
install_element (OSPF_NODE, &no_write_multiplier_cmd);
install_element (OSPF_NODE, &no_write_multiplier_val_cmd);
/* Init interface related vty commands. */
ospf_vty_if_init ();

View File

@ -561,7 +561,7 @@ zebra_add_import_table_entry (struct route_node *rn, struct rib *rib)
/* Assuming these routes are never recursive */
for (nhop = rib->nexthop; nhop; nhop = nhop->next)
copy_nexthops(newrib, nhop);
rib_copy_nexthops(newrib, nhop);
rib_add_ipv4_multipath(&p4, newrib, SAFI_UNICAST);
}

View File

@ -371,19 +371,17 @@ typedef struct rib_tables_iter_t_
rib_tables_iter_state_t state;
} rib_tables_iter_t;
extern struct nexthop *nexthop_ifindex_add (struct rib *, unsigned int);
extern struct nexthop *nexthop_ifname_add (struct rib *, char *);
extern struct nexthop *nexthop_blackhole_add (struct rib *);
extern struct nexthop *nexthop_ipv4_add (struct rib *, struct in_addr *,
struct in_addr *);
extern struct nexthop *nexthop_ipv4_ifindex_add (struct rib *,
struct in_addr *,
struct in_addr *,
unsigned int);
extern void nexthop_free (struct nexthop *nexthop, struct route_node *);
extern void nexthops_free (struct nexthop *nexthop, struct route_node *);
extern void nexthop_add (struct rib *rib, struct nexthop *nexthop);
extern void copy_nexthops (struct rib *rib, struct nexthop *nh);
extern struct nexthop *rib_nexthop_ifindex_add (struct rib *, unsigned int);
extern struct nexthop *rib_nexthop_ifname_add (struct rib *, char *);
extern struct nexthop *rib_nexthop_blackhole_add (struct rib *);
extern struct nexthop *rib_nexthop_ipv4_add (struct rib *, struct in_addr *,
struct in_addr *);
extern struct nexthop *rib_nexthop_ipv4_ifindex_add (struct rib *,
struct in_addr *,
struct in_addr *,
unsigned int);
extern void rib_nexthop_add (struct rib *rib, struct nexthop *nexthop);
extern void rib_copy_nexthops (struct rib *rib, struct nexthop *nh);
extern int nexthop_has_fib_child(struct nexthop *);
extern void rib_lookup_and_dump (struct prefix_ipv4 *);
@ -399,12 +397,13 @@ extern int rib_lookup_ipv4_route (struct prefix_ipv4 *, union sockunion *,
#define ZEBRA_RIB_FOUND_CONNECTED 2
#define ZEBRA_RIB_NOTFOUND 3
extern struct nexthop *nexthop_ipv6_add (struct rib *, struct in6_addr *);
extern struct nexthop *nexthop_ipv6_ifindex_add (struct rib *rib,
struct in6_addr *ipv6, unsigned int ifindex);
extern struct nexthop *nexthop_ipv6_ifname_add (struct rib *rib,
struct in6_addr *ipv6,
char *ifname);
extern struct nexthop *rib_nexthop_ipv6_add (struct rib *, struct in6_addr *);
extern struct nexthop *rib_nexthop_ipv6_ifindex_add (struct rib *rib,
struct in6_addr *ipv6,
unsigned int ifindex);
extern struct nexthop *rib_nexthop_ipv6_ifname_add (struct rib *rib,
struct in6_addr *ipv6,
char *ifname);
extern struct zebra_vrf *zebra_vrf_lookup (vrf_id_t vrf_id);
extern struct zebra_vrf *zebra_vrf_alloc (vrf_id_t);

View File

@ -257,8 +257,8 @@ DEFUN (no_router_id,
rid.prefixlen = 0;
rid.family = AF_INET;
if (argc > 0)
VTY_GET_INTEGER ("VRF ID", vrf_id, argv[0]);
if (argc > 1)
VTY_GET_INTEGER ("VRF ID", vrf_id, argv[1]);
router_id_set (&rid, vrf_id);
@ -266,10 +266,18 @@ DEFUN (no_router_id,
}
ALIAS (no_router_id,
no_router_id_vrf_cmd,
"no router-id " VRF_CMD_STR,
no_router_id_val_cmd,
"no router-id A.B.C.D",
NO_STR
"Remove the manually configured router-id\n"
"IP address to use for router-id\n")
ALIAS (no_router_id,
no_router_id_vrf_cmd,
"no router-id A.B.C.D " VRF_CMD_STR,
NO_STR
"Remove the manually configured router-id\n"
"IP address to use for router-id\n"
VRF_CMD_HELP_STR)
static int
@ -287,6 +295,7 @@ router_id_cmd_init (void)
install_element (CONFIG_NODE, &router_id_cmd);
install_element (CONFIG_NODE, &no_router_id_cmd);
install_element (CONFIG_NODE, &router_id_vrf_cmd);
install_element (CONFIG_NODE, &no_router_id_val_cmd);
install_element (CONFIG_NODE, &no_router_id_vrf_cmd);
}

View File

@ -801,12 +801,12 @@ netlink_routing_table (struct sockaddr_nl *snl, struct nlmsghdr *h,
if (gate)
{
if (index)
nexthop_ipv4_ifindex_add (rib, gate, src, index);
rib_nexthop_ipv4_ifindex_add (rib, gate, src, index);
else
nexthop_ipv4_add (rib, gate, src);
rib_nexthop_ipv4_add (rib, gate, src);
}
else
nexthop_ifindex_add (rib, index);
rib_nexthop_ifindex_add (rib, index);
len -= NLMSG_ALIGN(rtnh->rtnh_len);
rtnh = RTNH_NEXT(rtnh);
@ -1006,12 +1006,12 @@ netlink_route_change (struct sockaddr_nl *snl, struct nlmsghdr *h,
if (gate)
{
if (index)
nexthop_ipv4_ifindex_add (rib, gate, src, index);
rib_nexthop_ipv4_ifindex_add (rib, gate, src, index);
else
nexthop_ipv4_add (rib, gate, src);
rib_nexthop_ipv4_add (rib, gate, src);
}
else
nexthop_ifindex_add (rib, index);
rib_nexthop_ifindex_add (rib, index);
len -= NLMSG_ALIGN(rtnh->rtnh_len);
rtnh = RTNH_NEXT(rtnh);

View File

@ -1495,6 +1495,160 @@ DEFUN (no_ipv6_nd_prefix,
return CMD_SUCCESS;
}
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_nortaddr_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (off-link|) (no-autoconfig|) (router-address|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Do not use prefix for onlink determination\n"
"Do not use prefix for autoconfiguration\n"
"Set Router Address flag\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_rev_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (no-autoconfig|) (off-link|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Do not use prefix for autoconfiguration\n"
"Do not use prefix for onlink determination\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_rev_rtaddr_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (no-autoconfig|) (off-link|) (router-address|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Do not use prefix for autoconfiguration\n"
"Do not use prefix for onlink determination\n"
"Set Router Address flag\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_noauto_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (no-autoconfig|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Do not use prefix for autoconfiguration")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_offlink_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (off-link|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Do not use prefix for onlink determination\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_rtaddr_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite) (router-address|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n"
"Set Router Address flag\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_val_cmd,
"no ipv6 nd prefix X:X::X:X/M (<0-4294967295>|infinite) (<0-4294967295>|infinite)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Valid lifetime in seconds\n"
"Infinite valid lifetime\n"
"Preferred lifetime in seconds\n"
"Infinite preferred lifetime\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_noval_cmd,
"no ipv6 nd prefix X:X::X:X/M (no-autoconfig|) (off-link|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Do not use prefix for autoconfiguration\n"
"Do not use prefix for onlink determination\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_noval_rev_cmd,
"no ipv6 nd prefix X:X::X:X/M (off-link|) (no-autoconfig|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Do not use prefix for onlink determination\n"
"Do not use prefix for autoconfiguration\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_noval_noauto_cmd,
"no ipv6 nd prefix X:X::X:X/M (no-autoconfig|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Do not use prefix for autoconfiguration\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_noval_offlink_cmd,
"no ipv6 nd prefix X:X::X:X/M (off-link|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Do not use prefix for onlink determination\n")
ALIAS (no_ipv6_nd_prefix,
no_ipv6_nd_prefix_noval_rtaddr_cmd,
"no ipv6 nd prefix X:X::X:X/M (router-address|)",
NO_STR
"Interface IPv6 config commands\n"
"Neighbor discovery\n"
"Prefix information\n"
"IPv6 prefix\n"
"Set Router Address flag\n")
DEFUN (ipv6_nd_router_preference,
ipv6_nd_router_preference_cmd,
"ipv6 nd router-preference (high|medium|low)",
@ -1797,6 +1951,18 @@ rtadv_cmd_init (void)
install_element (INTERFACE_NODE, &ipv6_nd_prefix_noval_rtaddr_cmd);
install_element (INTERFACE_NODE, &ipv6_nd_prefix_prefix_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_rev_rtaddr_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_nortaddr_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_rev_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_noauto_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_offlink_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_rtaddr_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_val_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_noval_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_noval_rev_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_noval_noauto_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_noval_offlink_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_prefix_noval_rtaddr_cmd);
install_element (INTERFACE_NODE, &ipv6_nd_router_preference_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_router_preference_cmd);
install_element (INTERFACE_NODE, &no_ipv6_nd_router_preference_val_cmd);

View File

@ -80,31 +80,6 @@ static const struct
/* no entry/default: 150 */
};
/*
* nexthop_type_to_str
*/
const char *
nexthop_type_to_str (enum nexthop_types_t nh_type)
{
static const char *desc[] = {
"none",
"Directly connected",
"Interface route",
"IPv4 nexthop",
"IPv4 nexthop with ifindex",
"IPv4 nexthop with ifname",
"IPv6 nexthop",
"IPv6 nexthop with ifindex",
"IPv6 nexthop with ifname",
"Null0 nexthop",
};
if (nh_type >= ZEBRA_NUM_OF (desc))
return "<Invalid nh type>";
return desc[nh_type];
}
int
is_zebra_valid_kernel_table(u_int32_t table_id)
{
@ -150,57 +125,21 @@ zebra_check_addr (struct prefix *p)
return 1;
}
/* Add nexthop to the end of a nexthop list. */
static void
_nexthop_add (struct nexthop **target, struct nexthop *nexthop)
{
struct nexthop *last;
for (last = *target; last && last->next; last = last->next)
;
if (last)
last->next = nexthop;
else
*target = nexthop;
nexthop->prev = last;
}
/* Add nexthop to the end of a rib node's nexthop list */
void
nexthop_add (struct rib *rib, struct nexthop *nexthop)
rib_nexthop_add (struct rib *rib, struct nexthop *nexthop)
{
_nexthop_add(&rib->nexthop, nexthop);
nexthop_add(&rib->nexthop, nexthop);
rib->nexthop_num++;
}
static void
_copy_nexthops (struct nexthop **tnh, struct nexthop *nh)
{
struct nexthop *nexthop;
struct nexthop *nh1;
for (nh1 = nh; nh1; nh1 = nh1->next)
{
nexthop = nexthop_new();
nexthop->flags = nh->flags;
nexthop->type = nh->type;
nexthop->ifindex = nh->ifindex;
if (nh->ifname)
nexthop->ifname = XSTRDUP(0, nh->ifname);
memcpy(&(nexthop->gate), &(nh->gate), sizeof(union g_addr));
memcpy(&(nexthop->src), &(nh->src), sizeof(union g_addr));
_nexthop_add(tnh, nexthop);
if (CHECK_FLAG(nh1->flags, NEXTHOP_FLAG_RECURSIVE))
_copy_nexthops(&nexthop->resolved, nh1->resolved);
}
}
/**
* copy_nexthop - copy a nexthop to the rib structure.
*/
void
copy_nexthops (struct rib *rib, struct nexthop *nh)
rib_copy_nexthops (struct rib *rib, struct nexthop *nh)
{
struct nexthop *nexthop;
@ -212,14 +151,14 @@ copy_nexthops (struct rib *rib, struct nexthop *nh)
nexthop->ifname = XSTRDUP(0, nh->ifname);
memcpy(&(nexthop->gate), &(nh->gate), sizeof(union g_addr));
memcpy(&(nexthop->src), &(nh->src), sizeof(union g_addr));
nexthop_add(rib, nexthop);
rib_nexthop_add(rib, nexthop);
if (CHECK_FLAG(nh->flags, NEXTHOP_FLAG_RECURSIVE))
_copy_nexthops(&nexthop->resolved, nh->resolved);
copy_nexthops(&nexthop->resolved, nh->resolved);
}
/* Delete specified nexthop from the list. */
static void
nexthop_delete (struct rib *rib, struct nexthop *nexthop)
rib_nexthop_delete (struct rib *rib, struct nexthop *nexthop)
{
if (nexthop->next)
nexthop->next->prev = nexthop->prev;
@ -230,97 +169,60 @@ nexthop_delete (struct rib *rib, struct nexthop *nexthop)
rib->nexthop_num--;
}
/* Free nexthop. */
void
nexthop_free (struct nexthop *nexthop, struct route_node *rn)
{
if (nexthop->ifname)
XFREE (0, nexthop->ifname);
if (nexthop->resolved)
nexthops_free(nexthop->resolved, rn);
XFREE (MTYPE_NEXTHOP, nexthop);
}
/* Frees a list of nexthops */
void
nexthops_free (struct nexthop *nexthop, struct route_node *rn)
{
struct nexthop *nh, *next;
struct prefix nh_p;
for (nh = nexthop; nh; nh = next)
{
next = nh->next;
if (nh->type == NEXTHOP_TYPE_IPV4)
{
nh_p.family = AF_INET;
nh_p.prefixlen = IPV4_MAX_BITLEN;
nh_p.u.prefix4 = nh->gate.ipv4;
zebra_deregister_rnh_static_nh(&nh_p, rn);
}
else if (nh->type == NEXTHOP_TYPE_IPV6)
{
nh_p.family = AF_INET6;
nh_p.prefixlen = IPV6_MAX_BITLEN;
nh_p.u.prefix6 = nh->gate.ipv6;
zebra_deregister_rnh_static_nh(&nh_p, rn);
}
nexthop_free (nh, rn);
}
}
struct nexthop *
nexthop_ifindex_add (struct rib *rib, unsigned int ifindex)
rib_nexthop_ifindex_add (struct rib *rib, unsigned int ifindex)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IFINDEX;
nexthop->ifindex = ifindex;
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ifname_add (struct rib *rib, char *ifname)
rib_nexthop_ifname_add (struct rib *rib, char *ifname)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IFNAME;
nexthop->ifname = XSTRDUP (0, ifname);
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ipv4_add (struct rib *rib, struct in_addr *ipv4, struct in_addr *src)
rib_nexthop_ipv4_add (struct rib *rib, struct in_addr *ipv4, struct in_addr *src)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IPV4;
nexthop->gate.ipv4 = *ipv4;
if (src)
nexthop->src.ipv4 = *src;
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ipv4_ifindex_add (struct rib *rib, struct in_addr *ipv4,
struct in_addr *src, unsigned int ifindex)
rib_nexthop_ipv4_ifindex_add (struct rib *rib, struct in_addr *ipv4,
struct in_addr *src, unsigned int ifindex)
{
struct nexthop *nexthop;
struct interface *ifp;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IPV4_IFINDEX;
nexthop->gate.ipv4 = *ipv4;
if (src)
@ -331,44 +233,44 @@ nexthop_ipv4_ifindex_add (struct rib *rib, struct in_addr *ipv4,
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ONLINK);
}
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ipv6_add (struct rib *rib, struct in6_addr *ipv6)
rib_nexthop_ipv6_add (struct rib *rib, struct in6_addr *ipv6)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IPV6;
nexthop->gate.ipv6 = *ipv6;
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr *ipv6,
char *ifname)
rib_nexthop_ipv6_ifname_add (struct rib *rib, struct in6_addr *ipv6,
char *ifname)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_IPV6_IFNAME;
nexthop->gate.ipv6 = *ipv6;
nexthop->ifname = XSTRDUP (0, ifname);
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6,
unsigned int ifindex)
rib_nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6,
unsigned int ifindex)
{
struct nexthop *nexthop;
@ -377,21 +279,21 @@ nexthop_ipv6_ifindex_add (struct rib *rib, struct in6_addr *ipv6,
nexthop->gate.ipv6 = *ipv6;
nexthop->ifindex = ifindex;
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
struct nexthop *
nexthop_blackhole_add (struct rib *rib)
rib_nexthop_blackhole_add (struct rib *rib)
{
struct nexthop *nexthop;
nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop));
nexthop = nexthop_new();
nexthop->type = NEXTHOP_TYPE_BLACKHOLE;
SET_FLAG (rib->flags, ZEBRA_FLAG_BLACKHOLE);
nexthop_add (rib, nexthop);
rib_nexthop_add (rib, nexthop);
return nexthop;
}
@ -436,7 +338,8 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
if (set)
{
UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE);
nexthops_free(nexthop->resolved, top);
zebra_deregister_rnh_static_nexthops(nexthop->resolved, top);
nexthops_free(nexthop->resolved);
nexthop->resolved = NULL;
}
@ -574,7 +477,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
resolved_hop->ifindex = newhop->ifindex;
}
_nexthop_add(&nexthop->resolved, resolved_hop);
nexthop_add(&nexthop->resolved, resolved_hop);
}
resolved = 1;
}
@ -627,7 +530,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
resolved_hop->ifindex = newhop->ifindex;
}
_nexthop_add(&nexthop->resolved, resolved_hop);
nexthop_add(&nexthop->resolved, resolved_hop);
}
resolved = 1;
}
@ -663,7 +566,8 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
if (set)
{
UNSET_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE);
nexthops_free(nexthop->resolved, top);
zebra_deregister_rnh_static_nexthops (nexthop->resolved, top);
nexthops_free(nexthop->resolved);
nexthop->resolved = NULL;
}
@ -774,7 +678,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
resolved_hop->ifindex = newhop->ifindex;
}
_nexthop_add(&nexthop->resolved, resolved_hop);
nexthop_add(&nexthop->resolved, resolved_hop);
}
resolved = 1;
}
@ -817,7 +721,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
resolved_hop->ifindex = newhop->ifindex;
}
_nexthop_add(&nexthop->resolved, resolved_hop);
nexthop_add(&nexthop->resolved, resolved_hop);
}
resolved = 1;
}
@ -2098,7 +2002,8 @@ rib_unlink (struct route_node *rn, struct rib *rib)
}
/* free RIB and nexthops */
nexthops_free(rib->nexthop, rn);
zebra_deregister_rnh_static_nexthops (rib->nexthop, rn);
nexthops_free(rib->nexthop);
XFREE (MTYPE_RIB, rib);
}
@ -2221,12 +2126,12 @@ rib_add_ipv4 (int type, u_short instance, int flags, struct prefix_ipv4 *p,
if (gate)
{
if (ifindex)
nexthop_ipv4_ifindex_add (rib, gate, src, ifindex);
rib_nexthop_ipv4_ifindex_add (rib, gate, src, ifindex);
else
nexthop_ipv4_add (rib, gate, src);
rib_nexthop_ipv4_add (rib, gate, src);
}
else
nexthop_ifindex_add (rib, ifindex);
rib_nexthop_ifindex_add (rib, ifindex);
/* If this route is kernel route, set FIB flag to the route. */
if (type == ZEBRA_ROUTE_KERNEL || type == ZEBRA_ROUTE_CONNECT)
@ -2688,30 +2593,30 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p, struct static_ro
switch (si->type)
{
case STATIC_IPV4_GATEWAY:
nexthop_ipv4_add (rib, &si->addr.ipv4, NULL);
rib_nexthop_ipv4_add (rib, &si->addr.ipv4, NULL);
nh_p.family = AF_INET;
nh_p.prefixlen = IPV4_MAX_BITLEN;
nh_p.u.prefix4 = si->addr.ipv4;
zebra_register_rnh_static_nh(&nh_p, rn);
break;
case STATIC_IPV4_IFNAME:
nexthop_ifname_add (rib, si->ifname);
rib_nexthop_ifname_add (rib, si->ifname);
break;
case STATIC_IPV4_BLACKHOLE:
nexthop_blackhole_add (rib);
rib_nexthop_blackhole_add (rib);
break;
case STATIC_IPV6_GATEWAY:
nexthop_ipv6_add (rib, &si->addr.ipv6);
rib_nexthop_ipv6_add (rib, &si->addr.ipv6);
nh_p.family = AF_INET6;
nh_p.prefixlen = IPV6_MAX_BITLEN;
nh_p.u.prefix6 = si->addr.ipv6;
zebra_register_rnh_static_nh(&nh_p, rn);
break;
case STATIC_IPV6_IFNAME:
nexthop_ifname_add (rib, si->ifname);
rib_nexthop_ifname_add (rib, si->ifname);
break;
case STATIC_IPV6_GATEWAY_IFNAME:
nexthop_ipv6_ifname_add (rib, &si->addr.ipv6, si->ifname);
rib_nexthop_ipv6_ifname_add (rib, &si->addr.ipv6, si->ifname);
break;
}
@ -2744,30 +2649,30 @@ static_install_route (afi_t afi, safi_t safi, struct prefix *p, struct static_ro
switch (si->type)
{
case STATIC_IPV4_GATEWAY:
nexthop_ipv4_add (rib, &si->addr.ipv4, NULL);
rib_nexthop_ipv4_add (rib, &si->addr.ipv4, NULL);
nh_p.family = AF_INET;
nh_p.prefixlen = IPV4_MAX_BITLEN;
nh_p.u.prefix4 = si->addr.ipv4;
zebra_register_rnh_static_nh(&nh_p, rn);
break;
case STATIC_IPV4_IFNAME:
nexthop_ifname_add (rib, si->ifname);
rib_nexthop_ifname_add (rib, si->ifname);
break;
case STATIC_IPV4_BLACKHOLE:
nexthop_blackhole_add (rib);
rib_nexthop_blackhole_add (rib);
break;
case STATIC_IPV6_GATEWAY:
nexthop_ipv6_add (rib, &si->addr.ipv6);
rib_nexthop_ipv6_add (rib, &si->addr.ipv6);
nh_p.family = AF_INET6;
nh_p.prefixlen = IPV6_MAX_BITLEN;
nh_p.u.prefix6 = si->addr.ipv6;
zebra_register_rnh_static_nh(&nh_p, rn);
break;
case STATIC_IPV6_IFNAME:
nexthop_ifname_add (rib, si->ifname);
rib_nexthop_ifname_add (rib, si->ifname);
break;
case STATIC_IPV6_GATEWAY_IFNAME:
nexthop_ipv6_ifname_add (rib, &si->addr.ipv6, si->ifname);
rib_nexthop_ipv6_ifname_add (rib, &si->addr.ipv6, si->ifname);
break;
}
@ -2915,9 +2820,9 @@ static_uninstall_route (afi_t afi, safi_t safi, struct prefix *p, struct static_
nh_p.prefixlen = IPV6_MAX_BITLEN;
nh_p.u.prefix6 = nexthop->gate.ipv6;
}
nexthop_delete (rib, nexthop);
rib_nexthop_delete (rib, nexthop);
zebra_deregister_rnh_static_nh(&nh_p, rn);
nexthop_free (nexthop, rn);
nexthop_free (nexthop);
}
/* Unlock node. */
route_unlock_node (rn);
@ -3163,12 +3068,12 @@ rib_add_ipv6 (int type, u_short instance, int flags, struct prefix_ipv6 *p,
if (gate)
{
if (ifindex)
nexthop_ipv6_ifindex_add (rib, gate, ifindex);
rib_nexthop_ipv6_ifindex_add (rib, gate, ifindex);
else
nexthop_ipv6_add (rib, gate);
rib_nexthop_ipv6_add (rib, gate);
}
else
nexthop_ifindex_add (rib, ifindex);
rib_nexthop_ifindex_add (rib, ifindex);
/* If this route is kernel route, set FIB flag to the route. */
if (type == ZEBRA_ROUTE_KERNEL || type == ZEBRA_ROUTE_CONNECT)

View File

@ -244,6 +244,30 @@ zebra_deregister_rnh_static_nh(struct prefix *nh, struct route_node *static_rn)
zebra_delete_rnh(rnh, RNH_NEXTHOP_TYPE);
}
void
zebra_deregister_rnh_static_nexthops (struct nexthop *nexthop, struct route_node *rn)
{
struct nexthop *nh;
struct prefix nh_p;
for (nh = nexthop; nh ; nh = nh->next)
{
if (nh->type == NEXTHOP_TYPE_IPV4)
{
nh_p.family = AF_INET;
nh_p.prefixlen = IPV4_MAX_BITLEN;
nh_p.u.prefix4 = nh->gate.ipv4;
}
else if (nh->type == NEXTHOP_TYPE_IPV6)
{
nh_p.family = AF_INET6;
nh_p.prefixlen = IPV6_MAX_BITLEN;
nh_p.u.prefix6 = nh->gate.ipv6;
}
zebra_deregister_rnh_static_nh(&nh_p, rn);
}
}
static int
zebra_evaluate_rnh_nexthops(int family, struct rib *rib, struct route_node *prn,
int proto)
@ -666,7 +690,8 @@ free_state (struct rib *rib, struct route_node *rn)
return;
/* free RIB and nexthops */
nexthops_free(rib->nexthop, rn);
nexthops_free(rib->nexthop);
zebra_deregister_rnh_static_nexthops (rib->nexthop, rn);
XFREE (MTYPE_RIB, rib);
}
@ -690,7 +715,7 @@ copy_state (struct rnh *rnh, struct rib *rib, struct route_node *rn)
state->metric = rib->metric;
for (nh = rib->nexthop; nh; nh = nh->next)
copy_nexthops(state, nh);
rib_copy_nexthops(state, nh);
rnh->state = state;
}

View File

@ -60,6 +60,7 @@ extern void zebra_delete_rnh(struct rnh *rnh, rnh_type_t type);
extern void zebra_add_rnh_client(struct rnh *rnh, struct zserv *client, rnh_type_t type,
vrf_id_t vrfid);
extern void zebra_register_rnh_static_nh(struct prefix *, struct route_node *);
extern void zebra_deregister_rnh_static_nexthops (struct nexthop *nexthop, struct route_node *rn);
extern void zebra_deregister_rnh_static_nh(struct prefix *, struct route_node *);
extern void zebra_remove_rnh_client(struct rnh *rnh, struct zserv *client,
rnh_type_t type);

View File

@ -19,3 +19,6 @@ void zebra_register_rnh_static_nh(struct prefix *p, struct route_node *rn)
void zebra_deregister_rnh_static_nh(struct prefix *p, struct route_node *rn)
{}
void zebra_deregister_rnh_static_nexthops (struct nexthop *nexthop, struct route_node *rn)
{}

View File

@ -746,6 +746,14 @@ DEFUN (no_zebra_route_map_timer,
return (CMD_SUCCESS);
}
ALIAS (no_zebra_route_map_timer,
no_zebra_route_map_timer_val_cmd,
"no zebra route-map delay-timer <0-600>",
NO_STR
"Time to wait before route-map updates are processed\n"
"Reset delay-timer to default value, 30 secs\n"
"0 means event-driven updates are disabled\n")
DEFUN (ip_protocol,
ip_protocol_cmd,
"ip protocol " QUAGGA_IP_PROTOCOL_MAP_STR_ZEBRA " route-map ROUTE-MAP",
@ -1122,17 +1130,21 @@ DEFUN (no_ipv6_protocol_nht_rmap,
VTY_NEWLINE);
return CMD_WARNING;
}
if (nht_rm[AFI_IP6][i])
XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP6][i]);
if ((argc == 2 && strcmp(argv[1], nht_rm[AFI_IP6][i]) == 0) ||
(argc < 2))
if (nht_rm[AFI_IP6][i] && argc == 2 && strcmp(argv[1], nht_rm[AFI_IP6][i]))
{
vty_out (vty, "invalid route-map \"%s\"%s", argv[1], VTY_NEWLINE);
return CMD_WARNING;
}
if (nht_rm[AFI_IP6][i])
{
XFREE (MTYPE_ROUTE_MAP_NAME, nht_rm[AFI_IP6][i]);
nht_rm[AFI_IP6][i] = NULL;
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);
}
zebra_evaluate_rnh(0, AF_INET6, 1, RNH_NEXTHOP_TYPE, NULL);
return CMD_SUCCESS;
}
@ -1777,11 +1789,12 @@ zebra_route_map_init ()
install_element (ENABLE_NODE, &show_ip_protocol_nht_cmd);
install_element (CONFIG_NODE, &ipv6_protocol_nht_rmap_cmd);
install_element (CONFIG_NODE, &no_ipv6_protocol_nht_rmap_cmd);
install_element (ENABLE_NODE, &no_ipv6_protocol_nht_rmap_val_cmd);
install_element (CONFIG_NODE, &no_ipv6_protocol_nht_rmap_val_cmd);
install_element (VIEW_NODE, &show_ipv6_protocol_nht_cmd);
install_element (ENABLE_NODE, &show_ipv6_protocol_nht_cmd);
install_element (CONFIG_NODE, &zebra_route_map_timer_cmd);
install_element (CONFIG_NODE, &no_zebra_route_map_timer_cmd);
install_element (CONFIG_NODE, &no_zebra_route_map_timer_val_cmd);
route_map_init ();
route_map_init_vty ();

View File

@ -1341,6 +1341,22 @@ DEFUN (no_ip_route_vrf,
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, NULL, NULL, argv[2]);
}
DEFUN (no_ip_route_flags_vrf,
no_ip_route_flags_vrf_cmd,
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IP destination prefix (e.g. 10.0.0.0/8)\n"
"IP gateway address\n"
"IP gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], argv[2], NULL, NULL, argv[3]);
}
DEFUN (no_ip_route_tag_vrf,
no_ip_route_tag_vrf_cmd,
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
@ -1358,20 +1374,7 @@ DEFUN (no_ip_route_tag_vrf,
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], NULL, argv[2], NULL, argv[3]);
}
ALIAS (no_ip_route_vrf,
no_ip_route_flags_vrf_cmd,
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IP destination prefix (e.g. 10.0.0.0/8)\n"
"IP gateway address\n"
"IP gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
ALIAS (no_ip_route_tag_vrf,
DEFUN (no_ip_route_flags_tag_vrf,
no_ip_route_flags_tag_vrf_cmd,
"no ip route A.B.C.D/M (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
NO_STR
@ -1385,6 +1388,9 @@ ALIAS (no_ip_route_tag_vrf,
"Tag of this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], NULL, argv[1], argv[2], argv[3], NULL, argv[4]);
}
DEFUN (no_ip_route_flags2_vrf,
no_ip_route_flags2_vrf_cmd,
@ -1397,7 +1403,7 @@ DEFUN (no_ip_route_flags2_vrf,
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, NULL, NULL, NULL, argv[1]);
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, argv[1], NULL, NULL, argv[2]);
}
DEFUN (no_ip_route_flags2_tag_vrf,
@ -1413,7 +1419,7 @@ DEFUN (no_ip_route_flags2_tag_vrf,
"Tag value\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, NULL, argv[1], NULL, argv[1]);
return zebra_static_ipv4 (vty, 0, argv[0], NULL, NULL, argv[1], argv[2], NULL, argv[3]);
}
DEFUN (no_ip_route_mask_vrf,
@ -1432,6 +1438,23 @@ DEFUN (no_ip_route_mask_vrf,
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, NULL, NULL, argv[3]);
}
DEFUN (no_ip_route_mask_flags_vrf,
no_ip_route_mask_flags_vrf_cmd,
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IP destination prefix\n"
"IP destination prefix mask\n"
"IP gateway address\n"
"IP gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, NULL, argv[4]);
}
DEFUN (no_ip_route_mask_tag_vrf,
no_ip_route_mask_tag_vrf_cmd,
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE|null0) tag <1-65535> " VRF_CMD_STR,
@ -1450,21 +1473,7 @@ DEFUN (no_ip_route_mask_tag_vrf,
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL, argv[4]);
}
ALIAS (no_ip_route_mask_vrf,
no_ip_route_mask_flags_vrf_cmd,
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
NO_STR
IP_STR
"Establish static routes\n"
"IP destination prefix\n"
"IP destination prefix mask\n"
"IP gateway address\n"
"IP gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
ALIAS (no_ip_route_mask_tag_vrf,
DEFUN (no_ip_route_mask_flags_tag_vrf,
no_ip_route_mask_flags_tag_vrf_cmd,
"no ip route A.B.C.D A.B.C.D (A.B.C.D|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
NO_STR
@ -1479,6 +1488,9 @@ ALIAS (no_ip_route_mask_tag_vrf,
"Tag of this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], NULL, argv[5]);
}
DEFUN (no_ip_route_mask_flags2_vrf,
no_ip_route_mask_flags2_vrf_cmd,
@ -1492,7 +1504,7 @@ DEFUN (no_ip_route_mask_flags2_vrf,
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, NULL, NULL, NULL, argv[2]);
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, NULL, argv[3]);
}
DEFUN (no_ip_route_mask_flags2_tag_vrf,
@ -1509,7 +1521,7 @@ DEFUN (no_ip_route_mask_flags2_tag_vrf,
"Tag value\n"
VRF_CMD_HELP_STR)
{
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL, argv[3]);
return zebra_static_ipv4 (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], NULL, argv[4]);
}
@ -3505,7 +3517,7 @@ DEFUN (no_ipv6_route_tag,
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL, NULL);
}
ALIAS (no_ipv6_route,
DEFUN (no_ipv6_route_flags,
no_ipv6_route_flags_cmd,
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole)",
NO_STR
@ -3516,8 +3528,11 @@ ALIAS (no_ipv6_route,
"IPv6 gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, NULL, NULL);
}
ALIAS (no_ipv6_route_tag,
DEFUN (no_ipv6_route_flags_tag,
no_ipv6_route_flags_tag_cmd,
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535>",
NO_STR
@ -3530,6 +3545,9 @@ ALIAS (no_ipv6_route_tag,
"Silently discard pkts when matched\n"
"Set tag for this route\n"
"Tag value\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], NULL, NULL);
}
DEFUN (no_ipv6_route_ifname,
no_ipv6_route_ifname_cmd,
@ -3559,7 +3577,7 @@ DEFUN (no_ipv6_route_ifname_tag,
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL, NULL);
}
ALIAS (no_ipv6_route_ifname,
DEFUN (no_ipv6_route_ifname_flags,
no_ipv6_route_ifname_flags_cmd,
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole)",
NO_STR
@ -3570,8 +3588,11 @@ ALIAS (no_ipv6_route_ifname,
"IPv6 gateway interface name\n"
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, NULL, NULL);
}
ALIAS (no_ipv6_route_ifname_tag,
DEFUN (no_ipv6_route_ifname_flags_tag,
no_ipv6_route_ifname_flags_tag_cmd,
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535>",
NO_STR
@ -3584,6 +3605,9 @@ ALIAS (no_ipv6_route_ifname_tag,
"Silently discard pkts when matched\n"
"Set tag for this route\n"
"Tag value\n")
{
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], NULL, NULL);
}
DEFUN (no_ipv6_route_pref,
no_ipv6_route_pref_cmd,
@ -3992,7 +4016,7 @@ DEFUN (no_ipv6_route_tag_vrf,
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, NULL, argv[2], NULL, argv[3]);
}
ALIAS (no_ipv6_route_vrf,
DEFUN (no_ipv6_route_flags_vrf,
no_ipv6_route_flags_vrf_cmd,
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) " VRF_CMD_STR,
NO_STR
@ -4004,8 +4028,11 @@ ALIAS (no_ipv6_route_vrf,
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], NULL, NULL, argv[3]);
}
ALIAS (no_ipv6_route_tag_vrf,
DEFUN (no_ipv6_route_flags_tag_vrf,
no_ipv6_route_flags_tag_vrf_cmd,
"no ipv6 route X:X::X:X/M (X:X::X:X|INTERFACE) (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
NO_STR
@ -4019,6 +4046,9 @@ ALIAS (no_ipv6_route_tag_vrf,
"Set tag for this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 0, argv[0], argv[1], NULL, argv[2], argv[3], NULL, argv[4]);
}
DEFUN (no_ipv6_route_ifname_vrf,
no_ipv6_route_ifname_vrf_cmd,
@ -4050,7 +4080,7 @@ DEFUN (no_ipv6_route_ifname_tag_vrf,
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], NULL, argv[3], NULL, argv[4]);
}
ALIAS (no_ipv6_route_ifname_vrf,
DEFUN (no_ipv6_route_ifname_flags_vrf,
no_ipv6_route_ifname_flags_vrf_cmd,
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) " VRF_CMD_STR,
NO_STR
@ -4062,8 +4092,11 @@ ALIAS (no_ipv6_route_ifname_vrf,
"Emit an ICMP unreachable when matched\n"
"Silently discard pkts when matched\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], NULL, NULL, argv[4]);
}
ALIAS (no_ipv6_route_ifname_tag_vrf,
DEFUN (no_ipv6_route_ifname_flags_tag_vrf,
no_ipv6_route_ifname_flags_tag_vrf_cmd,
"no ipv6 route X:X::X:X/M X:X::X:X INTERFACE (reject|blackhole) tag <1-65535> " VRF_CMD_STR,
NO_STR
@ -4077,6 +4110,9 @@ ALIAS (no_ipv6_route_ifname_tag_vrf,
"Set tag for this route\n"
"Tag value\n"
VRF_CMD_HELP_STR)
{
return static_ipv6_func (vty, 0, argv[0], argv[1], argv[2], argv[3], argv[4], NULL, argv[5]);
}
DEFUN (no_ipv6_route_pref_vrf,
no_ipv6_route_pref_vrf_cmd,

View File

@ -1109,7 +1109,7 @@ zread_ipv4_add (struct zserv *client, u_short length, vrf_id_t vrf_id)
{
case ZEBRA_NEXTHOP_IFINDEX:
ifindex = stream_getl (s);
nexthop_ifindex_add (rib, ifindex);
rib_nexthop_ifindex_add (rib, ifindex);
break;
case ZEBRA_NEXTHOP_IFNAME:
ifname_len = stream_getc (s);
@ -1117,18 +1117,18 @@ zread_ipv4_add (struct zserv *client, u_short length, vrf_id_t vrf_id)
break;
case ZEBRA_NEXTHOP_IPV4:
nexthop.s_addr = stream_get_ipv4 (s);
nexthop_ipv4_add (rib, &nexthop, NULL);
rib_nexthop_ipv4_add (rib, &nexthop, NULL);
break;
case ZEBRA_NEXTHOP_IPV4_IFINDEX:
nexthop.s_addr = stream_get_ipv4 (s);
ifindex = stream_getl (s);
nexthop_ipv4_ifindex_add (rib, &nexthop, NULL, ifindex);
rib_nexthop_ipv4_ifindex_add (rib, &nexthop, NULL, ifindex);
break;
case ZEBRA_NEXTHOP_IPV6:
stream_forward_getp (s, IPV6_MAX_BYTELEN);
break;
case ZEBRA_NEXTHOP_BLACKHOLE:
nexthop_blackhole_add (rib);
rib_nexthop_blackhole_add (rib);
break;
}
}
@ -1351,7 +1351,7 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length)
}
break;
case ZEBRA_NEXTHOP_BLACKHOLE:
nexthop_blackhole_add (rib);
rib_nexthop_blackhole_add (rib);
break;
}
}
@ -1361,15 +1361,15 @@ zread_ipv4_route_ipv6_nexthop_add (struct zserv *client, u_short length)
{
if ((i < nh_count) && !IN6_IS_ADDR_UNSPECIFIED (&nexthops[i])) {
if ((i < if_count) && ifindices[i]) {
nexthop_ipv6_ifindex_add (rib, &nexthops[i], ifindices[i]);
rib_nexthop_ipv6_ifindex_add (rib, &nexthops[i], ifindices[i]);
}
else {
nexthop_ipv6_add (rib, &nexthops[i]);
rib_nexthop_ipv6_add (rib, &nexthops[i]);
}
}
else {
if ((i < if_count) && ifindices[i]) {
nexthop_ifindex_add (rib, ifindices[i]);
rib_nexthop_ifindex_add (rib, ifindices[i]);
}
}
}
@ -1471,7 +1471,7 @@ zread_ipv6_add (struct zserv *client, u_short length, vrf_id_t vrf_id)
}
break;
case ZEBRA_NEXTHOP_BLACKHOLE:
nexthop_blackhole_add (rib);
rib_nexthop_blackhole_add (rib);
break;
}
}
@ -1481,13 +1481,13 @@ zread_ipv6_add (struct zserv *client, u_short length, vrf_id_t vrf_id)
{
if ((i < nh_count) && !IN6_IS_ADDR_UNSPECIFIED (&nexthops[i])) {
if ((i < if_count) && ifindices[i])
nexthop_ipv6_ifindex_add (rib, &nexthops[i], ifindices[i]);
rib_nexthop_ipv6_ifindex_add (rib, &nexthops[i], ifindices[i]);
else
nexthop_ipv6_add (rib, &nexthops[i]);
rib_nexthop_ipv6_add (rib, &nexthops[i]);
}
else {
if ((i < if_count) && ifindices[i])
nexthop_ifindex_add (rib, ifindices[i]);
rib_nexthop_ifindex_add (rib, ifindices[i]);
}
}
}
@ -2285,6 +2285,17 @@ DEFUN (config_table,
return CMD_SUCCESS;
}
DEFUN (no_config_table,
no_config_table_cmd,
"no table TABLENO",
NO_STR
"Configure target kernel routing table\n"
"TABLE integer\n")
{
zebrad.rtm_table_default = 0;
return CMD_SUCCESS;
}
DEFUN (ip_forwarding,
ip_forwarding_cmd,
"ip forwarding",
@ -2529,6 +2540,7 @@ zebra_init (void)
install_element (VIEW_NODE, &show_table_cmd);
install_element (ENABLE_NODE, &show_table_cmd);
install_element (CONFIG_NODE, &config_table_cmd);
install_element (CONFIG_NODE, &no_config_table_cmd);
#endif /* HAVE_NETLINK */
#ifdef HAVE_IPV6