-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Adding vrrp sonic yang #20383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Adding vrrp sonic yang #20383
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,283 @@ | ||
| module sonic-vrrp { | ||
| namespace "http://github.com/Azure/sonic-vrrp"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| prefix svrrp; | ||
| yang-version 1.1; | ||
|
|
||
| import ietf-inet-types { | ||
| prefix "inet"; | ||
| } | ||
|
|
||
| import sonic-interface { | ||
| prefix sint; | ||
| } | ||
|
|
||
| import sonic-port { | ||
| prefix sprt; | ||
| } | ||
|
|
||
| import sonic-portchannel { | ||
| prefix spc; | ||
| } | ||
|
|
||
| import sonic-vlan-sub-interface { | ||
| prefix svlansubint; | ||
| } | ||
|
|
||
| import sonic-vlan { | ||
| prefix svlan; | ||
| } | ||
|
|
||
| organization | ||
| "SONiC"; | ||
|
|
||
| contact | ||
| "SONiC"; | ||
|
|
||
| description | ||
| "SONIC VRRP"; | ||
|
|
||
| revision 2024-11-01 { | ||
| description | ||
| "Initial revision."; | ||
| } | ||
|
|
||
| container sonic-vrrp { | ||
|
|
||
| container VRRP { | ||
| description | ||
| "Configures VRRP version 2 or 3 for IPv4."; | ||
|
|
||
| list VRRP_LIST { | ||
| max-elements 128; | ||
| key "ifname idkey"; | ||
|
|
||
| leaf ifname { | ||
| type union { | ||
| type leafref { | ||
| path "/sint:sonic-interface/sint:INTERFACE/sint:INTERFACE_LIST/sint:name"; | ||
| } | ||
| type leafref { | ||
| path "/spc:sonic-portchannel-interface/spc:PORTCHANNEL_INTERFACE/spc:PORTCHANNEL_INTERFACE_LIST/spc:name"; | ||
| } | ||
| type leafref { | ||
| path "/svlan:sonic-vlan/svlan:VLAN_INTERFACE/svlan:VLAN_INTERFACE_LIST/svlan:name"; | ||
| } | ||
| type leafref { | ||
| path "/svlansubint:sonic-vlan-sub-interface/svlansubint:VLAN_SUB_INTERFACE/svlansubint:VLAN_SUB_INTERFACE_LIST/svlansubint:name"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| leaf idkey { | ||
| type uint8 { | ||
| range "1..255"; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we add description for these leaf entries?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The terms used are simple and look to be self explanatory, hence did not add any description. |
||
| } | ||
| } | ||
|
|
||
| leaf vrid { | ||
| type uint8 { | ||
| range "1..255"; | ||
| } | ||
| } | ||
|
|
||
| leaf version { | ||
| type string { | ||
| pattern '2|3'; | ||
| } | ||
| } | ||
|
|
||
| leaf pre_empt { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a specific reason to name like pre_empt instead of preempt?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for better readability. |
||
| type string { | ||
| pattern 'True|False'; | ||
| } | ||
| } | ||
|
|
||
| leaf use_v2_checksum { | ||
| type string { | ||
| pattern 'True|False'; | ||
| } | ||
| } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use_v2_checksum is defined in yang model but not supported on cli or in frrcfgd.py. Should this be retained? |
||
|
|
||
| leaf priority { | ||
| type uint8 { | ||
| range "1..254"; | ||
| } | ||
| default 100; | ||
| } | ||
|
|
||
| leaf adv_interval { | ||
| type uint8 { | ||
| range "1..254"; | ||
| } | ||
| default 1; | ||
| } | ||
|
|
||
| leaf-list vip { | ||
| max-elements 4; | ||
| type inet:ipv4-address; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| container VRRP_TRACK { | ||
| description | ||
| "Configures VRRP track list."; | ||
|
|
||
| list VRRP_TRACK_LIST { | ||
|
|
||
| key "baseifname idkey trackifname"; | ||
|
|
||
| leaf baseifname { | ||
| type leafref { | ||
| path "../../../VRRP/VRRP_LIST/ifname"; | ||
| } | ||
| } | ||
|
|
||
| leaf idkey { | ||
| type leafref { | ||
| path "../../../VRRP/VRRP_LIST/idkey"; | ||
| } | ||
| } | ||
|
|
||
| leaf trackifname { | ||
| type union { | ||
| type leafref { | ||
| path "/sprt:sonic-port/sprt:PORT/sprt:PORT_LIST/sprt:name"; | ||
| } | ||
| type leafref { | ||
| path "/spc:sonic-portchannel/spc:PORTCHANNEL/spc:PORTCHANNEL_LIST/spc:name"; | ||
| } | ||
| type leafref { | ||
| path "/svlan:sonic-vlan/svlan:VLAN/svlan:VLAN_LIST/svlan:name"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this has to be comment out due to back link in yang issue. |
||
| } | ||
| type leafref { | ||
| path "/svlansubint:sonic-vlan-sub-interface/svlansubint:VLAN_SUB_INTERFACE/svlansubint:VLAN_SUB_INTERFACE_LIST/svlansubint:name"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| leaf priority_increment { | ||
| type uint8 { | ||
| range "1..255"; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| container VRRP6 { | ||
| description | ||
| "Configures VRRP for IPv6."; | ||
|
|
||
| list VRRP6_LIST { | ||
| max-elements 128; | ||
| key "ifname idkey"; | ||
|
|
||
| leaf ifname { | ||
| type union { | ||
| type leafref { | ||
| path "/sint:sonic-interface/sint:INTERFACE/sint:INTERFACE_LIST/sint:name"; | ||
| } | ||
| type leafref { | ||
| path "/spc:sonic-portchannel-interface/spc:PORTCHANNEL_INTERFACE/spc:PORTCHANNEL_INTERFACE_LIST/spc:name"; | ||
| } | ||
| type leafref { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same back link issue |
||
| path "/svlan:sonic-vlan/svlan:VLAN_INTERFACE/svlan:VLAN_INTERFACE_LIST/svlan:name"; | ||
| } | ||
| type leafref { | ||
| path "/svlansubint:sonic-vlan-sub-interface/svlansubint:VLAN_SUB_INTERFACE/svlansubint:VLAN_SUB_INTERFACE_LIST/svlansubint:name"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| leaf idkey { | ||
| type uint8 { | ||
| range "1..255"; | ||
| } | ||
| } | ||
|
|
||
| leaf vrid { | ||
| type uint8 { | ||
| range "1..255"; | ||
| } | ||
| } | ||
|
|
||
| leaf pre_empt { | ||
| type string { | ||
| pattern 'True|False'; | ||
| } | ||
| } | ||
|
|
||
| leaf use_v2_checksum { | ||
| type string { | ||
| pattern 'True|False'; | ||
| } | ||
| } | ||
|
|
||
| leaf priority { | ||
| type uint8 { | ||
| range "1..254"; | ||
| } | ||
| default 100; | ||
| } | ||
|
|
||
| leaf adv_interval { | ||
| type uint8 { | ||
| range "1..254"; | ||
| } | ||
| default 1; | ||
| } | ||
|
|
||
| leaf-list vip { | ||
| max-elements 4; | ||
| type inet:ipv6-address; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| container VRRP6_TRACK { | ||
| description | ||
| "Configures VRRP6 track list."; | ||
|
|
||
| list VRRP6_TRACK_LIST { | ||
|
|
||
| key "baseifname idkey trackifname"; | ||
|
|
||
| leaf baseifname { | ||
| type leafref { | ||
| path "../../../VRRP6/VRRP6_LIST/ifname"; | ||
| } | ||
| } | ||
|
|
||
| leaf idkey { | ||
| type leafref { | ||
| path "../../../VRRP6/VRRP6_LIST/idkey"; | ||
| } | ||
| } | ||
|
|
||
| leaf trackifname { | ||
| type union { | ||
| type leafref { | ||
| path "/sprt:sonic-port/sprt:PORT/sprt:PORT_LIST/sprt:name"; | ||
| } | ||
| type leafref { | ||
| path "/spc:sonic-portchannel/spc:PORTCHANNEL/spc:PORTCHANNEL_LIST/spc:name"; | ||
| } | ||
| type leafref { | ||
| path "/svlan:sonic-vlan/svlan:VLAN/svlan:VLAN_LIST/svlan:name"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same back link issue |
||
| } | ||
| type leafref { | ||
| path "/svlansubint:sonic-vlan-sub-interface/svlansubint:VLAN_SUB_INTERFACE/svlansubint:VLAN_SUB_INTERFACE_LIST/svlansubint:name"; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| leaf priority_increment { | ||
| type uint8 { | ||
| range "1..255"; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add unit test and update doc/Configuration.md?