mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-03 14:23:02 +02:00
OSPF: Implement interface setting to set cost
This commit is contained in:
committed by
Joachim Wiberg
parent
388c02b29a
commit
ad7c4fc737
@@ -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, *interface_type;
|
||||
const char *hello, *dead, *retransmit, *transmit, *interface_type, *cost;
|
||||
if (lydx_get_bool(interface, "enabled")) {
|
||||
struct lyd_node *bfd;
|
||||
int passive = 0;
|
||||
@@ -45,6 +45,7 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
|
||||
retransmit = lydx_get_cattr(interface, "retransmit-interval");
|
||||
transmit = lydx_get_cattr(interface, "transmit-delay");
|
||||
interface_type = lydx_get_cattr(interface, "interface-type");
|
||||
cost = lydx_get_cattr(interface, "cost");
|
||||
fprintf(fp, " ip ospf area %s\n", area_id);
|
||||
if (dead)
|
||||
fprintf(fp, " ip ospf dead-interval %s\n", dead);
|
||||
@@ -60,6 +61,8 @@ int parse_ospf_interfaces(sr_session_ctx_t *session, struct lyd_node *areas, FIL
|
||||
fputs(" ip ospf passive\n", fp);
|
||||
if (interface_type)
|
||||
fprintf(fp, " ip ospf network %s\n", interface_type);
|
||||
if (cost)
|
||||
fprintf(fp, " ip ospf cost %s\n", cost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -373,10 +373,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:cost"
|
||||
{
|
||||
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:lls"
|
||||
{
|
||||
deviate not-supported;
|
||||
|
||||
Reference in New Issue
Block a user