mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 00:56:19 +00:00
Hasso Tepper
http://hasso.linux.ee/zebra/ht-routemap-18042003_5.patch Trivial fixes to sync daemon's route-map commands to have same syntax. Fixes a lot of errors with "match ..." and "set ..." commands when using vtysh.
This commit is contained in:
parent
147193a28a
commit
73ffb25bec
@ -518,6 +518,52 @@ struct route_map_rule_cmd route_match_community_cmd =
|
|||||||
route_match_community_free
|
route_match_community_free
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Match function for extcommunity match. */
|
||||||
|
route_map_result_t
|
||||||
|
route_match_ecommunity (void *rule, struct prefix *prefix,
|
||||||
|
route_map_object_t type, void *object)
|
||||||
|
{
|
||||||
|
struct community_list *list;
|
||||||
|
struct bgp_info *bgp_info;
|
||||||
|
|
||||||
|
if (type == RMAP_BGP)
|
||||||
|
{
|
||||||
|
bgp_info = object;
|
||||||
|
|
||||||
|
list = community_list_lookup (bgp_clist, (char *) rule,
|
||||||
|
EXTCOMMUNITY_LIST_AUTO);
|
||||||
|
if (! list)
|
||||||
|
return RMAP_NOMATCH;
|
||||||
|
|
||||||
|
if (ecommunity_list_match (bgp_info->attr->ecommunity, list))
|
||||||
|
return RMAP_MATCH;
|
||||||
|
}
|
||||||
|
return RMAP_NOMATCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compile function for extcommunity match. */
|
||||||
|
void *
|
||||||
|
route_match_ecommunity_compile (char *arg)
|
||||||
|
{
|
||||||
|
return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compile function for extcommunity match. */
|
||||||
|
void
|
||||||
|
route_match_ecommunity_free (void *rule)
|
||||||
|
{
|
||||||
|
XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Route map commands for community matching. */
|
||||||
|
struct route_map_rule_cmd route_match_ecommunity_cmd =
|
||||||
|
{
|
||||||
|
"extcommunity",
|
||||||
|
route_match_ecommunity,
|
||||||
|
route_match_ecommunity_compile,
|
||||||
|
route_match_ecommunity_free
|
||||||
|
};
|
||||||
|
|
||||||
/* `match nlri` and `set nlri` are replaced by `address-family ipv4`
|
/* `match nlri` and `set nlri` are replaced by `address-family ipv4`
|
||||||
and `address-family vpnv4'. */
|
and `address-family vpnv4'. */
|
||||||
|
|
||||||
@ -2222,6 +2268,38 @@ ALIAS (no_match_community,
|
|||||||
"Community-list name\n"
|
"Community-list name\n"
|
||||||
"Do exact matching of communities\n")
|
"Do exact matching of communities\n")
|
||||||
|
|
||||||
|
DEFUN (match_ecommunity,
|
||||||
|
match_ecommunity_cmd,
|
||||||
|
"match extcommunity (<1-99>|<100-199>|WORD)",
|
||||||
|
MATCH_STR
|
||||||
|
"Match BGP/VPN extended community list\n"
|
||||||
|
"Extended community-list number (standard)\n"
|
||||||
|
"Extended community-list number (expanded)\n"
|
||||||
|
"Extended community-list name\n")
|
||||||
|
{
|
||||||
|
return bgp_route_match_add (vty, vty->index, "extcommunity", argv[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFUN (no_match_ecommunity,
|
||||||
|
no_match_ecommunity_cmd,
|
||||||
|
"no match extcommunity",
|
||||||
|
NO_STR
|
||||||
|
MATCH_STR
|
||||||
|
"Match BGP/VPN extended community list\n")
|
||||||
|
{
|
||||||
|
return bgp_route_match_delete (vty, vty->index, "extcommunity", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
ALIAS (no_match_ecommunity,
|
||||||
|
no_match_ecommunity_val_cmd,
|
||||||
|
"no match extcommunity (<1-99>|<100-199>|WORD)",
|
||||||
|
NO_STR
|
||||||
|
MATCH_STR
|
||||||
|
"Match BGP/VPN extended community list\n"
|
||||||
|
"Extended community-list number (standard)\n"
|
||||||
|
"Extended community-list number (expanded)\n"
|
||||||
|
"Extended community-list name\n")
|
||||||
|
|
||||||
DEFUN (match_aspath,
|
DEFUN (match_aspath,
|
||||||
match_aspath_cmd,
|
match_aspath_cmd,
|
||||||
"match as-path WORD",
|
"match as-path WORD",
|
||||||
@ -2335,15 +2413,21 @@ ALIAS (no_set_ip_nexthop,
|
|||||||
|
|
||||||
DEFUN (set_metric,
|
DEFUN (set_metric,
|
||||||
set_metric_cmd,
|
set_metric_cmd,
|
||||||
"set metric (<0-4294967295>|<+/-metric>)",
|
"set metric <0-4294967295>",
|
||||||
SET_STR
|
SET_STR
|
||||||
"Metric value for destination routing protocol\n"
|
"Metric value for destination routing protocol\n"
|
||||||
"Metric value\n"
|
"Metric value\n")
|
||||||
"Add or subtract metric\n")
|
|
||||||
{
|
{
|
||||||
return bgp_route_set_add (vty, vty->index, "metric", argv[0]);
|
return bgp_route_set_add (vty, vty->index, "metric", argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALIAS (set_metric,
|
||||||
|
set_metric_addsub_cmd,
|
||||||
|
"set metric <+/-metric>",
|
||||||
|
SET_STR
|
||||||
|
"Metric value for destination routing protocol\n"
|
||||||
|
"Add or subtract BGP metric\n")
|
||||||
|
|
||||||
DEFUN (no_set_metric,
|
DEFUN (no_set_metric,
|
||||||
no_set_metric_cmd,
|
no_set_metric_cmd,
|
||||||
"no set metric",
|
"no set metric",
|
||||||
@ -3093,6 +3177,7 @@ bgp_route_map_init ()
|
|||||||
route_map_install_match (&route_match_ip_next_hop_prefix_list_cmd);
|
route_map_install_match (&route_match_ip_next_hop_prefix_list_cmd);
|
||||||
route_map_install_match (&route_match_aspath_cmd);
|
route_map_install_match (&route_match_aspath_cmd);
|
||||||
route_map_install_match (&route_match_community_cmd);
|
route_map_install_match (&route_match_community_cmd);
|
||||||
|
route_map_install_match (&route_match_ecommunity_cmd);
|
||||||
route_map_install_match (&route_match_metric_cmd);
|
route_map_install_match (&route_match_metric_cmd);
|
||||||
route_map_install_match (&route_match_origin_cmd);
|
route_map_install_match (&route_match_origin_cmd);
|
||||||
|
|
||||||
@ -3136,6 +3221,9 @@ bgp_route_map_init ()
|
|||||||
install_element (RMAP_NODE, &no_match_community_cmd);
|
install_element (RMAP_NODE, &no_match_community_cmd);
|
||||||
install_element (RMAP_NODE, &no_match_community_val_cmd);
|
install_element (RMAP_NODE, &no_match_community_val_cmd);
|
||||||
install_element (RMAP_NODE, &no_match_community_exact_cmd);
|
install_element (RMAP_NODE, &no_match_community_exact_cmd);
|
||||||
|
install_element (RMAP_NODE, &match_ecommunity_cmd);
|
||||||
|
install_element (RMAP_NODE, &no_match_ecommunity_cmd);
|
||||||
|
install_element (RMAP_NODE, &no_match_ecommunity_val_cmd);
|
||||||
install_element (RMAP_NODE, &match_origin_cmd);
|
install_element (RMAP_NODE, &match_origin_cmd);
|
||||||
install_element (RMAP_NODE, &no_match_origin_cmd);
|
install_element (RMAP_NODE, &no_match_origin_cmd);
|
||||||
install_element (RMAP_NODE, &no_match_origin_val_cmd);
|
install_element (RMAP_NODE, &no_match_origin_val_cmd);
|
||||||
@ -3150,6 +3238,7 @@ bgp_route_map_init ()
|
|||||||
install_element (RMAP_NODE, &no_set_weight_cmd);
|
install_element (RMAP_NODE, &no_set_weight_cmd);
|
||||||
install_element (RMAP_NODE, &no_set_weight_val_cmd);
|
install_element (RMAP_NODE, &no_set_weight_val_cmd);
|
||||||
install_element (RMAP_NODE, &set_metric_cmd);
|
install_element (RMAP_NODE, &set_metric_cmd);
|
||||||
|
install_element (RMAP_NODE, &set_metric_addsub_cmd);
|
||||||
install_element (RMAP_NODE, &no_set_metric_cmd);
|
install_element (RMAP_NODE, &no_set_metric_cmd);
|
||||||
install_element (RMAP_NODE, &no_set_metric_val_cmd);
|
install_element (RMAP_NODE, &no_set_metric_val_cmd);
|
||||||
install_element (RMAP_NODE, &set_aspath_prepend_cmd);
|
install_element (RMAP_NODE, &set_aspath_prepend_cmd);
|
||||||
|
@ -214,14 +214,14 @@ route_map_command_status (struct vty *vty, int ret)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add "match address" */
|
/* add "match address" */
|
||||||
DEFUN (ospf6_routemap_match_address_prefixlist,
|
DEFUN (match_ipv6_address_prefix_list,
|
||||||
ospf6_routemap_match_address_prefixlist_cmd,
|
match_ipv6_address_prefix_list_cmd,
|
||||||
"match ipv6 address prefix-list WORD",
|
"match ipv6 address prefix-list WORD",
|
||||||
"Match values\n"
|
MATCH_STR
|
||||||
IPV6_STR
|
IPV6_STR
|
||||||
"Match address of route\n"
|
"Match address of route\n"
|
||||||
"Match entries of prefix-lists\n"
|
"Match entries of prefix-lists\n"
|
||||||
"IPv6 prefix-list name\n")
|
"IP prefix-list name\n")
|
||||||
{
|
{
|
||||||
int ret = route_map_add_match ((struct route_map_index *) vty->index,
|
int ret = route_map_add_match ((struct route_map_index *) vty->index,
|
||||||
"ipv6 address prefix-list", argv[0]);
|
"ipv6 address prefix-list", argv[0]);
|
||||||
@ -229,15 +229,15 @@ DEFUN (ospf6_routemap_match_address_prefixlist,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* delete "match address" */
|
/* delete "match address" */
|
||||||
DEFUN (ospf6_routemap_no_match_address_prefixlist,
|
DEFUN (no_match_ipv6_address_prefix_list,
|
||||||
ospf6_routemap_no_match_address_prefixlist_cmd,
|
no_match_ipv6_address_prefix_list_cmd,
|
||||||
"no match ipv6 address prefix-list WORD",
|
"no match ipv6 address prefix-list WORD",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Match values\n"
|
MATCH_STR
|
||||||
IPV6_STR
|
IPV6_STR
|
||||||
"Match address of route\n"
|
"Match address of route\n"
|
||||||
"Match entries of prefix-lists\n"
|
"Match entries of prefix-lists\n"
|
||||||
"IPv6 prefix-list name\n")
|
"IP prefix-list name\n")
|
||||||
{
|
{
|
||||||
int ret = route_map_delete_match ((struct route_map_index *) vty->index,
|
int ret = route_map_delete_match ((struct route_map_index *) vty->index,
|
||||||
"ipv6 address prefix-list", argv[0]);
|
"ipv6 address prefix-list", argv[0]);
|
||||||
@ -245,13 +245,13 @@ DEFUN (ospf6_routemap_no_match_address_prefixlist,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* add "set metric-type" */
|
/* add "set metric-type" */
|
||||||
DEFUN (ospf6_routemap_set_metric_type,
|
DEFUN (set_metric_type,
|
||||||
ospf6_routemap_set_metric_type_cmd,
|
set_metric_type_cmd,
|
||||||
"set metric-type (type-1|type-2)",
|
"set metric-type (type-1|type-2)",
|
||||||
"Set value\n"
|
SET_STR
|
||||||
"Type of metric\n"
|
"Type of metric for destination routing protocol\n"
|
||||||
"OSPF6 external type 1 metric\n"
|
"OSPF[6] external type 1 metric\n"
|
||||||
"OSPF6 external type 2 metric\n")
|
"OSPF[6] external type 2 metric\n")
|
||||||
{
|
{
|
||||||
int ret = route_map_add_set ((struct route_map_index *) vty->index,
|
int ret = route_map_add_set ((struct route_map_index *) vty->index,
|
||||||
"metric-type", argv[0]);
|
"metric-type", argv[0]);
|
||||||
@ -259,26 +259,38 @@ DEFUN (ospf6_routemap_set_metric_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* delete "set metric-type" */
|
/* delete "set metric-type" */
|
||||||
DEFUN (ospf6_routemap_no_set_metric_type,
|
DEFUN (no_set_metric_type,
|
||||||
ospf6_routemap_no_set_metric_type_cmd,
|
no_set_metric_type_cmd,
|
||||||
"no set metric-type (type-1|type-2)",
|
"no set metric-type",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Set value\n"
|
SET_STR
|
||||||
"Type of metric\n"
|
"Type of metric for destination routing protocol\n")
|
||||||
"OSPF6 external type 1 metric\n"
|
|
||||||
"OSPF6 external type 2 metric\n")
|
|
||||||
{
|
{
|
||||||
int ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
int ret;
|
||||||
|
if (argc == 0)
|
||||||
|
ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
||||||
|
"metric-type", NULL);
|
||||||
|
else
|
||||||
|
ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
||||||
"metric-type", argv[0]);
|
"metric-type", argv[0]);
|
||||||
return route_map_command_status (vty, ret);
|
return route_map_command_status (vty, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALIAS (no_set_metric_type,
|
||||||
|
no_set_metric_type_val_cmd,
|
||||||
|
"no set metric-type (type-1|type-2)",
|
||||||
|
NO_STR
|
||||||
|
SET_STR
|
||||||
|
"Type of metric for destination routing protocol\n"
|
||||||
|
"OSPF[6] external type 1 metric\n"
|
||||||
|
"OSPF[6] external type 2 metric\n")
|
||||||
|
|
||||||
/* add "set metric" */
|
/* add "set metric" */
|
||||||
DEFUN (set_metric,
|
DEFUN (set_metric,
|
||||||
set_metric_cmd,
|
set_metric_cmd,
|
||||||
"set metric <0-4294967295>",
|
"set metric <0-4294967295>",
|
||||||
"Set value\n"
|
SET_STR
|
||||||
"Metric value\n"
|
"Metric value for destination routing protocol\n"
|
||||||
"Metric value\n")
|
"Metric value\n")
|
||||||
{
|
{
|
||||||
int ret = route_map_add_set ((struct route_map_index *) vty->index,
|
int ret = route_map_add_set ((struct route_map_index *) vty->index,
|
||||||
@ -289,17 +301,29 @@ DEFUN (set_metric,
|
|||||||
/* delete "set metric" */
|
/* delete "set metric" */
|
||||||
DEFUN (no_set_metric,
|
DEFUN (no_set_metric,
|
||||||
no_set_metric_cmd,
|
no_set_metric_cmd,
|
||||||
"no set metric <0-4294967295>",
|
"no set metric",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Set value\n"
|
SET_STR
|
||||||
"Metric\n"
|
"Metric value for destination routing protocol\n")
|
||||||
"METRIC value\n")
|
|
||||||
{
|
{
|
||||||
int ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
int ret;
|
||||||
|
if (argc == 0)
|
||||||
|
ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
||||||
|
"metric", NULL);
|
||||||
|
else
|
||||||
|
ret = route_map_delete_set ((struct route_map_index *) vty->index,
|
||||||
"metric", argv[0]);
|
"metric", argv[0]);
|
||||||
return route_map_command_status (vty, ret);
|
return route_map_command_status (vty, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALIAS (no_set_metric,
|
||||||
|
no_set_metric_val_cmd,
|
||||||
|
"no set metric <0-4294967295>",
|
||||||
|
NO_STR
|
||||||
|
SET_STR
|
||||||
|
"Metric value for destination routing protocol\n"
|
||||||
|
"Metric value\n")
|
||||||
|
|
||||||
/* add "set forwarding-address" */
|
/* add "set forwarding-address" */
|
||||||
DEFUN (ospf6_routemap_set_forwarding,
|
DEFUN (ospf6_routemap_set_forwarding,
|
||||||
ospf6_routemap_set_forwarding_cmd,
|
ospf6_routemap_set_forwarding_cmd,
|
||||||
@ -341,16 +365,18 @@ ospf6_routemap_init ()
|
|||||||
route_map_install_set (&ospf6_routemap_rule_set_forwarding_cmd);
|
route_map_install_set (&ospf6_routemap_rule_set_forwarding_cmd);
|
||||||
|
|
||||||
/* Match address prefix-list */
|
/* Match address prefix-list */
|
||||||
install_element (RMAP_NODE, &ospf6_routemap_match_address_prefixlist_cmd);
|
install_element (RMAP_NODE, &match_ipv6_address_prefix_list_cmd);
|
||||||
install_element (RMAP_NODE, &ospf6_routemap_no_match_address_prefixlist_cmd);
|
install_element (RMAP_NODE, &no_match_ipv6_address_prefix_list_cmd);
|
||||||
|
|
||||||
/* ASE Metric Type (e.g. Type-1/Type-2) */
|
/* ASE Metric Type (e.g. Type-1/Type-2) */
|
||||||
install_element (RMAP_NODE, &ospf6_routemap_set_metric_type_cmd);
|
install_element (RMAP_NODE, &set_metric_type_cmd);
|
||||||
install_element (RMAP_NODE, &ospf6_routemap_no_set_metric_type_cmd);
|
install_element (RMAP_NODE, &no_set_metric_type_cmd);
|
||||||
|
install_element (RMAP_NODE, &no_set_metric_type_val_cmd);
|
||||||
|
|
||||||
/* ASE Metric */
|
/* ASE Metric */
|
||||||
install_element (RMAP_NODE, &set_metric_cmd);
|
install_element (RMAP_NODE, &set_metric_cmd);
|
||||||
install_element (RMAP_NODE, &no_set_metric_cmd);
|
install_element (RMAP_NODE, &no_set_metric_cmd);
|
||||||
|
install_element (RMAP_NODE, &no_set_metric_val_cmd);
|
||||||
|
|
||||||
/* ASE Metric */
|
/* ASE Metric */
|
||||||
install_element (RMAP_NODE, &ospf6_routemap_set_forwarding_cmd);
|
install_element (RMAP_NODE, &ospf6_routemap_set_forwarding_cmd);
|
||||||
|
@ -43,28 +43,32 @@
|
|||||||
void
|
void
|
||||||
ospf_route_map_update (char *name)
|
ospf_route_map_update (char *name)
|
||||||
{
|
{
|
||||||
|
struct ospf *ospf;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
/* If OSPF instatnce does not exist, return right now. */
|
/* If OSPF instatnce does not exist, return right now. */
|
||||||
if (!ospf_top)
|
ospf = ospf_lookup ();
|
||||||
|
if (ospf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Update route-map */
|
/* Update route-map */
|
||||||
for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
|
for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
|
||||||
{
|
{
|
||||||
if (ROUTEMAP_NAME (type) && strcmp (ROUTEMAP_NAME (type), name) == 0)
|
if (ROUTEMAP_NAME (ospf, type)
|
||||||
|
&& strcmp (ROUTEMAP_NAME (ospf, type), name) == 0)
|
||||||
{
|
{
|
||||||
/* Keep old route-map. */
|
/* Keep old route-map. */
|
||||||
struct route_map *old = ROUTEMAP (type);
|
struct route_map *old = ROUTEMAP (ospf, type);
|
||||||
|
|
||||||
/* Update route-map. */
|
/* Update route-map. */
|
||||||
ROUTEMAP (type) = route_map_lookup_by_name (ROUTEMAP_NAME (type));
|
ROUTEMAP (ospf, type) =
|
||||||
|
route_map_lookup_by_name (ROUTEMAP_NAME (ospf, type));
|
||||||
|
|
||||||
/* No update for this distribute type. */
|
/* No update for this distribute type. */
|
||||||
if (old == NULL && ROUTEMAP (type) == NULL)
|
if (old == NULL && ROUTEMAP (ospf, type) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ospf_distribute_list_update (type);
|
ospf_distribute_list_update (ospf, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,19 +76,21 @@ ospf_route_map_update (char *name)
|
|||||||
void
|
void
|
||||||
ospf_route_map_event (route_map_event_t event, char *name)
|
ospf_route_map_event (route_map_event_t event, char *name)
|
||||||
{
|
{
|
||||||
|
struct ospf *ospf;
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
/* If OSPF instatnce does not exist, return right now. */
|
/* If OSPF instatnce does not exist, return right now. */
|
||||||
if (!ospf_top)
|
ospf = ospf_lookup ();
|
||||||
|
if (ospf == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Update route-map. */
|
/* Update route-map. */
|
||||||
for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
|
for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
|
||||||
{
|
{
|
||||||
if (ROUTEMAP_NAME (type) && ROUTEMAP (type) &&
|
if (ROUTEMAP_NAME (ospf, type) && ROUTEMAP (ospf, type)
|
||||||
!strcmp (ROUTEMAP_NAME (type), name))
|
&& !strcmp (ROUTEMAP_NAME (ospf, type), name))
|
||||||
{
|
{
|
||||||
ospf_distribute_list_update (type);
|
ospf_distribute_list_update (ospf, type);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -750,8 +756,8 @@ DEFUN (set_metric_type,
|
|||||||
"set metric-type (type-1|type-2)",
|
"set metric-type (type-1|type-2)",
|
||||||
SET_STR
|
SET_STR
|
||||||
"Type of metric for destination routing protocol\n"
|
"Type of metric for destination routing protocol\n"
|
||||||
"OSPF external type 1 metric\n"
|
"OSPF[6] external type 1 metric\n"
|
||||||
"OSPF external type 2 metric\n")
|
"OSPF[6] external type 2 metric\n")
|
||||||
{
|
{
|
||||||
if (strcmp (argv[0], "1") == 0)
|
if (strcmp (argv[0], "1") == 0)
|
||||||
return ospf_route_set_add (vty, vty->index, "metric-type", "type-1");
|
return ospf_route_set_add (vty, vty->index, "metric-type", "type-1");
|
||||||
@ -780,8 +786,8 @@ ALIAS (no_set_metric_type,
|
|||||||
NO_STR
|
NO_STR
|
||||||
SET_STR
|
SET_STR
|
||||||
"Type of metric for destination routing protocol\n"
|
"Type of metric for destination routing protocol\n"
|
||||||
"OSPF external type 1 metric\n"
|
"OSPF[6] external type 1 metric\n"
|
||||||
"OSPF external type 2 metric\n")
|
"OSPF[6] external type 2 metric\n")
|
||||||
|
|
||||||
/* Route-map init */
|
/* Route-map init */
|
||||||
void
|
void
|
||||||
|
@ -628,11 +628,13 @@ ALIAS (no_match_interface,
|
|||||||
|
|
||||||
DEFUN (match_ip_next_hop,
|
DEFUN (match_ip_next_hop,
|
||||||
match_ip_next_hop_cmd,
|
match_ip_next_hop_cmd,
|
||||||
"match ip next-hop WORD",
|
"match ip next-hop (<1-199>|<1300-2699>|WORD)",
|
||||||
MATCH_STR
|
MATCH_STR
|
||||||
IP_STR
|
IP_STR
|
||||||
"Match next-hop address of route\n"
|
"Match next-hop address of route\n"
|
||||||
"IP access-list name\n")
|
"IP access-list number\n"
|
||||||
|
"IP access-list number (expanded range)\n"
|
||||||
|
"IP Access-list name\n")
|
||||||
{
|
{
|
||||||
return rip_route_match_add (vty, vty->index, "ip next-hop", argv[0]);
|
return rip_route_match_add (vty, vty->index, "ip next-hop", argv[0]);
|
||||||
}
|
}
|
||||||
@ -653,12 +655,14 @@ DEFUN (no_match_ip_next_hop,
|
|||||||
|
|
||||||
ALIAS (no_match_ip_next_hop,
|
ALIAS (no_match_ip_next_hop,
|
||||||
no_match_ip_next_hop_val_cmd,
|
no_match_ip_next_hop_val_cmd,
|
||||||
"no match ip next-hop WORD",
|
"no match ip next-hop (<1-199>|<1300-2699>|WORD)",
|
||||||
NO_STR
|
NO_STR
|
||||||
MATCH_STR
|
MATCH_STR
|
||||||
IP_STR
|
IP_STR
|
||||||
"Match next-hop address of route\n"
|
"Match next-hop address of route\n"
|
||||||
"IP access-list name\n")
|
"IP access-list number\n"
|
||||||
|
"IP access-list number (expanded range)\n"
|
||||||
|
"IP Access-list name\n")
|
||||||
|
|
||||||
DEFUN (match_ip_next_hop_prefix_list,
|
DEFUN (match_ip_next_hop_prefix_list,
|
||||||
match_ip_next_hop_prefix_list_cmd,
|
match_ip_next_hop_prefix_list_cmd,
|
||||||
@ -697,13 +701,16 @@ ALIAS (no_match_ip_next_hop_prefix_list,
|
|||||||
"Match entries of prefix-lists\n"
|
"Match entries of prefix-lists\n"
|
||||||
"IP prefix-list name\n")
|
"IP prefix-list name\n")
|
||||||
|
|
||||||
DEFUN (match_ip_address,
|
DEFUN (match_ip_address,
|
||||||
match_ip_address_cmd,
|
match_ip_address_cmd,
|
||||||
"match ip address WORD",
|
"match ip address (<1-199>|<1300-2699>|WORD)",
|
||||||
MATCH_STR
|
MATCH_STR
|
||||||
IP_STR
|
IP_STR
|
||||||
"Match address of route\n"
|
"Match address of route\n"
|
||||||
"IP access-list name\n")
|
"IP access-list number\n"
|
||||||
|
"IP access-list number (expanded range)\n"
|
||||||
|
"IP Access-list name\n")
|
||||||
|
|
||||||
{
|
{
|
||||||
return rip_route_match_add (vty, vty->index, "ip address", argv[0]);
|
return rip_route_match_add (vty, vty->index, "ip address", argv[0]);
|
||||||
}
|
}
|
||||||
@ -722,14 +729,16 @@ DEFUN (no_match_ip_address,
|
|||||||
return rip_route_match_delete (vty, vty->index, "ip address", argv[0]);
|
return rip_route_match_delete (vty, vty->index, "ip address", argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
ALIAS (no_match_ip_address,
|
ALIAS (no_match_ip_address,
|
||||||
no_match_ip_address_val_cmd,
|
no_match_ip_address_val_cmd,
|
||||||
"no match ip address WORD",
|
"no match ip address (<1-199>|<1300-2699>|WORD)",
|
||||||
NO_STR
|
NO_STR
|
||||||
MATCH_STR
|
MATCH_STR
|
||||||
IP_STR
|
IP_STR
|
||||||
"Match address of route\n"
|
"Match address of route\n"
|
||||||
"IP access-list name\n")
|
"IP access-list number\n"
|
||||||
|
"IP access-list number (expanded range)\n"
|
||||||
|
"IP Access-list name\n")
|
||||||
|
|
||||||
DEFUN (match_ip_address_prefix_list,
|
DEFUN (match_ip_address_prefix_list,
|
||||||
match_ip_address_prefix_list_cmd,
|
match_ip_address_prefix_list_cmd,
|
||||||
|
@ -158,7 +158,9 @@ route_set_metric_compile (char *arg)
|
|||||||
|
|
||||||
if (metric == LONG_MAX || *endptr != '\0')
|
if (metric == LONG_MAX || *endptr != '\0')
|
||||||
return NULL;
|
return NULL;
|
||||||
if (metric < 0 || metric > RIPNG_METRIC_INFINITY)
|
/* Commented out by Hasso Tepper, to avoid problems in vtysh. */
|
||||||
|
/* if (metric < 0 || metric > RIPNG_METRIC_INFINITY) */
|
||||||
|
if (metric < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
mod = XMALLOC (MTYPE_ROUTE_MAP_COMPILED,
|
mod = XMALLOC (MTYPE_ROUTE_MAP_COMPILED,
|
||||||
@ -314,15 +316,25 @@ DEFUN (set_metric,
|
|||||||
|
|
||||||
DEFUN (no_set_metric,
|
DEFUN (no_set_metric,
|
||||||
no_set_metric_cmd,
|
no_set_metric_cmd,
|
||||||
"no set metric <0-4294967295>",
|
"no set metric",
|
||||||
NO_STR
|
NO_STR
|
||||||
"Set value\n"
|
SET_STR
|
||||||
"Metric\n"
|
"Metric value for destination routing protocol\n")
|
||||||
"METRIC value\n")
|
|
||||||
{
|
{
|
||||||
|
if (argc == 0)
|
||||||
|
return ripng_route_set_delete (vty, vty->index, "metric", NULL);
|
||||||
|
|
||||||
return ripng_route_set_delete (vty, vty->index, "metric", argv[0]);
|
return ripng_route_set_delete (vty, vty->index, "metric", argv[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ALIAS (no_set_metric,
|
||||||
|
no_set_metric_val_cmd,
|
||||||
|
"no set metric <0-4294967295>",
|
||||||
|
NO_STR
|
||||||
|
SET_STR
|
||||||
|
"Metric value for destination routing protocol\n"
|
||||||
|
"Metric value\n")
|
||||||
|
|
||||||
void
|
void
|
||||||
ripng_route_map_init ()
|
ripng_route_map_init ()
|
||||||
{
|
{
|
||||||
|
@ -85,7 +85,7 @@ foreach (@ARGV) {
|
|||||||
$protocol = "VTYSH_RIPD";
|
$protocol = "VTYSH_RIPD";
|
||||||
}
|
}
|
||||||
if ($file =~ /routemap.c/) {
|
if ($file =~ /routemap.c/) {
|
||||||
$protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD";
|
$protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD";
|
||||||
}
|
}
|
||||||
if ($file =~ /filter.c/) {
|
if ($file =~ /filter.c/) {
|
||||||
if ($defun_array[1] =~ m/ipv6/) {
|
if ($defun_array[1] =~ m/ipv6/) {
|
||||||
|
@ -1174,21 +1174,6 @@ DEFSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD,
|
|||||||
NO_STR
|
NO_STR
|
||||||
"Interface specific description\n")
|
"Interface specific description\n")
|
||||||
|
|
||||||
DEFSH (VTYSH_RIPD|VTYSH_BGPD,
|
|
||||||
set_ip_nexthop_cmd,
|
|
||||||
"set ip next-hop A.B.C.D",
|
|
||||||
SET_STR
|
|
||||||
IP_STR
|
|
||||||
"Next hop address\n"
|
|
||||||
"IP address of next hop\n")
|
|
||||||
|
|
||||||
DEFSH (VTYSH_RMAP,
|
|
||||||
set_metric_cmd,
|
|
||||||
"set metric <0-4294967295>",
|
|
||||||
SET_STR
|
|
||||||
"Metric value for destination routing protocol\n"
|
|
||||||
"Metric value\n")
|
|
||||||
|
|
||||||
DEFUNSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_OSPF6D,
|
DEFUNSH (VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_OSPF6D,
|
||||||
vtysh_exit_interface,
|
vtysh_exit_interface,
|
||||||
vtysh_exit_interface_cmd,
|
vtysh_exit_interface_cmd,
|
||||||
@ -1909,9 +1894,6 @@ vtysh_init_vty ()
|
|||||||
install_element (ENABLE_NODE, &vtysh_start_bash_cmd);
|
install_element (ENABLE_NODE, &vtysh_start_bash_cmd);
|
||||||
install_element (ENABLE_NODE, &vtysh_start_zsh_cmd);
|
install_element (ENABLE_NODE, &vtysh_start_zsh_cmd);
|
||||||
|
|
||||||
install_element (RMAP_NODE, &set_metric_cmd);
|
|
||||||
install_element (RMAP_NODE, &set_ip_nexthop_cmd);
|
|
||||||
|
|
||||||
install_element (CONFIG_NODE, &vtysh_log_stdout_cmd);
|
install_element (CONFIG_NODE, &vtysh_log_stdout_cmd);
|
||||||
install_element (CONFIG_NODE, &no_vtysh_log_stdout_cmd);
|
install_element (CONFIG_NODE, &no_vtysh_log_stdout_cmd);
|
||||||
install_element (CONFIG_NODE, &vtysh_log_file_cmd);
|
install_element (CONFIG_NODE, &vtysh_log_file_cmd);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#define VTYSH_OSPF6D 0x10
|
#define VTYSH_OSPF6D 0x10
|
||||||
#define VTYSH_BGPD 0x20
|
#define VTYSH_BGPD 0x20
|
||||||
#define VTYSH_ALL VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD
|
#define VTYSH_ALL VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD
|
||||||
#define VTYSH_RMAP VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD
|
#define VTYSH_RMAP VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD
|
||||||
|
|
||||||
#define VTYSH_INDEX_ZEBRA 0
|
#define VTYSH_INDEX_ZEBRA 0
|
||||||
#define VTYSH_INDEX_RIP 1
|
#define VTYSH_INDEX_RIP 1
|
||||||
|
Loading…
Reference in New Issue
Block a user