Skip to content

Commit

Permalink
[WIP] expaning model
Browse files Browse the repository at this point in the history
  • Loading branch information
wkz committed Dec 12, 2024
1 parent f7c333a commit cf64833
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 26 deletions.
17 changes: 16 additions & 1 deletion src/confd/src/ietf-interfaces.c
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,23 @@ static int bridge_stp_settings(struct dagger *net, FILE *ip, const char *brname,

fputs("#!/sbin/mstpctl -b\n", mstpctl);

fprintf(mstpctl, "setforcevers %s %s\n", brname,
lydx_get_cattr(stp, "force-protocol"));

fprintf(mstpctl, "setfdelay %s %s\n", brname,
lydx_get_cattr(stp, "forward-delay"));

fprintf(mstpctl, "setmaxage %s %s\n", brname,
lydx_get_cattr(stp, "max-age"));

fprintf(mstpctl, "settxholdcount %s %s\n", brname,
lydx_get_cattr(stp, "transmit-hold-count"));

fprintf(mstpctl, "setmaxhops %s %s\n", brname,
lydx_get_cattr(stp, "max-hops"));

fprintf(mstpctl, "settreeprio %s 0 %s\n", brname,
lydx_get_cattr(stp, "priority"));
lydx_get_cattr(lydx_get_child(stp, "cist"), "priority"));

fclose(mstpctl);
return 0;
Expand Down
57 changes: 32 additions & 25 deletions src/confd/yang/infix-if-bridge.yang
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ submodule infix-if-bridge {
reserved link-local multicast groups, in 01:80:C2:00:00:0X.";
}

typedef stp-version {
typedef stp-protocol {
description "Spanning Tree Protocol version.";
type enumeration {
enum stp {
Expand Down Expand Up @@ -207,7 +207,7 @@ submodule infix-if-bridge {
type enumeration {
enum auto;
}
type bool;
type boolean;
}
default auto;
}
Expand Down Expand Up @@ -372,6 +372,27 @@ submodule infix-if-bridge {
}
}

grouping stp-tree {
leaf priority {
description "Priority.";
type stp-priority;
reference "IEEE 802.1Q-2018 13.18";
}
}

grouping stp-tree-port {
leaf priority {
description "Priority.";
type stp-priority;
reference "IEEE 802.1Q-2018 13.18";
}

leaf state {
description "Operational state.";
type stp-state;
config false;
}
}

/*
* Data Nodes
Expand Down Expand Up @@ -457,7 +478,7 @@ submodule infix-if-bridge {
}

leaf forward-delay {
description "Forward delay."
description "Forward delay.";
type uint8 {
range "4..30";
}
Expand All @@ -466,7 +487,7 @@ submodule infix-if-bridge {
}

leaf max-age {
description "Max age."
description "Max age.";
type uint8 {
range "6..40";
}
Expand All @@ -475,7 +496,7 @@ submodule infix-if-bridge {
}

leaf transmit-hold-count {
description "Transmit hold count."
description "Transmit hold count.";
type uint8 {
range "1..10";
}
Expand All @@ -484,7 +505,7 @@ submodule infix-if-bridge {
}

leaf max-hops {
description "Max hops."
description "Max hops.";
type uint8 {
range "6..40";
}
Expand All @@ -494,11 +515,7 @@ submodule infix-if-bridge {

container cist {
description "Common and Internal Spanning Tree.";
leaf priority {
description "Priority.";
type stp-priority;
reference "IEEE 802.1Q-2018 13.18";
}
uses stp-tree;
}

// list mst {
Expand All @@ -510,16 +527,13 @@ submodule infix-if-bridge {
// type dot1q-types:mstid-type;
// }

// uses stp-tree;

// leaf-list vlan {
// type leafref {
// path "/if:interfaces/interface/bridge/vlans/vlan/vid";
// }
// }

// leaf priority {
// description "Priority.";
// type stp-priority;
// }
// }
}
}
Expand Down Expand Up @@ -661,11 +675,7 @@ submodule infix-if-bridge {

container cist {
description "Common and Internal Spanning Tree.";
leaf priority {
description "Priority.";
type stp-priority;
reference "IEEE 802.1Q-2018 13.18";
}
uses stp-tree-port;
}

// list mst {
Expand All @@ -677,10 +687,7 @@ submodule infix-if-bridge {
// type dot1q-types:mstid-type;
// }

// leaf priority {
// description "Priority.";
// type stp-priority;
// }
// uses stp-tree-port;
// }
}

Expand Down

0 comments on commit cf64833

Please sign in to comment.