mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-02 13:53:01 +02:00
OSPF: add support to change network type for interface
Implemented types are broadcast and point-to-point
This commit is contained in:
committed by
Joachim Wiberg
parent
3240de833f
commit
94ae818895
@@ -32,7 +32,7 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
|
||||
interfaces = lydx_get_child(area, "interfaces");
|
||||
const char *area_id = lydx_get_cattr(area, "area-id");
|
||||
LY_LIST_FOR(lyd_child(interfaces), interface) {
|
||||
const char *hello, *dead, *retransmit, *transmit;
|
||||
const char *hello, *dead, *retransmit, *transmit, *interface_type;
|
||||
if (lydx_get_bool(interface, "enabled")) {
|
||||
struct lyd_node *bfd;
|
||||
int passive = 0;
|
||||
@@ -44,6 +44,7 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
|
||||
dead = lydx_get_cattr(interface, "dead-interval");
|
||||
retransmit = lydx_get_cattr(interface, "retransmit-interval");
|
||||
transmit = lydx_get_cattr(interface, "transmit-delay");
|
||||
interface_type = lydx_get_cattr(interface, "interface-type");
|
||||
fprintf(fp, " ip ospf area %s\n", area_id);
|
||||
if (dead)
|
||||
fprintf(fp, " ip ospf dead-interval %s\n", dead);
|
||||
@@ -55,8 +56,10 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
|
||||
fprintf(fp, " ip ospf transmit-delay %s\n", transmit);
|
||||
if (bfd_enabled)
|
||||
fputs(" ip ospf bfd\n", fp);
|
||||
if(passive)
|
||||
if (passive)
|
||||
fputs(" ip ospf passive\n", fp);
|
||||
if (interface_type)
|
||||
fprintf(fp, " ip ospf network %s\n", interface_type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +158,18 @@ module infix-routing {
|
||||
|
||||
|
||||
/* OSPF */
|
||||
typedef infix-ospf-interface-type {
|
||||
type enumeration {
|
||||
enum broadcast {
|
||||
description
|
||||
"Specifies an OSPF broadcast multi-access network.";
|
||||
}
|
||||
enum point-to-point {
|
||||
description
|
||||
"Specifies an OSPF point-to-point network.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
augment "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf" {
|
||||
description "ietf-ospf does not contain redistribution
|
||||
@@ -188,6 +200,14 @@ module infix-routing {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area/ospf:interfaces/ospf:interface/ospf:interface-type"
|
||||
{
|
||||
deviate replace {
|
||||
type infix-ospf-interface-type;
|
||||
}
|
||||
}
|
||||
|
||||
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:auto-cost" {
|
||||
deviate not-supported;
|
||||
}
|
||||
@@ -274,7 +294,6 @@ module infix-routing {
|
||||
{
|
||||
deviate not-supported;
|
||||
}
|
||||
|
||||
deviation "/ietf-r:routing/ietf-r:control-plane-protocols/ietf-r:control-plane-protocol/ospf:ospf/ospf:areas/ospf:area/ospf:interfaces/ospf:interface/ospf:multi-areas" {
|
||||
deviate not-supported;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user