OSPF: Add support for setting explicit-router-id

This commit is contained in:
Mattias Walström
2024-01-15 16:29:06 +01:00
committed by Joachim Wiberg
parent 4801c1f060
commit c906236be5
3 changed files with 6 additions and 3 deletions
+1
View File
@@ -207,6 +207,7 @@ sysrepoctl -s $SEARCH \
-i ietf-ipv4-unicast-routing@2018-03-13.yang -g wheel -p 0660 \
-i ietf-ospf@2022-10-19.yang -g wheel -p 0660 \
-e bfd \
-e explicit-router-id \
-i iana-if-type@2023-01-26.yang -g wheel -p 0660 \
-i ieee802-dot1q-types@2022-10-29.yang -g wheel -p 0660 \
-i infix-ip@2023-09-14.yang -g wheel -p 0660 \
+4
View File
@@ -111,6 +111,7 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
struct lyd_node *areas, *default_route;
int num_areas = 0;
int bfd_enabled = 0;
const char *router_id;
FILE *fp;
fp = fopen(OSPFD_CONF_NEXT, "w");
if (!fp) {
@@ -119,6 +120,7 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
}
fputs(FRR_STATIC_CONFIG, fp);
areas = lydx_get_child(ospf, "areas");
router_id = lydx_get_cattr(ospf, "explicit-router-id");
bfd_enabled = parse_ospf_interfaces(session, areas, fp);
fputs("router ospf\n", fp);
num_areas = parse_ospf_areas(session, areas, fp);
@@ -132,6 +134,8 @@ int parse_ospf(sr_session_ctx_t *session, struct lyd_node *ospf)
fputs("\n", fp);
}
}
if (router_id)
fprintf(fp, " ospf router-id %s\n", router_id);
fclose(fp);
if (!bfd_enabled)
+1 -3
View File
@@ -44,6 +44,7 @@ module infix-routing {
description "Initial limitation";
deviate not-supported;
}
deviation "/ietf-r:routing/ietf-r:router-id" {
description "Set in OSPF";
deviate not-supported;
@@ -230,9 +231,6 @@ module infix-routing {
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:database" {
deviate not-supported;
}
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:explicit-router-id" {
deviate not-supported;
}
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:graceful-restart" {
deviate not-supported;
}