-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
confd: replace phys-address deviation with new setting
This commit replaces the ietf-interfaces deviation for phys-address, used to set custom MAC address on interfaces, with a more flexible approach which can calculate the new MAC address based on the device's chassi MAC, with or without an added offset. The regression test has been updated to test all variants. Resolves: #680 Signed-off-by: Joachim Wiberg <[email protected]>
- Loading branch information
Showing
5 changed files
with
232 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ MODULES=( | |
"[email protected]" | ||
"[email protected]" | ||
"[email protected]" | ||
"infix-interfaces@2024-09-23.yang -e vlan-filtering" | ||
"infix-interfaces@2024-10-08.yang -e vlan-filtering" | ||
|
||
# from rousette | ||
"[email protected]" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ module infix-interfaces { | |
import ietf-interfaces { | ||
prefix if; | ||
} | ||
import ietf-yang-types { | ||
prefix yang; | ||
} | ||
|
||
include infix-if-base; | ||
include infix-if-bridge; | ||
|
@@ -20,6 +23,11 @@ module infix-interfaces { | |
contact "[email protected]"; | ||
description "Linux bridge and lag extensions for ietf-interfaces."; | ||
|
||
revision 2024-10-08 { | ||
description "Replace writable phy-address with custom-phys-address."; | ||
reference "internal"; | ||
} | ||
|
||
revision 2024-09-23 { | ||
description "Drop interfaces-state deviation, already marked deprecated."; | ||
reference "internal"; | ||
|
@@ -71,9 +79,34 @@ module infix-interfaces { | |
} | ||
} | ||
|
||
deviation "/if:interfaces/if:interface/if:phys-address" { | ||
deviate replace { | ||
config true; | ||
augment "/if:interfaces/if:interface" { | ||
description "Custom phys-address management, static or derived from chassis MAC."; | ||
|
||
container custom-phys-address { | ||
description "Override the default physical address."; | ||
|
||
choice type { | ||
description "Choose between static MAC address or chassis-derived MAC."; | ||
|
||
case static { | ||
leaf static { | ||
description "Statically configured interface address on protocol sub-layer, e.g., MAC."; | ||
type yang:phys-address; | ||
} | ||
} | ||
|
||
case chassis { | ||
container chassis { | ||
description "Derive physical address from chassis MAC address."; | ||
presence "Enable chassis-derived address."; | ||
|
||
leaf offset { | ||
description "Static offset added to the chassis MAC address."; | ||
type yang:phys-address; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters