f8fd2defb4
#### Why I did it If the grouping is in the same file in the module, fetching the grouping fails #### How I did it fixing the `uses_module_name` when the grouping is under the same file #### How to verify it Enabled a grouping under the same file which is `lldp`, there is a test in sonic-yang-mgmt that translates `sample-config-db` into yang format. This test passes with grouping in `lldp` used. #### Which release branch to backport (provide reason below if selected) <!-- - Note we only backport fixes to a release branch, *not* features! - Please also provide a reason for the backporting below. - e.g. - [x] 202006 --> - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 #### Description for the changelog <!-- Write a short (one line) summary that describes the changes in this pull request for inclusion in the changelog: --> #### A picture of a cute animal (not mandatory but encouraged)
124 lines
3.2 KiB
YANG
124 lines
3.2 KiB
YANG
module sonic-lldp {
|
|
namespace "http://github.com/Azure/sonic-lldp";
|
|
prefix slldp;
|
|
yang-version 1.1;
|
|
|
|
import sonic-port {
|
|
prefix prt;
|
|
}
|
|
|
|
import sonic-extension {
|
|
prefix sonic-ext;
|
|
}
|
|
|
|
organization
|
|
"SONiC";
|
|
|
|
contact
|
|
"SONiC";
|
|
|
|
description
|
|
"SONiC LLDP yang model";
|
|
|
|
revision 2021-07-08 {
|
|
description
|
|
"Initial revision.";
|
|
}
|
|
|
|
grouping lldp_mode_config {
|
|
leaf enabled {
|
|
type boolean;
|
|
default true;
|
|
description
|
|
"Enable/Disable LLDP";
|
|
}
|
|
|
|
leaf mode {
|
|
type enumeration {
|
|
enum RECEIVE;
|
|
enum TRANSMIT;
|
|
}
|
|
|
|
description
|
|
"RX/TX mode for LLDP frames";
|
|
}
|
|
}
|
|
|
|
container sonic-lldp {
|
|
container LLDP {
|
|
container GLOBAL {
|
|
|
|
leaf hello_time {
|
|
type uint8 {
|
|
range "5..254" {
|
|
error-message "Invalid hello timer value.";
|
|
}
|
|
}
|
|
default 30;
|
|
units seconds;
|
|
description
|
|
"It is the time interval at which periodic hellos are
|
|
exchanged. Default is 30 seconds";
|
|
}
|
|
|
|
leaf multiplier {
|
|
type uint8 {
|
|
range "1..10" {
|
|
error-message "Invalid LLDP multiplier value.";
|
|
}
|
|
}
|
|
default 4;
|
|
description
|
|
"This multiplier value is used to determine the timeout
|
|
interval (i.e. hello-time x multiplier value) after
|
|
which LLDP neighbor entry is deleted.";
|
|
}
|
|
|
|
leaf system_name {
|
|
type string;
|
|
description
|
|
"System administratively assigned name";
|
|
}
|
|
|
|
leaf system_description {
|
|
type string;
|
|
description
|
|
"System description";
|
|
}
|
|
|
|
leaf supp_mgmt_address_tlv {
|
|
type boolean;
|
|
default false;
|
|
description
|
|
"Suppress sending of Management Address TLV in LLDP frames";
|
|
}
|
|
|
|
leaf supp_system_capabilities_tlv {
|
|
type boolean;
|
|
default false;
|
|
description
|
|
"Suppress sending of System Capabilities TLV in LLDP frames";
|
|
}
|
|
|
|
uses lldp_mode_config;
|
|
}
|
|
}
|
|
|
|
container LLDP_PORT {
|
|
list LLDP_PORT_LIST {
|
|
key "ifname";
|
|
|
|
leaf ifname {
|
|
type leafref {
|
|
path "/prt:sonic-port/prt:PORT/prt:PORT_LIST/prt:name";
|
|
}
|
|
description
|
|
"Reference of port on which LLDP to be configured.";
|
|
}
|
|
|
|
uses lldp_mode_config;
|
|
}
|
|
}
|
|
}
|
|
}
|