mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 16:59:31 +00:00
Merge pull request #4029 from ak503/isis_yang
isis: priority of isis commands in interface configuration
This commit is contained in:
commit
c03b550b7a
@ -1000,7 +1000,7 @@ DEFPY(isis_mpls_te_inter_as, isis_mpls_te_inter_as_cmd,
|
||||
DEFPY(isis_default_originate, isis_default_originate_cmd,
|
||||
"[no] default-information originate <ipv4|ipv6>$ip"
|
||||
" <level-1|level-2>$level [always]$always"
|
||||
" [<metric (0-16777215)$metric|route-map WORD$rmap>]",
|
||||
" [{metric (0-16777215)$metric|route-map WORD$rmap}]",
|
||||
NO_STR
|
||||
"Control distribution of default information\n"
|
||||
"Distribute a default route\n"
|
||||
@ -1023,9 +1023,8 @@ DEFPY(isis_default_originate, isis_default_originate_cmd,
|
||||
nb_cli_enqueue_change(vty, "./route-map",
|
||||
rmap ? NB_OP_MODIFY : NB_OP_DESTROY,
|
||||
rmap ? rmap : NULL);
|
||||
nb_cli_enqueue_change(vty, "./metric",
|
||||
metric ? NB_OP_MODIFY : NB_OP_DESTROY,
|
||||
metric ? metric_str : NULL);
|
||||
nb_cli_enqueue_change(vty, "./metric", NB_OP_MODIFY,
|
||||
metric_str ? metric_str : NULL);
|
||||
if (strmatch(ip, "ipv6") && !always) {
|
||||
vty_out(vty,
|
||||
"Zebra doesn't implement default-originate for IPv6 yet\n");
|
||||
@ -1043,8 +1042,6 @@ static void vty_print_def_origin(struct vty *vty, struct lyd_node *dnode,
|
||||
const char *family, const char *level,
|
||||
bool show_defaults)
|
||||
{
|
||||
const char *metric;
|
||||
|
||||
vty_out(vty, " default-information originate %s %s", family, level);
|
||||
if (yang_dnode_get_bool(dnode, "./always"))
|
||||
vty_out(vty, " always");
|
||||
@ -1052,11 +1049,10 @@ static void vty_print_def_origin(struct vty *vty, struct lyd_node *dnode,
|
||||
if (yang_dnode_exists(dnode, "./route-map"))
|
||||
vty_out(vty, " route-map %s",
|
||||
yang_dnode_get_string(dnode, "./route-map"));
|
||||
else if (yang_dnode_exists(dnode, "./metric")) {
|
||||
metric = yang_dnode_get_string(dnode, "./metric");
|
||||
if (show_defaults || !yang_dnode_is_default(dnode, "./metric"))
|
||||
vty_out(vty, " metric %s", metric);
|
||||
}
|
||||
if (show_defaults || !yang_dnode_is_default(dnode, "./metric"))
|
||||
vty_out(vty, " metric %s",
|
||||
yang_dnode_get_string(dnode, "./metric"));
|
||||
|
||||
vty_out(vty, "\n");
|
||||
}
|
||||
|
||||
@ -1083,7 +1079,7 @@ DEFPY(isis_redistribute, isis_redistribute_cmd,
|
||||
"[no] redistribute <ipv4|ipv6>$ip " PROTO_REDIST_STR
|
||||
"$proto"
|
||||
" <level-1|level-2>$level"
|
||||
" [<metric (0-16777215)|route-map WORD>]",
|
||||
" [{metric (0-16777215)|route-map WORD}]",
|
||||
NO_STR REDIST_STR
|
||||
"Redistribute IPv4 routes\n"
|
||||
"Redistribute IPv6 routes\n" PROTO_REDIST_HELP
|
||||
@ -1101,9 +1097,8 @@ DEFPY(isis_redistribute, isis_redistribute_cmd,
|
||||
nb_cli_enqueue_change(vty, "./route-map",
|
||||
route_map ? NB_OP_MODIFY : NB_OP_DESTROY,
|
||||
route_map ? route_map : NULL);
|
||||
nb_cli_enqueue_change(vty, "./metric",
|
||||
metric ? NB_OP_MODIFY : NB_OP_DESTROY,
|
||||
metric ? metric_str : NULL);
|
||||
nb_cli_enqueue_change(vty, "./metric", NB_OP_MODIFY,
|
||||
metric_str ? metric_str : NULL);
|
||||
}
|
||||
|
||||
return nb_cli_apply_changes(
|
||||
@ -1112,16 +1107,16 @@ DEFPY(isis_redistribute, isis_redistribute_cmd,
|
||||
}
|
||||
|
||||
static void vty_print_redistribute(struct vty *vty, struct lyd_node *dnode,
|
||||
const char *family)
|
||||
bool show_defaults, const char *family)
|
||||
{
|
||||
const char *level = yang_dnode_get_string(dnode, "./level");
|
||||
const char *protocol = yang_dnode_get_string(dnode, "./protocol");
|
||||
|
||||
vty_out(vty, " redistribute %s %s %s", family, protocol, level);
|
||||
if (yang_dnode_exists(dnode, "./metric"))
|
||||
if (show_defaults || !yang_dnode_is_default(dnode, "./metric"))
|
||||
vty_out(vty, " metric %s",
|
||||
yang_dnode_get_string(dnode, "./metric"));
|
||||
else if (yang_dnode_exists(dnode, "./route-map"))
|
||||
if (yang_dnode_exists(dnode, "./route-map"))
|
||||
vty_out(vty, " route-map %s",
|
||||
yang_dnode_get_string(dnode, "./route-map"));
|
||||
vty_out(vty, "\n");
|
||||
@ -1130,12 +1125,12 @@ static void vty_print_redistribute(struct vty *vty, struct lyd_node *dnode,
|
||||
void cli_show_isis_redistribute_ipv4(struct vty *vty, struct lyd_node *dnode,
|
||||
bool show_defaults)
|
||||
{
|
||||
vty_print_redistribute(vty, dnode, "ipv4");
|
||||
vty_print_redistribute(vty, dnode, show_defaults, "ipv4");
|
||||
}
|
||||
void cli_show_isis_redistribute_ipv6(struct vty *vty, struct lyd_node *dnode,
|
||||
bool show_defaults)
|
||||
{
|
||||
vty_print_redistribute(vty, dnode, "ipv6");
|
||||
vty_print_redistribute(vty, dnode, show_defaults, "ipv6");
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -826,7 +826,7 @@ static void default_info_origin_apply_finish(const struct lyd_node *dnode,
|
||||
|
||||
if (yang_dnode_exists(dnode, "./metric"))
|
||||
metric = yang_dnode_get_uint32(dnode, "./metric");
|
||||
else if (yang_dnode_exists(dnode, "./route-map"))
|
||||
if (yang_dnode_exists(dnode, "./route-map"))
|
||||
routemap = yang_dnode_get_string(dnode, "./route-map");
|
||||
|
||||
isis_redist_set(area, level, family, DEFAULT_ROUTE, metric, routemap,
|
||||
@ -907,13 +907,6 @@ static int isis_instance_default_information_originate_ipv4_metric_modify(
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
static int isis_instance_default_information_originate_ipv4_metric_destroy(
|
||||
enum nb_event event, const struct lyd_node *dnode)
|
||||
{
|
||||
/* It's all done by default_info_origin_apply_finish */
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/default-information-originate/ipv6
|
||||
*/
|
||||
@ -981,13 +974,6 @@ static int isis_instance_default_information_originate_ipv6_metric_modify(
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
static int isis_instance_default_information_originate_ipv6_metric_destroy(
|
||||
enum nb_event event, const struct lyd_node *dnode)
|
||||
{
|
||||
/* It's all done by default_info_origin_apply_finish */
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/redistribute/ipv4
|
||||
*/
|
||||
@ -1005,7 +991,7 @@ static void redistribute_apply_finish(const struct lyd_node *dnode, int family)
|
||||
|
||||
if (yang_dnode_exists(dnode, "./metric"))
|
||||
metric = yang_dnode_get_uint32(dnode, "./metric");
|
||||
else if (yang_dnode_exists(dnode, "./route-map"))
|
||||
if (yang_dnode_exists(dnode, "./route-map"))
|
||||
routemap = yang_dnode_get_string(dnode, "./route-map");
|
||||
|
||||
isis_redist_set(area, level, family, type, metric, routemap, 0);
|
||||
@ -1078,14 +1064,6 @@ isis_instance_redistribute_ipv4_metric_modify(enum nb_event event,
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
static int
|
||||
isis_instance_redistribute_ipv4_metric_destroy(enum nb_event event,
|
||||
const struct lyd_node *dnode)
|
||||
{
|
||||
/* It's all done by redistribute_apply_finish */
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/redistribute/ipv6
|
||||
*/
|
||||
@ -1146,14 +1124,6 @@ isis_instance_redistribute_ipv6_metric_modify(enum nb_event event,
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
static int
|
||||
isis_instance_redistribute_ipv6_metric_destroy(enum nb_event event,
|
||||
const struct lyd_node *dnode)
|
||||
{
|
||||
/* It's all done by redistribute_apply_finish */
|
||||
return NB_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* XPath: /frr-isisd:isis/instance/multi-topology/ipv4-multicast
|
||||
*/
|
||||
@ -2926,7 +2896,6 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv4/metric",
|
||||
.cbs.modify = isis_instance_default_information_originate_ipv4_metric_modify,
|
||||
.cbs.destroy = isis_instance_default_information_originate_ipv4_metric_destroy,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6",
|
||||
@ -2947,7 +2916,6 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/default-information-originate/ipv6/metric",
|
||||
.cbs.modify = isis_instance_default_information_originate_ipv6_metric_modify,
|
||||
.cbs.destroy = isis_instance_default_information_originate_ipv6_metric_destroy,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/redistribute/ipv4",
|
||||
@ -2964,7 +2932,6 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/redistribute/ipv4/metric",
|
||||
.cbs.modify = isis_instance_redistribute_ipv4_metric_modify,
|
||||
.cbs.destroy = isis_instance_redistribute_ipv4_metric_destroy,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/redistribute/ipv6",
|
||||
@ -2981,7 +2948,6 @@ const struct frr_yang_module_info frr_isisd_info = {
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/redistribute/ipv6/metric",
|
||||
.cbs.modify = isis_instance_redistribute_ipv6_metric_modify,
|
||||
.cbs.destroy = isis_instance_redistribute_ipv6_metric_destroy,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-isisd:isis/instance/multi-topology/ipv4-multicast",
|
||||
|
@ -516,7 +516,7 @@ void isis_redist_area_finish(struct isis_area *area)
|
||||
DEFUN (isis_redistribute,
|
||||
isis_redistribute_cmd,
|
||||
"redistribute <ipv4|ipv6> " PROTO_REDIST_STR
|
||||
" [<metric (0-16777215)|route-map WORD>]",
|
||||
" [{metric (0-16777215)|route-map WORD}]",
|
||||
REDIST_STR
|
||||
"Redistribute IPv4 routes\n"
|
||||
"Redistribute IPv6 routes\n"
|
||||
@ -528,7 +528,7 @@ DEFUN (isis_redistribute,
|
||||
{
|
||||
int idx_afi = 1;
|
||||
int idx_protocol = 2;
|
||||
int idx_metric_rmap = fabricd ? 3 : 4;
|
||||
int idx_metric_rmap = 1;
|
||||
VTY_DECLVAR_CONTEXT(isis_area, area);
|
||||
int family;
|
||||
int afi;
|
||||
@ -556,20 +556,13 @@ DEFUN (isis_redistribute,
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
if (argc > idx_metric_rmap + 1) {
|
||||
if (argv[idx_metric_rmap + 1]->arg[0] == '\0')
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
if (argv_find(argv, argc, "metric", &idx_metric_rmap)) {
|
||||
metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL, 10);
|
||||
}
|
||||
|
||||
if (strmatch(argv[idx_metric_rmap]->text, "metric")) {
|
||||
char *endp;
|
||||
metric = strtoul(argv[idx_metric_rmap + 1]->arg, &endp,
|
||||
10);
|
||||
|
||||
if (*endp != '\0')
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
} else {
|
||||
routemap = argv[idx_metric_rmap + 1]->arg;
|
||||
}
|
||||
idx_metric_rmap = 1;
|
||||
if (argv_find(argv, argc, "route-map", &idx_metric_rmap)) {
|
||||
routemap = argv[idx_metric_rmap + 1]->arg;
|
||||
}
|
||||
|
||||
isis_redist_set(area, level, family, type, metric, routemap, 0);
|
||||
@ -614,7 +607,7 @@ DEFUN (no_isis_redistribute,
|
||||
DEFUN (isis_default_originate,
|
||||
isis_default_originate_cmd,
|
||||
"default-information originate <ipv4|ipv6>"
|
||||
" [always] [<metric (0-16777215)|route-map WORD>]",
|
||||
" [always] [{metric (0-16777215)|route-map WORD}]",
|
||||
"Control distribution of default information\n"
|
||||
"Distribute a default route\n"
|
||||
"Distribute default route for IPv4\n"
|
||||
@ -627,7 +620,7 @@ DEFUN (isis_default_originate,
|
||||
{
|
||||
int idx_afi = 2;
|
||||
int idx_always = fabricd ? 3 : 4;
|
||||
int idx_metric_rmap = fabricd ? 3 : 4;
|
||||
int idx_metric_rmap = 1;
|
||||
VTY_DECLVAR_CONTEXT(isis_area, area);
|
||||
int family;
|
||||
int originate_type = DEFAULT_ORIGINATE;
|
||||
@ -651,12 +644,13 @@ DEFUN (isis_default_originate,
|
||||
idx_metric_rmap++;
|
||||
}
|
||||
|
||||
if (argc > idx_metric_rmap) {
|
||||
if (strmatch(argv[idx_metric_rmap]->text, "metric"))
|
||||
metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL,
|
||||
10);
|
||||
else
|
||||
routemap = argv[idx_metric_rmap + 1]->arg;
|
||||
if (argv_find(argv, argc, "metric", &idx_metric_rmap)) {
|
||||
metric = strtoul(argv[idx_metric_rmap + 1]->arg, NULL, 10);
|
||||
}
|
||||
|
||||
idx_metric_rmap = 1;
|
||||
if (argv_find(argv, argc, "route-map", &idx_metric_rmap)) {
|
||||
routemap = argv[idx_metric_rmap + 1]->arg;
|
||||
}
|
||||
|
||||
if (family == AF_INET6 && originate_type != DEFAULT_ORIGINATE_ALWAYS) {
|
||||
|
@ -179,25 +179,23 @@ module frr-isisd {
|
||||
grouping redistribute-attributes {
|
||||
description
|
||||
"Common optional attributes of any redistribute entry.";
|
||||
choice attribute {
|
||||
leaf route-map {
|
||||
type string {
|
||||
length "1..max";
|
||||
}
|
||||
description
|
||||
"Applies the conditions of the specified route-map to routes that
|
||||
are redistributed into this routing instance.";
|
||||
leaf route-map {
|
||||
type string {
|
||||
length "1..max";
|
||||
}
|
||||
description
|
||||
"Applies the conditions of the specified route-map to routes that
|
||||
are redistributed into this routing instance.";
|
||||
}
|
||||
|
||||
leaf metric {
|
||||
type uint32 {
|
||||
range "0..16777215";
|
||||
}
|
||||
default "0";
|
||||
description
|
||||
"Metric used for the redistributed route. If 0,
|
||||
the default-metric attribute is used instead.";
|
||||
leaf metric {
|
||||
type uint32 {
|
||||
range "0..16777215";
|
||||
}
|
||||
default "0";
|
||||
description
|
||||
"Metric used for the redistributed route. If 0,
|
||||
the default-metric attribute is used instead.";
|
||||
}
|
||||
}
|
||||
|
||||
@ -737,13 +735,6 @@ module frr-isisd {
|
||||
"Area-tag associated to this circuit.";
|
||||
}
|
||||
|
||||
leaf circuit-type {
|
||||
type level;
|
||||
default "level-1-2";
|
||||
description
|
||||
"IS-type of this circuit.";
|
||||
}
|
||||
|
||||
leaf ipv4-routing {
|
||||
type boolean;
|
||||
default "false";
|
||||
@ -758,6 +749,13 @@ module frr-isisd {
|
||||
"Routing IS-IS IPv6 traffic over this circuit.";
|
||||
}
|
||||
|
||||
leaf circuit-type {
|
||||
type level;
|
||||
default "level-1-2";
|
||||
description
|
||||
"IS-type of this circuit.";
|
||||
}
|
||||
|
||||
container csnp-interval {
|
||||
description
|
||||
"Complete Sequence Number PDU (CSNP) generation interval.";
|
||||
|
Loading…
Reference in New Issue
Block a user