Thread Links | Date Links | ||||
---|---|---|---|---|---|
Thread Prev | Thread Next | Thread Index | Date Prev | Date Next | Date Index |
Hi (I’m hoping the message makes it through the reflectors after re-subscribing ). I used Yanglint on the lldp modules. 802.1Qcz Attached is a test file and some output. Note I fixed some warnings in yanglint. (yanglint require full prefixes in the YANG file.) Using yanglint for this is fairly straight forward but the config it a bit tedious. How I do it: I create an XML file (sample attached) that has the following format: <if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ia="urn:ietf:params:xml:ns:yang:iana-if-type"> <!—the prefix is shortened to a small set “if” etc you can use the full one but the xml is verbose.--> <if:interface> <if:name>eth0</if:name> <if:type>ia:ethernetCsmacd</if:type> <!--if:oper-status>up</if:oper-status--> </if:interface> The XML I generate from the tree file an using only read/write objects. You can do read only objects too but then you need to fill in a lot of data that may no be obvious and the conditional yang kicks in. I tried interfaces and it keep wanting more and more data. You can use the output of pyang that produces xml. I find it faster to build my own tags. You need to follow the tree structure but the order in the tree is not strict. I use group substitution to change “interface” into <if:interface> and duplicate and change the second occurrence to </if:interface> Then with a file of begin/end tags I add the tree structure. <ll:lldp xmlns:ll="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp" xmlns:ab="urn:ieee:std:802.1Q:yang:ieee802-dot1ab-types" xmlns:llb="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-basic-tlv" xmlns:lle="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-evb-tlv" xmlns:lld="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-dcbx-tlv" xmlns:llc="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-cn-tlv" xmlns:lli="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-ci-tlv" xmlns:llr="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-tr-tlv" xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing-types" xmlns:yt="urn:ietf:params:xml:ns:yang:ietf-yang-types" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ia="urn:ietf:params:xml:ns:yang:iana-if-type"> <ll:lldp-id>lldp1</ll:lldp-id> <ll:message-fast-tx>100</ll:message-fast-tx> <ll:message-tx-hold-multiplier>2</ll:message-tx-hold-multiplier> <ll:message-tx-interval>30</ll:message-tx-interval> <ll:reinit-delay>2</ll:reinit-delay> <ll:tx-credit-max>5</ll:tx-credit-max> <ll:tx-fast-init>4</ll:tx-fast-init> <ll:notification-interval>30</ll:notification-interval> <llr:topology-recognition-tlv-extension> <llr:topology-level>2</llr:topology-level> </llr:topology-recognition-tlv-extension> Then I run Yanglint and load the modules. I prefer the json output. $ yanglint > load iana-if-type > load ieee802-dot1ab-lldp > load ieee802-dot1q-lldp-basic-tlv > load ieee802-dot1q-lldp-evb-tlv > load ieee802-dot1q-lldp-dcbx-tlv > load ieee802-dot1q-lldp-cn-tlv > load ieee802-dot1q-lldp-cn-tlv > load ieee802-dot1q-lldp-tr-tlv > data -t config -f json test-lldp_basic1.xml { "ietf-interfaces:interfaces": { "interface": [ { "name": "eth0", "type": "iana-if-type:ethernetCsmacd", "ieee802-dot1q-bridge:bridge-port": { } }, { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "ieee802-dot1q-bridge:bridge-port": { } } ] }, "ieee802-dot1ab-lldp:lldp": [ { "lldp-id": "lldp1", "message-fast-tx": 100, "message-tx-hold-multiplier": 2, "message-tx-interval": 30, "reinit-delay": 2, "tx-credit-max": 5, "tx-fast-init": 4, "notification-interval": 30, "ieee802-dot1q-lldp-tr-tlv:topology-recognition-tlv-extension": { "topology-level": 2 See the attached files for a complete setup. Cheers Don To unsubscribe from the STDS-802-3-YANG list, click the following link: https://listserv.ieee.org/cgi-bin/wa?SUBED1=STDS-802-3-YANG&A=1 |
<if:interfaces xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ia="urn:ietf:params:xml:ns:yang:iana-if-type"> <if:interface> <if:name>eth0</if:name> <if:type>ia:ethernetCsmacd</if:type> <!--if:oper-status>up</if:oper-status--> </if:interface> <if:interface> <if:name>eth1</if:name> <if:type>ia:ethernetCsmacd</if:type> <!--if:oper-status>up</if:oper-status--> </if:interface> </if:interfaces> <ll:lldp xmlns:ll="urn:ieee:std:802.1AB:yang:ieee802-dot1ab-lldp" xmlns:ab="urn:ieee:std:802.1Q:yang:ieee802-dot1ab-types" xmlns:llb="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-basic-tlv" xmlns:lle="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-evb-tlv" xmlns:lld="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-dcbx-tlv" xmlns:llc="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-cn-tlv" xmlns:lli="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-ci-tlv" xmlns:llr="urn:ieee:std:802.1Q:yang:ieee802-dot1q-lldp-tr-tlv" xmlns:rt="urn:ietf:params:xml:ns:yang:ietf-routing-types" xmlns:yt="urn:ietf:params:xml:ns:yang:ietf-yang-types" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:ia="urn:ietf:params:xml:ns:yang:iana-if-type"> <ll:lldp-id>lldp1</ll:lldp-id> <ll:message-fast-tx>100</ll:message-fast-tx> <ll:message-tx-hold-multiplier>2</ll:message-tx-hold-multiplier> <ll:message-tx-interval>30</ll:message-tx-interval> <ll:reinit-delay>2</ll:reinit-delay> <ll:tx-credit-max>5</ll:tx-credit-max> <ll:tx-fast-init>4</ll:tx-fast-init> <ll:notification-interval>30</ll:notification-interval> <llr:topology-recognition-tlv-extension> <llr:topology-level>2</llr:topology-level> </llr:topology-recognition-tlv-extension> <ll:port> <ll:name>eth0</ll:name> <ll:admin-status>tx-and-rx</ll:admin-status> <ll:notification-enable>false</ll:notification-enable> <ll:tlvs-tx-enable> </ll:tlvs-tx-enable> <ll:message-fast-tx>200</ll:message-fast-tx> <ll:message-tx-hold-multiplier>3</ll:message-tx-hold-multiplier> <ll:message-tx-interval>60</ll:message-tx-interval> <ll:reinit-delay>3</ll:reinit-delay> <ll:tx-credit-max>4</ll:tx-credit-max> <ll:tx-fast-init>3</ll:tx-fast-init> <ll:notification-interval>60</ll:notification-interval> <ll:management-address-tx-port> <ll:address-subtype>ipv4</ll:address-subtype> <ll:man-address>VQ==</ll:man-address> <ll:tx-enable>false</ll:tx-enable> </ll:management-address-tx-port> <llb:tlvs-tx-org-basic-enable> port-vlan-id port-protocol-vlan-id vlan-name protocol-identity vid-user-digest management-vid link-aggregation </llb:tlvs-tx-org-basic-enable> <llb:port-vlan-id-tlv-extension> <llb:port-vlan-id>100</llb:port-vlan-id> </llb:port-vlan-id-tlv-extension> <llb:port-and-protocol-vlan-id-extension> <llb:port-vlan-id>100</llb:port-vlan-id> <llb:flags> port-and-protocol-vlan-supported port-and-protocol-vlan-enabled </llb:flags> </llb:port-and-protocol-vlan-id-extension> <llb:port-vlan-name-tlv-extension> <llb:vlan-id>100</llb:vlan-id> <llb:port-vlan-name>Fortune100 </llb:port-vlan-name> </llb:port-vlan-name-tlv-extension> <llb:protocol-identity-tlv-extension> <llb:protocol-identity>IEEE</llb:protocol-identity> </llb:protocol-identity-tlv-extension> <llb:link-aggregation-tlv-extension> <llb:aggregation-status> aggregation-capability aggregation-status port-typeLS port-typeMS </llb:aggregation-status> <llb:aggregated-port-id>42</llb:aggregated-port-id> </llb:link-aggregation-tlv-extension> <lle:tlvs-tx-org-evb-enable> evb cdcp </lle:tlvs-tx-org-evb-enable> <lle:evb-tlv-extension> <lle:evb-tlv-info-string>KYA=</lle:evb-tlv-info-string> </lle:evb-tlv-extension> <lle:cdcp-tlv-extension> <lle:cdcp-tlv-info-string>KgA=</lle:cdcp-tlv-info-string> </lle:cdcp-tlv-extension> <lld:tlvs-tx-org-dcbx-enable> ets-configuration ets-recommendation pfc application-priority application-vlan </lld:tlvs-tx-org-dcbx-enable> <lld:ets-configuration-tlv-extension> <lld:ets-config-willing>true</lld:ets-config-willing> <lld:ets-config-credit-based-shaper>true</lld:ets-config-credit-based-shaper> <lld:ets-config-traffic-classes-supported>8</lld:ets-config-traffic-classes-supported> <lld:ets-config-priority-assignment-table> <lld:ets-priority>5</lld:ets-priority> <lld:ets-priority-traffic-class>5</lld:ets-priority-traffic-class> </lld:ets-config-priority-assignment-table> <lld:ets-config-priority-assignment-table> <lld:ets-priority>4</lld:ets-priority> <lld:ets-priority-traffic-class>4</lld:ets-priority-traffic-class> </lld:ets-config-priority-assignment-table> <lld:ets-config-tc-bandwidth-table> <lld:ets-traffic-class>4</lld:ets-traffic-class> <lld:ets-percentage-bandwidth>80</lld:ets-percentage-bandwidth> </lld:ets-config-tc-bandwidth-table> <lld:ets-config-tsa-assignment-table> <lld:ets-tsa-traffic-class>1</lld:ets-tsa-traffic-class> <lld:ets-transmission-selection-algorithm>42</lld:ets-transmission-selection-algorithm> </lld:ets-config-tsa-assignment-table> </lld:ets-configuration-tlv-extension> <lld:ets-recommendation-tlv-extension> <lld:ets-recommendation-priority-assignment-table> <lld:ets-priority>1</lld:ets-priority> <lld:ets-priority-traffic-class>1</lld:ets-priority-traffic-class> </lld:ets-recommendation-priority-assignment-table> <lld:ets-recommendation-tc-bandwidth-table> <lld:ets-traffic-class>1</lld:ets-traffic-class> <lld:ets-percentage-bandwidth>65</lld:ets-percentage-bandwidth> </lld:ets-recommendation-tc-bandwidth-table> <lld:ets-recommendation-tsa-assignment-table> <lld:ets-tsa-traffic-class>1</lld:ets-tsa-traffic-class> <lld:ets-transmission-selection-algorithm>strict-priority</lld:ets-transmission-selection-algorithm> </lld:ets-recommendation-tsa-assignment-table> </lld:ets-recommendation-tlv-extension> <lld:pfc-tlv-extension> <lld:pfc-willing>true</lld:pfc-willing> <lld:pfc-macsec-bypass-capable>true</lld:pfc-macsec-bypass-capable> <lld:pfc-number-tc-capable>2</lld:pfc-number-tc-capable> <lld:pfc-enable>priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7 </lld:pfc-enable> </lld:pfc-tlv-extension> <lld:application-priority-tlv-extension> <lld:application-priority-table> <lld:application-priority>1</lld:application-priority> <lld:application-priority-selector>tcp-sctp-udp-dccp-sel</lld:application-priority-selector> <lld:application-priority-protocol>65535</lld:application-priority-protocol> </lld:application-priority-table> <lld:application-vlan-tlv-extension> <lld:application-vlan-table> <lld:application-vlan>10</lld:application-vlan> <lld:application-vlan-selector>tcp-sctp-udp-dccp-sel</lld:application-vlan-selector> <lld:application-vlan-protocol>0</lld:application-vlan-protocol> </lld:application-vlan-table> </lld:application-vlan-tlv-extension> </lld:application-priority-tlv-extension> <llc:tlvs-tx-org-congestion-notification-enable>true</llc:tlvs-tx-org-congestion-notification-enable> <llc:congestion-notification-tlv-extension> <llc:per-priority-xmit-cnpv-capable> priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7 </llc:per-priority-xmit-cnpv-capable> <llc:per-priority-xmit-ready> priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7 </llc:per-priority-xmit-ready> </llc:congestion-notification-tlv-extension> <lli:tlvs-tx-org-ci-enable>congestion-isolation</lli:tlvs-tx-org-ci-enable> <lli:congestion-isolation-tlv-extension> <lli:queue-map> <lli:priority>0</lli:priority> <lli:abs-traffic-class-plus-one>monitored-queue-tc-1</lli:abs-traffic-class-plus-one> </lli:queue-map> <lli:queue-map> <lli:priority>1</lli:priority> <lli:abs-traffic-class-plus-one>monitored-queue-tc-2</lli:abs-traffic-class-plus-one> </lli:queue-map> <lli:cim-encap-length>48</lli:cim-encap-length> </lli:congestion-isolation-tlv-extension> <llr:tlvs-tx-org-tr-enable>topology-recognition</llr:tlvs-tx-org-tr-enable> <llr:topology-recognition-tlv-extension> <llr:port-orientation>unknown</llr:port-orientation> </llr:topology-recognition-tlv-extension> </ll:port> </ll:lldp>
$ yanglint > load iana-if-type > load ieee802-dot1ab-lldp > load ieee802-dot1q-lldp-basic-tlv > load ieee802-dot1q-lldp-evb-tlv > load ieee802-dot1q-lldp-dcbx-tlv > load ieee802-dot1q-lldp-cn-tlv > load ieee802-dot1q-lldp-cn-tlv > load ieee802-dot1q-lldp-tr-tlv > data -t config -f json test-lldp_basic1.xml { "ietf-interfaces:interfaces": { "interface": [ { "name": "eth0", "type": "iana-if-type:ethernetCsmacd", "ieee802-dot1q-bridge:bridge-port": { } }, { "name": "eth1", "type": "iana-if-type:ethernetCsmacd", "ieee802-dot1q-bridge:bridge-port": { } } ] }, "ieee802-dot1ab-lldp:lldp": [ { "lldp-id": "lldp1", "message-fast-tx": 100, "message-tx-hold-multiplier": 2, "message-tx-interval": 30, "reinit-delay": 2, "tx-credit-max": 5, "tx-fast-init": 4, "notification-interval": 30, "ieee802-dot1q-lldp-tr-tlv:topology-recognition-tlv-extension": { "topology-level": 2 }, "port": [ { "name": "eth0", "admin-status": "tx-and-rx", "notification-enable": false, "tlvs-tx-enable": "", "message-fast-tx": 200, "message-tx-hold-multiplier": 3, "message-tx-interval": 60, "reinit-delay": 3, "tx-credit-max": 4, "tx-fast-init": 3, "notification-interval": 60, "management-address-tx-port": [ { "address-subtype": "ipv4", "man-address": "VQ==", "tx-enable": false } ], "ieee802-dot1q-lldp-basic-tlv:tlvs-tx-org-basic-enable": "port-vlan-id port-protocol-vlan-id vlan-name protocol-identity vid-user-digest management-vid link-aggregation", "ieee802-dot1q-lldp-basic-tlv:port-vlan-id-tlv-extension": { "port-vlan-id": 100 }, "ieee802-dot1q-lldp-basic-tlv:port-and-protocol-vlan-id-extension": { "port-vlan-id": 100, "flags": "port-and-protocol-vlan-supported port-and-protocol-vlan-enabled" }, "ieee802-dot1q-lldp-basic-tlv:port-vlan-name-tlv-extension": { "vlan-id": 100, "port-vlan-name": "Fortune100 " }, "ieee802-dot1q-lldp-basic-tlv:protocol-identity-tlv-extension": { "protocol-identity": "IEEE" }, "ieee802-dot1q-lldp-basic-tlv:link-aggregation-tlv-extension": { "aggregation-status": "aggregation-capability aggregation-status port-typeLS port-typeMS", "aggregated-port-id": 42 }, "ieee802-dot1q-lldp-evb-tlv:tlvs-tx-org-evb-enable": "evb cdcp", "ieee802-dot1q-lldp-evb-tlv:evb-tlv-extension": { "evb-tlv-info-string": "KYA=" }, "ieee802-dot1q-lldp-evb-tlv:cdcp-tlv-extension": { "cdcp-tlv-info-string": "KgA=" }, "ieee802-dot1q-lldp-dcbx-tlv:tlvs-tx-org-dcbx-enable": "ets-configuration ets-recommendation pfc application-priority application-vlan", "ieee802-dot1q-lldp-dcbx-tlv:ets-configuration-tlv-extension": { "ets-config-willing": true, "ets-config-credit-based-shaper": true, "ets-config-traffic-classes-supported": 8, "ets-config-priority-assignment-table": [ { "ets-priority": 5, "ets-priority-traffic-class": 5 }, { "ets-priority": 4, "ets-priority-traffic-class": 4 } ], "ets-config-tc-bandwidth-table": [ { "ets-traffic-class": 4, "ets-percentage-bandwidth": 80 } ], "ets-config-tsa-assignment-table": [ { "ets-tsa-traffic-class": 1, "ets-transmission-selection-algorithm": 42 } ] }, "ieee802-dot1q-lldp-dcbx-tlv:ets-recommendation-tlv-extension": { "ets-recommendation-priority-assignment-table": [ { "ets-priority": 1, "ets-priority-traffic-class": 1 } ], "ets-recommendation-tc-bandwidth-table": [ { "ets-traffic-class": 1, "ets-percentage-bandwidth": 65 } ], "ets-recommendation-tsa-assignment-table": [ { "ets-tsa-traffic-class": 1, "ets-transmission-selection-algorithm": "strict-priority" } ] }, "ieee802-dot1q-lldp-dcbx-tlv:pfc-tlv-extension": { "pfc-willing": true, "pfc-macsec-bypass-capable": true, "pfc-number-tc-capable": 2, "pfc-enable": "priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7" }, "ieee802-dot1q-lldp-dcbx-tlv:application-priority-tlv-extension": { "application-priority-table": [ { "application-priority": 1, "application-priority-selector": "tcp-sctp-udp-dccp-sel", "application-priority-protocol": 65535 } ] }, "ieee802-dot1q-lldp-cn-tlv:tlvs-tx-org-congestion-notification-enable": true, "ieee802-dot1q-lldp-cn-tlv:congestion-notification-tlv-extension": { "per-priority-xmit-cnpv-capable": "priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7", "per-priority-xmit-ready": "priority0 priority1 priority2 priority3 priority4 priority5 priority6 priority7" }, "ieee802-dot1q-lldp-ci-tlv:tlvs-tx-org-ci-enable": "congestion-isolation", "ieee802-dot1q-lldp-ci-tlv:congestion-isolation-tlv-extension": { "queue-map": [ { "priority": 0, "abs-traffic-class-plus-one": "monitored-queue-tc-1" }, { "priority": 1, "abs-traffic-class-plus-one": "monitored-queue-tc-2" } ], "cim-encap-length": 48 }, "ieee802-dot1q-lldp-tr-tlv:tlvs-tx-org-tr-enable": "topology-recognition", "ieee802-dot1q-lldp-tr-tlv:topology-recognition-tlv-extension": { "port-orientation": "unknown" } } ] } ] } ________________________________________________________________________ To unsubscribe from the STDS-802-3-YANG list, click the following link: https://listserv.ieee.org/cgi-bin/wa?SUBED1=STDS-802-3-YANG&A=1