From c9634f672a02e41990e1e0882b4e437d23eebd22 Mon Sep 17 00:00:00 2001 From: yuyr Date: Fri, 28 Nov 2025 14:35:21 +0800 Subject: [PATCH] first commit --- .gitignore | 8 + README.md | 287 ++ config.yaml | 25 + docs/h3c_netconf_compoents_with_type.md | 71 + ...h3c_netconf_components_with_temperature.md | 225 + ...h3c_netconf_components_with_transceiver.md | 166 + docs/h3c_netconf_transceiver_component.md | 196 + exp/yangcli/get_component.sh | 3 + exp/yangcli/get_components_transceiver.sh | 1 + exp/yangcli/get_components_type.sh | 1 + exp/yangcli/get_interface.sh | 2 + .../h3c-yang/H3C-acl-action@2020-05-16.yang | 139 + .../h3c-yang/H3C-acl-config@2023-11-02.yang | 3727 ++++++++++++++ .../h3c-yang/H3C-acl-data@2023-11-02.yang | 4282 +++++++++++++++++ .../h3c-yang/H3C-ifmgr-action@2025-02-13.yang | 386 ++ .../h3c-yang/H3C-ifmgr-config@2025-02-13.yang | 1001 ++++ .../h3c-yang/H3C-ifmgr-data@2025-02-13.yang | 2356 +++++++++ .../h3c-yang/H3C-ifmgr-event@2020-05-09.yang | 129 + .../openconfig-aaa-radius@2018-11-21.yang | 186 + .../openconfig-aaa-tacacs@2018-11-21.yang | 142 + .../openconfig-aaa-types@2018-11-21.yang | 172 + .../h3c-yang/openconfig-aaa@2019-10-28.yang | 834 ++++ .../h3c-yang/openconfig-acl@2018-11-21.yang | 847 ++++ .../openconfig-aft-common@2019-11-07.yang | 582 +++ .../openconfig-aft-ethernet@2019-11-07.yang | 121 + .../openconfig-aft-ipv4@2019-11-07.yang | 122 + .../openconfig-aft-ipv6@2019-11-07.yang | 122 + .../openconfig-aft-mpls@2019-11-07.yang | 139 + ...onfig-aft-network-instance@2018-11-21.yang | 109 + .../openconfig-aft-pf@2019-11-07.yang | 200 + .../openconfig-aft-types@2019-11-07.yang | 81 + .../h3c-yang/openconfig-aft@2019-11-07.yang | 177 + .../openconfig-alarm-types@2018-11-21.yang | 146 + ...g-bgp-common-multiprotocol@2019-07-10.yang | 543 +++ ...onfig-bgp-common-structure@2019-07-10.yang | 222 + .../openconfig-bgp-common@2019-07-10.yang | 690 +++ .../openconfig-bgp-errors@2018-11-21.yang | 427 ++ .../openconfig-bgp-global@2019-07-10.yang | 414 ++ .../openconfig-bgp-neighbor@2019-07-10.yang | 754 +++ .../openconfig-bgp-peer-group@2019-07-10.yang | 290 ++ .../openconfig-bgp-policy@2019-11-28.yang | 1161 +++++ .../openconfig-bgp-types@2020-03-24.yang | 658 +++ .../h3c-yang/openconfig-bgp@2019-07-10.yang | 189 + .../openconfig-extensions@2018-10-17.yang | 177 + .../openconfig-if-aggregate@2016-12-22.yang | 192 + .../openconfig-if-ethernet@2016-12-22.yang | 345 ++ .../h3c-yang/openconfig-if-ip@2017-07-14.yang | 1191 +++++ .../openconfig-igmp-types@2018-11-21.yang | 64 + .../h3c-yang/openconfig-igmp@2019-07-09.yang | 373 ++ .../openconfig-inet-types@2018-11-21.yang | 343 ++ .../openconfig-interfaces@2016-12-22.yang | 933 ++++ ...openconfig-isis-lsdb-types@2018-11-21.yang | 703 +++ .../openconfig-isis-lsp@2020-03-24.yang | 3615 ++++++++++++++ .../openconfig-isis-policy@2020-02-04.yang | 212 + .../openconfig-isis-routing@2020-03-24.yang | 408 ++ .../openconfig-isis-types@2018-11-21.yang | 356 ++ .../h3c-yang/openconfig-isis@2020-03-24.yang | 2096 ++++++++ .../openconfig-lldp-types@2018-11-21.yang | 306 ++ .../h3c-yang/openconfig-lldp@2018-11-21.yang | 660 +++ .../openconfig-local-routing@2020-03-24.yang | 430 ++ .../openconfig-mpls-igp@2018-11-21.yang | 131 + .../openconfig-mpls-ldp@2019-07-09.yang | 890 ++++ .../openconfig-mpls-rsvp@2020-02-04.yang | 1455 ++++++ .../openconfig-mpls-sr@2018-11-21.yang | 149 + .../openconfig-mpls-static@2018-11-21.yang | 318 ++ .../openconfig-mpls-te@2018-11-21.yang | 1386 ++++++ .../openconfig-mpls-types@2020-02-04.yang | 465 ++ .../h3c-yang/openconfig-mpls@2019-03-26.yang | 769 +++ ...config-network-instance-l2@2019-04-16.yang | 351 ++ ...config-network-instance-l3@2018-11-21.yang | 245 + ...ig-network-instance-policy@2018-11-21.yang | 126 + ...fig-network-instance-types@2018-11-21.yang | 272 ++ ...penconfig-network-instance@2019-11-28.yang | 1172 +++++ .../openconfig-ospf-policy@2018-11-21.yang | 199 + .../openconfig-ospf-types@2018-11-21.yang | 795 +++ ...nfig-ospfv2-area-interface@2019-11-28.yang | 490 ++ .../openconfig-ospfv2-area@2019-11-28.yang | 193 + .../openconfig-ospfv2-common@2019-11-28.yang | 115 + .../openconfig-ospfv2-global@2019-11-28.yang | 533 ++ .../openconfig-ospfv2-lsdb@2019-11-28.yang | 2379 +++++++++ .../openconfig-ospfv2@2019-11-28.yang | 127 + ...nconfig-packet-match-types@2018-11-21.yang | 309 ++ .../openconfig-packet-match@2018-11-21.yang | 371 ++ ...fig-pf-forwarding-policies@2018-11-21.yang | 391 ++ .../openconfig-pf-interfaces@2018-11-21.yang | 127 + .../openconfig-pf-path-groups@2018-11-21.yang | 131 + .../openconfig-pf-srte@2019-10-15.yang | 297 ++ .../openconfig-pim-types@2018-11-21.yang | 85 + .../h3c-yang/openconfig-pim@2019-07-09.yang | 481 ++ .../openconfig-platform-cpu@2018-11-21.yang | 72 + .../openconfig-platform-fan@2018-11-21.yang | 76 + ...enconfig-platform-linecard@2018-11-21.yang | 129 + .../openconfig-platform-port@2021-10-01.yang | 237 + .../openconfig-platform-psu@2018-11-21.yang | 146 + ...onfig-platform-transceiver@2021-07-29.yang | 789 +++ .../openconfig-platform-types@2021-07-29.yang | 433 ++ .../openconfig-platform@2018-11-21.yang | 790 +++ ...enconfig-policy-forwarding@2018-11-21.yang | 129 + .../openconfig-policy-types@2018-11-21.yang | 231 + .../openconfig-procmon@2019-03-15.yang | 180 + .../openconfig-qos-elements@2019-11-28.yang | 1318 +++++ .../openconfig-qos-interfaces@2019-11-28.yang | 678 +++ .../openconfig-qos-types@2018-11-21.yang | 159 + .../h3c-yang/openconfig-qos@2019-11-28.yang | 113 + .../openconfig-relay-agent@2018-11-21.yang | 825 ++++ ...nconfig-rib-bgp-attributes@2019-10-15.yang | 939 ++++ .../openconfig-rib-bgp-ext@2019-04-25.yang | 218 + ...-rib-bgp-shared-attributes@2019-10-15.yang | 203 + ...g-rib-bgp-table-attributes@2019-04-25.yang | 137 + .../openconfig-rib-bgp-tables@2019-10-15.yang | 916 ++++ .../openconfig-rib-bgp-types@2019-03-14.yang | 269 ++ .../openconfig-rib-bgp@2019-10-15.yang | 239 + .../openconfig-routing-policy@2018-11-21.yang | 1107 +++++ .../openconfig-rsvp-sr-ext@2019-07-09.yang | 418 ++ ...nfig-segment-routing-types@2020-02-04.yang | 158 + ...config-spanning-tree-types@2016-10-03.yang | 217 + .../openconfig-srte-policy@2020-05-01.yang | 669 +++ .../openconfig-system-logging@2017-01-29.yang | 479 ++ ...openconfig-system-terminal@2018-11-21.yang | 249 + .../openconfig-system@2017-01-29.yang | 856 ++++ ...openconfig-telemetry-types@2018-11-21.yang | 124 + .../openconfig-telemetry@2018-11-21.yang | 782 +++ ...fig-tencent-interfaces-ext@2019-02-01.yang | 278 ++ ...nfig-tencent-platform-chip@2019-01-24.yang | 830 ++++ ...openconfig-tencent-qos-ext@2019-02-01.yang | 144 + ...openconfig-terminal-device@2021-07-29.yang | 1672 +++++++ ...openconfig-transport-types@2021-07-29.yang | 1496 ++++++ .../h3c-yang/openconfig-types@2019-04-16.yang | 536 +++ .../openconfig-vlan-types@2016-05-26.yang | 180 + .../h3c-yang/openconfig-vlan@2016-05-26.yang | 407 ++ .../openconfig-yang-types@2018-11-21.yang | 191 + exp/yangcli/run_dump.sh | 1 + exp/yangcli/run_yangcli.sh | 13 + exp/yangcli/run_yangcli_h3c.sh | 13 + pytest.ini | 4 + requirements.txt | 12 + scripts/setup_port_forward.sh | 2 + src/exporter/__init__.py | 6 + .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 310 bytes src/exporter/__pycache__/api.cpython-312.pyc | Bin 0 -> 7941 bytes .../__pycache__/config.cpython-312.pyc | Bin 0 -> 6290 bytes .../__pycache__/connection.cpython-312.pyc | Bin 0 -> 4934 bytes .../__pycache__/errors.cpython-312.pyc | Bin 0 -> 1507 bytes .../__pycache__/logging_utils.cpython-312.pyc | Bin 0 -> 4089 bytes src/exporter/__pycache__/main.cpython-312.pyc | Bin 0 -> 7651 bytes .../__pycache__/metrics.cpython-312.pyc | Bin 0 -> 6799 bytes .../__pycache__/models.cpython-312.pyc | Bin 0 -> 2970 bytes .../netconf_client.cpython-312.pyc | Bin 0 -> 7428 bytes .../__pycache__/registry.cpython-312.pyc | Bin 0 -> 5220 bytes .../__pycache__/scraper.cpython-312.pyc | Bin 0 -> 5176 bytes .../__pycache__/sqlite_store.cpython-312.pyc | Bin 0 -> 8490 bytes src/exporter/api.py | 181 + src/exporter/config.py | 131 + src/exporter/connection.py | 88 + src/exporter/errors.py | 44 + src/exporter/logging_utils.py | 81 + src/exporter/main.py | 170 + src/exporter/metrics.py | 187 + src/exporter/models.py | 68 + src/exporter/netconf_client.py | 226 + src/exporter/registry.py | 96 + src/exporter/scraper.py | 148 + src/exporter/sqlite_store.py | 181 + .../conftest.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 1703 bytes ...t_api_devices.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 17525 bytes .../test_config.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 8753 bytes ...st_connection.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 14572 bytes ...lassification.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 7529 bytes ..._live_netconf.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 5321 bytes ..._e2e_exporter.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 18106 bytes ...logging_utils.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 7370 bytes ...ain_lifecycle.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 8820 bytes .../test_metrics.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 11961 bytes .../test_models.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 3770 bytes ...etconf_parser.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 22673 bytes ...ord_encryptor.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 2749 bytes ...test_registry.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 12931 bytes ...er_stop_event.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 2610 bytes ..._sqlite_store.cpython-312-pytest-9.0.1.pyc | Bin 0 -> 20648 bytes tests/conftest.py | 43 + tests/test_api_devices.py | 183 + tests/test_config.py | 86 + tests/test_connection.py | 125 + tests/test_error_classification.py | 16 + tests/test_h3c_live_netconf.py | 106 + tests/test_http_e2e_exporter.py | 265 + tests/test_logging_utils.py | 77 + tests/test_main_lifecycle.py | 121 + tests/test_metrics.py | 132 + tests/test_models.py | 67 + tests/test_netconf_parser.py | 174 + tests/test_password_encryptor.py | 19 + tests/test_registry.py | 130 + tests/test_scraper_stop_event.py | 46 + tests/test_sqlite_store.py | 253 + 195 files changed, 73003 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 config.yaml create mode 100644 docs/h3c_netconf_compoents_with_type.md create mode 100644 docs/h3c_netconf_components_with_temperature.md create mode 100644 docs/h3c_netconf_components_with_transceiver.md create mode 100644 docs/h3c_netconf_transceiver_component.md create mode 100755 exp/yangcli/get_component.sh create mode 100755 exp/yangcli/get_components_transceiver.sh create mode 100755 exp/yangcli/get_components_type.sh create mode 100755 exp/yangcli/get_interface.sh create mode 100644 exp/yangcli/h3c-yang/H3C-acl-action@2020-05-16.yang create mode 100644 exp/yangcli/h3c-yang/H3C-acl-config@2023-11-02.yang create mode 100644 exp/yangcli/h3c-yang/H3C-acl-data@2023-11-02.yang create mode 100644 exp/yangcli/h3c-yang/H3C-ifmgr-action@2025-02-13.yang create mode 100644 exp/yangcli/h3c-yang/H3C-ifmgr-config@2025-02-13.yang create mode 100644 exp/yangcli/h3c-yang/H3C-ifmgr-data@2025-02-13.yang create mode 100644 exp/yangcli/h3c-yang/H3C-ifmgr-event@2020-05-09.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aaa-radius@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aaa-tacacs@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aaa-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aaa@2019-10-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-acl@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-common@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-ethernet@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-ipv4@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-ipv6@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-mpls@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-network-instance@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-pf@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft-types@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-aft@2019-11-07.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-alarm-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-common-multiprotocol@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-common-structure@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-common@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-errors@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-global@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-neighbor@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-peer-group@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-policy@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp-types@2020-03-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-bgp@2019-07-10.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-extensions@2018-10-17.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-if-aggregate@2016-12-22.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-if-ethernet@2016-12-22.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-if-ip@2017-07-14.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-igmp-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-igmp@2019-07-09.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-inet-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-interfaces@2016-12-22.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis-lsdb-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis-lsp@2020-03-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis-policy@2020-02-04.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis-routing@2020-03-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-isis@2020-03-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-lldp-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-lldp@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-local-routing@2020-03-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-igp@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-ldp@2019-07-09.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-rsvp@2020-02-04.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-sr@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-static@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-te@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls-types@2020-02-04.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-mpls@2019-03-26.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-network-instance-l2@2019-04-16.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-network-instance-l3@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-network-instance-policy@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-network-instance-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-network-instance@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospf-policy@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospf-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2-area-interface@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2-area@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2-common@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2-global@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2-lsdb@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-ospfv2@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-packet-match-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-packet-match@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pf-forwarding-policies@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pf-interfaces@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pf-path-groups@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pf-srte@2019-10-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pim-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-pim@2019-07-09.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-cpu@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-fan@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-linecard@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-port@2021-10-01.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-psu@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-transceiver@2021-07-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform-types@2021-07-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-platform@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-policy-forwarding@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-policy-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-procmon@2019-03-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-qos-elements@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-qos-interfaces@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-qos-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-qos@2019-11-28.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-relay-agent@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-attributes@2019-10-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-ext@2019-04-25.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-shared-attributes@2019-10-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-table-attributes@2019-04-25.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-tables@2019-10-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp-types@2019-03-14.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rib-bgp@2019-10-15.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-routing-policy@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-rsvp-sr-ext@2019-07-09.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-segment-routing-types@2020-02-04.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-spanning-tree-types@2016-10-03.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-srte-policy@2020-05-01.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-system-logging@2017-01-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-system-terminal@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-system@2017-01-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-telemetry-types@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-telemetry@2018-11-21.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-tencent-interfaces-ext@2019-02-01.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-tencent-platform-chip@2019-01-24.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-tencent-qos-ext@2019-02-01.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-terminal-device@2021-07-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-transport-types@2021-07-29.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-types@2019-04-16.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-vlan-types@2016-05-26.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-vlan@2016-05-26.yang create mode 100644 exp/yangcli/h3c-yang/openconfig-yang-types@2018-11-21.yang create mode 100755 exp/yangcli/run_dump.sh create mode 100755 exp/yangcli/run_yangcli.sh create mode 100755 exp/yangcli/run_yangcli_h3c.sh create mode 100644 pytest.ini create mode 100644 requirements.txt create mode 100755 scripts/setup_port_forward.sh create mode 100644 src/exporter/__init__.py create mode 100644 src/exporter/__pycache__/__init__.cpython-312.pyc create mode 100644 src/exporter/__pycache__/api.cpython-312.pyc create mode 100644 src/exporter/__pycache__/config.cpython-312.pyc create mode 100644 src/exporter/__pycache__/connection.cpython-312.pyc create mode 100644 src/exporter/__pycache__/errors.cpython-312.pyc create mode 100644 src/exporter/__pycache__/logging_utils.cpython-312.pyc create mode 100644 src/exporter/__pycache__/main.cpython-312.pyc create mode 100644 src/exporter/__pycache__/metrics.cpython-312.pyc create mode 100644 src/exporter/__pycache__/models.cpython-312.pyc create mode 100644 src/exporter/__pycache__/netconf_client.cpython-312.pyc create mode 100644 src/exporter/__pycache__/registry.cpython-312.pyc create mode 100644 src/exporter/__pycache__/scraper.cpython-312.pyc create mode 100644 src/exporter/__pycache__/sqlite_store.cpython-312.pyc create mode 100644 src/exporter/api.py create mode 100644 src/exporter/config.py create mode 100644 src/exporter/connection.py create mode 100644 src/exporter/errors.py create mode 100644 src/exporter/logging_utils.py create mode 100644 src/exporter/main.py create mode 100644 src/exporter/metrics.py create mode 100644 src/exporter/models.py create mode 100644 src/exporter/netconf_client.py create mode 100644 src/exporter/registry.py create mode 100644 src/exporter/scraper.py create mode 100644 src/exporter/sqlite_store.py create mode 100644 tests/__pycache__/conftest.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_api_devices.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_config.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_connection.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_error_classification.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_h3c_live_netconf.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_http_e2e_exporter.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_logging_utils.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_main_lifecycle.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_metrics.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_models.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_netconf_parser.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_password_encryptor.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_registry.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_scraper_stop_event.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/__pycache__/test_sqlite_store.cpython-312-pytest-9.0.1.pyc create mode 100644 tests/conftest.py create mode 100644 tests/test_api_devices.py create mode 100644 tests/test_config.py create mode 100644 tests/test_connection.py create mode 100644 tests/test_error_classification.py create mode 100644 tests/test_h3c_live_netconf.py create mode 100644 tests/test_http_e2e_exporter.py create mode 100644 tests/test_logging_utils.py create mode 100644 tests/test_main_lifecycle.py create mode 100644 tests/test_metrics.py create mode 100644 tests/test_models.py create mode 100644 tests/test_netconf_parser.py create mode 100644 tests/test_password_encryptor.py create mode 100644 tests/test_registry.py create mode 100644 tests/test_scraper_stop_event.py create mode 100644 tests/test_sqlite_store.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..da14048 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.venv +.env +devices.db +exporter.log + +specs/ + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..0272b73 --- /dev/null +++ b/README.md @@ -0,0 +1,287 @@ +# NETCONF Transceiver Exporter + +基于 Python 的 Prometheus Exporter,通过 NETCONF 周期性轮询 H3C 交换机,采集光模块(transceiver)及其物理通道指标,并通过 HTTP `/metrics` 暴露给 Prometheus。 + +本项目已按设计文档 `specs/transceiver-exporter-design-v9.md` 与 TDD 文档 `specs/transcrive-exporter-tdd-design-v2.md` 实现,并带有完整测试集。 + +下面以本仓库为路径 `/home/yuyr/dev/switch_lab/netconf_exporter` 为例,说明从零开始的操作步骤。 + +--- + +## 1. 创建虚拟环境 & 安装依赖 + +### 1.1 创建虚拟环境 + +```bash +cd /home/yuyr/dev/switch_lab/netconf_exporter + +python3 -m venv .venv +source .venv/bin/activate +``` + +之后所有命令都建议在虚拟环境中执行(终端提示符前通常会有 `(.venv)`)。 + +### 1.2 安装依赖 + +```bash +cd /home/yuyr/dev/switch_lab/netconf_exporter + +pip install --upgrade pip +pip install -r requirements.txt +``` + +`requirements.txt` 包含: + +- 运行依赖:`fastapi`, `uvicorn`, `ncclient`, `cryptography`, `prometheus_client`, `PyYAML` 等; +- 开发/测试依赖:`pytest`, `pytest-asyncio`, `pytest-cov`, `httpx` 等。 + +--- + +## 2. 运行测试 + +项目所有源码都在 `src/exporter/` 下,测试在 `tests/` 目录中。 + +推荐使用如下命令运行所有测试: + +```bash +cd /home/yuyr/dev/switch_lab/netconf_exporter + +PYTHONPATH=src .venv/bin/pytest -q +``` + +- 会自动加载 `tests/conftest.py` 中定义的配置(包括从 `.env` 加载 H3C NETCONF 参数); +- 默认会运行: + - 单元/组件测试; + - 集成测试(包括 HTTP E2E); + - H3C NETCONF live 测试(如果 `.env` 中配置了可用的 H3C 连接参数)。 + +如果只想运行 H3C 相关测试,可以使用 mark 过滤,例如: + +```bash +PYTHONPATH=src .venv/bin/pytest -q -m "h3c_live" +``` + +只跑 HTTP 端到端测试: + +```bash +PYTHONPATH=src .venv/bin/pytest -q -m "http_e2e" +``` + +--- + +## 3. 配置 H3C NETCONF 访问参数(.env) + +为了方便本地联调 H3C 设备,本项目支持从 `.env` 文件中加载 H3C 连接参数。`tests/conftest.py` 会在 pytest 启动时自动读取 `.env`。 + +在项目根目录创建或编辑 `.env`: + +```env +H3C_NETCONF_HOST=127.0.0.1 +H3C_NETCONF_PORT=8830 +H3C_NETCONF_USER=netconf_user +H3C_NETCONF_PASSWORD='NASPLab123!' +``` + +说明: + +- 上述示例假设已经在本机将 127.0.0.1:8830 转发到真实 H3C 设备的 NETCONF 端口; +- `.env` 支持行尾注释(以 `#` 开头的行会被忽略),支持被单/双引号包裹的值; +- 若不想把密码写入 `.env`,可以在 shell 中 `export H3C_NETCONF_PASSWORD=...`,环境变量优先生效。 + +--- + +## 4. 编辑配置文件 config.yaml + +Exporter 在启动时从 `config.yaml` 中加载全局配置和静态设备列表。典型最小配置示例如下(仅含全局配置,设备通过 HTTP API 注册): + +```yaml +global: + http_listen: "0.0.0.0:19100" # HTTP 监听地址 + scrape_interval_seconds: 5 # 采集周期(秒) + netconf_port: 830 # 默认 NETCONF 端口(可被 runtime 设备覆盖) + connect_timeout_seconds: 5 # SSH 连接超时 + rpc_timeout_seconds: 30 # RPC 调用超时 + max_workers: 5 + + api_token: "changeme" # HTTP API token,curl/客户端需携带 + + runtime_db_path: "./devices.db" # SQLite 路径(保存 runtime 设备列表) + + # Fernet 密钥:32 字节 URL-safe Base64(长度 44) + # 生成方式: + # python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" + password_secret: "在这里替换为你的FernetKey" + + ssh_keepalive_seconds: 30 + failure_threshold: 3 # 连续失败多少次开始退避 + max_backoff_factor: 8 # 最大退避倍数 + shutdown_timeout_seconds: 60 # 关停时等待 scraper 的超时时间 + + log_level: INFO + log_to_stdout: true + log_file: "" # 若非空,则写入指定文件 + +devices: [] # 静态设备先留空,通过 API 动态注册 +``` + +注意: + +- `global.password_secret` 必须是合法的 Fernet key,否则程序会在启动时抛异常; +- 若将 `shutdown_timeout_seconds` 配得太小,相比 `scrape_interval_seconds + rpc_timeout_seconds`,会在启动时打印一个 warning(来自配置校验),提示关停可能会在 RPC 尚未结束时终止 scraper。 + +--- + +## 5. 启动 Exporter HTTP Server + +虚拟环境里,使用如下命令启动服务: + +```bash +cd /home/yuyr/dev/switch_lab/netconf_exporter + +PYTHONPATH=src .venv/bin/python -m exporter.main --config config.yaml +``` + +行为说明: + +- 启动时: + - 加载 `config.yaml`; + - 初始化日志系统(包含 `device=...` 字段); + - 初始化 SQLite `devices.db`; + - 加载静态设备(若有); + - 启动 Scraper 线程,按全局配置定期轮询设备; + - 启动 Uvicorn HTTP server,默认监听 `http_listen`(例如 `0.0.0.0:19100`)。 +- Ctrl+C 时: + - Uvicorn 会优雅关停 HTTP; + - Scraper 会收到 stop 信号并在 `shutdown_timeout_seconds` 内退出; + - 所有 NETCONF 连接和 SQLite 资源会被关闭; + - `KeyboardInterrupt` 会被捕获,退出不会打印 traceback。 + +启动成功后,可以在另一个终端通过: + +```bash +curl -s http://127.0.0.1:19100/healthz +``` + +查看基本健康状态(`{"status":"ok", ...}`)。 + +--- + +## 6. 通过 curl 注册 H3C 设备(runtime device) + +假设已经准备好 H3C 的 NETCONF 代理: + +- H3C 可通过 127.0.0.1:8830 被访问; +- 用户名/密码为 `.env` 中配置的 `H3C_NETCONF_USER` / `H3C_NETCONF_PASSWORD`。 + +启动 exporter 后,在另一个终端中执行(注意 token 要与 config.yaml 中一致): + +```bash +cd /home/yuyr/dev/switch_lab/netconf_exporter + +curl -s -X POST \ + -H "Content-Type: application/json" \ + -H "X-API-Token: changeme" \ + -d '{ + "name": "h3c-live-1", + "host": "127.0.0.1", + "port": 8830, + "username": "netconf_user", + "password": "NASPLab123!", + "enabled": true, + "supports_xpath": false + }' \ + http://127.0.0.1:19100/api/v1/devices +``` + +预期返回(示例): + +```json +{ + "name": "h3c-live-1", + "host": "127.0.0.1", + "port": 8830, + "enabled": true, + "scrape_interval_seconds": null, + "supports_xpath": false, + "source": "runtime" +} +``` + +可以再通过: + +```bash +curl -s -H "X-API-Token: changeme" http://127.0.0.1:19100/api/v1/devices +``` + +确认设备已注册(包含 `source: "runtime"`)。 + +--- + +## 7. 通过 curl 获取 Prometheus 指标 + +Scraper 线程会按 `global.scrape_interval_seconds` 周期性访问所有启用的设备,通过 NETCONF `` 拉取 transceiver/channel 数据,并写入内存缓存。 + +等待一到两个采集周期(例如配置为 5 秒,则等待 10 秒左右)后,可用 curl 获取指标: + +```bash +curl -s http://127.0.0.1:19100/metrics | head -n 40 +``` + +或聚焦某些关键指标: + +```bash +# 健康状态 +curl -s http://127.0.0.1:19100/metrics | grep netconf_scrape + +# Transceiver 级指标 +curl -s http://127.0.0.1:19100/metrics | grep '^transceiver_' + +# Channel 级指标 +curl -s http://127.0.0.1:19100/metrics | grep '^transceiver_channel_' +``` + +典型输出示例(部分): + +```text +netconf_scrape_success{device="h3c-live-1"} 1 +netconf_scrape_duration_seconds{device="h3c-live-1"} 0.532 + +transceiver_channel_rx_power_dbm{device="h3c-live-1",port="1/0/1",channel="1/0/1:1",component_name="63.TwoHundredGigE1/0/1:1"} -3.53 +transceiver_channel_tx_power_dbm{device="h3c-live-1",port="1/0/1",channel="1/0/1:1",component_name="63.TwoHundredGigE1/0/1:1"} 2.09 +... +``` + +如果 `netconf_scrape_success=0` 且 `netconf_scrape_errors_total{error_type="TimeoutError"}` > 0,说明采集超时或失败,可通过 exporter 日志进一步排查(`exporter.scraper` logger 会输出具体异常堆栈)。 + +--- + +## 8. 删除 runtime 设备 + +若需删除通过 API 注册的 H3C 设备: + +```bash +curl -s -X DELETE \ + -H "X-API-Token: changeme" \ + http://127.0.0.1:19100/api/v1/devices/h3c-live-1 +``` + +再次列出设备即不再看到 `h3c-live-1`。静态设备(来自 config.yaml `devices:`)无法通过 API 删除。 + +--- + +## 9. 关停 Exporter + +在运行 `exporter.main` 的终端中按 `Ctrl+C`: + +- Uvicorn 会打印 `Shutting down` / `Application shutdown complete`; +- Scraper 线程会收到终止信号,尝试在 `shutdown_timeout_seconds` 内退出; +- 所有 NETCONF 会话会发送 `` 并关闭; +- `KeyboardInterrupt` 会被捕获,退出不会打印 Python traceback。 + +Exporter 本身不持久化运行时状态,只有: + +- `config.yaml`:静态全局配置 + 静态设备; +- `devices.db`:运行时注册的设备列表(已加密的密码)。 + +因此重启 Exporter 不会影响 H3C 设备,只会重新加载配置并恢复运行时设备列表。 + diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..cced2cb --- /dev/null +++ b/config.yaml @@ -0,0 +1,25 @@ + global: + http_listen: "0.0.0.0:19100" # HTTP 监听地址 + scrape_interval_seconds: 60 # 调短一点,方便联调 + netconf_port: 830 # 默认值,不影响 runtime 设备 + connect_timeout_seconds: 5 + rpc_timeout_seconds: 30 + max_workers: 5 + + api_token: "changeme" # curl 要带的 Token + + runtime_db_path: "./devices.db" + + # Fernet 密钥:先生成(下一步的命令),把输出粘到这里 + password_secret: "mnp7sBccIOehLUwdk_vqMk2gTSPQxhmR9yDbpSHBvFY=" + + ssh_keepalive_seconds: 30 + failure_threshold: 3 + max_backoff_factor: 8 + shutdown_timeout_seconds: 30 + + log_level: INFO + log_to_stdout: true + log_file: "./exporter.log" + + devices: [] # 静态设备先留空,全部通过 API 注册 \ No newline at end of file diff --git a/docs/h3c_netconf_compoents_with_type.md b/docs/h3c_netconf_compoents_with_type.md new file mode 100644 index 0000000..9f644c1 --- /dev/null +++ b/docs/h3c_netconf_compoents_with_type.md @@ -0,0 +1,71 @@ +# 获取所有compoent列表,并带上type +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-platform:state/oc-platform:type" + +rpc-reply { + data { + components { + component "1.H3C S9827-128DH" { + name '1.H3C S9827-128DH' + state { + type FRU + } + } + component "2.H3C S9827-128DH" { + name '2.H3C S9827-128DH' + state { + type CHASSIS + } + } + component "3.Slot 1" { + name '3.Slot 1' + state { + type FRU + } + } + component "4.Slot 1" { + name '4.Slot 1' + state { + type FRU + } + } + component "5.Slot 1" { + name '5.Slot 1' + state { + type FRU + } + } +... + component 75.TwoHundredGigE1/0/4:1 { + name 75.TwoHundredGigE1/0/4:1 + state { + type TRANSCEIVER + } + } + component 76.TwoHundredGigE1/0/4:2 { + name 76.TwoHundredGigE1/0/4:2 + state { + type TRANSCEIVER + } + } + component 79.TwoHundredGigE1/0/5:1 { + name 79.TwoHundredGigE1/0/5:1 + state { + type TRANSCEIVER + } + } +... + component 1044.OCH-1/0/72.4 { + name 1044.OCH-1/0/72.4 + state { + type OPTICAL_CHANNEL + } + } + component "2663.CHIP 1" { + name '2663.CHIP 1' + state { + type CHIP + } + } + } + } +} diff --git a/docs/h3c_netconf_components_with_temperature.md b/docs/h3c_netconf_components_with_temperature.md new file mode 100644 index 0000000..1fd1fb5 --- /dev/null +++ b/docs/h3c_netconf_components_with_temperature.md @@ -0,0 +1,225 @@ + +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-platform:state/oc-platform:temperature" + +rpc-reply { + data { + components { + component 29.Board { + name 29.Board + state { + temperature { + instant 50.0 + } + } + } + component "30.PSU 1" { + name '30.PSU 1' + state { + temperature { + instant 26.0 + } + } + } + component "31.PSU 2" { + name '31.PSU 2' + state { + temperature { + instant 26.0 + } + } + } + component "32.PSU 3" { + name '32.PSU 3' + state { + temperature { + instant 26.0 + } + } + } + component "33.PSU 4" { + name '33.PSU 4' + state { + temperature { + instant 26.0 + } + } + } + component "43.SENSOR 1" { + name '43.SENSOR 1' + state { + temperature { + instant 40.0 + } + } + } + component "44.SENSOR 2" { + name '44.SENSOR 2' + state { + temperature { + instant 50.0 + } + } + } + component "45.SENSOR 3" { + name '45.SENSOR 3' + state { + temperature { + instant 27.0 + } + } + } + component "46.SENSOR 4" { + name '46.SENSOR 4' + state { + temperature { + instant 25.0 + } + } + } + component "47.SENSOR 5" { + name '47.SENSOR 5' + state { + temperature { + instant 28.0 + } + } + } + component "48.SENSOR 6" { + name '48.SENSOR 6' + state { + temperature { + instant 36.0 + } + } + } + component "49.SENSOR 7" { + name '49.SENSOR 7' + state { + temperature { + instant 36.0 + } + } + } + component "50.SENSOR 8" { + name '50.SENSOR 8' + state { + temperature { + instant 47.0 + } + } + } + component "51.SENSOR 9" { + name '51.SENSOR 9' + state { + temperature { + instant 24.0 + } + } + } + component "59.Main Board" { + name '59.Main Board' + state { + temperature { + instant 50.0 + } + } + } + component 63.TwoHundredGigE1/0/1:1 { + name 63.TwoHundredGigE1/0/1:1 + state { + temperature { + instant 45.0 + } + } + } + component 64.TwoHundredGigE1/0/1:2 { + name 64.TwoHundredGigE1/0/1:2 + state { + temperature { + instant 45.0 + } + } + } + component 67.TwoHundredGigE1/0/2:1 { + name 67.TwoHundredGigE1/0/2:1 + state { + temperature { + instant 45.0 + } + } + } + component 68.TwoHundredGigE1/0/2:2 { + name 68.TwoHundredGigE1/0/2:2 + state { + temperature { + instant 45.0 + } + } + } + component 71.TwoHundredGigE1/0/3:1 { + name 71.TwoHundredGigE1/0/3:1 + state { + temperature { + instant 46.0 + } + } + } + component 72.TwoHundredGigE1/0/3:2 { + name 72.TwoHundredGigE1/0/3:2 + state { + temperature { + instant 46.0 + } + } + } + component 75.TwoHundredGigE1/0/4:1 { + name 75.TwoHundredGigE1/0/4:1 + state { + temperature { + instant 45.0 + } + } + } + component 76.TwoHundredGigE1/0/4:2 { + name 76.TwoHundredGigE1/0/4:2 + state { + temperature { + instant 45.0 + } + } + } + component 319.FourHundredGigE1/0/65 { + name 319.FourHundredGigE1/0/65 + state { + temperature { + instant 46.0 + } + } + } + component 323.FourHundredGigE1/0/66 { + name 323.FourHundredGigE1/0/66 + state { + temperature { + instant 45.0 + } + } + } + component 327.FourHundredGigE1/0/67 { + name 327.FourHundredGigE1/0/67 + state { + temperature { + instant 46.0 + } + } + } + component 331.FourHundredGigE1/0/68 { + name 331.FourHundredGigE1/0/68 + state { + temperature { + instant 45.0 + } + } + } + } + } +} \ No newline at end of file diff --git a/docs/h3c_netconf_components_with_transceiver.md b/docs/h3c_netconf_components_with_transceiver.md new file mode 100644 index 0000000..ebaa80b --- /dev/null +++ b/docs/h3c_netconf_components_with_transceiver.md @@ -0,0 +1,166 @@ +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-transceiver:transceiver" + +rpc-reply { + data { + components { + component { + name 63.TwoHundredGigE1/0/1:1 + transceiver { + config { + enabled false + fec-mode oc-platform-types:FEC_AUTO + } + state { + enabled false + fec-mode oc-platform-types:FEC_AUTO + present PRESENT + form-factor oc-opt-types:OTHER + vendor H3C + vendor-part EQ854HG01M3-H3C + vendor-rev 03 + ethernet-pmd oc-opt-types:ETH_UNDEFINED + serial-no G80231AM995701HH + date-code 2000-00-00T00:00:00 + fault-condition false + voltage { + instant 3.34 + } + supply-voltage { + instant 3.34 + } + laser-bias-current { + instant 2147483647.00 + } + input-power { + instant 2147483647.00 + } + output-power { + instant 2147483647.00 + } + } + physical-channels { + channel 1 { + index 1 + config { + index 1 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:1 + tx-laser true + } + state { + index 1 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:1 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 2.05 + } + input-power { + instant -3.55 + } + laser-bias-current { + instant 8.82 + } + } + } + channel 2 { + index 2 + config { + index 2 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:2 + tx-laser true + } + state { + index 2 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:2 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 2.18 + } + input-power { + instant 1.07 + } + laser-bias-current { + instant 8.72 + } + } + } + } + } + } + component { + name 64.TwoHundredGigE1/0/1:2 + transceiver { + config { + enabled false + fec-mode oc-platform-types:FEC_AUTO + } + state { + enabled false + fec-mode oc-platform-types:FEC_AUTO + present PRESENT + form-factor oc-opt-types:OTHER + vendor H3C + vendor-part EQ854HG01M3-H3C + vendor-rev 03 + ethernet-pmd oc-opt-types:ETH_UNDEFINED + serial-no G80231AM995701HH + date-code 2000-00-00T00:00:00 + fault-condition false + voltage { + instant 3.34 + } + supply-voltage { + instant 3.34 + } + laser-bias-current { + instant 2147483647.00 + } + input-power { + instant 2147483647.00 + } + output-power { + instant 2147483647.00 + } + } + physical-channels { + channel 1 { + index 1 + config { + index 1 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:1 + tx-laser true + } + state { + index 1 + associated-optical-channel 583.OCH-1/0/1.1 + description 1/0/1:1 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviat + +... + diff --git a/docs/h3c_netconf_transceiver_component.md b/docs/h3c_netconf_transceiver_component.md new file mode 100644 index 0000000..d352d82 --- /dev/null +++ b/docs/h3c_netconf_transceiver_component.md @@ -0,0 +1,196 @@ +逐个光模块compoent去获取光模块的详细信息,./run_yangcli.sh "sget /oc-platform:components/oc-platform:component[oc-platform:name='323.FourHundredGigE1/0/66']" + +rpc-reply { + data { + components { + component { + name 323.FourHundredGigE1/0/66 + state { + name 323.FourHundredGigE1/0/66 + type TRANSCEIVER + serial-no G80231AM995701JX + firmware-version 3.0 + id 323 + location 'Slot 1 Subslot 0' + removable true + oper-status oc-platform-types:ACTIVE + empty false + parent '59.Main Board' + allocated-power 12 + hardware-version 1.0 + temperature { + instant 40.0 + } + } + transceiver { + config { + enabled false + fec-mode oc-platform-types:FEC_AUTO + } + state { + enabled false + fec-mode oc-platform-types:FEC_AUTO + present PRESENT + form-factor oc-opt-types:OTHER + vendor H3C + vendor-part EQ854HG01M3-H3C + vendor-rev 03 + ethernet-pmd oc-opt-types:ETH_UNDEFINED + serial-no G80231AM995701JX + date-code 2000-00-00T00:00:00 + fault-condition false + voltage { + instant 3.32 + } + supply-voltage { + instant 3.32 + } + laser-bias-current { + instant 2147483647.00 + } + input-power { + instant 2147483647.00 + } + output-power { + instant 2147483647.00 + } + } + physical-channels { + channel 1 { + index 1 + config { + index 1 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:1 + tx-laser true + } + state { + index 1 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:1 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 2.23 + } + input-power { + instant 0.41 + } + laser-bias-current { + instant 8.91 + } + } + } + channel 2 { + index 2 + config { + index 2 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:2 + tx-laser true + } + state { + index 2 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:2 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 2.10 + } + input-power { + instant 0.68 + } + laser-bias-current { + instant 8.77 + } + } + } + channel 3 { + index 3 + config { + index 3 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:3 + tx-laser true + } + state { + index 3 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:3 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 1.91 + } + input-power { + instant 1.08 + } + laser-bias-current { + instant 8.74 + } + } + } + channel 4 { + index 4 + config { + index 4 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:4 + tx-laser true + } + state { + index 4 + associated-optical-channel 648.OCH-1/0/66.1 + description 1/0/66:4 + tx-laser true + laser-temperature { + instant 2147483647.0 + } + target-frequency-deviation { + instant 2147483647.0 + } + tec-current { + instant 2147483647.00 + } + output-power { + instant 2.07 + } + input-power { + instant 0.68 + } + laser-bias-current { + instant 8.72 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/exp/yangcli/get_component.sh b/exp/yangcli/get_component.sh new file mode 100755 index 0000000..ff12cb3 --- /dev/null +++ b/exp/yangcli/get_component.sh @@ -0,0 +1,3 @@ + + +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component[oc-platform:name='323.FourHundredGigE1/0/66']" diff --git a/exp/yangcli/get_components_transceiver.sh b/exp/yangcli/get_components_transceiver.sh new file mode 100755 index 0000000..6d582cf --- /dev/null +++ b/exp/yangcli/get_components_transceiver.sh @@ -0,0 +1 @@ +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-transceiver:transceiver" diff --git a/exp/yangcli/get_components_type.sh b/exp/yangcli/get_components_type.sh new file mode 100755 index 0000000..c92b9ce --- /dev/null +++ b/exp/yangcli/get_components_type.sh @@ -0,0 +1 @@ +./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-platform:state/oc-platform:type" diff --git a/exp/yangcli/get_interface.sh b/exp/yangcli/get_interface.sh new file mode 100755 index 0000000..dfd4bfd --- /dev/null +++ b/exp/yangcli/get_interface.sh @@ -0,0 +1,2 @@ + # ./run_yangcli.sh "sget oc-if:interfaces" + ./run_yangcli.sh "sget oc-if:interfaces/oc-if:interface[oc-if:name='FourHundredGigE1/0/128']" diff --git a/exp/yangcli/h3c-yang/H3C-acl-action@2020-05-16.yang b/exp/yangcli/h3c-yang/H3C-acl-action@2020-05-16.yang new file mode 100644 index 0000000..5741dbe --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-acl-action@2020-05-16.yang @@ -0,0 +1,139 @@ +module H3C-acl-action { + yang-version 1.1; + namespace "http://www.h3c.com/netconf/action:1.0-ACL"; + prefix "acl-action"; + import comware-basetype { + prefix "base"; + } + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for acl action."; + revision 2020-05-16 { + description "Initial revision."; + } + container ACL { + config false; + action Groups { + description "ACL group table + This table supports creating rows."; + input { + list Group { + description "ACL group"; + key "GroupType GroupID"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + mandatory true; + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User."; + } + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..5999"; + } + mandatory true; + description "ACL group ID. IPv4: 2000~5999, IPv6: 2000~3999"; + } + leaf CountClear { + type empty; + mandatory true; + description "Clear the count."; + } + } + } + } + action NamedGroups { + description "ACL named group table + This table supports creating rows."; + input { + list Group { + description "ACL group"; + key "GroupType GroupIndex"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + mandatory true; + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User."; + } + leaf GroupIndex { + type base:Basetype_String { + pattern "([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + mandatory true; + description "Acl Group Name of Index.If it's Index, range from 2000 to 5999."; + } + leaf CountClear { + type empty; + mandatory true; + description "Clear the count."; + } + } + } + } + action PfilterApply { + description "Pfilter apply table + This table supports creating rows."; + input { + list Pfilter { + description "Pfilter apply"; + key "AppObjType AppObjIndex AppDirection AppAclType AppAclGroup"; + leaf AppObjType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + mandatory true; + description "Object type. 1: interface, 2: vlan,3: global."; + } + leaf AppObjIndex { + type base:Basetype_NameAndIndexUnion; + mandatory true; + description "Object Index."; + } + leaf AppDirection { + type enumeration { + enum 1; + enum 2; + } + mandatory true; + description "Apply Direction.1:inbound, 2:outbound."; + } + leaf AppAclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + mandatory true; + description "ACL Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User-defined, 5: default."; + } + leaf AppAclGroup { + type base:Basetype_String { + pattern "(0)|([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + mandatory true; + description "ACL Group Index.range from 2000 to 5999, Default: 0."; + } + leaf CountClear { + type empty; + mandatory true; + description "Clear the count."; + } + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-acl-config@2023-11-02.yang b/exp/yangcli/h3c-yang/H3C-acl-config@2023-11-02.yang new file mode 100644 index 0000000..4c4f727 --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-acl-config@2023-11-02.yang @@ -0,0 +1,3727 @@ +module H3C-acl-config { + namespace "http://www.h3c.com/netconf/config:1.0-ACL"; + prefix "acl-config"; + import comware-basetype { + prefix "base"; + } + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for acl config."; + revision 2023-11-02 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2023-10-18 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2021-11-03 { + description "Initial revision."; + } + container ACL { + container Groups { + description "ACL groups table. + This table supports creating rows."; + list Group { + description "ACL group row."; + key "GroupType GroupID"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User-defined."; + } + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..5999"; + } + description "Group ID. IPv4: 2000~5999, IPv6: 2000~3999."; + } + leaf MatchOrder { + type enumeration { + enum 1; + enum 2; + } + description "Match order. 1: config, 2: auto. Default: config."; + } + leaf Step { + type base:Basetype_UnsignedInteger32 { + range "1..20"; + } + description "Step length, range from 1 to 20. Default: 5."; + } + leaf Name { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,62}"; + } + description "Name of the ACL group, a case-insensitive string of 1 to 63 characters."; + } + leaf Description { + type base:Basetype_Text { + length "1..127"; + } + description "Description of the ACL group, a string of 1 to 127 characters."; + } + } + } + container NamedGroups { + description "ACL named groups table. + This table supports creating rows."; + list Group { + description "ACL group row."; + key "GroupType GroupCategory GroupIndex"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User-defined."; + } + leaf GroupCategory { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Group type. 0: invalid, 1: basic, 2: advanced."; + } + leaf GroupIndex { + type base:Basetype_String { + pattern "([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 5999."; + } + leaf MatchOrder { + type enumeration { + enum 1; + enum 2; + } + description "Match order. 1: config, 2: auto. Default: config."; + } + leaf Step { + type base:Basetype_UnsignedInteger32 { + range "1..20"; + } + description "Step length, range from 1 to 20. Default: 5."; + } + leaf Description { + type base:Basetype_Text { + length "1..127"; + } + description "Description of the ACL group, a string of 1 to 127 characters."; + } + leaf Name { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,62}"; + } + description "Name of the ACL group, a case-insensitive string of 1 to 63 characters."; + } + } + } + container IPv4BasicRules { + description "Table of IPv4 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..2999"; + } + description "Group ID. Range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any IP address."; + } + container SrcIPv4 { + description "Source IP, including SrcIPv4Addr and SrcIPv4Wildcard."; + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container IPv4NamedBasicRules { + description "Table of named IPv4 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(2[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any IP address."; + } + container SrcIPv4 { + description "Source IP, including SrcIPv4Addr and SrcIPv4Wildcard."; + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container IPv6BasicRules { + description "Table of IPv6 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..2999"; + } + description "Group ID. Range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6, including SrcIPv6Address and SrcIPv6Prefix."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container IPv6NamedBasicRules { + description "Table of named IPv6 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(2[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6, including SrcIPv6Address and SrcIPv6Prefix."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container IPv4AdvanceRules { + description "Table of IPv4 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "3000..3999"; + } + description "Group ID. Range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + container DSCPRange { + leaf StartDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the start DSCP of IP packet."; + } + leaf EndDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the end DSCP of IP packet."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP { + leaf ICMPType { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMP message type."; + } + leaf ICMPCode { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMP message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf EncapType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Encap Type. 1: VXLAN, 2: GRE-ENCAP, 3: IPINIP-ENCAP."; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + leaf InProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InSrcAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-source IPv4 address."; + } + container InSrcIPv4 { + leaf InSrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf InSrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf InDstAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-destination IPv4 address."; + } + container InDstIPv4 { + leaf InDstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf InDstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InEstablished { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a Inner TCP connection."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv4NamedAdvanceRules { + description "Table of named IPv4 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(3[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + container DSCPRange { + leaf StartDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the start DSCP of IP packet."; + } + leaf EndDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the end DSCP of IP packet."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP { + leaf ICMPType { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMP message type."; + } + leaf ICMPCode { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMP message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf EncapType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Encap Type. 1: VXLAN, 2: GRE-ENCAP, 3: IPINIP-ENCAP."; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + leaf InProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InSrcAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-source IPv4 address."; + } + container InSrcIPv4 { + leaf InSrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf InSrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf InDstAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-destination IPv4 address."; + } + container InDstIPv4 { + leaf InDstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf InDstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InEstablished { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a Inner TCP connection."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv6AdvanceRules { + description "Table of IPv6 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "3000..3999"; + } + description "Group ID. Range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv6 address."; + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IPv6 packet."; + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf FlowLabel { + type base:Basetype_UnsignedInteger32 { + range "0..1048575"; + } + description "The value of flow label of IPv6 packet header."; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + container SrcPort { + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP6 { + leaf ICMP6Type { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMPv6 message type."; + } + leaf ICMP6Code { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMPv6 message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf HopTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any hop type."; + } + leaf HopTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of hop type which is in the range of 0 to 255."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv6NamedAdvanceRules { + description "Table of named IPv6 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(3[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv6 address."; + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IPv6 packet."; + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf FlowLabel { + type base:Basetype_UnsignedInteger32 { + range "0..1048575"; + } + description "The value of flow label of IPv6 packet header."; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + container SrcPort { + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP6 { + leaf ICMP6Type { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMPv6 message type."; + } + leaf ICMP6Code { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMPv6 message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf HopTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any hop type."; + } + leaf HopTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of hop type which is in the range of 0 to 255."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container MACRules { + description "Table of MAC ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "4000..4999"; + } + description "Group ID. Range from 4000 to 4999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container SrcMACAddr { + leaf SrcMACAddress { + type base:Basetype_MacAddress; + } + leaf SrcMACMask { + type base:Basetype_MacAddress; + } + } + container DstMACAddr { + leaf DstMACAddress { + type base:Basetype_MacAddress; + } + leaf DstMACMask { + type base:Basetype_MacAddress; + } + } + leaf COS { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "802.1p priority."; + } + container Protocol { + description "Protocol in the Ethernet frame header."; + leaf ProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf ProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + container LSAP { + leaf LSAPType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of LSAP"; + } + leaf LSAPTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of LSAP."; + } + } + leaf EncapType { + type enumeration { + enum 1; + } + description "Encap Type. 1: VXLAN"; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + container InSrcMACAddr { + leaf InSrcMACAddress { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMACAddr { + leaf InDstMACAddress { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + container InProtocol { + description "Inner protocol in the Ethernet frame header."; + leaf InProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf InProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container MACNamedRules { + description "Table of named MAC ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(4[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 4000 to 4999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container SrcMACAddr { + leaf SrcMACAddress { + type base:Basetype_MacAddress; + } + leaf SrcMACMask { + type base:Basetype_MacAddress; + } + } + container DstMACAddr { + leaf DstMACAddress { + type base:Basetype_MacAddress; + } + leaf DstMACMask { + type base:Basetype_MacAddress; + } + } + leaf COS { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "802.1p priority."; + } + container Protocol { + description "Protocol in the Ethernet frame header."; + leaf ProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf ProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + container LSAP { + leaf LSAPType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of LSAP"; + } + leaf LSAPTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of LSAP."; + } + } + leaf EncapType { + type enumeration { + enum 1; + } + description "Encap Type. 1: VXLAN"; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + container InSrcMACAddr { + leaf InSrcMACAddress { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMACAddr { + leaf InDstMACAddress { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + container InProtocol { + description "Inner protocol in the Ethernet frame header."; + leaf InProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf InProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + } + } + container UserRules { + description "Table of the user ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "5000..5999"; + } + description "Group ID. Range from 5000 to 5999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container L2Rule { + description "Specifies that the offset is relative to the beginning of the Layer 2 frame header."; + leaf L2RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L2RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L2Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv4Rule { + description "Specifies that the offset is relative to the beginning of the IPv4 header."; + leaf IPv4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv6Rule { + description "Specifies that the offset is relative to the beginning of the IPv6 header."; + leaf IPv6RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv6RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv6Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L4Rule { + description "Specifies that the offset is relative to the beginning of the Layer 4 header."; + leaf L4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L5Rule { + description "Specifies that the offset is relative to the beginning of the Layer 5 header."; + leaf L5RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L5RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L5Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + leaf UdfFormat { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "udf packet format type. 1: INT, 2:raw-ip."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf IPv6ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf DualStackProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf EncapType { + type enumeration { + enum 5; + enum 6; + enum 7; + enum 8; + } + description "Encap Type. 5: srv6-l2vpn-be, 6: srv6-l2vpn-te, 7: srv6-l3vpn-be, 8: srv6-l3vpn-te."; + } + container SRv6 { + leaf SegmentLeft { + type base:Basetype_UnsignedInteger32; + description "Segment left."; + } + leaf SegmentList { + type base:Basetype_UnsignedInteger32; + description "Segment list."; + } + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + leaf InVlantag { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Inner Vlan Tag. 0: none, 1: single, 2: double."; + } + leaf InServiceVlan { + type base:Basetype_VlanRange; + description "Inner Service Vlan."; + } + leaf InCustomVlan { + type base:Basetype_VlanRange; + description "Inner Custom Vlan."; + } + container InSrcMAC { + leaf InSrcMAC { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMAC { + leaf InDstMAC { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + leaf InProtocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InIPv6Protocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner Ipv6 protocol type of packets, 256 indicates IP family."; + } + container InSrcAddr { + leaf InSrcAddr { + type base:Basetype_IpAddress; + } + leaf InSrcMask { + type base:Basetype_IpAddress; + } + } + container InDstAddr { + leaf InDstAddr { + type base:Basetype_IpAddress; + } + leaf InDstMask { + type base:Basetype_IpAddress; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of inner IP packet's ECN."; + } + leaf InDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of inner IP packet."; + } + leaf InPrecedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of inner IP packet's precedence."; + } + leaf InTOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of inner IP packet's TOS."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts the number of times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + } + } + container UserNamedRules { + description "Table of the named user ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(5[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 5000 to 5999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Rule ID. Range from 0 to 65535."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container L2Rule { + description "Specifies that the offset is relative to the beginning of the Layer 2 frame header."; + leaf L2RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L2RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L2Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv4Rule { + description "Specifies that the offset is relative to the beginning of the IPv4 header."; + leaf IPv4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv6Rule { + description "Specifies that the offset is relative to the beginning of the IPv6 header."; + leaf IPv6RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv6RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv6Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L4Rule { + description "Specifies that the offset is relative to the beginning of the Layer 4 header."; + leaf L4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L5Rule { + description "Specifies that the offset is relative to the beginning of the Layer 5 header."; + leaf L5RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L5RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L5Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + leaf UdfFormat { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "udf packet format type. 1: INT, 2:raw-ip."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf IPv6ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf DualStackProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf EncapType { + type enumeration { + enum 5; + enum 6; + enum 7; + enum 8; + } + description "Encap Type. 5: srv6-l2vpn-be, 6: srv6-l2vpn-te, 7: srv6-l3vpn-be, 8: srv6-l3vpn-te."; + } + container SRv6 { + leaf SegmentLeft { + type base:Basetype_UnsignedInteger32; + description "Segment left."; + } + leaf SegmentList { + type base:Basetype_UnsignedInteger32; + description "Segment list."; + } + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + leaf InVlantag { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Inner Vlan Tag. 0: none, 1: single, 2: double."; + } + leaf InServiceVlan { + type base:Basetype_VlanRange; + description "Inner Service Vlan."; + } + leaf InCustomVlan { + type base:Basetype_VlanRange; + description "Inner Custom Vlan."; + } + container InSrcMAC { + leaf InSrcMAC { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMAC { + leaf InDstMAC { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + leaf InProtocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InIPv6Protocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner Ipv6 protocol type of packets, 256 indicates IP family."; + } + container InSrcAddr { + leaf InSrcAddr { + type base:Basetype_IpAddress; + } + leaf InSrcMask { + type base:Basetype_IpAddress; + } + } + container InDstAddr { + leaf InDstAddr { + type base:Basetype_IpAddress; + } + leaf InDstMask { + type base:Basetype_IpAddress; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of inner IP packet's ECN."; + } + leaf InDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of inner IP packet."; + } + leaf InPrecedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of inner IP packet's precedence."; + } + leaf InTOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of inner IP packet's TOS."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts the number of times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + } + } + container Intervals { + description "ACL intervals table. + This table supports creating rows."; + list Interval { + description "ACL interval row."; + key "IntervalType"; + leaf IntervalType { + type enumeration { + enum 1; + enum 2; + } + description "Interval Type. 1: logs, 2: trap."; + } + leaf IntervalValue { + type base:Basetype_UnsignedInteger32 { + range "5..1440"; + } + description "The value of Interval."; + } + } + } + container PfilterDefAction { + description "Pfilter base information table"; + leaf DefaultAction { + type enumeration { + enum 1; + enum 2; + } + description "Default Action.1:Permit,2:Deny."; + } + } + container PfilterIgnoreAction { + description "Pfilter base information table"; + leaf IgnoreAction { + type base:Basetype_Boolean; + description "Ignore permit action."; + } + } + container PfilterApply { + description "Pfilter apply table + This table supports creating rows."; + list Pfilter { + description "Pfilter apply row"; + key "AppObjType AppObjIndex AppDirection AppAclType AppAclGroup"; + leaf AppObjType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Object type. 1: interface, 2: vlan, 3: global."; + } + leaf AppObjIndex { + type base:Basetype_NameAndIndexUnion; + description "Object Index."; + } + leaf AppDirection { + type enumeration { + enum 1; + enum 2; + } + description "Apply Direction. 1: inbound, 2: outbound."; + } + leaf AppAclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "ACL Group type. 1: ipv4, 2: ipv6, 3:MAC, 4:user, 5:default."; + } + leaf AppAclGroup { + type base:Basetype_String { + pattern "(0)|([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 5999, Default: 0."; + } + leaf HardCount { + type enumeration { + enum 1; + enum 2; + } + description "Hardware count flag.1:true,2:false.Default:false."; + } + leaf InnerEncap { + type enumeration { + enum 0; + enum 1; + } + description "Encap Type.0:none,1:vxlan."; + } + leaf ShareMode { + type base:Basetype_Boolean; + description "Enable share mode flag."; + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-acl-data@2023-11-02.yang b/exp/yangcli/h3c-yang/H3C-acl-data@2023-11-02.yang new file mode 100644 index 0000000..81aeda3 --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-acl-data@2023-11-02.yang @@ -0,0 +1,4282 @@ +module H3C-acl-data { + namespace "http://www.h3c.com/netconf/data:1.0-ACL"; + prefix "acl-data"; + import comware-basetype { + prefix "base"; + } + + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for acl data."; + revision 2023-11-02 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2023-10-18 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2022-07-07 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2022-03-23 { + description "Initial revision."; + } + container ACL { + config false; + container Base { + description "ACL base information table"; + leaf ProcessingStatus { + type enumeration { + enum 1; + enum 2; + } + description "Processing status. 1: Processing, 2: Idle"; + } + } + container Capability { + description "ACL capability table."; + container UserAclL2 { + description "Capability parameters of Layer 2 frame rule."; + leaf L2MaxOffset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum offset from the beginning of Layer 2 frame."; + } + leaf L2MaxLen { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum length of the matching pattern of Layer 2 frame."; + } + } + container UserAclL4 { + description "Capability parameters of Layer 4 frame rule."; + leaf L4MaxOffset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum offset from the beginning of Layer 4 frame."; + } + leaf L4MaxLen { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum length of the matching pattern of Layer 4 frame."; + } + } + container UserAclIPv4 { + description "Capability parameters of IPv4 packet rule."; + leaf IPv4MaxOffset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum offset from the beginning of IPv4 packet."; + } + leaf IPv4MaxLen { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum length of the matching pattern of IPv4 packet."; + } + } + container UserAclL5 { + description "Capability parameters of Layer 5 frame rule."; + leaf L5MaxOffset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum offset from the beginning of Layer 5 frame."; + } + leaf L5MaxLen { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum length of the matching pattern of Layer 5 frame."; + } + } + container UserAclIPv6 { + description "Capability parameters of IPv6 packet rule."; + leaf IPv6MaxOffset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum offset from the beginning of IPv6 packet."; + } + leaf IPv6MaxLen { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Maximum length of the matching pattern of IPv6 packet."; + } + } + leaf AclMaxRuleNumPerGroup { + type base:Basetype_UnsignedInteger32; + description "Maximum ACL rules number per group."; + } + } + container Groups { + description "ACL groups table. + This table supports creating rows."; + list Group { + description "ACL group row."; + key "GroupType GroupID"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User-defined."; + } + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..5999"; + } + description "Group ID. IPv4: 2000~5999, IPv6: 2000~3999."; + } + leaf MatchOrder { + type enumeration { + enum 1; + enum 2; + } + description "Match order. 1: config, 2: auto. Default: config."; + } + leaf Step { + type base:Basetype_UnsignedInteger32 { + range "1..20"; + } + description "Step length, range from 1 to 20. Default: 5."; + } + leaf Name { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,62}"; + } + description "Name of the ACL group, a case-insensitive string of 1 to 63 characters."; + } + leaf Description { + type base:Basetype_Text { + length "1..127"; + } + description "Description of the ACL group, a string of 1 to 127 characters."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The rules number of the ACL group. Range from 0 to 65535."; + } + } + } + container NamedGroups { + description "ACL named groups table. + This table supports creating rows."; + list Group { + description "ACL group row."; + key "GroupType GroupCategory GroupIndex"; + leaf GroupType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "Group type. 1: IPv4, 2: IPv6, 3: MAC, 4: User-defined."; + } + leaf GroupCategory { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Group type. 0: invalid, 1: basic, 2: advanced."; + } + leaf GroupIndex { + type base:Basetype_String { + pattern "([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 5999."; + } + leaf MatchOrder { + type enumeration { + enum 1; + enum 2; + } + description "Match order. 1: config, 2: auto. Default: config."; + } + leaf Step { + type base:Basetype_UnsignedInteger32 { + range "1..20"; + } + description "Step length, range from 1 to 20. Default: 5."; + } + leaf Description { + type base:Basetype_Text { + length "1..127"; + } + description "Description of the ACL group, a string of 1 to 127 characters."; + } + leaf Name { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,62}"; + } + description "Name of the ACL group, a case-insensitive string of 1 to 63 characters."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The rules number of the ACL group. Range from 0 to 65535."; + } + leaf GroupNum { + type base:Basetype_UnsignedInteger32; + description "The number of object groups."; + } + } + } + container IPv4BasicRules { + description "Table of IPv4 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..2999"; + } + description "Group ID. Range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any IP address."; + } + container SrcIPv4 { + description "Source IP, including SrcIPv4Addr and SrcIPv4Wildcard."; + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + } + } + container IPv4NamedBasicRules { + description "Table of named IPv4 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(2[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any IP address."; + } + container SrcIPv4 { + description "Source IP, including SrcIPv4Addr and SrcIPv4Wildcard."; + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IP wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32; + description "The number of rules."; + } + } + } + container IPv6BasicRules { + description "Table of IPv6 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "2000..2999"; + } + description "Group ID. Range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6, including SrcIPv6Address and SrcIPv6Prefix."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + } + } + container IPv6NamedBasicRules { + description "Table of named IPv6 basic ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(2[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 2000 to 2999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6, including SrcIPv6Address and SrcIPv6Prefix."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32; + description "The number of rules."; + } + } + } + container IPv4AdvanceRules { + description "Table of IPv4 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "3000..3999"; + } + description "Group ID. Range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + container DSCPRange { + leaf StartDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the start DSCP of IP packet."; + } + leaf EndDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the end DSCP of IP packet."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP { + leaf ICMPType { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMP message type."; + } + leaf ICMPCode { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMP message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf EncapType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Encap Type. 1: VXLAN, 2: GRE-ENCAP, 3: IPINIP-ENCAP."; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + leaf InProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InSrcAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-source IPv4 address."; + } + container InSrcIPv4 { + leaf InSrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf InSrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf InDstAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-destination IPv4 address."; + } + container InDstIPv4 { + leaf InDstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf InDstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InEstablished { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a Inner TCP connection."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv4NamedAdvanceRules { + description "Table of named IPv4 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(3[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + container DSCPRange { + leaf StartDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the start DSCP of IP packet."; + } + leaf EndDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of the end DSCP of IP packet."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP { + leaf ICMPType { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMP message type."; + } + leaf ICMPCode { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMP message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf EncapType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Encap Type. 1: VXLAN, 2: GRE-ENCAP, 3: IPINIP-ENCAP."; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + leaf InProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InSrcAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-source IPv4 address."; + } + container InSrcIPv4 { + leaf InSrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf InSrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + leaf InDstAny { + type base:Basetype_Boolean; + description "The flag of matching any inner-destination IPv4 address."; + } + container InDstIPv4 { + leaf InDstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf InDstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InEstablished { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a Inner TCP connection."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32; + description "The number of rules."; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv6AdvanceRules { + description "Table of IPv6 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "3000..3999"; + } + description "Group ID. Range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv6 address."; + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IPv6 packet."; + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf FlowLabel { + type base:Basetype_UnsignedInteger32 { + range "0..1048575"; + } + description "The value of flow label of IPv6 packet header."; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + container SrcPort { + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP6 { + leaf ICMP6Type { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMPv6 message type."; + } + leaf ICMP6Code { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMPv6 message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf HopTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any hop type."; + } + leaf HopTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of hop type which is in the range of 0 to 255."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container IPv6NamedAdvanceRules { + description "Table of named IPv6 advance ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(3[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 3000 to 3999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv6 address."; + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source object group name"; + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv6 address."; + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination object group name"; + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IPv6 packet."; + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf FlowLabel { + type base:Basetype_UnsignedInteger32 { + range "0..1048575"; + } + description "The value of flow label of IPv6 packet header."; + } + leaf RoutingTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any routing header type."; + } + leaf RoutingTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of routing header type."; + } + container SrcPort { + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + leaf SrcPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Source port object group name"; + } + container DstPort { + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf DstPortObjectGroup { + type base:Basetype_String { + length "0..63"; + } + description "Destination port object group name"; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + container ICMP6 { + leaf ICMP6Type { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The ICMPv6 message type."; + } + leaf ICMP6Code { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "The ICMPv6 message code. 256 is invalid value."; + } + } + leaf Fragment { + type base:Basetype_Boolean; + description "The flag of matching fragmented packet. + 0: the rule applies to all fragments and non-fragments, + 1: the rule applies to only non-first fragments."; + } + leaf HopTypeAny { + type base:Basetype_Boolean; + description "The flag of matching any hop type."; + } + leaf HopTypeValue { + type base:Basetype_UnsignedInteger32 { + range "0..255"; + } + description "The value of hop type which is in the range of 0 to 255."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + leaf QoSLocalID { + type base:Basetype_UnsignedInteger32 { + range "1..4095"; + } + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Logging { + type base:Basetype_Boolean; + description "Logs matching packets."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf UserGroup { + type base:Basetype_String { + length "1..32"; + } + description "Specifies a user group for the rule, a case-insensitive string of 1 to 32 characters."; + } + leaf UserGroupAny { + type base:Basetype_Boolean; + description "Match any user group."; + } + leaf FragmentType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + } + description "first-fragment | non-frag | non-or-first-frag | any-frag"; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32; + description "The number of rules."; + } + container Ttl { + description "TTL information, including TtlOp, TtlValue1 and TtlValue2."; + leaf TtlOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Ttl operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf TtlValue1 { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "The value of start ttl value."; + } + leaf TtlValue2 { + type base:Basetype_UnsignedInteger32 { + range "1..256"; + } + description "The value of end ttl value; 256 is invalid value."; + } + } + container PktLength { + description "PktLength information, including PktLengthOp, PktLengthValue1 and PktLengthValue2."; + leaf PktLengthOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "PktLength operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf PktLengthValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of start PktLength value."; + } + leaf PktLengthValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of end PktLength value; 65536 is invalid value."; + } + } + } + } + container MACRules { + description "Table of MAC ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "4000..4999"; + } + description "Group ID. Range from 4000 to 4999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container SrcMACAddr { + leaf SrcMACAddress { + type base:Basetype_MacAddress; + } + leaf SrcMACMask { + type base:Basetype_MacAddress; + } + } + container DstMACAddr { + leaf DstMACAddress { + type base:Basetype_MacAddress; + } + leaf DstMACMask { + type base:Basetype_MacAddress; + } + } + leaf COS { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "802.1p priority."; + } + container Protocol { + description "Protocol in the Ethernet frame header."; + leaf ProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf ProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + container LSAP { + leaf LSAPType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of LSAP"; + } + leaf LSAPTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of LSAP."; + } + } + leaf EncapType { + type enumeration { + enum 1; + } + description "Encap Type. 1: VXLAN"; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + container InSrcMACAddr { + leaf InSrcMACAddress { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMACAddr { + leaf InDstMACAddress { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + container InProtocol { + description "Inner protocol in the Ethernet frame header."; + leaf InProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf InProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + } + } + container MACNamedRules { + description "Table of named MAC ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(4[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 4000 to 4999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container SrcMACAddr { + leaf SrcMACAddress { + type base:Basetype_MacAddress; + } + leaf SrcMACMask { + type base:Basetype_MacAddress; + } + } + container DstMACAddr { + leaf DstMACAddress { + type base:Basetype_MacAddress; + } + leaf DstMACMask { + type base:Basetype_MacAddress; + } + } + leaf COS { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "802.1p priority."; + } + container Protocol { + description "Protocol in the Ethernet frame header."; + leaf ProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf ProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + container LSAP { + leaf LSAPType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of LSAP"; + } + leaf LSAPTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of LSAP."; + } + } + leaf EncapType { + type enumeration { + enum 1; + } + description "Encap Type. 1: VXLAN"; + } + leaf VxlanID { + type base:Basetype_UnsignedInteger32 { + range "0..16777215"; + } + } + container InSrcMACAddr { + leaf InSrcMACAddress { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMACAddr { + leaf InDstMACAddress { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + container InProtocol { + description "Inner protocol in the Ethernet frame header."; + leaf InProtocolType { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The type of protocol in the Ethernet frame header."; + } + leaf InProtocolTypeMask { + type base:Basetype_String { + pattern "[a-fA-F0-9]{1,4}"; + } + description "The mask of protocol in the Ethernet frame header."; + } + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + leaf MatchIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "The matching index of rules when match-order of group is auto."; + } + leaf RuleNum { + type base:Basetype_UnsignedInteger32; + description "The number of rules."; + } + } + } + container UserRules { + description "Table of the user ACL rules. + This table supports creating rows."; + list Rule { + key "GroupID RuleID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "5000..5999"; + } + description "Group ID. Range from 5000 to 5999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container L2Rule { + description "Specifies that the offset is relative to the beginning of the Layer 2 frame header."; + leaf L2RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L2RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L2Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv4Rule { + description "Specifies that the offset is relative to the beginning of the IPv4 header."; + leaf IPv4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv6Rule { + description "Specifies that the offset is relative to the beginning of the IPv6 header."; + leaf IPv6RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv6RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv6Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L4Rule { + description "Specifies that the offset is relative to the beginning of the Layer 4 header."; + leaf L4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L5Rule { + description "Specifies that the offset is relative to the beginning of the Layer 5 header."; + leaf L5RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L5RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L5Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + leaf UdfFormat { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "udf packet format type. 1: INT, 2:raw-ip."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf IPv6ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf DualStackProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf EncapType { + type enumeration { + enum 5; + enum 6; + enum 7; + enum 8; + } + description "Encap Type. 5: srv6-l2vpn-be, 6: srv6-l2vpn-te, 7: srv6-l3vpn-be, 8: srv6-l3vpn-te."; + } + container SRv6 { + leaf SegmentLeft { + type base:Basetype_UnsignedInteger32; + description "Segment left."; + } + leaf SegmentList { + type base:Basetype_UnsignedInteger32; + description "Segment list."; + } + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + leaf InVlantag { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Inner Vlan Tag. 0: none, 1: single, 2: double."; + } + leaf InServiceVlan { + type base:Basetype_VlanRange; + description "Inner Service Vlan."; + } + leaf InCustomVlan { + type base:Basetype_VlanRange; + description "Inner Custom Vlan."; + } + container InSrcMAC { + leaf InSrcMAC { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMAC { + leaf InDstMAC { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + leaf InProtocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InIPv6Protocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner Ipv6 protocol type of packets, 256 indicates IP family."; + } + container InSrcAddr { + leaf InSrcAddr { + type base:Basetype_IpAddress; + } + leaf InSrcMask { + type base:Basetype_IpAddress; + } + } + container InDstAddr { + leaf InDstAddr { + type base:Basetype_IpAddress; + } + leaf InDstMask { + type base:Basetype_IpAddress; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of inner IP packet's ECN."; + } + leaf InDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of inner IP packet."; + } + leaf InPrecedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of inner IP packet's precedence."; + } + leaf InTOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of inner IP packet's TOS."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts the number of times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + } + } + container UserNamedRules { + description "Table of the named user ACL rules. + This table supports creating rows."; + list Rule { + key "GroupIndex RuleID"; + leaf GroupIndex { + type base:Basetype_String { + pattern "(5[0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's Index, range from 5000 to 5999."; + } + leaf RuleID { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule ID. Range from 0 to 65534."; + } + leaf Action { + type enumeration { + enum 1; + enum 2; + } + description "Action type. 1: deny, 2: permit."; + } + container L2Rule { + description "Specifies that the offset is relative to the beginning of the Layer 2 frame header."; + leaf L2RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L2RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L2Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv4Rule { + description "Specifies that the offset is relative to the beginning of the IPv4 header."; + leaf IPv4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container IPv6Rule { + description "Specifies that the offset is relative to the beginning of the IPv6 header."; + leaf IPv6RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf IPv6RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf IPv6Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L4Rule { + description "Specifies that the offset is relative to the beginning of the Layer 4 header."; + leaf L4RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L4RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L4Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + container L5Rule { + description "Specifies that the offset is relative to the beginning of the Layer 5 header."; + leaf L5RuleString { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern in hexadecimal format. Its length must be a multiple of two. + Range from 2 to 254."; + } + leaf L5RuleMask { + type base:Basetype_String { + pattern "([a-fA-F0-9]{2}){1,127}"; + } + description "Defines a match pattern mask in hexadecimal format. + Its length must be the same as that of the match pattern. Range from 2 to 254."; + } + leaf L5Offset { + type base:Basetype_UnsignedInteger32 { + range "0..254"; + } + description "Specifies an offset in bytes after which the match operation begins."; + } + } + leaf UdfFormat { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "udf packet format type. 1: INT, 2:raw-ip."; + } + leaf ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf IPv6ProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf DualStackProtocolType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Protocol type of packets, 256 indicates IP family."; + } + leaf EncapType { + type enumeration { + enum 5; + enum 6; + enum 7; + enum 8; + } + description "Encap Type. 5: srv6-l2vpn-be, 6: srv6-l2vpn-te, 7: srv6-l3vpn-be, 8: srv6-l3vpn-te."; + } + container SRv6 { + leaf SegmentLeft { + type base:Basetype_UnsignedInteger32; + description "Segment left."; + } + leaf SegmentList { + type base:Basetype_UnsignedInteger32; + description "Segment list."; + } + } + leaf SrcAny { + type base:Basetype_Boolean; + description "The flag of matching any source IPv4 address."; + } + container SrcIPv4 { + leaf SrcIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address."; + } + leaf SrcIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Source IPv4 address wildcard."; + } + } + container SrcIPv6 { + description "Source IPv6."; + leaf SrcIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Source IPv6 address."; + } + leaf SrcIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of source IPv6 address."; + } + } + leaf SrcMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Source micseg group Id."; + } + leaf SrcMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Source micseg agg mask length."; + } + leaf DstAny { + type base:Basetype_Boolean; + description "The flag of matching any destination IPv4 address."; + } + container DstIPv4 { + leaf DstIPv4Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address."; + } + leaf DstIPv4Wildcard { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv4Address; + } + description "Destination IPv4 address wildcard."; + } + } + container DstIPv6 { + description "Destination IPv6."; + leaf DstIPv6Addr { + type union { + type base:Basetype_EmptyString; + type base:Basetype_Ipv6Address; + } + description "Destination IPv6 address."; + } + leaf DstIPv6Prefix { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + } + description "Prefix length of destination IPv6 address."; + } + } + leaf DstMicsegGroup { + type base:Basetype_UnsignedShort { + range "0..65535"; + } + description "Destination micseg group Id."; + } + leaf DstMicsegMaskLength { + type base:Basetype_UnsignedShort { + range "1..15"; + } + description "Destination micseg agg mask length."; + } + container SrcPort { + description "Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf SrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf SrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf SrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container DstPort { + description "Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf DstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf DstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf DstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf ECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of IP packet's ECN."; + } + leaf DSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of IP packet."; + } + leaf Precedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of IP packet's precedence."; + } + leaf TOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of IP packet's TOS."; + } + leaf InVlantag { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Inner Vlan Tag. 0: none, 1: single, 2: double."; + } + leaf InServiceVlan { + type base:Basetype_VlanRange; + description "Inner Service Vlan."; + } + leaf InCustomVlan { + type base:Basetype_VlanRange; + description "Inner Custom Vlan."; + } + container InSrcMAC { + leaf InSrcMAC { + type base:Basetype_MacAddress; + } + leaf InSrcMACMask { + type base:Basetype_MacAddress; + } + } + container InDstMAC { + leaf InDstMAC { + type base:Basetype_MacAddress; + } + leaf InDstMACMask { + type base:Basetype_MacAddress; + } + } + leaf InProtocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner protocol type of packets, 256 indicates IP family."; + } + leaf InIPv6Protocol { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Inner Ipv6 protocol type of packets, 256 indicates IP family."; + } + container InSrcAddr { + leaf InSrcAddr { + type base:Basetype_IpAddress; + } + leaf InSrcMask { + type base:Basetype_IpAddress; + } + } + container InDstAddr { + leaf InDstAddr { + type base:Basetype_IpAddress; + } + leaf InDstMask { + type base:Basetype_IpAddress; + } + } + container InSrcPort { + description "Inner-Source port, including SrcPortOp, SrcPortValue1 and SrcPortValue2."; + leaf InSrcPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Source port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InSrcPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first source port."; + } + leaf InSrcPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second source port; 65536 is invalid value."; + } + } + container InDstPort { + description "Inner-Destination port, including DstPortOp, DstPortValue1 and DstPortValue2."; + leaf InDstPortOp { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "Destination port operator. 1: lt, 2: eq, 3: gt, 4: neq, 5: range."; + } + leaf InDstPortValue1 { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "The value of first destination port."; + } + leaf InDstPortValue2 { + type base:Basetype_UnsignedInteger32 { + range "0..65536"; + } + description "The value of second destination port; 65536 is invalid value."; + } + } + leaf InECN { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The value of inner IP packet's ECN."; + } + leaf InDSCP { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "The value of DSCP of inner IP packet."; + } + leaf InPrecedence { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "The value of inner IP packet's precedence."; + } + leaf InTOS { + type base:Basetype_UnsignedInteger32 { + range "0..15"; + } + description "The value of inner IP packet's TOS."; + } + leaf TimeRange { + type base:Basetype_String { + pattern "[a-zA-Z][^? +]{0,31}"; + } + description "Specifies a time range for the rule, a case-insensitive string of 1 to 32 characters. + It must start with an English letter."; + } + leaf Counting { + type base:Basetype_Boolean; + description "Counts the number of times the ACL rule has been matched."; + } + leaf Comment { + type base:Basetype_Text { + length "1..127"; + } + description "Rule comment, a case-sensitive string of 1 to 127 characters."; + } + leaf Status { + type enumeration { + enum 1; + enum 2; + } + description "Rule status. 1: active, 2: inactive."; + } + leaf Count { + type base:Basetype_Counter64; + description "The number of times the ACL rule has been matched."; + } + container TcpFlag { + leaf ACK { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP ACK flag."; + } + leaf FIN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP FIN flag."; + } + leaf PSH { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP PSH flag."; + } + leaf RST { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP RST flag."; + } + leaf SYN { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP SYN flag."; + } + leaf URG { + type base:Basetype_UnsignedInteger32 { + range "0..1"; + } + description "TCP URG flag."; + } + } + leaf Established { + type base:Basetype_Boolean; + description "The flags that indicating the established status of a TCP connection."; + } + leaf VRF { + type base:Basetype_String { + length "1..31"; + } + description "Applies the rule to packets in a VRF instance."; + } + } + } + container Intervals { + description "ACL intervals table. + This table supports creating rows."; + list Interval { + description "ACL interval row."; + key "IntervalType"; + leaf IntervalType { + type enumeration { + enum 1; + enum 2; + } + description "Interval Type. 1: logs, 2: trap."; + } + leaf IntervalValue { + type base:Basetype_UnsignedInteger32 { + range "5..1440"; + } + description "The value of Interval."; + } + } + } + container PfilterCapability { + description "Pfilter capability table."; + leaf ApplyType { + type base:Basetype_UnsignedInteger32; + description "Capability parameters of apply type"; + } + leaf ApplyDirection { + type base:Basetype_UnsignedInteger32; + description "Capability parameters of apply direction."; + } + leaf CountControl { + type base:Basetype_UnsignedInteger32; + description "Capability parameters of count control."; + } + } + container PfilterDefAction { + description "Pfilter base information table"; + leaf DefaultAction { + type enumeration { + enum 1; + enum 2; + } + description "Default Action.1:Permit,2:Deny."; + } + } + container PfilterIgnoreAction { + description "Pfilter base information table"; + leaf IgnoreAction { + type base:Basetype_Boolean; + description "Ignore permit action."; + } + } + container PfilterApply { + description "Pfilter apply table + This table supports creating rows."; + list Pfilter { + description "Pfilter apply row"; + key "AppObjType AppObjIndex AppDirection AppAclType AppAclGroup"; + leaf AppObjType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Object type. 1: interface, 2: vlan,3: global."; + } + leaf AppObjIndex { + type base:Basetype_NameAndIndexUnion; + description "Object Index."; + } + leaf AppDirection { + type enumeration { + enum 1; + enum 2; + } + description "Apply Direction.1:inbound,2:outbound."; + } + leaf AppAclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "ACL Group type. 1: IPv4, 2: IPv6, 3:MAC, 4:User-defined, 5: default."; + } + leaf AppAclGroup { + type base:Basetype_String { + pattern "(0)|([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index.If it's index, range from 2000 to 5999, Default: 0."; + } + leaf HardCount { + type enumeration { + enum 1; + enum 2; + } + description "Hardware count flag.1:true,2:false.Default:false"; + } + leaf InnerEncap { + type enumeration { + enum 0; + enum 1; + } + description "Encap Type.0:none,1:vxlan."; + } + leaf ShareMode { + type base:Basetype_Boolean; + description "Enable share mode flag."; + } + leaf AppSequence { + type base:Basetype_UnsignedInteger32 { + range "1..4294967295"; + } + description "The configure sequence of packet filter application."; + } + leaf IfName { + type base:Basetype_String { + length "1..47"; + } + description "Interface name"; + } + } + } + container PfilterGroupRunInfo { + description "Pfilter Group RunInfo table"; + list GroupRunInfo { + description "Pfilter group row"; + key "AppObjType AppObjIndex AppDirection AppAclType AppAclGroup"; + leaf AppObjType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Object type. 1: interface, 2: vlan,3: global."; + } + leaf AppObjIndex { + type base:Basetype_NameAndIndexUnion; + description "Object Index."; + } + leaf AppDirection { + type enumeration { + enum 1; + enum 2; + } + description "Apply Direction.1:inbound,2:outbound."; + } + leaf AppAclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + } + description "ACL Group type. 1: IPv4, 2: IPv6, 3:MAC, 4:user, 5:Default."; + } + leaf AppAclGroup { + type base:Basetype_String { + pattern "([123])|([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name or Index. If it's index, range from 2000 to 5999, Default 1: MAC, 2: IPv4, 3: IPv6."; + } + leaf AclGroupStatus { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "The status of ACL group applied.1:success,2:failed,3:partialSuccess"; + } + leaf AclGroupCountStatus { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "The status of enabling hardware count. 1:success, 2:failed, 3:partialSuccess"; + } + leaf AclGroupPermitPkts { + type base:Basetype_Counter64; + description "The number of packets permitted."; + } + leaf AclGroupPermitBytes { + type base:Basetype_Counter64; + description "The number of bytes permitted."; + } + leaf AclGroupDenyPkts { + type base:Basetype_Counter64; + description "The number of packets denied."; + } + leaf AclGroupDenyBytes { + type base:Basetype_Counter64; + description "The number of bytes denied."; + } + leaf IfName { + type base:Basetype_String { + length "1..47"; + } + description "Interface name"; + } + } + } + container PfilterRuleRunInfo { + description "Pfilter Rule RunInfo table"; + list RuleRunInfo { + description "Pfilter rule row"; + key "AppObjType AppObjIndex AppDirection AppAclType AppAclGroup AppAclRuleIndex"; + leaf AppObjType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Object type. 1: interface, 2: vlan,3: global."; + } + leaf AppObjIndex { + type base:Basetype_NameAndIndexUnion; + description "Object Index."; + } + leaf AppDirection { + type enumeration { + enum 1; + enum 2; + } + description "Apply Direction.1:inbound,2:outbound."; + } + leaf AppAclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "ACL Group type. 1: IPv4, 2: IPv6, 3:MAC, 4:user."; + } + leaf AppAclGroup { + type base:Basetype_String { + pattern "([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name of Index. If it's index, range from 2000 to 5999"; + } + leaf AppAclRuleIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule index.range from 0 to 65534."; + } + leaf AclRuleStatus { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "The status of rule application.1:success,2:failed,3:partialSuccess"; + } + leaf AclRuleCountStatus { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "The status of enabling rule's hardware count.1:success,2:failed,3:partialSuccess"; + } + leaf AclRuleMatchPkts { + type base:Basetype_Counter64; + description "The number of packets matched"; + } + leaf AclRuleMatchBytes { + type base:Basetype_Counter64; + description "The number of bytes matched"; + } + leaf IfName { + type base:Basetype_String { + length "1..47"; + } + description "Interface name"; + } + } + } + container PfilterStatisticSum { + description "Pfilter sum table"; + list StatisticSum { + description "Pfilter sum row"; + key "Direction AclType AclGroup AclRuleIndex"; + leaf Direction { + type enumeration { + enum 1; + enum 2; + } + description "Apply Direction.1:inbound,2:outbound."; + } + leaf AclType { + type enumeration { + enum 1; + enum 2; + enum 3; + enum 4; + } + description "ACL Group type. 1: IPv4, 2: IPv6, 3:MAC, 4:user."; + } + leaf AclGroup { + type base:Basetype_String { + pattern "([2345][0-9]{3})|([a-zA-Z][^? +]{0,62})"; + } + description "Acl Group Name or Index. If it's index, range from 2000 to 5999"; + } + leaf AclRuleIndex { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Rule index.range from 0 to 65534."; + } + leaf MatchPackets { + type base:Basetype_Counter64; + description "The sum number of packets matched the ACL rule"; + } + leaf MatchBytes { + type base:Basetype_Counter64; + description "The sum number of bytes matched the ACL rule."; + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-ifmgr-action@2025-02-13.yang b/exp/yangcli/h3c-yang/H3C-ifmgr-action@2025-02-13.yang new file mode 100644 index 0000000..a524806 --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-ifmgr-action@2025-02-13.yang @@ -0,0 +1,386 @@ +module H3C-ifmgr-action { + yang-version 1.1; + namespace "http://www.h3c.com/netconf/action:1.0-Ifmgr"; + prefix "ifmgr-action"; + import comware-basetype { + prefix "base"; + } + + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for ifmgr action."; + revision 2025-02-13 { + description "Modify ifmgr/Interfaces/Interface/UsingType add new type."; + reference "private"; + } + revision 2024-09-11 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2024-08-08 { + description "Add new node ifmgr/Interfaces/Interface/UsingType."; + } + revision 2024-07-18 { + description "Add new node Ifmgr/Interfaces/Interface/ReduceRestore."; + } + revision 2020-05-09 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-04-07 { + description "Initial revision."; + } + container Ifmgr { + config false; + action Interfaces { + description "This table contains interface action information."; + input { + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + mandatory true; + description "Interface index as table index"; + } + leaf Loopback { + type enumeration { + enum 1; + enum 2; + } + mandatory true; + description "Interface loopback testing as follows: + 1 Internal + 2 External"; + } + leaf Default { + type empty; + mandatory true; + description "Restore default settings."; + } + leaf Clear { + type empty; + mandatory true; + description "Clears interface statistics."; + } + leaf ReduceRestore { + type empty; + mandatory true; + description "Restore interface default speed."; + } + leaf UsingType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + enum 6; + enum 7; + enum 8; + enum 9; + enum 10; + enum 11; + enum 12; + enum 13; + enum 14; + enum 15; + enum 16; + enum 17; + enum 18; + enum 19; + enum 20; + enum 21; + enum 22; + enum 23; + enum 24; + enum 25; + enum 26; + enum 27; + enum 28; + enum 29; + enum 30; + enum 37; + enum 38; + enum 39; + enum 40; + enum 41; + enum 42; + enum 43; + enum 44; + enum 45; + enum 46; + enum 47; + enum 48; + enum 49; + enum 50; + enum 51; + enum 52; + enum 53; + enum 54; + enum 55; + enum 56; + enum 57; + enum 58; + enum 59; + enum 60 { + description "400GETOXGE4channel"; + } + enum 61 { + description "XGETO400GE"; + } + } + description "Split or combine interfaces. + Each enumeration represents a switching mode: + 0 UNKNOWN + 1 XGETOFGE + 2 XGETOHGE + 3 FGETOXGE + 4 HGETOXGE + 5 FGETOHGE + 6 HGETOFGE + 7 FGETOTGE + 8 TGETOFGE + 9 HGETOWGE + 10 WGETOHGE + 11 FC16GTO32G + 12 FC32GTO16G + 13 400GETOHGE + 14 HGETO400GE + 15 400GETO50GE + 16 50GETO400GE + 17 400GETO200GE + 18 200GETO400GE + 19 200GETOHGE + 20 HGETO200GE + 21 200GETO25GE + 22 200GETO50GE + 23 400GETO25GE + 24 25GETO200GE + 25 50GETO200GE + 26 25GETO400GE + 27 HGETO50GE + 28 50GETOHGE + 29 XGETO200GE + 30 200GETOXGE + 37 400GETO2HGEchannel + 38 800GETOHGE1channel + 39 800GETO200GE1channel + 40 800GETO400GE1channel + 41 400GETOHGE1channel + 42 400GETO200GE1channel + 43 200GETOHGE1channel + 44 800GETO400GE + 45 800GETO400GE2channel + 46 800GETO200GE2channel + 47 400GETO200GE2channel + 48 400GETO100GE2channel + 49 200GETO100GE2channel + 50 200GETOFGE + 51 200GETOFGE1channel + 52 HGETOXGE2channel + 53 HGETO25GE2channel + 54 HGETO800GE + 55 200GETO800GE + 56 400GETO800GE + 57 40GETO200GE + 58 800GETOHGE + 59 800GETO200GE + 60 400GETOXGE4channel + 61 XGETO400GE"; + } + } + } + } + action ClearAllIfStatistics { + description "This table is used to clear statistics on all interfaces."; + input { + leaf Clear { + type empty; + mandatory true; + description "Clears statistics on all interfaces."; + } + } + } + action SubInterfaces { + description "This table is used to create or delete sub-interfaces."; + input { + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + mandatory true; + description "Interface index as table index."; + } + leaf SubNum { + type base:Basetype_UnsignedInteger32; + mandatory true; + description "Sub-interface number."; + } + leaf Remove { + type empty; + mandatory true; + description "Delete specified sub-interface."; + } + } + } + } + action LogicInterfaces { + description "This table is used to create or delete logic interfaces."; + input { + list Interface { + key "IfTypeExt Number"; + leaf IfTypeExt { + type base:Basetype_UnsignedInteger32; + mandatory true; + description "the interface type"; + } + leaf Number { + type base:Basetype_UnsignedInteger32; + mandatory true; + description "Number of the logic interface."; + } + leaf Remove { + type empty; + mandatory true; + description "Delete specified logic interface."; + } + } + } + } + action VirtualCableTest { + description "VirtualCableTest table"; + input { + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + mandatory true; + description "Interface index as table index."; + } + } + } + } + action EthFlexESwitch { + description "This table is used to switch port type of interfaces between Eth and flexE"; + input { + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + mandatory true; + description "Full name of an interface."; + } + leaf PortType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + mandatory true; + description "the switched port type of an Interface as follows: + 1 switch to Eth type + 2 switch to flexE type + 3 switch to flexEfg type"; + } + } + } + } + action ClearPacketDropStatistics { + description "This table is used to clear dropped packets of specified interface."; + input { + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + mandatory true; + description "Interface index as table index."; + } + leaf Clear { + type empty; + mandatory true; + description "Clear dropped packets of specified interface."; + } + } + } + } + action ShutdownAllPhyIf { + description "This table is used to shut all physical interfaces down."; + input { + leaf Shutdown { + type base:Basetype_Boolean; + description "Shut down all physical interfaces."; + } + } + } + action NakStatistics { + description "This table contains statistics for NAK packets from the interface."; + input { + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + mandatory true; + description "Full name of an interface."; + } + leaf Clear { + type empty; + mandatory true; + description "Clear the NAK packet statistics of the interface."; + } + } + } + } + action CnpStatistics { + description "This table contains statistics for CNP packet from the interface."; + input { + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + mandatory true; + description "Full name of an interface."; + } + leaf Clear { + type empty; + mandatory true; + description "Clear the CNP packet statistics of the interface."; + } + } + } + } + action ClearAllIfNakStatistics { + description "This table is used to clear NAK packet statistics on all interfaces."; + input { + leaf Clear { + type empty; + mandatory true; + description "Clear NAK packet statistics on all interfaces."; + } + leaf ClearIfType { + type base:Basetype_UnsignedInteger32{ + range "0..256"; + } + mandatory true; + description "Interface type. Numerical value must be in range(0..256)."; + } + } + } + action ClearAllIfCnpStatistics { + description "This table is used to clear CNP packet statistics on all interfaces."; + input { + leaf Clear { + type empty; + mandatory true; + description "Clears CNP packet statistics on all interfaces."; + } + leaf ClearIfType { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + mandatory true; + description "Interface type. Numerical value must be in range(0..256)."; + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-ifmgr-config@2025-02-13.yang b/exp/yangcli/h3c-yang/H3C-ifmgr-config@2025-02-13.yang new file mode 100644 index 0000000..e9cfe15 --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-ifmgr-config@2025-02-13.yang @@ -0,0 +1,1001 @@ +module H3C-ifmgr-config { + namespace "http://www.h3c.com/netconf/config:1.0-Ifmgr"; + prefix "ifmgr-config"; + import comware-basetype { + prefix "base"; + } + import comware-extension { + prefix "ext"; + } + + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for ifmgr config."; + revision 2025-02-13 { + description "Modify ifmgr/Interfaces/Interface/UsingType add new type."; + reference "private"; + } + revision 2024-12-27 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2024-10-24 { + description "Add GlobalConfig table."; + reference "private"; + } + revision 2024-08-08 { + description "Add new node ifmgr/Interfaces/Interface/UsingType."; + } + revision 2024-07-18 { + description "Add new enumuration to Ifmgr/Interfaces/Interface/UsingType. Add new node Ifmgr/Interfaces/Interface/AutoReduceEnable."; + } + revision 2024-06-26 { + description "Synchronize the modification of the LbnGroupGlobal to the YANG file."; + } + revision 2024-04-16 { + description "Add IfFecData LbnGroupGlobal LbnGroups"; + } + revision 2022-02-17 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-05-09 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-04-07 { + description "Initial revision."; + } + container Ifmgr { + container TrafficStatistics { + description "TrafficStatistics sub module"; + container Interval { + description "Interval table"; + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..300"; + } + description "Sampling interval of all interface, in seconds, in step of 5."; + } + } + } + container StormConstrain { + description "StormConstrain sub module"; + container Interfaces { + description "This table contains interface storm constrain information."; + list Interface { + description "The Name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + leaf CtlMode { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Storm constrain protective action + Enumeration: + 0(N/A) + 1(Block) + 2(Shutdown)"; + } + leaf Trap { + type base:Basetype_Boolean; + description "Event trap switch"; + } + leaf Log { + type base:Basetype_Boolean; + description "Event log switch"; + } + container Broadcast { + description "Broadcast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Broadcast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Broadcast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Broadcast threshold unit:1(pps),2(ratio),3(kbps)"; + } + } + container Multicast { + description "Multicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Multicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Multicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Multicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + } + container UnknownUnicast { + description "Unknown-unicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Unknown-unicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Unknown-unicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Unknown-unicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + } + container KnownUnicast { + description "Known-unicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Known-unicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Known-unicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Known-unicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + } + } + } + container Interval { + description "Interval Table"; + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "1..300"; + } + description "Traffic statistics collection interval for storm constrain, in seconds."; + } + } + } + container PortIsolation { + description "Port isolate sub module"; + container Groups { + description "Port isolate groups table + This table supports creating rows."; + list Group { + description "The name of Row"; + key "IsolatedGroupID"; + leaf IsolatedGroupID { + type base:Basetype_UnsignedInteger32; + description "Isolation group ID"; + } + } + } + container Interfaces { + description "Interfaces table"; + list Interface { + description "The name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index."; + } + leaf IsolatedGroupID { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Port isolation group ID of an interface."; + } + } + } + } + container Interfaces { + description "This table contains basic interface information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Description { + type base:Basetype_Text { + length "0..255"; + } + description "Interface description.String length constraints must be in range(0..255)."; + } + leaf AdminStatus { + type base:Basetype_Integer32 { + range "1..2"; + } + description "Interface administration status,as follows: + 1 Admin Up + 2 Admin Down"; + } + leaf ConfigSpeed { + type base:Basetype_UnsignedInteger64 { + range "0..1048576"; + } + description "Configured speed of an interface.Each bit represents a speed as follows: + 1:Auto + 2:10Mbps + 4:100Mbps + 8:155Mbps + 16:622Mbps + 32:1Gbps + 64:2Gbps + 128:2.5Gbps + 256:4Gbps + 512:8Gbps + 1024:10Gbps + 2048:16Gbps + 4096:20Gbps + 8192:40Gbps + 16384:100Gbps + 32768:5Gbps + 65536:25Gbps + 131072:32Gbps + 262144:50Gbps + 524288:200Gbps + 1048576:400Gbps)"; + } + leaf ConfigDuplex { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "This table contains storm constrain traffic collection interval information.."; + } + leaf PortLayer { + type enumeration { + enum 1; + enum 2; + } + description "Port layer of an interface as follows: + 1 Layer 2 + 2 Layer 3"; + } + leaf LinkType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "VLAN type of an interface as follows: + 1 ACCESS + 2 TRUNK + 3 HYBRID"; + } + leaf PVID { + type base:Basetype_UnsignedInteger32 { + range "1..4094"; + } + description "Port VLAN identification (PVID) of an interface."; + } + leaf MAC { + type base:Basetype_MacAddress; + } + leaf Loopback { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Loopback test as follows: + 0 No loopback + 1 Internal + 2 External"; + } + leaf MDI { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "MDI mode of an interface as follows: + 1 MDI-II (straight-through cable) + 2 MDI-X (crossover cable) + 3 MDI-AUTO (auto-sensing)"; + } + leaf ConfigMTU { + type base:Basetype_UnsignedInteger32; + description "Configured MTU of an interface."; + } + leaf ConfigBandwidth { + type base:Basetype_UnsignedInteger64 { + range "1..400000000"; + } + description "Configured bandwidth of an interface(units: kbit/s)."; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..300"; + } + description "Sampling interval of an interface"; + } + leaf ForceUP { + type base:Basetype_Boolean; + description "Forcibly bring up an interface."; + } + container LinkDelay { + description "Physical state change suppression configuration of an interface."; + leaf UpTime { + type base:Basetype_UnsignedInteger32; + description "Configured link-up event suppression interval of an interface(units: millisecond)."; + } + leaf DownTime { + type base:Basetype_UnsignedInteger32; + description "Configured link-down event suppression interval of an interface(units: millisecond)."; + } + } + leaf KeepAlive { + type base:Basetype_UnsignedInteger32 { + range "0..32767"; + } + description "Set the hold timer of an interface"; + } + leaf KeepAliveRetry { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "Configured number of attempts for transmitting a keepalive message"; + } + leaf TrafficStatisticsEnable { + type base:Basetype_EnableState; + description "TrafficStatistics Status of the port: + enable + disable"; + } + leaf SubIfRateStatisticsEnable { + type base:Basetype_EnableState; + description "Enable rate statistics collection for the subinterfaces of an Ethernet interface. + enable + disable"; + } + container ServiceSlot { + description "Primary traffic processing slot ID"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "ID of the IRF member device where the entity resides."; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Slot ID of the entity"; + } + leaf Cpu { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "CPU ID"; + } + } + container ServiceStandbySlot { + description "Backup traffic processing slot ID"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "ID of the IRF member device where the entity resides"; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Slot ID of the entity"; + } + leaf Cpu { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "CPU ID"; + } + } + leaf Interframe { + type base:Basetype_Boolean; + description "Include inter-frame gaps in interface statistics."; + } + leaf AutoReduceEnable { + type base:Basetype_EnableState; + description "Enable interface automatic speed reduction function: + enable + disable"; + } + leaf UsingType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + enum 6; + enum 7; + enum 8; + enum 9; + enum 10; + enum 11; + enum 12; + enum 13; + enum 14; + enum 15; + enum 16; + enum 17; + enum 18; + enum 19; + enum 20; + enum 21; + enum 22; + enum 23; + enum 24; + enum 25; + enum 26; + enum 27; + enum 28; + enum 29; + enum 30; + enum 37; + enum 38; + enum 39; + enum 40; + enum 41; + enum 42; + enum 43; + enum 44; + enum 45; + enum 46; + enum 47; + enum 48; + enum 49; + enum 50; + enum 51; + enum 52; + enum 53; + enum 54; + enum 55; + enum 56; + enum 57; + enum 58; + enum 59; + enum 60 { + description "400GETOXGE4channel"; + } + enum 61 { + description "XGETO400GE"; + } + } + description "Split or combine interfaces. + Each enumeration represents a switching mode: + 0 UNKNOWN + 1 XGETOFGE + 2 XGETOHGE + 3 FGETOXGE + 4 HGETOXGE + 5 FGETOHGE + 6 HGETOFGE + 7 FGETOTGE + 8 TGETOFGE + 9 HGETOWGE + 10 WGETOHGE + 11 FC16GTO32G + 12 FC32GTO16G + 13 400GETOHGE + 14 HGETO400GE + 15 400GETO50GE + 16 50GETO400GE + 17 400GETO200GE + 18 200GETO400GE + 19 200GETOHGE + 20 HGETO200GE + 21 200GETO25GE + 22 200GETO50GE + 23 400GETO25GE + 24 25GETO200GE + 25 50GETO200GE + 26 25GETO400GE + 27 HGETO50GE + 28 50GETOHGE + 29 XGETO200GE + 30 200GETOXGE + 37 400GETO2HGEchannel + 38 800GETOHGE1channel + 39 800GETO200GE1channel + 40 800GETO400GE1channel + 41 400GETOHGE1channel + 42 400GETO200GE1channel + 43 200GETOHGE1channel + 44 800GETO400GE + 45 800GETO400GE2channel + 46 800GETO200GE2channel + 47 400GETO200GE2channel + 48 400GETO100GE2channel + 49 200GETO100GE2channel + 50 200GETOFGE + 51 200GETOFGE1channel + 52 HGETOXGE2channel + 53 HGETO25GE2channel + 54 HGETO800GE + 55 200GETO800GE + 56 400GETO800GE + 57 40GETO200GE + 58 800GETOHGE + 59 800GETO200GE + 60 400GETOXGE4channel + 61 XGETO400GE"; + } + } + } + container EthInterfaces { + description "EthInterfaces Table"; + list Interface { + description "The name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + leaf Combo { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Combo mode of an interface(1(fiber mode); 2(copper mode); 3(auto mode))"; + } + leaf FlowControl { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Flow control information of an interface + 1(Enable flow control) + 2(Disable) + 3(Only enable flow control packet receiving)"; + } + leaf AutoPowerDown { + type base:Basetype_Boolean; + description "Port auto power down"; + } + leaf Jumboframe { + type base:Basetype_UnsignedInteger32; + description "Jumbo frame information of an interface"; + } + container BroadcastSuppression { + description "Broadcast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Configured broadcast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Broadcast suppression unit:1(ratio),2(pps),3(kbps)"; + } + } + container MulticastSuppression { + description "Multicast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Configured multicast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Multicast suppression unit:1(ratio),2(pps),3(kbps)"; + } + leaf Flag { + type enumeration { + enum 1; + enum 2; + } + description "Multicast suppression flag:1(all),2(unknown)"; + } + } + container UnknownUnicastSuppression { + description "UnknownUnicast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Config unknownUnicast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "UnknownUnicast suppression unit:1(ratio),2(pps),3(kbps)"; + } + } + leaf BPDUDrop { + type base:Basetype_Boolean; + description "Whether any type of IEEE BPDUs is drop on the port."; + } + leaf EEE { + type base:Basetype_Boolean; + description "Whether energy efficient ethernet is enable on the port."; + } + leaf ConnectMode { + type enumeration { + enum 1; + enum 2; + } + description "Port connection mode of an interface. + Enumeration: + 1(Normal connection mode) + 2(Extend connection mode)"; + } + container LinkFlap { + description "Link flapping information of an interface"; + leaf Mode { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Interface operation status as follows: + 0: noconfig + 1: enable + 2: disable"; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..86400"; + } + description "Link flapping detection interval"; + } + leaf Threshold { + type base:Basetype_UnsignedInteger32 { + range "2..1200"; + } + description "Maximum link flapping times in detection interval"; + } + } + } + } + container NewSubInterfaces { + description "This table is used to create or delete sub-interfaces. + This table supports creating rows."; + list Interface { + key "IfIndex SubNum"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf SubNum { + type base:Basetype_UnsignedInteger32; + description "Sub-interface number."; + } + } + } + container ReserveVlanInterface { + description "This table contains the reservation of VLAN interface resources."; + list VlanInterface { + key "Type"; + leaf Type { + type enumeration { + enum 1; + enum 2; + } + description "The reservation type: + 1 Global + 2 Local"; + } + leaf VlanList { + type base:Basetype_VlanRange; + description "List of vlan IDs which relative vlan interface is reserved."; + ext:support-incremental "true"; + } + } + } + container ShutdownInterval { + description "This table contains shutdown recover interval."; + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "0..300"; + } + description "Recover interval for interface, in seconds."; + } + } + container CellularChannel { + list Interface { + key "IfIndex CreateMode ChannelNum"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + } + leaf CreateMode { + type enumeration { + enum 1; + enum 2; + } + } + leaf ChannelNum { + type base:Basetype_UnsignedInteger32; + } + } + } + container LinkFlap { + description "This table is used to enable link flapping protection on all physical interfaces."; + leaf Enable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf Batch { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..86400"; + } + description "Link flapping detection interval"; + } + leaf Threshold { + type base:Basetype_UnsignedInteger32 { + range "2..1200"; + } + description "Maximum link flapping times in detection interval"; + } + } + container ShutdownAllPhyIf { + description "This table is used to shut all physical interfaces down."; + leaf Shutdown { + type base:Basetype_Boolean; + description "Shut down all physical interfaces."; + } + } + container FlexeInstances { + description "This table is used to create or delete FlexeInstances."; + list FlexeInstance { + key "Chassis Slot Subslot"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "ID of the member where the entity resides."; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Slot ID of the entity."; + } + leaf Subslot { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Subslot ID of the entity."; + } + leaf ConfigMode { + type enumeration { + enum 1; + enum 2; + } + description "Bandwidth configurtion mode: + 1 Bandwidth + 2 TimeSlot"; + } + container FlexeGroups { + description "This table contains the config information of Flexe group interfaces."; + list FlexeGroup { + description "List of FlexeGroup for Flexe group interfaces"; + key "GroupID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "1..1048573"; + } + description "Group ID"; + } + container BindPhyInterfaces { + description "This table contains the config information of FlexE Physical interfaces"; + list BindPhyInterface { + key "PhyIfIndex"; + leaf PhyIfIndex { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Phyisycal Interface index"; + } + leaf PhyNo { + type base:Basetype_UnsignedInteger32 { + range "1..254"; + } + description "PHY number for the FlexE Phyisycal Interface"; + } + } + } + container Clients { + description "This table contains the config information of FlexE client"; + list Client { + description "List of Client for FlexE client"; + key "ClientID"; + leaf ClientID { + type base:Basetype_UnsignedInteger32 { + range "1..65534"; + } + } + leaf Bandwidth { + type base:Basetype_UnsignedInteger32 { + range "5..4194303"; + } + } + container TimeSlots { + description "This table contains the config information of timeslots"; + list TimeSlot { + key "PhyIfIndex"; + leaf PhyIfIndex { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Phyisycal Interface index"; + } + leaf TimeSlotList { + type base:Basetype_Text { + length "1..512"; + } + } + } + } + } + } + } + } + } + } + + container LbnGroupGlobal { + description "This table is used to enable loadbalance ecmp lbn-group and loadbalance link-aggregation lbn-group."; + leaf EcmpEnable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf LaggEnable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf EcmpMode { + type string; + } + } + container LbnGroups { + description "This table contains information about lbngroup and its members."; + list LbnGroup { + key "GroupName"; + leaf GroupName { + type base:Basetype_String { + length "1..31"; + } + description "Full name of an lbngroup."; + } + container GroupMembers { + description "This table contains information about lbngroup members."; + list GroupMember { + description "List of GroupMember for LbnGroup"; + key "InterfaceName"; + leaf InterfaceName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf MemberIndex { + type base:Basetype_UnsignedInteger32; + description "Index of an groupmember."; + } + } + } + } + } + container GlobalConfig { + description "This table contains the global configuration of the Ifmgr table."; + leaf SubIfUpDownTrapLog { + type base:Basetype_EnableState; + description "Trap and log enable State of subinterfaces: + enable + disable"; + } + } + container NakStatistics { + description "This table contains statistics for NAK packets from the interface."; + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Enable { + type base:Basetype_EnableState; + description "Enable interface NAK packet statistics function: + enable + disable"; + } + } + } + container CnpStatistics { + description "This table contains statistics for CNP packet from the interface."; + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Enable { + type base:Basetype_EnableState; + description "Enable interface CNP packet statistics function: + enable + disable"; + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-ifmgr-data@2025-02-13.yang b/exp/yangcli/h3c-yang/H3C-ifmgr-data@2025-02-13.yang new file mode 100644 index 0000000..ea13cae --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-ifmgr-data@2025-02-13.yang @@ -0,0 +1,2356 @@ +module H3C-ifmgr-data { + namespace "http://www.h3c.com/netconf/data:1.0-Ifmgr"; + prefix "ifmgr-data"; + import comware-basetype { + prefix "base"; + } + import comware-extension { + prefix "ext"; + } + + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for ifmgr data."; + revision 2025-02-13 { + description "Modify ifmgr/Interfaces/Interface/UsingType add new type."; + reference "private"; + } + revision 2024-12-27 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2024-10-24 { + description "Add GlobalConfig table."; + reference "private"; + } + revision 2024-08-08 { + description "Add new node ifmgr/Interfaces/Interface/UsingType and InterfaceCapabilities/PortUsing."; + } + revision 2024-07-18 { + description "Add new node Ifmgr/Interfaces/Interface/AutoReduceEnable."; + } + revision 2024-06-26 { + description "Synchronize the modification of the LbnGroupGlobal to the YANG file."; + } + revision 2024-04-16 { + description "Add IfFecData LbnGroupGlobal LbnGroups"; + } + revision 2022-02-17 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-05-09 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-04-07 { + description "Initial revision."; + } + container Ifmgr { + config false; + container TrafficStatistics { + config false; + description "Local time when the statistics on an interface were cleared most recently."; + container Interfaces { + description "This table contains basic interface information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Name { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Interval { + type base:Basetype_UnsignedInteger32; + description "Sampling interval of all interfaces, in seconds."; + } + leaf InPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound packets during a specific period."; + } + leaf OutPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound packets during a specific period."; + } + leaf InOctets { + type base:Basetype_UnsignedInteger64; + description "Number of inbound bytes during a specific period."; + } + leaf OutOctets { + type base:Basetype_UnsignedInteger64; + description "Number of outbound bytes during a specific period."; + } + leaf InBits { + type base:Basetype_UnsignedInteger64; + description "Number of inbound bits during a specific period."; + } + leaf OutBits { + type base:Basetype_UnsignedInteger64; + description "Number of outbound bits during a specific period."; + } + } + } + container Interval { + description "This table contains traffic statistics interval information."; + leaf Configurable { + type base:Basetype_Boolean; + description "Whether the sampling interval for all interface can be configured."; + } + leaf Interval { + type base:Basetype_UnsignedInteger32; + description "Sampling interval of all interface(units: second)"; + } + } + } + container StormConstrain { + config false; + description "Storm Constrain sub module"; + container Interfaces { + description "This table contains interface storm constrain information."; + list Interface { + description "The Name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + leaf CtlMode { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Storm constrain protective action + Enumeration: + 0(N/A) + 1(Block) + 2(Shutdown)"; + } + leaf Trap { + type base:Basetype_Boolean; + description "Event trap switch"; + } + leaf Log { + type base:Basetype_Boolean; + description "Event log switch"; + } + container Broadcast { + description "Broadcast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Broadcast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Broadcast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Broadcast threshold unit:1(pps),2(ratio),3(kbps)"; + } + leaf Forward { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Broadcast traffic forwarding status + Enumeration: + 0(Forwarding) + 1(Block) + 2(Shutdown)"; + } + leaf SwitchNum { + type base:Basetype_UnsignedInteger32; + description "Number of broadcast traffic forwarding state changes"; + } + } + container Multicast { + description "Multicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Multicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Multicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Multicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + leaf Forward { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Multicast traffic forwarding status + Enumeration: + 0(Forwarding) + 1(Block) + 2(Shutdown)"; + } + leaf SwitchNum { + type base:Basetype_UnsignedInteger32; + description "Number of multicast traffic forwarding state changes"; + } + } + container UnknownUnicast { + description "Unknown-unicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Unknown-unicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Unknown-unicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Unknown-unicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + leaf Forward { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Unknown-unicast traffic forwarding status + Enumeration: + 0(Forwarding) + 1(Block) + 2(Shutdown)"; + } + leaf SwitchNum { + type base:Basetype_UnsignedInteger32; + description "Number of Unknown-unicast traffic forwarding state changes"; + } + } + container KnownUnicast { + description "Known-unicast storm constrain information of an interface"; + leaf Upper { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Known-unicast upper threshold value"; + } + leaf Lower { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Known-unicast lower threshold value"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Known-unicast threshold unit:1(pps),2(ratio),3(kbps)"; + } + leaf Forward { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Known-unicast traffic forwarding status + Enumeration: + 0(Forwarding) + 1(Block) + 2(Shutdown)"; + } + leaf SwitchNum { + type base:Basetype_UnsignedInteger32; + description "Number of Known-unicast traffic forwarding state changes"; + } + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + container Interval { + description "Interval table"; + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "1..300"; + } + description "Traffic statistics collection interval for storm constrain on all interface, in seconds."; + } + } + } + container PortIsolation { + config false; + description "Port isolate sub module"; + container Groups { + description "Port isolate groups table + This table supports creating rows."; + list Group { + description "The name of Row"; + key "IsolatedGroupID"; + leaf IsolatedGroupID { + type base:Basetype_UnsignedInteger32; + description "Isolation group ID"; + } + leaf InterfaceList { + type base:Basetype_IfIndexRange; + description "Interface IfIndex list of an isolation group ID."; + } + } + } + container Interfaces { + description "Interfaces table"; + list Interface { + description "The name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index."; + } + leaf IsolatedGroupID { + type base:Basetype_UnsignedInteger32 { + range "1..max"; + } + description "Port isolation group ID of an interface."; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + container Capabilities { + description "The capability of port-isolate"; + leaf MaxGroupNum { + type base:Basetype_UnsignedInteger32; + description "The maximum port isolation group number."; + } + } + } + container DataBuffer { + config false; + description "Data Buffer sub module"; + container IfBuffer { + description "This table contains the buffer of interface."; + list Interface { + description "Row name"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + leaf FreeBuf { + type base:Basetype_UnsignedInteger32; + description "The number of packet buffers available for the interface."; + } + leaf InitBuf { + type base:Basetype_UnsignedInteger32; + description "The number of packet buffers allocated when the interface was created."; + } + leaf MinBuf { + type base:Basetype_UnsignedInteger32; + description "The smallest number of packet buffers available for the interface."; + } + leaf MissPkts { + type base:Basetype_UnsignedInteger64; + description "Broadcast storm constrain information of an interface"; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + } + container DevicePortInfo { + config false; + description "Physic interface location information."; + container Interfaces { + description "This table contains device port information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Port { + type base:Basetype_UnsignedInteger32; + description "Serial number of physic interfaces."; + } + leaf ModuleID { + type base:Basetype_UnsignedInteger32; + description "Module ID of physic interfaces."; + } + } + } + } + container Interfaces { + description "This table contains basic interface information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Name { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf AbbreviatedName { + type base:Basetype_Text { + length "0..47"; + } + description "Abbreviated name of an interface. String length constraints must be in range(0..47)"; + } + leaf PortIndex { + type base:Basetype_UnsignedShort; + description "Port index."; + } + leaf ifTypeExt { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Interface extension type. Numerical value must be in range(0..256).)"; + } + leaf ifType { + type base:Basetype_UnsignedInteger32; + description "Interface type, according to rfc 2233 MIB"; + } + leaf Description { + type base:Basetype_Text { + length "0..255"; + } + description "Interface description.String length constraints must be in range(0..255)."; + } + leaf AdminStatus { + type base:Basetype_Integer32 { + range "1..2"; + } + description "Interface administration status,as follows: + 1 Admin Up + 2 Admin Down"; + } + leaf OperStatus { + type base:Basetype_UnsignedInteger32 { + range "1..7"; + } + description "Interface operation status as follows: + 1: up + 2: down + 3: testing + 4: unknown + 5: dormant + 6: notPresent + 7: lowerLayerDown"; + } + leaf ConfigSpeed { + type base:Basetype_UnsignedInteger64 { + range "0..1048576"; + } + description "Configured speed of an interface. Each bit represents a speed as follows: + 1:Auto + 2:10Mbps + 4:100Mbps + 8:155Mbps + 16:622Mbps + 32:1Gbps + 64:2Gbps + 128:2.5Gbps + 256:4Gbps + 512:8Gbps + 1024:10Gbps + 2048:16Gbps + 4096:20Gbps + 8192:40Gbps + 16384:100Gbps + 32768:5Gbps + 65536:25Gbps + 131072:32Gbps + 262144:50Gbps + 524288:200Gbps + 1048576:400Gbps)"; + } + leaf ActualSpeed { + type base:Basetype_UnsignedInteger64; + description "Actual speed of an interface(units: kbps)."; + } + leaf ConfigDuplex { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Configured duplex mode of an interface."; + } + leaf ActualDuplex { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Actual duplex mode of an interface"; + } + leaf PortLayer { + type enumeration { + enum 1; + enum 2; + } + description "Port layer of an interface as follows: + 1 Layer 2 + 2 Layer 3"; + } + leaf LinkType { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "VLAN type of an interface as follows: + 1 ACCESS + 2 TRUNK + 3 HYBRID"; + } + leaf PVID { + type base:Basetype_UnsignedInteger32 { + range "1..4094"; + } + description "Port VLAN identification (PVID) of an interface."; + } + leaf InetAddressIPV4 { + type base:Basetype_Ipv4Address; + description "Primary IPv4 address of an interface."; + } + leaf InetAddressIPV4Mask { + type base:Basetype_Ipv4Address; + description "Primary IPv4 address mask of an interface."; + } + leaf InetAddressIPV6 { + type base:Basetype_Ipv6Address; + description "Primary IPv6 address of an interface."; + } + leaf InetAddressIPV6PrefixLength { + type base:Basetype_UnsignedInteger32 { + range "1..128"; + } + description "Primary IPv6 address length of an interface."; + } + leaf PhysicalIndex { + type base:Basetype_UnsignedInteger32; + description "Entity index of an interface."; + } + leaf MAC { + type base:Basetype_MacAddress; + description "MAC address of an interface."; + } + leaf ForwardingAttributes { + type base:Basetype_UnsignedInteger32 { + range "0..63"; + } + description "Forwarding attributes of an interface."; + } + leaf Loopback { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Loopback test as follows: + 0 No loopback + 1 Internal + 2 External"; + } + leaf MDI { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "MDI mode of an interface as follows: + 1 MDI-II (straight-through cable) + 2 MDI-X (crossover cable) + 3 MDI-AUTO (auto-sensing)"; + } + leaf ConfigMTU { + type base:Basetype_UnsignedInteger32; + description "Configured MTU of an interface."; + } + leaf ActualMTU { + type base:Basetype_UnsignedInteger32; + description "Actual MTU of an interface."; + } + leaf ConfigBandwidth { + type base:Basetype_UnsignedInteger64 { + range "1..400000000"; + } + description "Configured bandwidth of an interface(units: kbit/s)."; + } + leaf ActualBandwidth { + type base:Basetype_UnsignedInteger64; + description "Actual bandwidth of an interface(units: kbit/s)"; + } + leaf SubPort { + type base:Basetype_Boolean; + description "Whether the port is sub-interface."; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..300"; + } + description "Sampling interval of an interface"; + } + leaf ForceUP { + type base:Basetype_Boolean; + description "Forcibly bring up an interface."; + } + leaf Actual64Bandwidth { + type base:Basetype_UnsignedInteger64; + description "Actual bandwidth of an interface(units: kbit/s)"; + } + container LinkDelay { + description "Physical state change suppression configuration of an interface."; + leaf UpTime { + type base:Basetype_UnsignedInteger32; + description "Configured link-up event suppression interval of an interface(units: millisecond)."; + } + leaf DownTime { + type base:Basetype_UnsignedInteger32; + description "Configured link-down event suppression interval of an interface(units: millisecond)."; + } + } + leaf KeepAlive { + type base:Basetype_UnsignedInteger32 { + range "0..32767"; + } + description "Set the hold timer of an interface"; + } + leaf KeepAliveRetry { + type base:Basetype_UnsignedInteger32 { + range "1..255"; + } + description "Configured number of attempts for transmitting a keepalive message"; + } + leaf DefaultMac { + type base:Basetype_MacAddress; + description "The original MAC address of the interface"; + } + leaf LastChange { + type base:Basetype_OctectString; + description "From last state change time to now."; + } + leaf PhyLastChange { + type base:Basetype_OctectString; + } + leaf TrafficStatisticsEnable { + type base:Basetype_EnableState; + description "TrafficStatistics Status of the port: + enable + disable"; + } + leaf SubIfRateStatisticsEnable { + type base:Basetype_EnableState; + description "Enable rate statistics collection for the subinterfaces of an Ethernet interface"; + } + container ServiceSlot { + description "Primary traffic processing slot ID"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "ID of the IRF member device where the entity resides."; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Slot ID of the entity"; + } + leaf Cpu { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "CPU ID"; + } + } + container ServiceStandbySlot { + description "Backup traffic processing slot ID"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "ID of the IRF member device where the entity resides"; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "Slot ID of the entity"; + } + leaf Cpu { + type base:Basetype_UnsignedInteger32 { + range "0..65535"; + } + description "CPU ID"; + } + } + leaf Interframe { + type base:Basetype_Boolean; + description "Include inter-frame gaps in interface statistics."; + } + leaf AutoReduceEnable { + type base:Basetype_EnableState; + description "Enable interface automatic speed reduction function: + enable + disable"; + } + leaf UsingType { + type enumeration { + enum 0; + enum 1; + enum 2; + enum 3; + enum 4; + enum 5; + enum 6; + enum 7; + enum 8; + enum 9; + enum 10; + enum 11; + enum 12; + enum 13; + enum 14; + enum 15; + enum 16; + enum 17; + enum 18; + enum 19; + enum 20; + enum 21; + enum 22; + enum 23; + enum 24; + enum 25; + enum 26; + enum 27; + enum 28; + enum 29; + enum 30; + enum 37; + enum 38; + enum 39; + enum 40; + enum 41; + enum 42; + enum 43; + enum 44; + enum 45; + enum 46; + enum 47; + enum 48; + enum 49; + enum 50; + enum 51; + enum 52; + enum 53; + enum 54; + enum 55; + enum 56; + enum 57; + enum 58; + enum 59; + enum 60 { + description "400GETOXGE4channel"; + } + enum 61 { + description "XGETO400GE"; + } + } + description "Split or combine interfaces. + Each enumeration represents a switching mode: + 0 UNKNOWN + 1 XGETOFGE + 2 XGETOHGE + 3 FGETOXGE + 4 HGETOXGE + 5 FGETOHGE + 6 HGETOFGE + 7 FGETOTGE + 8 TGETOFGE + 9 HGETOWGE + 10 WGETOHGE + 11 FC16GTO32G + 12 FC32GTO16G + 13 400GETOHGE + 14 HGETO400GE + 15 400GETO50GE + 16 50GETO400GE + 17 400GETO200GE + 18 200GETO400GE + 19 200GETOHGE + 20 HGETO200GE + 21 200GETO25GE + 22 200GETO50GE + 23 400GETO25GE + 24 25GETO200GE + 25 50GETO200GE + 26 25GETO400GE + 27 HGETO50GE + 28 50GETOHGE + 29 XGETO200GE + 30 200GETOXGE + 37 400GETO2HGEchannel + 38 800GETOHGE1channel + 39 800GETO200GE1channel + 40 800GETO400GE1channel + 41 400GETOHGE1channel + 42 400GETO200GE1channel + 43 200GETOHGE1channel + 44 800GETO400GE + 45 800GETO400GE2channel + 46 800GETO200GE2channel + 47 400GETO200GE2channel + 48 400GETO100GE2channel + 49 200GETO100GE2channel + 50 200GETOFGE + 51 200GETOFGE1channel + 52 HGETOXGE2channel + 53 HGETO25GE2channel + 54 HGETO800GE + 55 200GETO800GE + 56 400GETO800GE + 57 40GETO200GE + 58 800GETOHGE + 59 800GETO200GE + 60 400GETOXGE4channel + 61 XGETO400GE"; + } + } + } + container Statistics { + description "This table contains interface statistics."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Name { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf AbbreviatedName { + type base:Basetype_InterfaceName; + description "Abbreviated name of an interface."; + } + leaf InOctets { + type base:Basetype_UnsignedInteger64; + description "Number of inbound bytes on an interface."; + } + leaf InUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound unicast packets on an interface."; + } + leaf InNUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound non-unicast packets on an interface."; + } + leaf InDiscards { + type base:Basetype_UnsignedInteger64; + description "Number of discarded inbound packets on an interface."; + } + leaf InErrors { + type base:Basetype_UnsignedInteger64; + description "Number of errored inbound packets on an interface."; + } + leaf InUnknownProtos { + type base:Basetype_UnsignedInteger64; + description "Number of unsupported and unknown inbound packets on an interface."; + } + leaf InRate { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound bytes on an interface."; + } + leaf OutOctets { + type base:Basetype_UnsignedInteger64; + description "Number of outbound bytes on an interface."; + } + leaf OutUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound unicast packets on an interface."; + } + leaf OutNUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound non-unicast packets on an interface."; + } + leaf OutDiscards { + type base:Basetype_UnsignedInteger64; + description "Number of discarded outbound packets on an interface."; + } + leaf OutErrors { + type base:Basetype_UnsignedInteger64; + description "Number of errored outbound packets on an interface."; + } + leaf OutRate { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound bytes on an interface."; + } + leaf LastClear { + type base:Basetype_DateTime; + description "Local time when the statistics on an interface were cleared most recently."; + } + leaf InPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound packets on an interface."; + } + leaf OutPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound packets on an interface."; + } + leaf InPktRate { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound packets on an interface."; + } + leaf OutPktRate { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound packets on an interface."; + } + leaf InUsage { + type base:Basetype_UnsignedInteger64; + description "Broadband utilization rate of inbound on an interface."; + } + leaf OutUsage { + type base:Basetype_UnsignedInteger64; + description "Broadband utilization rate of outbound on an interface."; + } + } + } + container Ports { + description "This table contains port information."; + list Port { + key "PortIndex"; + leaf PortIndex { + type base:Basetype_UnsignedShort; + description "Port index as table index."; + } + leaf Name { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + } + } + container InterfaceCapabilities { + description "This table contains port capability information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Configurable { + type base:Basetype_Boolean; + description "Whether the interface is configurable."; + } + leaf Shutdown { + type base:Basetype_Boolean; + description "Whether the interface can be shutdown manually."; + } + leaf Speed { + type base:Basetype_UnsignedInteger64 { + range "0..131071"; + } + description "Mode s of speed which can be configured.Each bit represents a speed as follows: + 1:AuTo + 2:10Mbps + 4:100Mbps + 8:155Mbps + 16:622Mbps + 32:1Gbps + 64:2Gbps + 128:2.5Gbps + 256:4Gbps + 512:8Gbps + 1024:10Gbps + 2048:16Gbps + 4096:20Gbps + 8192:40Gbps + 16384:100Gbps + 32768:5Gbps + 65536:25Gbps)"; + } + leaf AutoSpeed { + type base:Basetype_UnsignedInteger64 { + range "0..7"; + } + description "Modes of auto-negotiation speed which can be configured."; + } + leaf Duplex { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "Modes of duplex which can be configured."; + } + leaf PortLayer { + type base:Basetype_Boolean; + description "Whether the port layer can be changed."; + } + leaf Loopback { + type base:Basetype_Boolean; + description "Whether the loopback test can be configured."; + } + leaf MDI { + type base:Basetype_UnsignedInteger32 { + range "0..7"; + } + description "Types of MDI which can be configured."; + } + leaf Bandwidth { + type base:Basetype_Boolean; + description "Whether the bandwidth can be configured."; + } + leaf MinMTU { + type base:Basetype_UnsignedInteger32; + description "The minimum MTU which can be configured."; + } + leaf MaxMTU { + type base:Basetype_UnsignedInteger32; + description "The maximum MTU which can be configured."; + } + leaf MinSubNum { + type base:Basetype_UnsignedInteger32; + description "Minimum sub-interface number."; + } + leaf MaxSubNum { + type base:Basetype_UnsignedInteger32; + description "Maximum sub-interface number."; + } + leaf MaxCreateSubNum { + type base:Basetype_UnsignedInteger32; + description "The total numbers of sub-interface which can be created."; + } + leaf ContextAllocType { + type base:Basetype_UnsignedInteger32 { + range "0..3"; + } + description "The allocation type of an interface for CONTEXT."; + } + leaf Removable { + type base:Basetype_Boolean; + description "Whether the interface can be deleted."; + } + leaf Interval { + type base:Basetype_Boolean; + description "Whether the sampling interval can be configured."; + } + leaf ForceUP { + type base:Basetype_Boolean; + description "Whether port force up can be configured."; + } + leaf LoopbackAutoStop { + type base:Basetype_Boolean; + description "Whether the loopback detection can be auto stop."; + } + leaf MAC { + type base:Basetype_Boolean; + description "Whether MAC can be configured."; + } + leaf TrafficStatisticsEnable { + type base:Basetype_Boolean; + description "Whether interface statistics collection for interface can be configured."; + } + leaf SubIfRateStatisticsEnable { + type base:Basetype_Boolean; + description "Whether interface rate statistics collection for the subinterface of interface can be configured."; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf FlexECapability { + type base:Basetype_Boolean; + description "Whether the interface can be switched to a flexe interface."; + } + leaf ServiceSlotCap { + type base:Basetype_Boolean; + description "Whether Service slot can be configured."; + } + leaf ServiceStandbySlotCap { + type base:Basetype_Boolean; + description "Whether Service standby slot can be configured."; + } + leaf PortUsing { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Whether interface splitting/combination is supported and its effective method after it is configured. + 0 Notsupport + 1 Reboot + 2 Immediately"; + } + } + } + container TypeCapabilities { + description "This table contains interface type capability information."; + list Capability { + key "IfTypeExt"; + leaf IfTypeExt { + type base:Basetype_UnsignedInteger32 { + range "0..256"; + } + description "Interface Type.Numerical value must be in range(0..256)"; + } + leaf MinNum { + type base:Basetype_UnsignedShort; + description "Minimum interface number."; + } + leaf MaxNum { + type base:Basetype_UnsignedShort; + description "Maximum interface number."; + } + leaf MinSubNum { + type base:Basetype_UnsignedShort; + description "Minimum sub-interface number."; + } + leaf MaxSubNum { + type base:Basetype_UnsignedShort; + description "Maximum sub-interface number."; + } + leaf MaxCreateNum { + type base:Basetype_UnsignedShort; + description "Total interface numbers which can be created."; + } + leaf MaxCreateSubNum { + type base:Basetype_UnsignedShort; + description "Total sub-interface numbers which can be created."; + } + leaf MAC { + type base:Basetype_Boolean; + description "Check whether a MAC address can be configured."; + } + leaf IfFullName { + type base:Basetype_String; + description "Full name of an interface."; + } + leaf IfSimpleName { + type base:Basetype_String; + description "Abbreviated name of an interface."; + } + leaf VlanTm { + type base:Basetype_Boolean; + } + } + } + container EthInterfaces { + description "This table contains ethernet interface information."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index"; + } + leaf Combo { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Combo mode of an interface(1(fiber mode); 2(copper mode); 3(auto mode))"; + } + leaf FlowControl { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Flow control information of an interface + 1(Enable flow control) + 2(Disable) + 3(Only enable flow control packet receiving)"; + } + leaf AutoPowerDown { + type base:Basetype_Boolean; + description "Port auto power down"; + } + leaf Jumboframe { + type base:Basetype_UnsignedInteger32; + description "Jumbo frame information of an interface"; + } + container BroadcastSuppression { + description "Broadcast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Configured broadcast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf ActualValue { + type base:Basetype_UnsignedInteger32; + description "Actual broadcast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Broadcast suppression unit:1(ratio),2(pps),3(kbps)"; + } + } + container MulticastSuppression { + description "Multicast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Configured multicast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf ActualValue { + type base:Basetype_UnsignedInteger32; + description "Actual multicast suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "Multicast suppression unit:1(ratio),2(pps),3(kbps)"; + } + leaf Flag { + type enumeration { + enum 1; + enum 2; + } + description "Multicast suppression flag:1(all),2(unknown)"; + } + } + container UnknownUnicastSuppression { + description "UnknownUnicast suppression information of an interface"; + leaf ConfigValue { + type base:Basetype_UnsignedInteger32; + description "Configured unknownUnicastUnit suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf ActualValue { + type base:Basetype_UnsignedInteger32; + description "Actual unknownUnicastUnit suppression value of an interface + Value range: + ratio: 0 to 100 + pps: 0 to 1.4881 * the maximum interface rate. + kbps: 0 to the maximum interface rate"; + } + leaf Unit { + type enumeration { + enum 1; + enum 2; + enum 3; + } + description "UnknownUnicastUnit suppression unit:1(ratio),2(pps),3(kbps)"; + } + } + leaf BPDUDrop { + type base:Basetype_Boolean; + description "Whether any type of IEEE BPDUs is drop on the port."; + } + leaf EEE { + type base:Basetype_Boolean; + description "Whether energy efficient Ethernet is enable on the port."; + } + leaf ConnectMode { + type enumeration { + enum 1; + enum 2; + } + description "Port connection mode of an interface. + Enumeration: + 1(Normal connection mode) + 2(Extend connection mode)"; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf FiberOrCopper { + type enumeration { + enum 1; + enum 2; + } + description "Actual fiber or copper mode of an interface(1(fiber mode); 2(copper mode))"; + } + container LinkFlap { + description "Link flapping information of an interface"; + leaf Mode { + type enumeration { + enum 0; + enum 1; + enum 2; + } + description "Interface operation status as follows: + 0: noconfig + 1: enable + 2: disable"; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..86400"; + } + description "Link flapping detection interval"; + } + leaf Threshold { + type base:Basetype_UnsignedInteger32 { + range "2..1200"; + } + description "Maximum link flapping times in detection interval"; + } + } + } + } + container EthInterfaceCapabilities { + description "The capabilities of Ethernet interface"; + list Interface { + description "The name of Row"; + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index."; + } + leaf Combo { + type base:Basetype_Boolean; + description "Whether the fiber mode or copper mode can be activated."; + } + leaf StormConstrain { + type base:Basetype_Boolean; + description "Whether storm constrain can be configured."; + } + leaf FlowControl { + type base:Basetype_Boolean; + description "Whether flow control can be configured."; + } + leaf AutoPowerDown { + type base:Basetype_Boolean; + description "Whether auto power down can be configured."; + } + leaf MinJumboframe { + type base:Basetype_UnsignedInteger32; + description "The minimum jumbofame which can be configured."; + } + leaf MaxJumboframe { + type base:Basetype_UnsignedInteger32; + description "The maximum jumbofame which can be configured."; + } + leaf BPDUDrop { + type base:Basetype_Boolean; + description "Whether bpdu drop can be configured."; + } + leaf EEE { + type base:Basetype_Boolean; + description "Whether energy efficient ethernet can be configured."; + } + leaf ConnectMode { + type base:Basetype_Boolean; + description "Whether port connection mode can be configured."; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + container IfHistoryTrafficStatistics { + list TrafficStatistics { + key "IfIndex Interval TimeStamp"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + } + leaf Interval { + type enumeration { + enum 0; + enum 1; + enum 2; + } + } + leaf TimeStamp { + type base:Basetype_DateTime; + } + leaf InOctets { + type base:Basetype_UnsignedInteger64; + } + leaf OutOctets { + type base:Basetype_UnsignedInteger64; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + container AllHistoryTrafficStatistics { + list TrafficStatistics { + key "Interval TimeStamp"; + leaf Interval { + type enumeration { + enum 0; + enum 1; + enum 2; + } + } + leaf TimeStamp { + type base:Basetype_DateTime; + } + leaf InOctets { + type base:Basetype_UnsignedInteger64; + } + leaf OutOctets { + type base:Basetype_UnsignedInteger64; + } + } + } + container DeviceCapabilities { + leaf HistoryTrafficStatistic { + type base:Basetype_Boolean; + } + leaf ManualNoLoopBack { + type base:Basetype_Boolean; + } + leaf DefaultShutdown { + type base:Basetype_Boolean; + } + } + container NewSubInterfaces { + description "This table is used to create or delete sub-interfaces. + This table supports creating rows."; + list Interface { + key "IfIndex SubNum"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf SubNum { + type base:Basetype_UnsignedInteger32; + description "Sub-interface number."; + } + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + } + } + container ReserveVlanInterface { + description "This table contains the reservation of VLAN interface resources."; + list VlanInterface { + key "Type"; + leaf Type { + type enumeration { + enum 1; + enum 2; + } + description "The reservation type: + 1 Global + 2 Local"; + } + leaf VlanList { + type base:Basetype_VlanRange; + description "List of vlan IDs which relative vlan interface is reserved."; + ext:support-incremental "true"; + } + } + } + container EthPortStatistics { + description "This table contains ethernet interface statistics."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Name { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf InBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound bytes on an interface."; + } + leaf InPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound packets on an interface."; + } + leaf InUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound unicast packets on an interface."; + } + leaf InBrdcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound broadcast packets on an interface."; + } + leaf InMulticastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound multicast packets on an interface."; + } + leaf InPauses { + type base:Basetype_UnsignedInteger64; + description "Number of inbound pause frames on an interface."; + } + leaf InNormalBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal bytes on an interface."; + } + leaf InNormalUnicastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal unicast bytes on an interface."; + } + leaf InNormalBrdcastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal broadcast bytes on an interface."; + } + leaf InNormalMulticastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal multicast bytes on an interface."; + } + leaf InUnknownUnicastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of inbound unknown unicast bytes on an interface."; + } + leaf InNormalPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal packets on an interface."; + } + leaf InNormalUnicastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal unicast packets on an interface."; + } + leaf InNormalBrdcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal broadcast packets on an interface."; + } + leaf InNormalMulticastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal multicast packets on an interface."; + } + leaf InUnknownUnicastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound unknown unicast packets on an interface."; + } + leaf InNormalPauses { + type base:Basetype_UnsignedInteger64; + description "Number of inbound normal pause frames on an interface."; + } + leaf InErrorPkts { + type base:Basetype_UnsignedInteger64; + description "Number of errored inbound packets on an interface."; + } + leaf InPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound packages on an interface."; + } + leaf InByteSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound bytes on an interface."; + } + leaf InBrdcastPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound broadcast packages on an interface."; + } + leaf InMulticastPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of inbound multicast packages on an interface."; + } + leaf InRunts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound runts on an interface."; + } + leaf InGiants { + type base:Basetype_UnsignedInteger64; + description "Number of inbound giants on an interface."; + } + leaf InThrottles { + type base:Basetype_UnsignedInteger64; + description "Number of inbound frames that had a non-integer number of bytes."; + } + leaf InErrCRCFrames { + type base:Basetype_UnsignedInteger64; + description "Total number of inbound frames that had a normal length, but contained CRC errors."; + } + leaf InErrFrames { + type base:Basetype_UnsignedInteger64; + description "Total number of inbound frames that contained CRC errors and a non-integer number of bytes."; + } + leaf InOverrunDropPkts { + type base:Basetype_UnsignedInteger64; + description "Number of packets dropped because the input rate of the port exceeded the queuing capability."; + } + leaf InAbortPkts { + type base:Basetype_UnsignedInteger64; + description "Total number of illegal inbound packets."; + } + leaf InIgnoreDropFrames { + type base:Basetype_UnsignedInteger64; + description "Number of inbound frames dropped because the receiving buffer of the port ran low."; + } + leaf InParityErrFrames { + type base:Basetype_UnsignedInteger64; + description "Total number of frames with parity errors."; + } + leaf InSpeedPeakBytes { + type base:Basetype_UnsignedInteger64; + description "Peak rate of inbound traffic in Bps, and the time when the peak inbound traffic rate occurred."; + } + leaf InSpeedPeakTime { + type base:Basetype_DateTime; + description "Speed peak time of inbound bytes on an interface."; + } + leaf OutBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound bytes on an interface."; + } + leaf OutPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound packages on an interface."; + } + leaf OutUcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound unicast packets on an interface."; + } + leaf OutBrdcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound broadcast packets on an interface."; + } + leaf OutMulticastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound multicast packets on an interface."; + } + leaf OutPauses { + type base:Basetype_UnsignedInteger64; + description "Number of outbound pause frames on an interface."; + } + leaf OutNormalBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal bytes on an interface."; + } + leaf OutNormalUnicastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal unicast bytes on an interface."; + } + leaf OutNormalBrdcastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal broadcast bytes on an interface."; + } + leaf OutNormalMulticastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal multicast bytes on an interface."; + } + leaf OutUnknownUnicastBytes { + type base:Basetype_UnsignedInteger64; + description "Number of outbound unknown unicast bytes on an interface."; + } + leaf OutNormalPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal packets on an interface."; + } + leaf OutNormalUnicastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal unicast packets on an interface."; + } + leaf OutNormalBrdcastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal broadcast packets on an interface."; + } + leaf OutNormalMulticastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal multicast packets on an interface."; + } + leaf OutUnknownUnicastPkts { + type base:Basetype_UnsignedInteger64; + description "Number of outbound unknown unicast packets on an interface."; + } + leaf OutNormalPauses { + type base:Basetype_UnsignedInteger64; + description "Number of outbound normal pause frames on an interface."; + } + leaf OutErrorPkts { + type base:Basetype_UnsignedInteger64; + description "Number of error outbound packets on an interface."; + } + leaf OutPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound packages on an interface."; + } + leaf OutByteSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound bytes on an interface."; + } + leaf OutBrdcastPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound broadcast packages on an interface."; + } + leaf OutMulticastPktSpeed { + type base:Basetype_UnsignedInteger64; + description "Rate of outbound multicast packages on an interface."; + } + leaf OutUnderRunDropPkts { + type base:Basetype_UnsignedInteger64; + description "Number of packets dropped because the output rate of the interface exceeded the output queuing capability."; + } + leaf OutBuffFailDropPkts { + type base:Basetype_UnsignedInteger64; + description "Number of packets dropped because the transmitting buffer of the interface ran low."; + } + leaf OutAbortPkts { + type base:Basetype_UnsignedInteger64; + description "Number of packets that failed to be transmitted, for example, because of Ethernet collisions."; + } + leaf OutDeferedFrames { + type base:Basetype_UnsignedInteger64; + description "Number of frames that the interface deferred to transmit because of detected collisions."; + } + leaf OutCollisionFrames { + type base:Basetype_UnsignedInteger64; + description "Number of frames that the interface stopped transmitting because Ethernet collisions were detected during transmission."; + } + leaf OutLateCollisionFrames { + type base:Basetype_UnsignedInteger64; + description "Number of frames that the interface deferred to transmit after transmitting their first 512 bits because of detected collisions."; + } + leaf OutLostCarriers { + type base:Basetype_UnsignedInteger64; + description "Number of carrier losses during transmission."; + } + leaf OutNoCarriers { + type base:Basetype_UnsignedInteger64; + description "Number of times that the port failed to detect the carrier when attempting to send frames."; + } + leaf OutSpeedPeakBytes { + type base:Basetype_UnsignedInteger64; + description "Peak rate of outbound traffic in Bps, and the time when the peak outbound traffic rate occurred."; + } + leaf OutSpeedPeakTime { + type base:Basetype_DateTime; + description "Speed peak time of outbound bytes on an interface."; + } + } + } + container ShutdownInterval { + description "This table contains shutdown recovery interval."; + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "0..300"; + } + description "Recover interval for interface, in seconds."; + } + } + container IfPacketDropStatistics { + description "This table contains interface dropped packets statistics."; + list Interface { + key "IfIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as IfPacketDropStatistics table index."; + } + leaf InsufficientBandDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to full GBP or insufficient bandwidth."; + } + leaf FFPDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to Fast Filter Processor."; + } + leaf STPDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to STP non-forwarding state."; + } + leaf RateLimitDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to rate-limit."; + } + leaf BroadcastBuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to broadcast-suppression."; + } + leaf UnicastBuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to unicast-suppression."; + } + leaf MulticastSuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to unicast-suppression."; + } + leaf TxDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to Tx packet aging."; + } + leaf InsufficientBuffInDrop { + type base:Basetype_UnsignedInteger64; + description "Packets output dropped due to insufficient data buffer."; + } + leaf InsufficientBuffOutDrop { + type base:Basetype_UnsignedInteger64; + description "Packets input dropped due to insufficient data buffer."; + } + } + } + container GlobalPacketDropStatistics { + description "The table contains global dropped packets statistics."; + leaf InsufficientBandDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to full GBP or insufficient bandwidth."; + } + leaf FFPDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to Fast Filter Processor."; + } + leaf STPDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to STP non-forwarding state."; + } + leaf RateLimitDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to rate-limit."; + } + leaf BroadcastBuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to broadcast-suppression."; + } + leaf UnicastBuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to unicast-suppression."; + } + leaf MulticastSuppressionDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to unicast-suppression."; + } + leaf TxDrop { + type base:Basetype_UnsignedInteger64; + description "Packets dropped due to Tx packet aging."; + } + leaf InsufficientBuffInDrop { + type base:Basetype_UnsignedInteger64; + description "Packets input dropped due to insufficient data buffer."; + } + leaf InsufficientBuffOutDrop { + type base:Basetype_UnsignedInteger64; + description "Packets output dropped due to insufficient data buffer."; + } + } + container SubChannel { + description "This table contains the sub channel index info of interface."; + list Interface { + key "IfIndex CreateMode SubChannelIndex"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + } + leaf CreateMode { + type enumeration { + enum 1; + enum 2; + } + description "The channel type: + 1 serial-set + 2 eth-channel"; + } + leaf SubChannelIndex { + type base:Basetype_NameAndIndexUnion; + } + } + } + container CellularChannel { + list Interface { + key "IfIndex CreateMode ChannelNum"; + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + } + leaf CreateMode { + type enumeration { + enum 1; + enum 2; + } + } + leaf ChannelNum { + type base:Basetype_UnsignedInteger32; + } + } + } + container LinkFlap { + description "This table is used to enable link flapping protection on all physical interfaces."; + leaf Enable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf Batch { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf Interval { + type base:Basetype_UnsignedInteger32 { + range "5..86400"; + } + description "Link flapping detection interval"; + } + leaf Threshold { + type base:Basetype_UnsignedInteger32 { + range "2..1200"; + } + description "Maximum link flapping times in detection interval"; + } + } + container ShutdownAllPhyIf { + description "This table is used to shut all physical interfaces down."; + leaf Shutdown { + type base:Basetype_Boolean; + description "Shut down all physical interfaces."; + } + } + container FlexeInstances { + description "This table contains the config information of flexe."; + list FlexeInstance { + description "List of FlexeInstances for FlexeMesaage"; + key "Chassis Slot Subslot"; + leaf Chassis { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "ID of the member where the entity resides."; + } + leaf Slot { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Slot ID of the entity."; + } + leaf Subslot { + type base:Basetype_UnsignedInteger32 { + range "0..65534"; + } + description "Subslot ID of the entity."; + } + leaf ConfigMode { + type enumeration { + enum 1; + enum 2; + } + description "Bandwidth configurtion mode: + 1 Bandwidth + 2 TimeSlot"; + } + container FlexeGroups { + description "This table contains the config information of Flexe group interfaces."; + list FlexeGroup { + description "List of FlexeGroup for Flexe group interfaces"; + key "GroupID"; + leaf GroupID { + type base:Basetype_UnsignedInteger32 { + range "1..1048573"; + } + description "Group ID"; + } + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Group interface ifdex"; + } + container BindPhyInterfaces { + description "This table contains the config information of FlexE Physical interfaces"; + list BindPhyInterface { + key "PhyIfIndex"; + leaf PhyIfIndex { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Phyisycal Interface index"; + } + leaf PhyNo { + type base:Basetype_UnsignedInteger32 { + range "1..254"; + } + description "PHY number for the FlexE Phyisycal Interface"; + } + } + } + container Clients { + description "This table contains the config information of FlexE client"; + list Client { + description "List of Client for FlexE client"; + key "ClientID"; + leaf ClientID { + type base:Basetype_UnsignedInteger32 { + range "1..65534"; + } + description "FlexE Client ID"; + } + leaf FlexEIfIndex { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Interface index"; + } + leaf Bandwidth { + type base:Basetype_UnsignedInteger32 { + range "5..4194303"; + } + description "Bandwidth calue in Gbps"; + } + container TimeSlots { + description "This table contains the config information of timeslots"; + list TimeSlot { + key "PhyIfIndex"; + leaf PhyIfIndex { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Phyisycal Interface index"; + } + leaf TimeSlotList { + type base:Basetype_String; + description "PHY number for the FlexE Phyisycal Interface"; + } + } + } + } + } + container ClientChannels { + description "This table contains the config information of FlexE clientchannel"; + list ClientChannel { + description "List of ClientChannel for FlexE ClientChannel"; + key "ClientChannelID"; + leaf ClientChannelID { + type base:Basetype_UnsignedInteger32 { + range "1..65534"; + } + } + leaf ClientConfigMode { + type enumeration { + enum 1; + enum 2; + } + description "Bandwidth configurtion mode: + 1 Bandwidth + 2 TimeSlot"; + } + leaf Bandwidth { + type base:Basetype_UnsignedInteger32 { + range "5..4194303"; + } + } + container TimeSlots { + description "This table contains the config information of timeslots"; + list TimeSlot { + key "PhyInterface"; + leaf PhyInterface { + type base:Basetype_NameAndIndexUnion; + description "FlexeE Phyisycal Interface index"; + } + leaf TimeSlotList { + type base:Basetype_Text { + length "1..512"; + } + } + } + } + container FG-Clients { + description "This table contains the config information of subclient"; + list FG-Client { + key "FG-ClientID"; + leaf FG-ClientID { + type base:Basetype_UnsignedInteger32 { + range "1..65534"; + } + } + leaf Bandwidth { + type base:Basetype_UnsignedInteger32 { + range "10..4194303"; + } + } + leaf SubTimeSlotList { + type base:Basetype_Text { + length "1..512"; + } + } + } + } + } + } + } + } + } + } + container FlexEFGInterfaces { + description "This table is used to create or delete FlexeInstances."; + list FlexEFGInterface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf ConfigMode { + type enumeration { + enum 1; + enum 2; + } + description "Bandwidth configurtion mode: + 1 Bandwidth + 2 TimeSlot"; + } + container FG-Clients { + description "This table contains the config information of FlexE client"; + list FG-Client { + description "List of Client for FlexE client"; + key "FG-ClientID"; + leaf FG-ClientID { + type base:Basetype_UnsignedInteger32 { + range "1..65534"; + } + } + leaf Bandwidth { + type base:Basetype_UnsignedInteger32 { + range "10..4194303"; + } + } + leaf SubTimeSlotList { + type base:Basetype_Text { + length "1..512"; + } + } + } + } + } + } + + container IfFecData { + description "This table contains ethernet fec statistics."; + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Correctable { + type base:Basetype_UnsignedInteger64; + description "Number of Correctable on an interface."; + } + leaf Uncorrectable { + type base:Basetype_UnsignedInteger64; + description "Number of Uncorrectable on an interface."; + } + } + } + + container LbnGroupGlobal { + description "This table is used to enable loadbalance ecmp lbn-group,loadbalance link-aggregation lbn-group, get max lbn-group num and get max groupmember num."; + leaf EcmpEnable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf LaggEnable { + type enumeration { + enum 0; + enum 1; + } + description "Configure operation status as follows: + 0: disable + 1: enable"; + } + leaf EcmpMode { + type string; + } + leaf LbnGroupMaxNum { + type base:Basetype_UnsignedInteger32; + description "The maximum number of lbn-groups supported to be created."; + } + leaf GroupMemberMaxIndex { + type base:Basetype_UnsignedInteger32; + description "The maximum number of member ports supported by a single lbn-group"; + } + } + container LbnGroups { + description "This table contains information about lbngroup and its members."; + list LbnGroup { + key "GroupName"; + leaf GroupName { + type base:Basetype_String { + length "1..31"; + } + description "Full name of an lbngroup."; + } + leaf GroupIndex { + type base:Basetype_UnsignedInteger32; + description "Index of an lbngroup."; + } + container GroupMembers { + description "This table contains information about lbngroup members."; + list GroupMember { + description "List of GroupMember for LbnGroup"; + key "InterfaceName"; + leaf InterfaceName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf MemberIndex { + type base:Basetype_UnsignedInteger32; + description "Index of an groupmember."; + } + } + } + } + } + container GlobalConfig { + description "This table contains the global configuration of the Ifmgr table."; + leaf SubIfUpDownTrapLog { + type base:Basetype_EnableState; + description "Trap and log enable State of subinterfaces: + enable + disable"; + } + } + container LbnOutInterfaces { + description "This table Used to obtain the corresponding outbound interface of the specified LBN interface."; + list Interface { + key "InName IpAddress VpnInstanceName"; + leaf InName { + type base:Basetype_InterfaceName; + description "Full name of an input interface."; + } + leaf IpAddress { + type base:Basetype_IpAddress; + description "IPv4 or IPv6 address"; + } + leaf VpnInstanceName { + type base:Basetype_VRF; + description "The VRF name."; + } + leaf OutName { + type base:Basetype_InterfaceName; + description "Full name of an Output interface."; + } + } + } + container LbnInInterfaces { + description "This table Used to obtain the corresponding inbound interface of the specified LBN interface."; + list Interface { + key "OutName IpAddress VpnInstanceName Chassis Slot CPUID"; + leaf OutName { + type base:Basetype_InterfaceName; + description "Full name of an Output interface."; + } + leaf IpAddress { + type base:Basetype_IpAddress; + description "IPv4 or IPv6 address"; + } + leaf VpnInstanceName { + type base:Basetype_VRF; + description "The VRF name."; + } + leaf Chassis { + type base:Basetype_UnsignedShort; + description "Identification of the member where the entity resides as table index."; + } + leaf Slot { + type base:Basetype_UnsignedShort; + description "Slot identification of the device node as table index."; + } + leaf CPUID { + type base:Basetype_UnsignedShort; + description "CPU identification as table index"; + } + leaf InPortLbnIndex { + type base:Basetype_UnsignedInteger32; + description "inport Lbn index"; + } + } + } + container NakStatistics { + description "This table contains statistics for NAK packets from the interface."; + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Enable { + type base:Basetype_EnableState; + description "Enable interface NAK packet statistics function: + enable + disable"; + } + leaf InPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound packets on an interface"; + } + } + } + container CnpStatistics { + description "This table contains statistics for CNP packet from the interface."; + list Interface { + key "IfName"; + leaf IfName { + type base:Basetype_InterfaceName; + description "Full name of an interface."; + } + leaf Enable { + type base:Basetype_EnableState; + description "Enable interface CNP packet statistics function: + enable + disable"; + } + leaf InPkts { + type base:Basetype_UnsignedInteger64; + description "Number of inbound packets on an interface."; + } + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/H3C-ifmgr-event@2020-05-09.yang b/exp/yangcli/h3c-yang/H3C-ifmgr-event@2020-05-09.yang new file mode 100644 index 0000000..ddc8f1c --- /dev/null +++ b/exp/yangcli/h3c-yang/H3C-ifmgr-event@2020-05-09.yang @@ -0,0 +1,129 @@ +module H3C-ifmgr-event { + namespace "http://www.h3c.com/netconf/event:1.0/ifmgr:1.0"; + prefix "ifmgr-event"; + import comware-basetype { + prefix "base"; + } + + organization "NEW H3C Technologies Co., Ltd."; + contact "Website: http://www.h3c.com"; + description "The module entities for ifmgr event."; + revision 2020-05-09 { + description "Synchronize the modification of the schema file to the YANG file."; + } + revision 2020-04-07 { + description "Initial revision."; + } + notification InterfaceEvent { + container Interface { + leaf Name { + type union { + type base:Basetype_EmptyString; + type base:Basetype_InterfaceName; + } + description "Full name of an interface."; + } + leaf Status { + type base:Basetype_Integer32 { + range "0..5"; + } + description "Interface administration status,as follows: + 0 IF_ACTIVE + 1 IF_DEACTIVE + 2 IF_PHY_UP + 3 IF_PHY_DOWN + 4 IF_LINK_UP + 5 IF_LINK_DOWN"; + } + leaf Description { + type base:Basetype_Text { + length "0..255"; + } + description "Interface description.String length constraints must be in range(0..255)."; + } + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf AdminStatus { + type base:Basetype_Integer32 { + range "1..2"; + } + description "Interface administration status,as follows: + 1 Admin Up + 2 Admin Down"; + } + leaf OperStatus { + type base:Basetype_UnsignedInteger32 { + range "1..7"; + } + description "Interface operation status as follows: + 1: up + 2: down + 3: testing + 4: unknown + 5: dormant + 6: notPresent + 7: lowerLayerDown"; + } + leaf IfType { + type union { + type base:Basetype_EmptyString; + type base:Basetype_UnsignedInteger32; + } + description "Interface type"; + } + } + } + notification InterfaceBandWidthEvent { + container InterfaceBandWidth { + leaf IfIndex { + type base:Basetype_NameAndIndexUnion; + description "Interface index as table index."; + } + leaf Name { + type union { + type base:Basetype_EmptyString; + type base:Basetype_InterfaceName; + } + description "Full name of an interface."; + } + leaf CFGBandWidth { + type base:Basetype_UnsignedInteger32 { + range "1..400000000"; + } + description "Configured bandwidth of an interface(units: kbit/s)."; + } + leaf Description { + type base:Basetype_Text { + length "0..255"; + } + description "Interface description.String length constraints must be in range(0..255)."; + } + } + } + notification InterfaceSpeedEvent { + container InterfaceSpeed { + leaf Name { + type union { + type base:Basetype_EmptyString; + type base:Basetype_InterfaceName; + } + description "Full name of an interface."; + } + leaf BandWidth { + type base:Basetype_UnsignedInteger32 { + range "1..400000000"; + } + description "The bandwidth of an interface."; + } + leaf Description { + type base:Basetype_Text { + length "0..255"; + } + description "Interface description.String length constraints must be in range(0..255)."; + } + } + } +} + diff --git a/exp/yangcli/h3c-yang/openconfig-aaa-radius@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-aaa-radius@2018-11-21.yang new file mode 100644 index 0000000..a18b9d6 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aaa-radius@2018-11-21.yang @@ -0,0 +1,186 @@ +submodule openconfig-aaa-radius { + + yang-version "1"; + + belongs-to "openconfig-aaa" { + prefix "oc-aaa"; + } + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-aaa-types { prefix oc-aaa-types; } + import openconfig-types { prefix oc-types; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + related to the RADIUS protocol for authentication, + authorization, and accounting."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.1"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + identity RADIUS { + base oc-aaa-types:AAA_SERVER_TYPE; + description + "Remote Authentication Dial In User Service (RADIUS) AAA + server"; + reference + "RFC 2865 - Remote Authentication Dial In User Service + (RADIUS)"; + } + + // typedef statements + + // grouping statements + + grouping aaa-radius-server-config { + description + "Configuration data for a RADIUS server"; + + leaf auth-port { + type oc-inet:port-number; + default 1812; + description + "Port number for authentication requests"; + } + + leaf acct-port { + type oc-inet:port-number; + default 1813; + description + "Port number for accounting requests"; + } + + leaf secret-key { + type oc-types:routing-password; + description + "The unencrypted shared key used between the authentication + server and the device."; + } + + leaf source-address { + type oc-inet:ip-address; + description + "Source IP address to use in messages to the RADIUS server"; + } + + leaf retransmit-attempts { + type uint8; + description + "Number of times the system may resend a request to the + RADIUS server when it is unresponsive"; + } + } + + grouping aaa-radius-server-state { + description + "Operational state data for a RADIUS server"; + + container counters { + description + "A collection of RADIUS related state objects."; + + leaf retried-access-requests { + type oc-yang:counter64; + description + "Retransmitted Access-Request messages."; + } + + leaf access-accepts { + type oc-yang:counter64; + description + "Received Access-Accept messages."; + } + + leaf access-rejects { + type oc-yang:counter64; + description + "Received Access-Reject messages."; + } + + leaf timeout-access-requests { + type oc-yang:counter64; + description + "Access-Request messages that have timed-out, + requiring retransmission."; + } + } + } + + grouping aaa-radius-server-top { + description + "Top-level grouping for RADIUS server data"; + + container radius { + description + "Top-level container for RADIUS server data"; + + container config { + description + "Configuration data for RADIUS servers"; + + uses aaa-radius-server-config; + } + + container state { + + config false; + + description + "Operational state data for RADIUS servers"; + + uses aaa-radius-server-config; + uses aaa-radius-server-state; + } + } + } + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-aaa-tacacs@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-aaa-tacacs@2018-11-21.yang new file mode 100644 index 0000000..1320bd0 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aaa-tacacs@2018-11-21.yang @@ -0,0 +1,142 @@ +submodule openconfig-aaa-tacacs { + + yang-version "1"; + + belongs-to "openconfig-aaa" { + prefix "oc-aaa"; + } + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-aaa-types { prefix oc-aaa-types; } + import openconfig-types { prefix oc-types; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + related to the TACACS+ protocol for authentication, + authorization, and accounting."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.1"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + identity TACACS { + base oc-aaa-types:AAA_SERVER_TYPE; + description + "Terminal Access Controller Access Control System (TACACS+) + AAA server"; + reference + "The TACACS+ Protocol (draft-ietf-opsawg-tacacs-05) + RFC 1492 - An Access Control Protocol, Sometimes Called + TACACS"; + } + + // typedef statements + + // grouping statements + + grouping aaa-tacacs-server-config { + description + "Configuration data for a TACACS+ server"; + + leaf port { + type oc-inet:port-number; + default 49; + description + "The port number on which to contact the TACACS server"; + } + + leaf secret-key { + type oc-types:routing-password; + description + "The unencrypted shared key used between the authentication + server and the device."; + } + + leaf source-address { + type oc-inet:ip-address; + description + "Source IP address to use in messages to the TACACS server"; + } + } + + grouping aaa-tacacs-server-state { + description + "Operational state data for a TACACS+ server"; + } + + grouping aaa-tacacs-server-top { + description + "Top-level grouping for TACACS+ sever data"; + + container tacacs { + description + "Top-level container for TACACS+ server data"; + + container config { + description + "Configuration data for TACACS+ server"; + + uses aaa-tacacs-server-config; + } + + container state { + + config false; + + description + "Operational state data for TACACS+ server"; + + uses aaa-tacacs-server-config; + uses aaa-tacacs-server-state; + } + } + } + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-aaa-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-aaa-types@2018-11-21.yang new file mode 100644 index 0000000..8385eca --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aaa-types@2018-11-21.yang @@ -0,0 +1,172 @@ +module openconfig-aaa-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/aaa/types"; + + prefix "oc-aaa-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines shared types for data related to AAA + (authentication, authorization, accounting)."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.1"; + } + + revision "2018-04-12" { + description + "Add when conditions, correct identities"; + reference "0.4.0"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity AAA_SERVER_TYPE { + description + "Base identity for types of AAA servers"; + } + + + identity SYSTEM_DEFINED_ROLES { + description + "Base identity for system_defined roles that can be assigned + to users."; + } + + identity SYSTEM_ROLE_ADMIN { + base SYSTEM_DEFINED_ROLES; + description + "Built-in role that allows the equivalent of superuser + permission for all configuration and operational commands + on the device."; + } + + identity AAA_ACCOUNTING_EVENT_TYPE { + description + "Base identity for specifying events types that should be + sent to AAA server for accounting"; + } + + identity AAA_ACCOUNTING_EVENT_COMMAND { + base AAA_ACCOUNTING_EVENT_TYPE; + description + "Specifies interactive command events for AAA accounting"; + } + + identity AAA_ACCOUNTING_EVENT_LOGIN { + base AAA_ACCOUNTING_EVENT_TYPE; + description + "Specifies login events for AAA accounting"; + } + + identity AAA_AUTHORIZATION_EVENT_TYPE { + description + "Base identity for specifying activities that should be + sent to AAA server for authorization"; + } + + identity AAA_AUTHORIZATION_EVENT_COMMAND { + base AAA_AUTHORIZATION_EVENT_TYPE; + description + "Specifies interactive command events for AAA authorization"; + } + + identity AAA_AUTHORIZATION_EVENT_CONFIG { + base AAA_AUTHORIZATION_EVENT_TYPE; + description + "Specifies configuration (e.g., EXEC) events for AAA + authorization"; + } + + identity AAA_METHOD_TYPE { + description + "Base identity to define well-known methods for AAA + operations"; + } + + identity TACACS_ALL { + base AAA_METHOD_TYPE; + description + "The group of all TACACS+ servers."; + } + + identity RADIUS_ALL { + base AAA_METHOD_TYPE; + description + "The group of all RADIUS servers."; + } + + identity LOCAL { + base AAA_METHOD_TYPE; + description + "Locally configured method for AAA operations."; + } + + + // typedef statements + + typedef crypt-password-type { + type string; + description + "A password that is hashed based on the hash algorithm + indicated by the prefix in the string. The string + takes the following form, based on the Unix crypt function: + + $[$=(,=)*][$[$]] + + Common hash functions include: + + id | hash function + ---+--------------- + 1 | MD5 + 2a| Blowfish + 2y| Blowfish (correct handling of 8-bit chars) + 5 | SHA-256 + 6 | SHA-512 + + These may not all be supported by a target device."; + } + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-aaa@2019-10-28.yang b/exp/yangcli/h3c-yang/openconfig-aaa@2019-10-28.yang new file mode 100644 index 0000000..d653ab2 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aaa@2019-10-28.yang @@ -0,0 +1,834 @@ +module openconfig-aaa { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/aaa"; + + prefix "oc-aaa"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-inet-types { prefix oc-inet; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-aaa-types { prefix oc-aaa-types; } + + include openconfig-aaa-tacacs; + include openconfig-aaa-radius; + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + related to authorization, authentication, and accounting (AAA) + management. + + Portions of this model reuse data definitions or structure from + RFC 7317 - A YANG Data Model for System Management"; + + oc-ext:openconfig-version "0.4.3"; + + revision "2019-10-28" { + description + "Fix bug in when statement path"; + reference "0.4.3"; + } + + revision "2019-08-20" { + description + "Fix identity prefixes and when statement paths"; + reference "0.4.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.1"; + } + + revision "2018-04-12" { + description + "Add when conditions, correct identities"; + reference "0.4.0"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + // grouping statements + grouping aaa-servergroup-common-config { + description + "Configuration data for AAA server groups"; + + leaf name { + type string; + description + "Name for the server group"; + } + + leaf type { + type identityref { + base oc-aaa-types:AAA_SERVER_TYPE; + } + description + "AAA server type -- all servers in the group must be of this + type"; + } + } + + grouping aaa-servergroup-common-state { + description + "Operational state data for AAA server groups"; + + //TODO: add list of group members as opstate + } + + grouping aaa-servergroup-common-top { + description + "Top-level grouping for AAA server groups"; + + container server-groups { + description + "Enclosing container for AAA server groups"; + + list server-group { + key "name"; + description + "List of AAA server groups. All servers in a group + must have the same type as indicated by the server + type."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to configured name of the server group"; + } + + container config { + description + "Configuration data for each server group"; + + uses aaa-servergroup-common-config; + } + + container state { + config false; + + description + "Operational state data for each server group"; + + uses aaa-servergroup-common-config; + uses aaa-servergroup-common-state; + } + + uses aaa-server-top; + } + } + } + + grouping aaa-server-config { + description + "Common configuration data for AAA servers"; + + leaf name { + type string; + description + "Name assigned to the server"; + } + + + leaf address { + type oc-inet:ip-address; + description "Address of the authentication server"; + } + + leaf timeout { + type uint16; + units seconds; + description + "Set the timeout in seconds on responses from the AAA + server"; + } + } + + grouping aaa-server-state { + description + "Common operational state data for AAA servers"; + + leaf connection-opens { + type oc-yang:counter64; + description + "Number of new connection requests sent to the server, e.g. + socket open"; + } + + leaf connection-closes { + type oc-yang:counter64; + description + "Number of connection close requests sent to the server, e.g. + socket close"; + } + + leaf connection-aborts { + type oc-yang:counter64; + description + "Number of aborted connections to the server. These do + not include connections that are close gracefully."; + } + + leaf connection-failures { + type oc-yang:counter64; + description + "Number of connection failures to the server"; + } + + leaf connection-timeouts { + type oc-yang:counter64; + description + "Number of connection timeouts to the server"; + } + + leaf messages-sent { + type oc-yang:counter64; + description + "Number of messages sent to the server"; + } + + leaf messages-received { + type oc-yang:counter64; + description + "Number of messages received by the server"; + } + + leaf errors-received { + type oc-yang:counter64; + description + "Number of error messages received from the server"; + } + + } + + grouping aaa-server-top { + description + "Top-level grouping for list of AAA servers"; + + container servers { + description + "Enclosing container the list of servers"; + + list server { + key "address"; + description + "List of AAA servers"; + + leaf address { + type leafref { + path "../config/address"; + } + description + "Reference to the configured address of the AAA server"; + } + + container config { + description + "Configuration data "; + + uses aaa-server-config; + } + + container state { + config false; + + description + "Operational state data "; + + uses aaa-server-config; + uses aaa-server-state; + } + + uses aaa-tacacs-server-top { + when "../../config/type = 'oc-aaa:TACACS'"; + } + + uses aaa-radius-server-top { + when "../../config/type = 'oc-aaa:RADIUS'"; + } + } + } + } + + grouping aaa-admin-config { + description + "Configuration data for the system built-in + administrator / root user account"; + + leaf admin-password { + type string; + oc-ext:openconfig-hashed-value; + description + "The admin/root password, supplied as a cleartext string. + The system should hash and only store the password as a + hashed value."; + } + + leaf admin-password-hashed { + type oc-aaa-types:crypt-password-type; + description + "The admin/root password, supplied as a hashed value + using the notation described in the definition of the + crypt-password-type."; + } + } + + grouping aaa-admin-state { + description + "Operational state data for the root user"; + + leaf admin-username { + type string; + description + "Name of the administrator user account, e.g., admin, root, + etc."; + } + } + + grouping aaa-authentication-admin-top { + description + "Top-level grouping for root user configuration and state + data"; + + container admin-user { + description + "Top-level container for the system root or admin user + configuration and operational state"; + + container config { + description + "Configuration data for the root user account"; + + uses aaa-admin-config; + } + + container state { + config false; + + description + "Operational state data for the root user account"; + + uses aaa-admin-config; + uses aaa-admin-state; + } + } + } + grouping aaa-authentication-user-config { + description + "Configuration data for local users"; + + leaf username { + type string; + description + "Assigned username for this user"; + } + + leaf password { + type string; + oc-ext:openconfig-hashed-value; + description + "The user password, supplied as cleartext. The system + must hash the value and only store the hashed value."; + } + + leaf password-hashed { + type oc-aaa-types:crypt-password-type; + description + "The user password, supplied as a hashed value + using the notation described in the definition of the + crypt-password-type."; + } + + leaf ssh-key { + type string; + description + "SSH public key for the user (RSA or DSA)"; + } + + leaf role { + type union { + type string; + type identityref { + base oc-aaa-types:SYSTEM_DEFINED_ROLES; + } + } + description + "Role assigned to the user. The role may be supplied + as a string or a role defined by the SYSTEM_DEFINED_ROLES + identity."; + } + } + + grouping aaa-authentication-user-state { + description + "Operational state data for local users"; + } + + grouping aaa-authentication-user-top { + description + "Top-level grouping for local users"; + + container users { + description + "Enclosing container list of local users"; + + list user { + key "username"; + description + "List of local users on the system"; + + leaf username { + type leafref { + path "../config/username"; + } + description + "References the configured username for the user"; + } + + container config { + description + "Configuration data for local users"; + + uses aaa-authentication-user-config; + } + + container state { + config false; + + description + "Operational state data for local users"; + + uses aaa-authentication-user-config; + uses aaa-authentication-user-state; + } + } + + } + } + + grouping aaa-accounting-methods-common { + description + "Common definitions for accounting methods"; + + leaf-list accounting-method { + type union { + type identityref { + base oc-aaa-types:AAA_METHOD_TYPE; + } + type string; + //TODO: in YANG 1.1 this should be converted to a leafref to + //point to the server group name. + } + ordered-by user; + description + "An ordered list of methods used for AAA accounting for this + event type. The method is defined by the destination for + accounting data, which may be specified as the group of + all TACACS+/RADIUS servers, a defined server group, or + the local system."; + } + } + + + grouping aaa-accounting-events-config { + description + "Configuration data for AAA accounting events"; + + leaf event-type { + type identityref { + base oc-aaa-types:AAA_ACCOUNTING_EVENT_TYPE; + } + description + "The type of activity to record at the AAA accounting + server"; + } + + leaf record { + type enumeration { + enum START_STOP { + description + "Send START record to the accounting server at the + beginning of the activity, and STOP record at the + end of the activity."; + } + enum STOP { + description + "Send STOP record to the accounting server when the + user activity completes"; + } + } + description + "Type of record to send to the accounting server for this + activity type"; + } + } + + grouping aaa-accounting-events-state { + description + "Operational state data for accounting events"; + } + + grouping aaa-accounting-events-top { + description + "Top-level grouping for accounting events"; + + container events { + description + "Enclosing container for defining handling of events + for accounting"; + + list event { + key "event-type"; + description + "List of events subject to accounting"; + + leaf event-type { + type leafref { + path "../config/event-type"; + } + description + "Reference to the event-type being logged at the + accounting server"; + } + + container config { + description + "Configuration data for accounting events"; + + uses aaa-accounting-events-config; + } + + container state { + config false; + + description + "Operational state data for accounting events"; + + uses aaa-accounting-events-config; + uses aaa-accounting-events-state; + } + } + } + } + + grouping aaa-accounting-config { + description + "Configuration data for event accounting"; + + uses aaa-accounting-methods-common; + + } + + grouping aaa-accounting-state { + description + "Operational state data for event accounting services"; + } + + grouping aaa-accounting-top { + description + "Top-level grouping for user activity accounting"; + + container accounting { + description + "Top-level container for AAA accounting"; + + container config { + description + "Configuration data for user activity accounting."; + + uses aaa-accounting-config; + } + + container state { + config false; + + description + "Operational state data for user accounting."; + + uses aaa-accounting-config; + uses aaa-accounting-state; + } + + uses aaa-accounting-events-top; + + } + } + + grouping aaa-authorization-methods-config { + description + "Common definitions for authorization methods for global + and per-event type"; + + leaf-list authorization-method { + type union { + type identityref { + base oc-aaa-types:AAA_METHOD_TYPE; + } + type string; + } + ordered-by user; + description + "Ordered list of methods for authorizing commands. The first + method that provides a response (positive or negative) should + be used. The list may contain a well-defined method such + as the set of all TACACS or RADIUS servers, or the name of + a defined AAA server group. The system must validate + that the named server group exists."; + } + } + + grouping aaa-authorization-events-config { + description + "Configuration data for AAA authorization events"; + + leaf event-type { + type identityref { + base oc-aaa-types:AAA_AUTHORIZATION_EVENT_TYPE; + } + description + "The type of event to record at the AAA authorization + server"; + } + } + + grouping aaa-authorization-events-state { + description + "Operational state data for AAA authorization events"; + } + + grouping aaa-authorization-events-top { + description + "Top-level grouping for authorization events"; + + container events { + description + "Enclosing container for the set of events subject + to authorization"; + + list event { + key "event-type"; + description + "List of events subject to AAA authorization"; + + leaf event-type { + type leafref { + path "../config/event-type"; + } + description + "Reference to the event-type list key"; + } + + container config { + description + "Configuration data for each authorized event"; + + uses aaa-authorization-events-config; + } + + container state { + config false; + + description + "Operational state data for each authorized activity"; + + uses aaa-authorization-events-config; + uses aaa-authorization-events-state; + } + } + } + } + + grouping aaa-authorization-config { + description + "Configuration data for AAA authorization"; + + uses aaa-authorization-methods-config; + } + + grouping aaa-authorization-state { + description + "Operational state data for AAA authorization"; + } + + grouping aaa-authorization-top { + description + "Top-level grouping for AAA authorization"; + + container authorization { + description + "Top-level container for AAA authorization configuration + and operational state data"; + + container config { + description + "Configuration data for authorization based on AAA + methods"; + + uses aaa-authorization-config; + } + + container state { + config false; + + description + "Operational state data for authorization based on AAA"; + + uses aaa-authorization-config; + uses aaa-authorization-state; + } + + uses aaa-authorization-events-top; + + } + } + + grouping aaa-authentication-config { + description + "Configuration data for global authentication"; + + leaf-list authentication-method { + type union { + type identityref { + base oc-aaa-types:AAA_METHOD_TYPE; + } + type string; + //TODO: string should be a leafref to a defined + //server group. this will be possible in YANG 1.1 + //type leafref { + //path "/aaa/server-groups/server-group/config/name"; + //} + } + ordered-by user; + description + "Ordered list of authentication methods for users. This + can be either a reference to a server group, or a well- + defined designation in the AAA_METHOD_TYPE identity. If + authentication fails with one method, the next defined + method is tried -- failure of all methods results in the + user being denied access."; + } + } + + grouping aaa-authentication-state { + description + "Operational state data for global authentication"; + } + + grouping aaa-authentication-top { + description + "Top-level grouping for top-level authentication"; + + container authentication { + description + "Top-level container for global authentication data"; + + container config { + description + "Configuration data for global authentication services"; + + uses aaa-authentication-config; + } + + container state { + config false; + + description + "Operational state data for global authentication + services"; + + uses aaa-authentication-config; + uses aaa-authentication-state; + } + + uses aaa-authentication-admin-top; + uses aaa-authentication-user-top; + } + } + + grouping aaa-config { + description + "Configuration data for top level AAA"; + } + + grouping aaa-state { + description + "Operational state data for top level AAA"; + } + + grouping aaa-top { + description + "Top-level grouping for AAA services"; + + container aaa { + description + "Top-level container for AAA services"; + + container config { + description + "Configuration data for top level AAA services"; + + uses aaa-config; + } + + container state { + config false; + + description + "Operational state data for top level AAA services "; + + uses aaa-config; + uses aaa-state; + } + + uses aaa-authentication-top; + uses aaa-authorization-top; + uses aaa-accounting-top; + uses aaa-servergroup-common-top; + + } + } + + + + // data definition statements + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-acl@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-acl@2018-11-21.yang new file mode 100644 index 0000000..fe80988 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-acl@2018-11-21.yang @@ -0,0 +1,847 @@ +module openconfig-acl { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/acl"; + + prefix "oc-acl"; + + import openconfig-packet-match { prefix oc-match; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state + data for network access control lists (i.e., filters, rules, + etc.). ACLs are organized into ACL sets, with each set + containing one or more ACL entries. ACL sets are identified + by a unique name, while each entry within a set is assigned + a sequence-id that determines the order in which the ACL + rules are applied to a packet. Note that ACLs are evaluated + in ascending order based on the sequence-id (low to high). + + Individual ACL rules specify match criteria based on fields in + the packet, along with an action that defines how matching + packets should be handled. Entries have a type that indicates + the type of match criteria, e.g., MAC layer, IPv4, IPv6, etc."; + + oc-ext:openconfig-version "1.0.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.0.2"; + } + + revision "2018-04-24" { + description + "Clarified order of ACL evaluation"; + reference "1.0.1"; + } + + revision "2017-05-26" { + description + "Separated ACL entries by type"; + reference "1.0.0"; + } + + revision "2016-08-08" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + revision "2016-01-22" { + description + "Initial revision"; + reference "TBD"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + identity ACL_TYPE { + description + "Base identity for types of ACL sets"; + } + + identity ACL_IPV4 { + base ACL_TYPE; + description + "IP-layer ACLs with IPv4 addresses"; + } + + identity ACL_IPV6 { + base ACL_TYPE; + description + "IP-layer ACLs with IPv6 addresses"; + } + + identity ACL_L2 { + base ACL_TYPE; + description + "MAC-layer ACLs"; + } + + identity ACL_MIXED { + base ACL_TYPE; + description + "Mixed-mode ACL that specifies L2 and L3 protocol + fields. This ACL type is not implemented by many + routing/switching devices."; + } + + // ACL action type + + identity FORWARDING_ACTION { + description + "Base identity for actions in the forwarding category"; + } + + identity ACCEPT { + base FORWARDING_ACTION; + description + "Accept the packet"; + } + + identity DROP { + base FORWARDING_ACTION; + description + "Drop packet without sending any ICMP error message"; + } + + identity REJECT { + base FORWARDING_ACTION; + description + "Drop the packet and send an ICMP error message to the source"; + } + + identity LOG_ACTION { + description + "Base identity for defining the destination for logging + actions"; + } + + identity LOG_SYSLOG { + base LOG_ACTION; + description + "Log the packet in Syslog"; + } + + identity LOG_NONE { + base LOG_ACTION; + description + "No logging"; + } + + identity ACL_COUNTER_CAPABILITY { + description + "Base identity for system to indicate how it is able to report + counters"; + } + + identity INTERFACE_ONLY { + base ACL_COUNTER_CAPABILITY; + description + "ACL counters are available and reported only per interface"; + } + + identity AGGREGATE_ONLY { + base ACL_COUNTER_CAPABILITY; + description + "ACL counters are aggregated over all interfaces, and reported + only per ACL entry"; + } + + identity INTERFACE_AGGREGATE { + base ACL_COUNTER_CAPABILITY; + description + "ACL counters are reported per interface, and also aggregated + and reported per ACL entry."; + } + + // grouping statements + + // input interface + grouping input-interface-config { + description + "Config of interface"; + + } + + grouping input-interface-state { + description + "State information of interface"; + } + + grouping input-interface-top { + description + "Input interface top level container"; + + container input-interface { + description + "Input interface container"; + + container config { + description + "Config data"; + uses input-interface-config; + } + + container state { + config false; + description + "State information"; + uses input-interface-config; + uses input-interface-state; + } + + uses oc-if:interface-ref; + + } + } + + // Action Type + grouping action-config { + description + "Config of action type"; + + + leaf forwarding-action { + type identityref { + base FORWARDING_ACTION; + } + mandatory true; + description + "Specifies the forwarding action. One forwarding action + must be specified for each ACL entry"; + } + + leaf log-action { + type identityref { + base LOG_ACTION; + } + default LOG_NONE; + description + "Specifies the log action and destination for + matched packets. The default is not to log the + packet."; + } + + + } + + grouping action-state { + description + "State information of action type"; + + } + + grouping action-top { + description + "ACL action type top level container"; + + container actions { + description + "Enclosing container for list of ACL actions associated + with an entry"; + + container config { + description + "Config data for ACL actions"; + uses action-config; + } + + container state { + config false; + description + "State information for ACL actions"; + uses action-config; + uses action-state; + } + } + } + + grouping acl-counters-state { + description + "Common grouping for ACL counters"; + + leaf matched-packets { + type oc-yang:counter64; + description + "Count of the number of packets matching the current ACL + entry. + + An implementation should provide this counter on a + per-interface per-ACL-entry if possible. + + If an implementation only supports ACL counters per entry + (i.e., not broken out per interface), then the value + should be equal to the aggregate count across all interfaces. + + An implementation that provides counters per entry per + interface is not required to also provide an aggregate count, + e.g., per entry -- the user is expected to be able implement + the required aggregation if such a count is needed."; + } + + leaf matched-octets { + type oc-yang:counter64; + description + "Count of the number of octets (bytes) matching the current + ACL entry. + + An implementation should provide this counter on a + per-interface per-ACL-entry if possible. + + If an implementation only supports ACL counters per entry + (i.e., not broken out per interface), then the value + should be equal to the aggregate count across all interfaces. + + An implementation that provides counters per entry per + interface is not required to also provide an aggregate count, + e.g., per entry -- the user is expected to be able implement + the required aggregation if such a count is needed."; + } + + } + + // Access List Entries + grouping access-list-entries-config { + description + "Access List Entries (ACE) config."; + + leaf sequence-id { + type uint32; + description + "The sequence id determines the order in which ACL entries + are applied. The sequence id must be unique for each entry + in an ACL set. Target devices should apply the ACL entry + rules in ascending order determined by sequence id (low to + high), rather than the relying only on order in the list."; + } + + leaf description { + type string; + description + "A user-defined description, or comment, for this Access List + Entry."; + } + + } + + grouping access-list-entries-state { + description + "Access List Entries state."; + + uses acl-counters-state; + + } + + grouping access-list-entries-top { + description + "Access list entries to level container"; + + container acl-entries { + description + "Access list entries container"; + + list acl-entry { + key "sequence-id"; + description + "List of ACL entries comprising an ACL set"; + + leaf sequence-id { + type leafref { + path "../config/sequence-id"; + } + description + "references the list key"; + } + + container config { + description + "Access list entries config"; + uses access-list-entries-config; + } + + container state { + config false; + description + "State information for ACL entries"; + uses access-list-entries-config; + uses access-list-entries-state; + } + + uses oc-match:ethernet-header-top { + when "../../config/type='ACL_L2'" { + description + "MAC-layer fields are valid when the ACL type is L2"; + } + } + uses oc-match:ipv4-protocol-fields-top { + when "../../config/type='ACL_IPV4'" { + description + "IPv4-layer fields are valid when the ACL type is + IPv4"; + } + } + uses oc-match:ipv6-protocol-fields-top { + when "../../config/type='ACL_IPV6'" { + description + "IPv6-layer fields are valid when the ACL type is + IPv6"; + } + } + uses oc-match:transport-fields-top { + when "../../config/type='ACL_IPV6' or " + + "../../config/type='ACL_IPV4'" { + description + "Transport-layer fields are valid when specifying + L3 ACL types"; + } + } + uses input-interface-top; + + uses action-top; + } + } + } + + grouping acl-set-config { + description + "Access Control List config"; + + leaf name { + type string; + description + "The name of the access-list set"; + } + + leaf type { + type identityref { + base ACL_TYPE; + } + description + "The type determines the fields allowed in the ACL entries + belonging to the ACL set (e.g., IPv4, IPv6, etc.)"; + } + + leaf description { + type string; + description + "Description, or comment, for the ACL set"; + } + + } + + grouping acl-set-state { + description + "Access Control List state"; + } + + grouping acl-set-top { + description + "Access list entries variables top level container"; + + container acl-sets { + description + "Access list entries variables enclosing container"; + + list acl-set { + key "name type"; + description + "List of ACL sets, each comprising of a list of ACL + entries"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name list key"; + } + + leaf type { + type leafref { + path "../config/type"; + } + description + "Reference to the type list key"; + } + + container config { + description + "Access list config"; + uses acl-set-config; + } + + container state { + config false; + description + "Access list state information"; + uses acl-set-config; + uses acl-set-state; + } + uses access-list-entries-top; + } + } + } + + grouping interface-acl-entries-config { + description + "Configuration data for per-interface ACLs"; + + } + + grouping interface-acl-entries-state { + description + "Operational state data for per-interface ACL entries"; + + leaf sequence-id { + type leafref { + path "/acl/acl-sets/" + + "acl-set[name=current()/../../../../set-name]" + + "[type=current()/../../../../type]/" + + "acl-entries/acl-entry/sequence-id"; + } + description + "Reference to an entry in the ACL set applied to an + interface"; + } + + uses acl-counters-state; + + } + + grouping interface-acl-entries-top { + description + "Top-level grouping for per-interface ACL entries"; + + container acl-entries { + config false; + description + "Enclosing container for list of references to ACLs"; + + list acl-entry { + key "sequence-id"; + description + "List of ACL entries assigned to an interface"; + + leaf sequence-id { + type leafref { + path "../state/sequence-id"; + } + description + "Reference to per-interface acl entry key"; + } + + // no config container since the enclosing container is + // read-only + + container state { + + config false; + + description + "Operational state data for per-interface ACL entries"; + + uses interface-acl-entries-config; + uses interface-acl-entries-state; + } + } + } + } + + grouping interface-ingress-acl-config { + description + "Configuration data for per-interface ingress ACLs"; + + leaf set-name { + type leafref { + path "../../../../../../acl-sets/acl-set/config/name"; + } + description + "Reference to the ACL set name applied on ingress"; + } + + leaf type { + type leafref { + path "../../../../../../acl-sets/acl-set[name=current()/../set-name]" + + "/config/type"; + } + description + "Reference to the ACL set type applied on ingress"; + } + } + + grouping interface-ingress-acl-state { + description + "Operational state data for the per-interface ingress ACL"; + } + + grouping interface-ingress-acl-top { + description + "Top-level grouping for per-interface ingress ACL data"; + + container ingress-acl-sets { + description + "Enclosing container the list of ingress ACLs on the + interface"; + + list ingress-acl-set { + key "set-name type"; + description + "List of ingress ACLs on the interface"; + + leaf set-name { + type leafref { + path "../config/set-name"; + } + description + "Reference to set name list key"; + } + + leaf type { + type leafref { + path "../config/type"; + } + description + "Reference to type list key"; + } + + container config { + description + "Configuration data "; + + uses interface-ingress-acl-config; + } + + container state { + + config false; + + description + "Operational state data for interface ingress ACLs"; + + uses interface-ingress-acl-config; + uses interface-ingress-acl-state; + } + + uses interface-acl-entries-top; + } + } + } + + grouping interface-egress-acl-config { + description + "Configuration data for per-interface egress ACLs"; + + leaf set-name { + type leafref { + path "../../../../../../acl-sets/acl-set/config/name"; + } + description + "Reference to the ACL set name applied on egress"; + } + + leaf type { + type leafref { + path "../../../../../../acl-sets/acl-set[name=current()/../set-name]" + + "/config/type"; + } + description + "Reference to the ACL set type applied on egress."; + } + } + + grouping interface-egress-acl-state { + description + "Operational state data for the per-interface egress ACL"; + } + + grouping interface-egress-acl-top { + description + "Top-level grouping for per-interface egress ACL data"; + + container egress-acl-sets { + description + "Enclosing container the list of egress ACLs on the + interface"; + + list egress-acl-set { + key "set-name type"; + description + "List of egress ACLs on the interface"; + + leaf set-name { + type leafref { + path "../config/set-name"; + } + description + "Reference to set name list key"; + } + + leaf type { + type leafref { + path "../config/type"; + } + description + "Reference to type list key"; + } + + container config { + description + "Configuration data "; + + uses interface-egress-acl-config; + } + + container state { + + config false; + + description + "Operational state data for interface egress ACLs"; + + uses interface-egress-acl-config; + uses interface-egress-acl-state; + } + + uses interface-acl-entries-top; + } + } + } + + grouping acl-interfaces-config { + description + "Configuration data for interface references"; + + leaf id { + type oc-if:interface-id; + description + "User-defined identifier for the interface -- a common + convention could be '.'"; + } + } + + grouping acl-interfaces-state { + description + "Operational state data for interface references"; + } + + grouping acl-interfaces-top { + description + "Top-level grouping for interface-specific ACL data"; + + container interfaces { + description + "Enclosing container for the list of interfaces on which + ACLs are set"; + + list interface { + key "id"; + description + "List of interfaces on which ACLs are set"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to the interface id list key"; + } + + container config { + description + "Configuration for ACL per-interface data"; + + uses acl-interfaces-config; + } + + container state { + + config false; + + description + "Operational state for ACL per-interface data"; + + uses acl-interfaces-config; + uses acl-interfaces-state; + } + + uses oc-if:interface-ref; + uses interface-ingress-acl-top; + uses interface-egress-acl-top; + } + } + } + + grouping acl-config { + description + "Global configuration data for ACLs"; + } + + grouping acl-state { + description + "Global operational state data for ACLs"; + + leaf counter-capability { + type identityref { + base ACL_COUNTER_CAPABILITY; + } + description + "System reported indication of how ACL counters are reported + by the target"; + } + } + grouping acl-top { + description + "Top level grouping for ACL data and structure"; + + container acl { + description + "Top level enclosing container for ACL model config + and operational state data"; + + container config { + description + "Global config data for ACLs"; + + uses acl-config; + } + + container state { + + config false; + + description + "Global operational state data for ACLs"; + + uses acl-config; + uses acl-state; + } + + uses acl-set-top; + uses acl-interfaces-top; + } + } + + // data definition statements + uses acl-top; + + // augment statements + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-common@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-common@2019-11-07.yang new file mode 100644 index 0000000..84b8aeb --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-common@2019-11-07.yang @@ -0,0 +1,582 @@ +submodule openconfig-aft-common { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-interfaces { prefix "oc-if"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-yang-types { prefix "oc-yang"; } + import openconfig-inet-types { prefix "oc-inet"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + import openconfig-policy-types { prefix "oc-pol-types"; } + import openconfig-aft-types { prefix "oc-aftt"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings that are re-used + across multiple contexts within the AFT model."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-nhop-structural { + description + "Structural grouping describing a next-hop entry."; + + container next-hops { + description + "The list of next-hops that are to be used for entry within + the AFT table. The structure of each next-hop is address + family independent, such that it is possible to resolve fully + how the next-hop is treated. For example: + + - Where ingress IPv4 unicast packets are to be forwarded via + an MPLS LSP, the next-hop list should indicate the MPLS + label stack that is used to the next-hop. + - Where ingress MPLS labelled packets are to be forwarded to + an IPv6 nexthop (for example, a CE within a VPN, then the + popped label stack, and IPv6 next-hop address should be + indicated)."; + + list next-hop { + key "index"; + + description + "A next-hop associated with the forwarding instance."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "A unique index identifying the next-hop entry for the + AFT entry"; + + } + + container config { + description + "Configuration parameters relating to the AFT next-hop + entry"; + + uses aft-common-entry-nexthop-config; + } + + container state { + config false; + description + "Operational state parameters relating to the AFT + next-hop entry"; + + uses aft-common-entry-nexthop-config; + uses aft-common-entry-nexthop-state; + uses aft-labeled-entry-state; + } + + uses oc-if:interface-ref; + } + } + } + + grouping aft-common-entry-state { + description + "Operational state parameters relating to a forwarding entry"; + + leaf packets-forwarded { + type oc-yang:counter64; + description + "The number of packets which have matched, and been forwarded, + based on the AFT entry."; + } + + leaf octets-forwarded { + type oc-yang:counter64; + description + "The number of octets which have matched, and been forwarded, + based on the AFT entry"; + } + + // We are at $afi/$entry/state/next-hop-group + leaf next-hop-group { + type leafref { + path "../../../../next-hop-groups/next-hop-group/config/id"; + } + description + "A reference to the next-hop-group that is in use for the entry + within the AFT. Traffic is distributed across the set of next-hops + within the next-hop group according to the weight."; + } + } + + grouping aft-labeled-entry-state { + description + "Operational state for LSP name in forwarding entry"; + + leaf lsp-name { + type string; + description + "Where applicable, the protocol name for the next-hop labelled + forwarding entry. This leaf is applicable only to next-hops + which include MPLS label information, and its value typically + corresponds to the RSVP-TE LSP name."; + } + } + + grouping aft-common-entry-nexthop-config { + description + "Configuration parameters relating to a next-hop entry for a AFT + entry"; + + leaf index { + type uint64; + description + "A unique entry for the next-hop."; + } + } + + grouping aft-common-entry-nexthop-state { + description + "Parameters relating to a next-hop."; + + leaf ip-address { + type oc-inet:ip-address; + description + "The IP address of the next-hop system."; + } + + leaf mac-address { + type oc-yang:mac-address; + description + "The MAC address of the next-hop if resolved by the local + network instance."; + } + + leaf-list pushed-mpls-label-stack { + type oc-mplst:mpls-label; + ordered-by user; + description + "The MPLS label stack imposed when forwarding packets to the + next-hop + - the stack is encoded as a leaf list whereby the order of the + entries is such that the first entry in the list is the + label at the bottom of the stack to be pushed. + + To this end, a packet which is to forwarded to a device using + a service label of 42, and a transport label of 8072 will be + represented with a label stack list of [42, 8072]. + + The MPLS label stack list is ordered by the user, such that no + system re-ordering of leaves is permitted by the system. + + A swap operation is reflected by entries in the + popped-mpls-label-stack and pushed-mpls-label-stack nodes."; + + } + + leaf encapsulate-header { + type oc-aftt:encapsulation-header-type; + description + "When forwarding a packet to the specified next-hop the local + system performs an encapsulation of the packet - adding the + specified header type."; + } + + uses aft-common-install-protocol; + } + + grouping aft-common-install-protocol { + description + "Grouping for a common reference to the protocol which + installed an entry."; + + leaf origin-protocol { + type identityref { + base "oc-pol-types:INSTALL_PROTOCOL_TYPE"; + } + description + "The protocol from which the AFT entry was learned."; + } + + } + + grouping aft-common-ip-state { + description + "Common parameters across IP address families"; + + uses aft-common-install-protocol; + + leaf decapsulate-header { + type oc-aftt:encapsulation-header-type; + description + "When forwarding a packet to the specified next-hop, the local + system performs a decapsulation of the packet - removing the + specified header type. In the case that no next-hop is + specified, the packet header is removed, and a subsequent + forwarding lookup is performed on the packet encapsulated + within the header, matched within the relevant AFT within the + specified network-instance."; + } + } + + grouping aft-next-hop-groups-structural { + description + "Logical grouping for groups of next-hops."; + + container next-hop-groups { + description + "Surrounding container for groups of next-hops."; + + list next-hop-group { + key "id"; + + description + "An individual set of next-hops grouped into a common group. + Each entry within an abstract forwarding table points to a + next-hop-group. Entries in the next-hop-group are forwarded to + according to the weights specified for each next-hop group. + + If an entry within the next-hop group becomes unusable, for + example due to an interface failure, the remaining entries + are used until all entries become unusable - at which point + the backup next-hop-group (if specified) is used."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "A reference to a unique identifier for the next-hop-group."; + } + + container config { + description + "Configuration parameters related to the next-hop-group."; + uses aft-nhg-config; + } + + container state { + config false; + description + "Operational state parameters relating to next-hop-groups."; + uses aft-nhg-config; + uses aft-nhg-state; + } + + container next-hops { + description + "Surrounding container for the list of next-hops within + the next-hop-group."; + + list next-hop { + key "index"; + + description + "An individual next-hop within the next-hop-group. Each + next-hop is a reference to an entry within the next-hop + list."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "A reference to the index for the next-hop within the + the next-hop-group."; + } + + container config { + description + "Configuration parameters related to a next-hop within + the next-hop-group."; + uses aft-nhg-nh-config; + } + + container state { + config false; + description + "Operational state parameters related to a next-hop + within the next-hop-group."; + uses aft-nhg-nh-config; + uses aft-nhg-nh-state; + } + } + } + + container conditional { + description + "When a system selects a next-hop-group based on conditions + in addition to those specified in the referencing table entries + (for example, DSCP is used in addition to the IPv4 destination + prefix), these conditions are specified in the conditions list. + Where such conditions exist, the next-hop-group MUST only + specify next-hop-groups under the conditional list, and therefore + MUST NOT specify any corresponding next-hops. The + next-hop-groups that are referenced by any conditions MUST + reference only next-hops and therefore MUST NOT be conditional + themselves."; + + list condition { + key "id"; + + description + "A conditional next-hop-group that is used by the AFT + entry. The conditions that are specified within the + group are logically ANDed together. If a condition + is a leaf-list field its contents are logically ORed."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "A reference to the identifier for the condition."; + } + + container config { + description + "Configuration parameters related to the conditional + next-hop selection."; + + uses aft-nhg-conditional-config; + } + + container state { + config false; + description + "Operational state parameters related to the conditional + next-hop selection."; + uses aft-nhg-conditional-config; + uses aft-nhg-conditional-state; + } + + container input-interfaces { + description + "The set of input interfaces that are required to be matched for + the next-hop-group condition to be met. Each non-interface condition + is logically ANDed with each member of the list -- i.e., interfaces in + the list are logically ORed. + + If the input-interface list is empty, the condition applies to ALL input + interfaces."; + + list input-interface { + key "id"; + + description + "The input interface that must be matched for the condition to be met."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to the unique ID assigned to the input interface within + the conditions list."; + } + + container config { + description + "Configuration parameters that relate to the input interface."; + uses aft-nhg-conditional-interface-config; + } + + container state { + config false; + description + "Operational state parameters that relate to the input interface."; + uses aft-nhg-conditional-interface-config; + uses aft-nhg-conditional-interface-state; + } + } + } + } + } + } + } + } + + grouping aft-nhg-config { + description + "Configuration parameters related to a next-hop-group."; + + leaf id { + type uint64; + description + "A unique identifier for the next-hop-group. This index + is not expected to be consistent across reboots, or + reprogramming of the next-hop-group. When updating + a next-hop-group, if the group is removed by the system + or assigned an alternate identifier, the system should + send telemetry notifications deleting the previous + identifier. If the identifier of the next-hop-group + is changed, all AFT entries that reference it must + also be updated."; + } + } + + grouping aft-nhg-state { + description + "Operational state parameters related to a next-hop-group."; + + leaf color { + type uint64; + description + "An arbitrary colour that is used as an identifier for the next-hop + group. Some next-hop resolutions may utilise the colour to select + the particular next-hop-group that a routing entry should be resolved + to. In this case, next-hop-group selection may be based on colour + matches rather than the protocol specified next-hop. + + Regardless of whether the next-hop-group's specified colour is + used to select an AFT's active forwarding entry, the next-hop-group + referenced by an entry should be the currently active value. + + Next-hop-groups that are installed on the system through a protocol + that allows injection of such entries (e.g., BGP using the SR-TE + Policy SAFI, or gRPC-based RIB programming) should have the colour + specified in the injecting protocol within this leaf."; + } + + leaf backup-next-hop-group { + // We are at afts/next-hop-groups/next-hop-group/config/backup-next-hop-group + type leafref { + path "../../../next-hop-group/config/id"; + } + description + "The backup next-hop-group for the current group. When all + entries within the next-hop group become unusable, the backup + next-hop group is used if specified."; + } + } + + grouping aft-nhg-nh-config { + description + "Configuration parameters relating to an individual next-hop within + a next-hop-group."; + + leaf index { + type leafref { + // We are at afts/next-hop-groups/next-hop-group/next-hops/next-hop/config/id + path "../../../../../../next-hops/next-hop/config/index"; + } + description + "A reference to the identifier for the next-hop to which + the entry in the next-hop group corresponds."; + } + } + + grouping aft-nhg-nh-state { + description + "Operational state parameters relating to an individual next-hop + within the next-hop-group."; + + leaf weight { + type uint64; + description + "The weight applied to the next-hop within the group. Traffic + is balanced across the next-hops within the group in the + proportion of weight/(sum of weights of the next-hops within + the next-hop group)."; + } + } + + grouping aft-nhg-conditional-config { + description + "Configuration parameters relating to the conditional selection of + a next-hop group for an AFT entry."; + + leaf id { + type uint64; + description + "A unique identifier for the conditional criteria."; + } + } + + grouping aft-nhg-conditional-state { + description + "Operational state parameters relating to the conditional selection + of a next-hop group for an AFT entry."; + + leaf-list dscp { + type oc-inet:dscp; + description + "A set of DSCP values that must be matched by an input packet for + the next-hop-group specified to be selected. A logical OR is applied + across the DSCP values."; + } + + leaf next-hop-group { + type leafref { + // we are at afts/next-hop-groups/next-hop-group/conditions/condition/state/next-hop-group + path "../../../../../next-hop-group/config/id"; + } + description + "The next-hop-group that is used by the system for packets that match + the criteria specified."; + } + } + + grouping aft-nhg-conditional-interface-config { + description + "Configuration parameters relating to the input-interface condition for + a next-hop-group."; + + leaf id { + type string; + description + "A unique reference for the input interface."; + } + } + + grouping aft-nhg-conditional-interface-state { + description + "Operational state parameters relating to the input-interface condition + for a next-hop-group."; + uses oc-if:interface-ref-common; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-ethernet@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-ethernet@2019-11-07.yang new file mode 100644 index 0000000..5a9c465 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-ethernet@2019-11-07.yang @@ -0,0 +1,121 @@ +submodule openconfig-aft-ethernet { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-yang-types { prefix "oc-yang"; } + + // Include common cross-AFT groupings from the common submodule. + include openconfig-aft-common; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings for the abstract + forwarding tables for Ethernet."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-ethernet-structural { + description + "Structural grouping defining the schema for the Ethernet + abstract forwarding table."; + + list mac-entry { + key "mac-address"; + + description + "List of the Ethernet entries within the abstract + forwarding table. This list is keyed by the outer MAC address + of the Ethernet frame."; + + leaf mac-address { + type leafref { + path "../config/mac-address"; + } + description + "Reference to the outer MAC address matched by the + entry."; + } + + container config { + description + "Configuration parameters for the Ethernet AFT entry."; + uses aft-ethernet-entry-config; + } + + container state { + config false; + description + "Operational state parameters for the Ethernet AFT + entry."; + uses aft-ethernet-entry-config; + uses aft-ethernet-entry-state; + } + } + } + + grouping aft-ethernet-entry-config { + description + "Configuration parameters for the Ethernet AFT entry."; + + leaf mac-address { + type oc-yang:mac-address; + description + "The outer MAC address of the Ethernet frame that must + be matched for the AFT entry to be utilised."; + } + } + + grouping aft-ethernet-entry-state { + description + "Operational state parameters for the Ethernet AFT entry."; + uses aft-common-entry-state; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-ipv4@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-ipv4@2019-11-07.yang new file mode 100644 index 0000000..d230a60 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-ipv4@2019-11-07.yang @@ -0,0 +1,122 @@ +submodule openconfig-aft-ipv4 { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-inet-types { prefix "oc-inet"; } + + // Include common cross-AFT groupings from the common submodule. + include openconfig-aft-common; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings for the abstract + forwarding tables for IPv4."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-ipv4-unicast-structural { + description + "Structural grouping defining the schema for the IPv4 unicast + abstract forwarding table."; + + list ipv4-entry { + key "prefix"; + + description + "List of the IPv4 unicast entries within the abstract + forwarding table. This list is keyed by the destination IPv4 + prefix."; + + leaf prefix { + type leafref { + path "../config/prefix"; + } + description + "Reference to the IPv4 unicast destination prefix which + must be matched to utilise the AFT entry."; + } + + container config { + description + "Configuration parameters for the IPv4 unicast AFT entry."; + uses aft-ipv4-unicast-entry-config; + } + + container state { + config false; + description + "Operational state parameters for the IPv4 unicast AFT + entry."; + uses aft-ipv4-unicast-entry-config; + uses aft-ipv4-unicast-entry-state; + } + } + } + + grouping aft-ipv4-unicast-entry-config { + description + "Configuration parameters for the IPv4 unicast entry."; + + leaf prefix { + type oc-inet:ipv4-prefix; + description + "The IPv4 destination prefix that should be matched to + utilise the AFT entry."; + } + } + + grouping aft-ipv4-unicast-entry-state { + description + "Operational state parameters for the IPv4 unicast entry."; + uses aft-common-entry-state; + uses aft-common-ip-state; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-ipv6@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-ipv6@2019-11-07.yang new file mode 100644 index 0000000..3fbaf08 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-ipv6@2019-11-07.yang @@ -0,0 +1,122 @@ +submodule openconfig-aft-ipv6 { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-inet-types { prefix "oc-inet"; } + + // Include common cross-AFT groupings from the common submodule. + include openconfig-aft-common; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings for the abstract + forwarding tables for IPv6."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-ipv6-unicast-structural { + description + "Structural grouping defining the schema for the IPv6 unicast + abstract forwarding table."; + + list ipv6-entry { + key "prefix"; + + description + "List of the IPv6 unicast entries within the abstract + forwarding table. This list is keyed by the destination IPv6 + prefix."; + + leaf prefix { + type leafref { + path "../config/prefix"; + } + description + "Reference to the IPv6 unicast destination prefix which + must be matched to utilise the AFT entry."; + } + + container config { + description + "Configuration parameters for the IPv6 unicast AFT entry."; + uses aft-ipv6-unicast-entry-config; + } + + container state { + config false; + description + "Operational state parameters for the IPv6 unicast AFT + entry."; + uses aft-ipv6-unicast-entry-config; + uses aft-ipv6-unicast-entry-state; + } + } + } + + grouping aft-ipv6-unicast-entry-config { + description + "Configuration parameters for the IPv6 unicast entry."; + + leaf prefix { + type oc-inet:ipv6-prefix; + description + "The IPv6 destination prefix that should be matched to + utilise the AFT entry."; + } + } + + grouping aft-ipv6-unicast-entry-state { + description + "Operational state parameters for the IPv6 unicast entry."; + uses aft-common-entry-state; + uses aft-common-ip-state; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-mpls@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-mpls@2019-11-07.yang new file mode 100644 index 0000000..823a034 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-mpls@2019-11-07.yang @@ -0,0 +1,139 @@ +submodule openconfig-aft-mpls { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + + // Include common cross-AFT groupings from the common submodule. + include openconfig-aft-common; + + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings for the abstract + forwarding table for MPLS label forwarding."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-mpls-structural { + description + "Structural grouping defining the schema for the MPLS + abstract forwarding table."; + + list label-entry { + key "label"; + + description + "List of the MPLS entries within the abstract + forwarding table. This list is keyed by the top-most MPLS + label."; + + leaf label { + type leafref { + path "../config/label"; + } + description + "Reference to the top-most MPLS label matched by the + entry."; + } + + container config { + description + "Configuration parameters for the MPLS AFT entry."; + uses aft-mpls-entry-config; + } + + container state { + config false; + description + "Operational state parameters for the MPLS AFT + entry."; + uses aft-mpls-entry-config; + uses aft-mpls-entry-state; + } + } + } + + grouping aft-mpls-entry-config { + description + "Configuration parameters for the MPLS entry."; + + leaf label { + type oc-mplst:mpls-label; + description + "The top-most MPLS label that should be matched to + utilise the AFT entry."; + } + } + + grouping aft-mpls-entry-state { + description + "Operational state parameters for the MPLS entry."; + uses aft-common-entry-state; + + leaf-list popped-mpls-label-stack { + type oc-mplst:mpls-label; + description + "The MPLS label stack to be popped from the packet when + switched by the system. The stack is encoded as a leaf-list + such that the first entry is the label that is outer-most (i.e., + furthest from the bottom of the stack). + + If the local system pops the outer-most label 400, then the + value of this list is [400,]. If the local system removes two + labels, the outer-most being 500, and the second of which is + 400, then the value of the list is [500, 400]. + + A swap operation is reflected by entries in the + popped-mpls-label-stack and pushed-mpls-label-stack nodes."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-network-instance@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-aft-network-instance@2018-11-21.yang new file mode 100644 index 0000000..2d577ec --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-network-instance@2018-11-21.yang @@ -0,0 +1,109 @@ +module openconfig-aft-network-instance { + yang-version "1"; + + namespace "http://openconfig.net/yang/aft/ni"; + prefix "oc-aftni"; + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-network-instance { prefix "oc-ni"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module provides augmentations that are utilized + when building the OpenConfig network instance model to + add per-NI AFTs."; + + oc-ext:openconfig-version "0.2.3"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.3"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.2.2"; + } + + revision 2017-01-13 { + description + "Updated revision for external review"; + reference "0.2.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:afts/oc-ni:next-hops/oc-ni:next-hop/oc-ni:state" { + + description + "Add leaves that require referencing of a network instance to the + operational state parameters of a next-hop within the AFT for IPv4 + unicast."; + + uses aft-nexthop-ni-state; + } + + grouping aft-nexthop-ni-state { + description + "Operational state parameters relating to a next-hop which reference a + network instance."; + + leaf network-instance { + type oc-ni:network-instance-ref; + description + "The network-instance within which the next-hop should be resolved. + When this leaf is unspecified, the next-hop is resolved within + the local instance."; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:afts/oc-ni:ipv4-unicast/oc-ni:ipv4-entry/oc-ni:state" { + description + "Add leaves that require referencing of a network instance to the + operational state parameters of an entry within the IPv4 unicast AFT."; + + uses aft-entry-ni-state; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:afts/oc-ni:ipv6-unicast/oc-ni:ipv6-entry/oc-ni:state" { + description + "Add leaves that require referencing of a network instance to the + operational state parameters of an entry within the IPv6 unicast AFT."; + + uses aft-entry-ni-state; + } + + grouping aft-entry-ni-state { + description + "Operational state parameters relating to an AFT entry which reference + a network instance."; + + leaf origin-network-instance { + type oc-ni:network-instance-ref; + description + "If the AFT entry was imported from another network instance (e.g., it + corresponds to a L3 forwarding entry which was learned within another + network-instance), the value of this leaf reflects the network-instance + from which it was learned. + + For example, if the local network-instance corresponds to a L3VRF, and + routes are imported from the VPNv4 address-family of the BGP instance + in the DEFAULT_INSTANCE, then this value would reflect the + DEFAULT_INSTANCE as the origin-network-instance."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-pf@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-pf@2019-11-07.yang new file mode 100644 index 0000000..8ed8cf6 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-pf@2019-11-07.yang @@ -0,0 +1,200 @@ +submodule openconfig-aft-pf { + belongs-to "openconfig-aft" { + prefix "oc-aft"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-inet-types { prefix "oc-inet"; } + import openconfig-yang-types { prefix "oc-yang"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + import openconfig-packet-match-types { + prefix "oc-pkt-match-types"; + } + + // Include common cross-AFT groupings from the common submodule. + include openconfig-aft-common; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Submodule containing definitions of groupings for the abstract + forwarding table(s) for policy forwarding entries. These are + defined to be forwarding tables that allow matches on + fields other than the destination address that is used in + other forwarding tables."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + grouping aft-pf-structural { + description + "Structural grouping defining the schema for the policy + forwarding abstract forwarding table."; + + list policy-forwarding-entry { + key "index"; + + description + "List of the policy forwarding entries within the abstract + forwarding table. Each entry is uniquely identified by an + index on the system, due to the arbitrary match conditions + that may be implemented within the policy forwarding AFT. + The index may change upon changes of the entry if, and only + if, the device exporting the AFT replaces the entire entry + by removing the previous entry and replacing it with a + subsequent updated version."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the arbitary index for the policy forwarding + AFT entry."; + } + + container config { + description + "Configuration parameters for the Policy forwarding + AFT entry."; + uses aft-pf-entry-config; + } + + container state { + config false; + description + "Operational state parameters for the Policy Forwarding + AFT entry."; + uses aft-pf-entry-config; + uses aft-pf-entry-state; + } + } + } + + grouping aft-pf-entry-config { + description + "Configuration parameters for the Policy Forwarding + AFT entry."; + + leaf index { + type uint64; + description + "An arbitrary 64-bit index identifying the policy forwarding + AFT entry."; + } + + leaf ip-prefix { + type oc-inet:ip-prefix; + description + "The IP prefix that the forwarding entry matches."; + } + + leaf mac-address { + type oc-yang:mac-address; + description + "The MAC address that the forwarding entry matches. Used for + Layer 2 forwarding entries, e.g., within a VSI instance."; + } + + leaf mpls-label { + type oc-mplst:mpls-label; + description + "The MPLS label that the forwarding entry matches. Used for + MPLS forwarding entries, whereby the local device acts as an + LSR."; + } + + leaf mpls-tc { + type oc-mplst:mpls-tc; + description + "The value of the MPLS Traffic Class bits (formerly known as + the MPLS experimental bits) that are to be matched by the AFT + entry."; + reference + "RFC5462: Multiprotocol Label Switching (MPLS) Label Stack + Entry: 'EXP' Field Renamed to 'Traffic Class' Field"; } + + leaf ip-dscp { + type oc-inet:dscp; + description + "The value of the differentiated services code point (DSCP) to + be matched for the forwarding entry. The value is specified in + cases where specific class-based forwarding based on IP is + implemented by the device."; + } + + leaf ip-protocol { + type oc-pkt-match-types:ip-protocol-type; + description + "The value of the IP protocol field of an IPv4 packet, or the + next-header field of an IPv6 packet which is to be matched by + the AFT entry. This field is utilised where forwarding is + performed based on L4 information."; + } + + leaf l4-src-port { + type oc-inet:port-number; + description + "The value of the source port field of the transport header + that is to be matched by the AFT entry."; + } + + leaf l4-dst-port { + type oc-inet:port-number; + description + "The value of the destination port field of the transport + header that is to be matched by the AFT entry."; + } + } + + grouping aft-pf-entry-state { + description + "Operational state parameters for the Policy Forwarding + AFT entry."; + uses aft-common-entry-state; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft-types@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft-types@2019-11-07.yang new file mode 100644 index 0000000..ade141f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft-types@2019-11-07.yang @@ -0,0 +1,81 @@ +module openconfig-aft-types { + + namespace "http://openconfig.net/yang/fib-types"; + prefix "oc-aftt"; + + import openconfig-extensions { prefix "oc-ext"; } + + organization + "OpenConfig Working Group"; + + contact + "OpenConfig Working Group + www.openconfig.net"; + + description + "Types related to the OpenConfig Abstract Forwarding + Table (AFT) model"; + + oc-ext:openconfig-version "0.3.4"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.3.4"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + typedef encapsulation-header-type { + type enumeration { + enum GRE { + description + "The encapsulation header is a Generic Routing Encapsulation + header."; + } + enum IPV4 { + description + "The encapsulation header is an IPv4 packet header"; + } + enum IPV6 { + description + "The encapsulation header is an IPv6 packet header"; + } + enum MPLS { + description + "The encapsulation header is one or more MPLS labels indicated + by the pushed and popped label stack lists."; + } + } + description + "Types of tunnel encapsulation that are supported by systems as either + head- or tail-end."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-aft@2019-11-07.yang b/exp/yangcli/h3c-yang/openconfig-aft@2019-11-07.yang new file mode 100644 index 0000000..89e99da --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-aft@2019-11-07.yang @@ -0,0 +1,177 @@ +module openconfig-aft { + + yang-version "1"; + + namespace "http://openconfig.net/yang/aft"; + + prefix "oc-aft"; + + import openconfig-extensions { prefix "oc-ext"; } + + // Include IPv4 AFT submodule. + include openconfig-aft-ipv4; + // Include IPv6 AFT submodule. + include openconfig-aft-ipv6; + // Include MPLS AFT submodule. + include openconfig-aft-mpls; + // Include policy forwarding AFT submodule. + include openconfig-aft-pf; + // Include the ethernet AFT submodule. + include openconfig-aft-ethernet; + // Include the common cross-AFT entities. + include openconfig-aft-common; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "A model describing the forwarding entries installed on a network + element. It should be noted that this model is not expected to + align 1:1 with the underlying structure used directly by a + forwarding element (e.g., linecard), but rather provide an + abstraction that can be consumed by an NMS to observe, and in some + cases manipulate, the internal forwarding database in a simplified + manner. Since the underlying model of the forwarding table is not + expected to align with this model, the structure described herein + is referred to as an Abstract Forwarding Table (AFT), rather than + the FIB."; + + oc-ext:openconfig-version "0.4.1"; + + revision "2019-11-07" { + description + "Move lsp-name leaf out of aft-common-entry-nexthop-state group."; + reference "0.4.1"; + } + + revision "2019-08-02" { + description + "Add installing protocol for IPv[46] unicast entries. + Add the ability to describe conditional next-hop groups + outside of the policy forwarding module to allow for efficient + handling of CBTS, where many prefixes may share the same next-hop + criteria."; + reference "0.4.0"; + } + + revision "2019-08-01" { + description + "Add lsp-name leaf to AFT next-hop."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Formatting fixes"; + reference "0.3.1"; + } + + revision 2017-05-10 { + description + "Refactor to provide concretised per-AF schemas per AFT."; + reference "0.3.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // config + state groupings + + // structural groupings + + grouping aft-top { + description + "Top-level grouping allowing per-protocol instantiation of the + AFT."; + + container afts { + description + "The abstract forwarding tables (AFTs) that are associated + with the network instance. An AFT is instantiated per-protocol + running within the network-instance - such that one exists for + IPv4 Unicast, IPv6 Unicast, MPLS, L2 forwarding entries, etc. + A forwarding entry within the FIB has a set of next-hops, + which may be a reference to an entry within another table - + e.g., where a Layer 3 next-hop has an associated Layer 2 + forwarding entry."; + + container ipv4-unicast { + description + "The abstract forwarding table for IPv4 unicast. Entries + within this table are uniquely keyed on the IPv4 unicast + destination prefix which is matched by ingress packets. + + The data set represented by the IPv4 Unicast AFT is the set + of entries from the IPv4 unicast RIB that have been selected + for installation into the FIB of the device exporting the + data structure."; + + uses aft-ipv4-unicast-structural; + } + + container ipv6-unicast { + description + "The abstract forwarding table for IPv6 unicast. Entries + within this table are uniquely keyed on the IPv6 unicast + destination prefix which is matched by ingress packets. + + The data set represented by the IPv6 Unicast AFTis the set + of entries within the IPv6 RIB that "; + + uses aft-ipv6-unicast-structural; + + } + + container policy-forwarding { + description + "The abstract forwarding table for policy-based forwarding + entries. Since multiple match criteria can be utilised + within a policy-based forwarding rule, this AFT provides a + flexible match criteria, and is indexed based on an + arbitrary 64-bit index. Entries within the AFT may match on + multiple field types (e.g., L4 header fields, as well as L2 + fields). + + Examples of entries within this table are: + - IPv4 policy-based routing based on DSCP. + - MPLS policy-based forwarding entries."; + + uses aft-pf-structural; + } + + container mpls { + description + "The abstract forwarding table for MPLS label based + forwarding entries. Entries within the table are keyed based + on the top-most MPLS label in the stack on the ingress + packet."; + + uses aft-mpls-structural; + } + + container ethernet { + description + "The abstract forwarding table for Ethernet based forwarding + entries. Entries within the table are keyed based on the + destination MAC address on the ingress packet."; + + uses aft-ethernet-structural; + } + + uses aft-next-hop-groups-structural; + uses aft-nhop-structural; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-alarm-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-alarm-types@2018-11-21.yang new file mode 100644 index 0000000..49093f6 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-alarm-types@2018-11-21.yang @@ -0,0 +1,146 @@ +module openconfig-alarm-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/alarms/types"; + + prefix "oc-alarm-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines operational state data related to alarms + that the device is reporting. + This model reuses some data items defined in the draft IETF + YANG Alarm Module: + https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02 + Portions of this code were derived from the draft IETF YANG Alarm + Module. Please reproduce this note if possible. + IETF code is subject to the following copyright and license: + Copyright (c) IETF Trust and the persons identified as authors of + the code. + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in + Section 4.c of the IETF Trust's Legal Provisions Relating + to IETF Documents (http://trustee.ietf.org/license-info)."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2018-01-16" { + description + "Moved alarm identities into separate types module"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + identity OPENCONFIG_ALARM_TYPE_ID { + description + "Base identity for alarm type ID profiles"; + } + + identity AIS { + base OPENCONFIG_ALARM_TYPE_ID; + description + "Defines an alarm indication signal type of alarm"; + } + + identity EQPT { + base OPENCONFIG_ALARM_TYPE_ID; + description + "Defines an equipment related type of alarm that is specific + to the physical hardware"; + } + + identity LOS { + base OPENCONFIG_ALARM_TYPE_ID; + description + "Defines a loss of signal type of alarm"; + } + + identity OTS { + base OPENCONFIG_ALARM_TYPE_ID; + description + "Defines a optical transport signal type of alarm"; + } + + identity OPENCONFIG_ALARM_SEVERITY { + description + "Base identity for alarm severity profiles. Derived + identities are based on contents of the draft + IETF YANG Alarm Module"; + reference + "IETF YANG Alarm Module: Draft - typedef severity + https://tools.ietf.org/html/draft-vallin-netmod-alarm-module-02"; + + } + + identity UNKNOWN { + base OPENCONFIG_ALARM_SEVERITY; + description + "Indicates that the severity level could not be determined. + This level SHOULD be avoided."; + } + + identity MINOR { + base OPENCONFIG_ALARM_SEVERITY; + description + "Indicates the existence of a non-service affecting fault + condition and that corrective action should be taken in + order to prevent a more serious (for example, service + affecting) fault. Such a severity can be reported, for + example, when the detected alarm condition is not currently + degrading the capacity of the resource"; + } + + identity WARNING { + base OPENCONFIG_ALARM_SEVERITY; + description + "Indicates the detection of a potential or impending service + affecting fault, before any significant effects have been felt. + Action should be taken to further diagnose (if necessary) and + correct the problem in order to prevent it from becoming a more + serious service affecting fault."; + } + + identity MAJOR { + base OPENCONFIG_ALARM_SEVERITY; + description + "Indicates that a service affecting condition has developed + and an urgent corrective action is required. Such a severity + can be reported, for example, when there is a severe + degradation in the capability of the resource and its full + capability must be restored."; + } + + identity CRITICAL { + base OPENCONFIG_ALARM_SEVERITY; + description + "Indicates that a service affecting condition has occurred + and an immediate corrective action is required. Such a + severity can be reported, for example, when a resource becomes + totally out of service and its capability must be restored."; + } + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-common-multiprotocol@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-common-multiprotocol@2019-07-10.yang new file mode 100644 index 0000000..b97ecaa --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-common-multiprotocol@2019-07-10.yang @@ -0,0 +1,543 @@ +submodule openconfig-bgp-common-multiprotocol { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-bgp-types { prefix oc-bgp-types; } + import openconfig-routing-policy { prefix oc-rpol; } + import openconfig-types { prefix oc-types; } + + include openconfig-bgp-common; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains groupings that are related to support + for multiple protocols in BGP. The groupings are common across + multiple contexts."; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-common-mp-afi-safi-graceful-restart-config { + description + "BGP graceful restart parameters that apply on a per-AFI-SAFI + basis"; + + leaf enabled { + type boolean; + default false; + description + "This leaf indicates whether graceful-restart is enabled for + this AFI-SAFI"; + } + } + + grouping bgp-common-mp-afi-safi-config { + description + "Configuration parameters used for all BGP AFI-SAFIs"; + + leaf afi-safi-name { + type identityref { + base oc-bgp-types:AFI_SAFI_TYPE; + } + description "AFI,SAFI"; + } + + leaf enabled { + type boolean; + default false; + description + "This leaf indicates whether the AFI-SAFI is + enabled for the neighbour or group"; + } + } + + grouping bgp-common-mp-all-afi-safi-list-contents { + description + "A common grouping used for contents of the list that is used + for AFI-SAFI entries"; + + // import and export policy included for the afi/safi + uses oc-rpol:apply-policy-group; + + uses bgp-common-mp-ipv4-unicast-group; + uses bgp-common-mp-ipv6-unicast-group; + uses bgp-common-mp-ipv4-labeled-unicast-group; + uses bgp-common-mp-ipv6-labeled-unicast-group; + uses bgp-common-mp-l3vpn-ipv4-unicast-group; + uses bgp-common-mp-l3vpn-ipv6-unicast-group; + uses bgp-common-mp-l3vpn-ipv4-multicast-group; + uses bgp-common-mp-l3vpn-ipv6-multicast-group; + uses bgp-common-mp-l2vpn-vpls-group; + uses bgp-common-mp-l2vpn-evpn-group; + uses bgp-common-mp-srte-policy-ipv4-group; + uses bgp-common-mp-srte-policy-ipv6-group; + } + + // Groupings relating to each address family + grouping bgp-common-mp-ipv4-unicast-group { + description + "Group for IPv4 Unicast configuration options"; + + container ipv4-unicast { + when "../afi-safi-name = 'oc-bgp-types:IPV4_UNICAST'" { + description + "Include this container for IPv4 Unicast specific + configuration"; + } + + description "IPv4 unicast configuration options"; + + // include common IPv[46] unicast options + uses bgp-common-mp-ipv4-ipv6-unicast-common; + + // placeholder for IPv4 unicast specific configuration + } + } + + grouping bgp-common-mp-ipv6-unicast-group { + description + "Group for IPv6 Unicast configuration options"; + + container ipv6-unicast { + when "../afi-safi-name = 'oc-bgp-types:IPV6_UNICAST'" { + description + "Include this container for IPv6 Unicast specific + configuration"; + } + + description "IPv6 unicast configuration options"; + + // include common IPv[46] unicast options + uses bgp-common-mp-ipv4-ipv6-unicast-common; + + // placeholder for IPv6 unicast specific configuration + // options + } + } + + grouping bgp-common-mp-ipv4-labeled-unicast-group { + description + "Group for IPv4 Labeled Unicast configuration options"; + + container ipv4-labeled-unicast { + when "../afi-safi-name = 'oc-bgp-types:IPV4_LABELED_UNICAST'" { + description + "Include this container for IPv4 Labeled Unicast specific + configuration"; + } + + description "IPv4 Labeled Unicast configuration options"; + + uses bgp-common-mp-all-afi-safi-common; + + // placeholder for IPv4 Labeled Unicast specific config + // options + } + } + + grouping bgp-common-mp-ipv6-labeled-unicast-group { + description + "Group for IPv6 Labeled Unicast configuration options"; + + container ipv6-labeled-unicast { + when "../afi-safi-name = 'oc-bgp-types:IPV6_LABELED_UNICAST'" { + description + "Include this container for IPv6 Labeled Unicast specific + configuration"; + } + + description "IPv6 Labeled Unicast configuration options"; + + uses bgp-common-mp-all-afi-safi-common; + + // placeholder for IPv6 Labeled Unicast specific config + // options. + } + } + + grouping bgp-common-mp-l3vpn-ipv4-unicast-group { + description + "Group for IPv4 Unicast L3VPN configuration options"; + + container l3vpn-ipv4-unicast { + when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV4_UNICAST'" { + description + "Include this container for IPv4 Unicast L3VPN specific + configuration"; + } + + description "Unicast IPv4 L3VPN configuration options"; + + // include common L3VPN configuration options + uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; + + // placeholder for IPv4 Unicast L3VPN specific config options. + } + } + + grouping bgp-common-mp-l3vpn-ipv6-unicast-group { + description + "Group for IPv6 Unicast L3VPN configuration options"; + + container l3vpn-ipv6-unicast { + when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV6_UNICAST'" { + description + "Include this container for unicast IPv6 L3VPN specific + configuration"; + } + + description "Unicast IPv6 L3VPN configuration options"; + + // include common L3VPN configuration options + uses bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common; + + // placeholder for IPv6 Unicast L3VPN specific configuration + // options + } + } + + grouping bgp-common-mp-l3vpn-ipv4-multicast-group { + description + "Group for IPv4 L3VPN multicast configuration options"; + + container l3vpn-ipv4-multicast { + when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV4_MULTICAST'" { + description + "Include this container for multicast IPv6 L3VPN specific + configuration"; + } + + description "Multicast IPv4 L3VPN configuration options"; + + // include common L3VPN multicast options + uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; + + // placeholder for IPv4 Multicast L3VPN specific configuration + // options + } + } + + grouping bgp-common-mp-l3vpn-ipv6-multicast-group { + description + "Group for IPv6 L3VPN multicast configuration options"; + + container l3vpn-ipv6-multicast { + when "../afi-safi-name = 'oc-bgp-types:L3VPN_IPV6_MULTICAST'" { + description + "Include this container for multicast IPv6 L3VPN specific + configuration"; + } + + description "Multicast IPv6 L3VPN configuration options"; + + // include common L3VPN multicast options + uses bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common; + + // placeholder for IPv6 Multicast L3VPN specific configuration + // options + } + } + + grouping bgp-common-mp-l2vpn-vpls-group { + description + "Group for BGP-signalled VPLS configuration options"; + + container l2vpn-vpls { + when "../afi-safi-name = 'oc-bgp-types:L2VPN_VPLS'" { + description + "Include this container for BGP-signalled VPLS specific + configuration"; + } + + description "BGP-signalled VPLS configuration options"; + + // include common L2VPN options + uses bgp-common-mp-l2vpn-common; + + // placeholder for BGP-signalled VPLS specific configuration + // options + } + } + + grouping bgp-common-mp-l2vpn-evpn-group { + description + "Group for BGP EVPN configuration options"; + + container l2vpn-evpn { + when "../afi-safi-name = 'oc-bgp-types:L2VPN_EVPN'" { + description + "Include this container for BGP EVPN specific + configuration"; + } + + description "BGP EVPN configuration options"; + + // include common L2VPN options + uses bgp-common-mp-l2vpn-common; + + // placeholder for BGP EVPN specific configuration options + } + } + + // Common groupings across multiple AFI,SAFIs + grouping bgp-common-mp-all-afi-safi-common { + description + "Grouping for configuration common to all AFI,SAFI"; + + container prefix-limit { + description + "Configure the maximum number of prefixes that will be + accepted from a peer"; + + container config { + description + "Configuration parameters relating to the prefix + limit for the AFI-SAFI"; + uses bgp-common-mp-all-afi-safi-common-prefix-limit-config; + } + + container state { + config false; + description + "State information relating to the prefix-limit for the + AFI-SAFI"; + uses bgp-common-mp-all-afi-safi-common-prefix-limit-config; + } + } + } + + grouping bgp-common-mp-ipv4-ipv6-unicast-common { + description + "Common configuration that is applicable for IPv4 and IPv6 + unicast"; + + // include common afi-safi options. + uses bgp-common-mp-all-afi-safi-common; + + // configuration options that are specific to IPv[46] unicast + container config { + description + "Configuration parameters for common IPv4 and IPv6 unicast + AFI-SAFI options"; + uses bgp-common-mp-ipv4-ipv6-unicast-common-config; + } + container state { + config false; + description + "State information for common IPv4 and IPv6 unicast + parameters"; + uses bgp-common-mp-ipv4-ipv6-unicast-common-config; + } + } + + grouping bgp-common-mp-l3vpn-ipv4-ipv6-unicast-common { + description + "Common configuration applied across L3VPN for IPv4 + and IPv6"; + + // placeholder -- specific configuration options that are generic + // across IPv[46] unicast address families. + uses bgp-common-mp-all-afi-safi-common; + } + + grouping bgp-common-mp-l3vpn-ipv4-ipv6-multicast-common { + description + "Common configuration applied across L3VPN for IPv4 + and IPv6"; + + // placeholder -- specific configuration options that are + // generic across IPv[46] multicast address families. + uses bgp-common-mp-all-afi-safi-common; + } + + grouping bgp-common-mp-l2vpn-common { + description + "Common configuration applied across L2VPN address + families"; + + // placeholder -- specific configuration options that are + // generic across L2VPN address families + uses bgp-common-mp-all-afi-safi-common; + } + + grouping bgp-common-mp-srte-policy-ipv4-group { + description + "Grouping for SR-TE for AFI 1"; + + container srte-policy-ipv4 { + when "../afi-safi-name = 'oc-bgp-types:SRTE_POLICY_IPV4'" { + description + "Only include this container when the address family is + specified to be SR-TE Policy SAFI for the IPv4 unicast + address family."; + } + + description + "Configuration and operational state parameters relating to + the SR-TE Policy SAFI for IPv4 Unicast."; + + uses bgp-common-mp-all-afi-safi-common; + } + } + + grouping bgp-common-mp-srte-policy-ipv6-group { + description + "Grouping for SR-TE for AFI 2"; + + container srte-policy-ipv6 { + when "../afi-safi-name = 'oc-bgp-types:SRTE_POLICY_IPV6'" { + description + "Only include this container when the address family is + specified to be SR-TE Policy SAFI for the IPv6 unicast + address family."; + } + + description + "Configuration and operational state parameters relating to + the SR-TE Policy SAFI for IPv6 Unicast."; + + uses bgp-common-mp-all-afi-safi-common; + } + } + + // Config groupings for common groups + grouping bgp-common-mp-all-afi-safi-common-prefix-limit-config { + description + "Configuration parameters relating to prefix-limits for an + AFI-SAFI"; + + leaf max-prefixes { + type uint32; + description + "Maximum number of prefixes that will be accepted + from the neighbour"; + } + + leaf prevent-teardown { + type boolean; + default false; + description + "Do not tear down the BGP session when the maximum + prefix limit is exceeded, but rather only log a + warning. The default of this leaf is false, such + that when it is not specified, the session is torn + down."; + } + + leaf warning-threshold-pct { + type oc-types:percentage; + description + "Threshold on number of prefixes that can be received + from a neighbour before generation of warning messages + or log entries. Expressed as a percentage of + max-prefixes"; + } + + leaf restart-timer { + type decimal64 { + fraction-digits 2; + } + units "seconds"; + description + "Time interval in seconds after which the BGP session + is re-established after being torn down due to exceeding + the max-prefix limit."; + } + } + + grouping bgp-common-mp-ipv4-ipv6-unicast-common-config { + description + "Common configuration parameters for IPv4 and IPv6 Unicast + address families"; + + leaf send-default-route { + type boolean; + default "false"; + description + "If set to true, send the default-route to the neighbour(s)"; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-common-structure@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-common-structure@2019-07-10.yang new file mode 100644 index 0000000..a28588d --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-common-structure@2019-07-10.yang @@ -0,0 +1,222 @@ +submodule openconfig-bgp-common-structure { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + + include openconfig-bgp-common-multiprotocol; + include openconfig-bgp-common; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains groupings that are common across multiple BGP + contexts and provide structure around other primitive groupings."; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-common-structure-neighbor-group-logging-options { + description + "Structural grouping used to include error handling configuration and + state for both BGP neighbors and groups"; + + container logging-options { + description + "Logging options for events related to the BGP neighbor or + group"; + container config { + description + "Configuration parameters enabling or modifying logging + for events relating to the BGPgroup"; + uses bgp-common-neighbor-group-logging-options-config; + } + container state { + config false; + description + "State information relating to logging for the BGP neighbor + or group"; + uses bgp-common-neighbor-group-logging-options-config; + } + } + } + + grouping bgp-common-structure-neighbor-group-ebgp-multihop { + description + "Structural grouping used to include eBGP multihop configuration and + state for both BGP neighbors and peer groups"; + + container ebgp-multihop { + description + "eBGP multi-hop parameters for the BGPgroup"; + container config { + description + "Configuration parameters relating to eBGP multihop for the + BGP group"; + uses bgp-common-neighbor-group-multihop-config; + } + container state { + config false; + description + "State information for eBGP multihop, for the BGP neighbor + or group"; + uses bgp-common-neighbor-group-multihop-config; + } + } + } + + grouping bgp-common-structure-neighbor-group-route-reflector { + description + "Structural grouping used to include route reflector configuration and + state for both BGP neighbors and peer groups"; + + container route-reflector { + description + "Route reflector parameters for the BGPgroup"; + container config { + description + "Configuraton parameters relating to route reflection + for the BGPgroup"; + uses bgp-common-neighbor-group-route-reflector-config; + } + container state { + config false; + description + "State information relating to route reflection for the + BGPgroup"; + uses bgp-common-neighbor-group-route-reflector-config; + } + } + } + + grouping bgp-common-structure-neighbor-group-as-path-options { + description + "Structural grouping used to include AS_PATH manipulation configuration + and state for both BGP neighbors and peer groups"; + + container as-path-options { + description + "AS_PATH manipulation parameters for the BGP neighbor or + group"; + container config { + description + "Configuration parameters relating to AS_PATH manipulation + for the BGP peer or group"; + uses bgp-common-neighbor-group-as-path-options-config; + } + container state { + config false; + description + "State information relating to the AS_PATH manipulation + mechanisms for the BGP peer or group"; + uses bgp-common-neighbor-group-as-path-options-config; + } + } + } + + grouping bgp-common-structure-neighbor-group-add-paths { + description + "Structural grouping used to include ADD-PATHs configuration and state + for both BGP neighbors and peer groups"; + + container add-paths { + description + "Parameters relating to the advertisement and receipt of + multiple paths for a single NLRI (add-paths)"; + container config { + description + "Configuration parameters relating to ADD_PATHS"; + uses bgp-common-neighbor-group-add-paths-config; + } + container state { + config false; + description + "State information associated with ADD_PATHS"; + uses bgp-common-neighbor-group-add-paths-config; + } + } + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-common@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-common@2019-07-10.yang new file mode 100644 index 0000000..5aa36af --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-common@2019-07-10.yang @@ -0,0 +1,690 @@ +submodule openconfig-bgp-common { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-bgp-types { prefix oc-bgp-types; } + import openconfig-routing-policy { prefix oc-rpol; } + import openconfig-types { prefix oc-types; } + import openconfig-inet-types { prefix oc-inet; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains common groupings that are common across + multiple contexts within the BGP module. That is to say that they + may be application to a subset of global, peer-group or neighbor + contexts."; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-common-neighbor-group-timers-config { + description + "Config parameters related to timers associated with the BGP + peer"; + + leaf connect-retry { + type decimal64 { + fraction-digits 2; + } + default 30; + description + "Time interval in seconds between attempts to establish a + session with the peer."; + } + + leaf hold-time { + type decimal64 { + fraction-digits 2; + } + default 90; + description + "Time interval in seconds that a BGP session will be + considered active in the absence of keepalive or other + messages from the peer. The hold-time is typically + set to 3x the keepalive-interval."; + reference + "RFC 4271 - A Border Gateway Protocol 4, Sec. 10"; + } + + leaf keepalive-interval { + type decimal64 { + fraction-digits 2; + } + default 30; + description + "Time interval in seconds between transmission of keepalive + messages to the neighbor. Typically set to 1/3 the + hold-time."; + } + + leaf minimum-advertisement-interval { + type decimal64 { + fraction-digits 2; + } + default 30; + description + "Minimum time which must elapse between subsequent UPDATE + messages relating to a common set of NLRI being transmitted + to a peer. This timer is referred to as + MinRouteAdvertisementIntervalTimer by RFC 4721 and serves to + reduce the number of UPDATE messages transmitted when a + particular set of NLRI exhibit instability."; + reference + "RFC 4271 - A Border Gateway Protocol 4, Sec 9.2.1.1"; + } + } + + grouping bgp-common-neighbor-group-config { + description + "Neighbor level configuration items."; + + leaf peer-as { + type oc-inet:as-number; + description + "AS number of the peer."; + } + + leaf local-as { + type oc-inet:as-number; + description + "The local autonomous system number that is to be used + when establishing sessions with the remote peer or peer + group, if this differs from the global BGP router + autonomous system number."; + } + + leaf peer-type { + type oc-bgp-types:peer-type; + description + "Explicitly designate the peer or peer group as internal + (iBGP) or external (eBGP)."; + } + + leaf auth-password { + type oc-types:routing-password; + description + "Configures an MD5 authentication password for use with + neighboring devices."; + } + + leaf remove-private-as { + // could also make this a container with a flag to enable + // remove-private and separate option. here, option implies + // remove-private is enabled. + type oc-bgp-types:remove-private-as-option; + description + "Remove private AS numbers from updates sent to peers - when + this leaf is not specified, the AS_PATH attribute should be + sent to the peer unchanged"; + } + + leaf route-flap-damping { + type boolean; + default false; + description + "Enable route flap damping."; + } + + leaf send-community { + type oc-bgp-types:community-type; + default "NONE"; + description + "Specify which types of community should be sent to the + neighbor or group. The default is to not send the + community attribute"; + } + + leaf description { + type string; + description + "An optional textual description (intended primarily for use + with a peer or group"; + } + } + + grouping bgp-common-neighbor-group-transport-config { + description + "Configuration parameters relating to the transport protocol + used by the BGP session to the peer"; + + leaf tcp-mss { + type uint16; + description + "Sets the max segment size for BGP TCP sessions."; + } + + leaf mtu-discovery { + type boolean; + default false; + description + "Turns path mtu discovery for BGP TCP sessions on (true) + or off (false)"; + } + + leaf passive-mode { + type boolean; + default false; + description + "Wait for peers to issue requests to open a BGP session, + rather than initiating sessions from the local router."; + } + + leaf local-address { + type union { + type oc-inet:ip-address; + type string; + } + //TODO: the string should be converted to a leafref type + //to point to an interface when YANG 1.1 is available with + //leafrefs in union types. + description + "Set the local IP (either IPv4 or IPv6) address to use + for the session when sending BGP update messages. This + may be expressed as either an IP address or reference + to the name of an interface."; + } + } + + grouping bgp-common-neighbor-group-error-handling-config { + description + "Configuration parameters relating to enhanced error handling + behaviours for BGP"; + + leaf treat-as-withdraw { + type boolean; + default "false"; + description + "Specify whether erroneous UPDATE messages for which the + NLRI can be extracted are reated as though the NLRI is + withdrawn - avoiding session reset"; + reference "draft-ietf-idr-error-handling-16"; + } + } + + grouping bgp-common-neighbor-group-logging-options-config { + description + "Configuration parameters specifying the logging behaviour for + BGP sessions to the peer"; + + leaf log-neighbor-state-changes { + type boolean; + default "true"; + description + "Configure logging of peer state changes. Default is + to enable logging of peer state changes."; + } + } + + grouping bgp-common-neighbor-group-multihop-config { + description + "Configuration parameters specifying the multihop behaviour for + BGP sessions to the peer"; + + leaf enabled { + type boolean; + default "false"; + description + "When enabled the referenced group or neighbors are permitted + to be indirectly connected - including cases where the TTL + can be decremented between the BGP peers"; + } + + leaf multihop-ttl { + type uint8; + description + "Time-to-live value to use when packets are sent to the + referenced group or neighbors and ebgp-multihop is enabled"; + } + } + + grouping bgp-common-neighbor-group-route-reflector-config { + description + "Configuration parameters determining whether the behaviour of + the local system when acting as a route-reflector"; + + leaf route-reflector-cluster-id { + type oc-bgp-types:rr-cluster-id-type; + description + "route-reflector cluster id to use when local router is + configured as a route reflector. Commonly set at the group + level, but allows a different cluster + id to be set for each neighbor."; + } + + leaf route-reflector-client { + type boolean; + default "false"; + description + "Configure the neighbor as a route reflector client."; + } + } + + grouping bgp-common-neighbor-group-as-path-options-config { + description + "Configuration parameters allowing manipulation of the AS_PATH + attribute"; + + leaf allow-own-as { + type uint8; + default 0; + description + "Specify the number of occurrences of the local BGP speaker's + AS that can occur within the AS_PATH before it is rejected."; + } + + leaf replace-peer-as { + type boolean; + default "false"; + description + "Replace occurrences of the peer's AS in the AS_PATH + with the local autonomous system number"; + } + + leaf disable-peer-as-filter { + type boolean; + default "false"; + description + "When set to true, the system advertises routes to a peer + even if the peer's AS was in the AS path. The default + behavior (false) suppresses advertisements to peers if + their AS number is in the AS path of the route."; + } + } + + grouping bgp-common-neighbor-group-add-paths-config { + description + "Configuration parameters specfying whether the local system + will send or receive multiple paths using ADD_PATHS"; + + leaf receive { + type boolean; + default false; + description + "Enable capability negotiation to receive multiple path + advertisements for an NLRI from the neighbor or group"; + reference + "RFC 7911 - Advertisement of Multiple Paths in BGP"; + } + + leaf send { + type boolean; + default false; + description + "Enable capability negotiation to send multiple path + advertisements for an NLRI from the neighbor or group"; + reference + "RFC 7911 - Advertisement of Multiple Paths in BGP"; + } + + leaf send-max { + type uint8; + description + "The maximum total number of paths to advertise to neighbors + for a single NLRI. This includes the single best path as + well as additional paths advertised when add-paths is + enabled."; + } + + leaf eligible-prefix-policy { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:name"; + } + description + "A reference to a routing policy which can be used to + restrict the prefixes for which add-paths is enabled"; + } + } + + grouping bgp-common-graceful-restart-config { + description + "Configuration parameters relating to BGP graceful restart."; + + leaf enabled { + type boolean; + description + "Enable or disable the graceful-restart capability."; + } + + leaf restart-time { + type uint16 { + range 0..4096; + } + description + "Estimated time (in seconds) for the local BGP speaker to + restart a session. This value is advertise in the graceful + restart BGP capability. This is a 12-bit value, referred to + as Restart Time in RFC4724. Per RFC4724, the suggested + default value is <= the hold-time value."; + } + + leaf stale-routes-time { + type decimal64 { + fraction-digits 2; + } + description + "An upper-bound on the time thate stale routes will be + retained by a router after a session is restarted. If an + End-of-RIB (EOR) marker is received prior to this timer + expiring stale-routes will be flushed upon its receipt - if + no EOR is received, then when this timer expires stale paths + will be purged. This timer is referred to as the + Selection_Deferral_Timer in RFC4724"; + } + + leaf helper-only { + type boolean; + description + "Enable graceful-restart in helper mode only. When this + leaf is set, the local system does not retain forwarding + its own state during a restart, but supports procedures + for the receiving speaker, as defined in RFC4724."; + } + } + + grouping bgp-common-use-multiple-paths-config { + description + "Generic configuration options relating to use of multiple + paths for a referenced AFI-SAFI, group or neighbor"; + + leaf enabled { + type boolean; + default false; + description + "Whether the use of multiple paths for the same NLRI is + enabled for the neighbor. This value is overridden by + any more specific configuration value."; + } + } + + grouping bgp-common-use-multiple-paths-ebgp-as-options-config { + description + "Configuration parameters specific to eBGP multipath applicable + to all contexts"; + + leaf allow-multiple-as { + type boolean; + default "false"; + description + "Allow multipath to use paths from different neighbouring + ASes. The default is to only consider multiple paths from + the same neighbouring AS."; + } + } + + grouping bgp-common-global-group-use-multiple-paths { + description + "Common grouping used for both global and groups which provides + configuration and state parameters relating to use of multiple + paths"; + + container use-multiple-paths { + description + "Parameters related to the use of multiple paths for the + same NLRI"; + + container config { + description + "Configuration parameters relating to multipath"; + uses bgp-common-use-multiple-paths-config; + } + container state { + config false; + description + "State parameters relating to multipath"; + uses bgp-common-use-multiple-paths-config; + } + + container ebgp { + description + "Multipath parameters for eBGP"; + container config { + description + "Configuration parameters relating to eBGP multipath"; + uses bgp-common-use-multiple-paths-ebgp-config; + } + container state { + config false; + description + "State information relating to eBGP multipath"; + uses bgp-common-use-multiple-paths-ebgp-config; + } + } + + container ibgp { + description + "Multipath parameters for iBGP"; + container config { + description + "Configuration parameters relating to iBGP multipath"; + uses bgp-common-use-multiple-paths-ibgp-config; + } + container state { + config false; + description + "State information relating to iBGP multipath"; + uses bgp-common-use-multiple-paths-ibgp-config; + } + } + } + } + + grouping bgp-common-use-multiple-paths-ebgp-config { + description + "Configuration parameters relating to multipath for eBGP"; + + leaf allow-multiple-as { + type boolean; + default "false"; + description + "Allow multipath to use paths from different neighbouring + ASes. The default is to only consider multiple paths from + the same neighbouring AS."; + } + + leaf maximum-paths { + type uint32; + default 1; + description + "Maximum number of parallel paths to consider when using + BGP multipath. The default is use a single path."; + } + } + + grouping bgp-common-use-multiple-paths-ibgp-config { + description + "Configuration parmaeters relating to multipath for iBGP"; + + leaf maximum-paths { + type uint32; + default 1; + description + "Maximum number of parallel paths to consider when using + iBGP multipath. The default is to use a single path"; + } + } + + grouping bgp-common-route-selection-options-config { + description + "Set of configuration options that govern best + path selection."; + + leaf always-compare-med { + type boolean; + default "false"; + description + "Compare multi-exit discriminator (MED) value from + different ASes when selecting the best route. The + default behavior is to only compare MEDs for paths + received from the same AS."; + } + + leaf ignore-as-path-length { + type boolean; + default "false"; + description + "Ignore the AS path length when selecting the best path. + The default is to use the AS path length and prefer paths + with shorter length."; + } + + leaf external-compare-router-id { + type boolean; + default "true"; + description + "When comparing similar routes received from external + BGP peers, use the router-id as a criterion to select + the active path."; + } + + leaf advertise-inactive-routes { + type boolean; + default "false"; + description + "Advertise inactive routes to external peers. The + default is to only advertise active routes."; + } + + leaf enable-aigp { + type boolean; + default false; + description + "Flag to enable sending / receiving accumulated IGP + attribute in routing updates"; + } + + leaf ignore-next-hop-igp-metric { + type boolean; + default "false"; + description + "Ignore the IGP metric to the next-hop when calculating + BGP best-path. The default is to select the route for + which the metric to the next-hop is lowest"; + } + } + + grouping bgp-common-route-selection-options { + description + "Configuration and state relating to route selection options"; + + container route-selection-options { + description + "Parameters relating to options for route selection"; + container config { + description + "Configuration parameters relating to route selection + options"; + uses bgp-common-route-selection-options-config; + } + container state { + config false; + description + "State information for the route selection options"; + uses bgp-common-route-selection-options-config; + } + } + } + + grouping bgp-common-state { + description + "Grouping containing common counters relating to prefixes and + paths"; + + leaf total-paths { + type uint32; + description + "Total number of BGP paths within the context"; + } + + leaf total-prefixes { + type uint32; + description + "Total number of BGP prefixes received within the context"; + } + } + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-errors@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-bgp-errors@2018-11-21.yang new file mode 100644 index 0000000..86aad05 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-errors@2018-11-21.yang @@ -0,0 +1,427 @@ +submodule openconfig-bgp-errors { + + belongs-to openconfig-bgp-types { + prefix "oc-bgp-types"; + } + + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module defines BGP NOTIFICATION message error codes + and subcodes"; + + oc-ext:openconfig-version "5.0.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + identity BGP_ERROR_CODE { + description + "Indicates the error type in a BGP NOTIFICATION message"; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + identity BGP_ERROR_SUBCODE { + description + "Provides more specific information about the nature of the + error reported in a NOTIFICATION message. Each Error + Code may have one or more Error Subcodes associated with it."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + + identity UNSPECIFIC { + base BGP_ERROR_SUBCODE; + description + "The error subcode field is unspecific when the NOTIFICATION + message does not include any specific error subcode (i.e.., + value 0)."; + } + + identity MESSAGE_HEADER_ERROR { + base BGP_ERROR_CODE; + description + "Errors detected while processing the Message Header"; + } + + identity OPEN_MESSAGE_ERROR { + base BGP_ERROR_CODE; + description + "Errors detected while processing the OPEN message"; + } + + identity UPDATE_MESSAGE_ERROR { + base BGP_ERROR_CODE; + description + "Errors detected while processing the UPDATE message"; + } + + identity HOLD_TIMER_EXPIRED { + base BGP_ERROR_CODE; + description + "Indicates that the system did not receive successive + KEEPALIVE, UPDATE, and/or NOTIFICATION messages within the + period specified in the Hold Time field of the OPEN message"; + } + + identity FINITE_STATE_MACHINE_ERROR { + base BGP_ERROR_CODE; + description + "Error detected by the BGP Finite State Machine + (e.g., receipt of an unexpected event)"; + } + + identity CEASE { + base BGP_ERROR_CODE; + description + "Sent by a BGP peer to close its BGP connection in absence of + any fatal errors. If the BGP speaker terminates its + connection with a neihbor because the number of prefixes + received exceeds the configured upper bound, the speaker must + send the neighbor a NOTIFICATION message with the Cease + error code."; + } + + identity ROUTE_REFRESH_MESSAGE_ERROR { + base BGP_ERROR_CODE; + description + "The length, excluding the fixed-size message header, of the + received ROUTE-REFRESH message with Message Subtype 1 and 2 is + not 4. Applicable only when a BGP speaker has received the + 'Enhanced Route Refresh Capability' from a peer"; + reference + "RFC 7313 - Enhanced Route Refresh Capability for BGP-4"; + } + + identity MESSAGE_HEADER_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for Message Header error + notifications"; + } + + identity CONNECTION_NOT_SYNCHRONIZED { + base MESSAGE_HEADER_SUBCODE; + description + "Marker field of the message header is not all ones as + expected"; + } + + identity BAD_MESSAGE_LENGTH { + base MESSAGE_HEADER_SUBCODE; + description + "Indicates the message has an erroneous length with one + or more of the following: + + - the Length field of the message header is less than 19 or + greater than 4096 + + - the Length field of an OPEN message is less than the minimum + length of the OPEN message + + - the Length field of an UPDATE message is less than the + minimum length of the UPDATE message + + - the Length field of a KEEPALIVE message is not equal to 19 + + - the Length field of a NOTIFICATION message is less than the + minimum length of the NOTIFICATION message + + The erroneous Length field must be reported in the + NOTIFICATION data."; + } + + identity BAD_MESSAGE_TYPE { + base MESSAGE_HEADER_SUBCODE; + description + "Type field of the message header is not recognized. The + erroneous type field must be reported in the NOTIFICATION + data"; + } + + identity OPEN_MESSAGE_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for OPEN message error + notifications"; + } + + identity UNSUPPORTED_VERSION_NUMBER { + base OPEN_MESSAGE_SUBCODE; + description + "Version number in the Version field of the received OPEN + message is not supported"; + } + + identity BAD_PEER_AS { + base OPEN_MESSAGE_SUBCODE; + description + "Autonomous System field of the OPEN message is unacceptable"; + } + + identity BAD_BGP_IDENTIFIER { + base OPEN_MESSAGE_SUBCODE; + description + "BGP Identifier field of the OPEN message is syntactically + incorrect"; + } + + identity UNSUPPORTED_OPTIONAL_PARAMETER { + base OPEN_MESSAGE_SUBCODE; + description + "One of the Optional Parameters in the OPEN message is not + recognized"; + } + + identity UNACCEPTABLE_HOLD_TIME { + base OPEN_MESSAGE_SUBCODE; + description + "Hold Time field of the OPEN message is unacceptable"; + } + + identity UNSUPPORTED_CAPABILITY { + base OPEN_MESSAGE_SUBCODE; + description + "Inidicates that the peer does not support capabilities + advertisement -- the peer may send this subcode in response to + an OPEN message that carries the Capabilities Optional + Parameter"; + reference + "RFC 5492 - Capabilities Advertisement with BGP-4"; + } + + identity UPDATE_MESSAGE_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for UPDATE message error + notifications"; + } + + identity MALFORMED_ATTRIBUTE_LIST { + base UPDATE_MESSAGE_SUBCODE; + description + "Inidicates Withdrawn Routes Length or Total Attribute Length + is too large, or + + An attribute appears more than once in the UPDATE message"; + } + + identity UNRECOGNIZED_WELL_KNOWN_ATTRIBUTE { + base UPDATE_MESSAGE_SUBCODE; + description + "One or more of the well-known mandatory attributes are not + recognized"; + } + + identity MISSING_WELL_KNOWN_ATTRIBUTE { + base UPDATE_MESSAGE_SUBCODE; + description + "One or more of the well-known mandatory attributes are not + present"; + } + + identity ATTRIBUTE_FLAGS_ERROR { + base UPDATE_MESSAGE_SUBCODE; + description + "Attribute has Attribute Flags that conflict with the + Attribute Type Code"; + } + + identity ATTRIBUTE_LENGTH_ERROR { + base UPDATE_MESSAGE_SUBCODE; + description + "Attribute has an Attribute Length that conflicts with the + expected length (based on the attribute type code)"; + } + + identity INVALID_ORIGIN_ATTRIBUTE { + base UPDATE_MESSAGE_SUBCODE; + description + "ORIGIN attribute has an undefined value"; + } + + identity INVALID_NEXT_HOP_ATTRIBUTE { + base UPDATE_MESSAGE_SUBCODE; + description + "The NEXT_HOP attribute field is syntactically incorrect"; + } + + identity OPTIONAL_ATTRIBUTE_ERROR { + base UPDATE_MESSAGE_SUBCODE; + description + "An error is detected in the value of a recognized optional + attribute (such an attribute must be discarded)"; + } + + identity INVALID_NETWORK_FIELD { + base UPDATE_MESSAGE_SUBCODE; + description + "The NLRI field in the UPDATE message is syntactically + incorrect"; + } + + identity MALFORMED_AS_PATH { + base UPDATE_MESSAGE_SUBCODE; + description + "The AS_PATH attribute is syntactically incorrect"; + } + + identity FINITE_STATE_MACHINE_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for BGP finite state machine + errors."; + reference + "RFC 6608 - Subcodes for BGP Finite State Machine Error"; + } + + identity RECEIVE_UNEXPECTED_MESSAGE_OPENSENT { + base FINITE_STATE_MACHINE_SUBCODE; + description + "The peer BGP speaker received an unexpected message from + the local system while the peer speaker session was in the + OpenSent state"; + } + + identity RECEIVE_UNEXPECTED_MESSAGE_OPENCONFIRM { + base FINITE_STATE_MACHINE_SUBCODE; + description + "The peer BGP speaker received an unexpected message from + the local system while the peer speaker session was in the + OpenConfirm state"; + } + + identity RECEIVE_UNEXPECTED_MESSAGE_ESTABLISHED { + base FINITE_STATE_MACHINE_SUBCODE; + description + "The peer BGP speaker received an unexpected message from + the local system while the peer speaker session was in the + Established state"; + } + + identity CEASE_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for Cease notification messages"; + reference + "RFC 4486 - Subcodes for BGP Cease Notification Message"; + } + + identity MAX_NUM_PREFIXES_REACHED { + base CEASE_SUBCODE; + description + "The peer BGP speaker terminated its peering with the local + system because the number of address prefixes received + exceeds a locally configured upper bound"; + } + + identity ADMINISTRATIVE_SHUTDOWN { + base CEASE_SUBCODE; + description + "The peer BGP speaker administratively shut down its peering + with the local system"; + } + + identity PEER_DE_CONFIGURED { + base CEASE_SUBCODE; + description + "The peer BGP speaker de-configure the peering with the local + system"; + } + + identity ADMINISTRATIVE_RESET { + base CEASE_SUBCODE; + description + "The peer BGP speaker administratively reset the peering with + the local system"; + } + + identity CONNECTION_REJECTED { + base CEASE_SUBCODE; + description + "The peer BGP speaker disallowed the BGP connection to the + local system after the peer speaker accepted a transport + protocol connection"; + } + + identity OTHER_CONFIG_CHANGE { + base CEASE_SUBCODE; + description + "The peer BGP speaker administratively reset the peering with + the local sytem due to a configuration change that is not + covered by another subcode."; + } + + identity CONN_COLLISION_RESOLUTION { + base CEASE_SUBCODE; + description + "The peer BGP speaker sent a CEASE NOTIFICATION as a result of + the collision resolution procedure described in RFC 4271"; + } + + identity OUT_OF_RESOURCES { + base CEASE_SUBCODE; + description + "The peer BGP speaker ran out of resources (e.g., memory) and + reset the session with the local system"; + } + + identity ROUTE_REFRESH_SUBCODE { + base BGP_ERROR_SUBCODE; + description + "Error subcode definitions for the ROUTE-REFRESH message + error"; + } + + identity INVALID_MESSAGE_LENGTH { + base ROUTE_REFRESH_SUBCODE; + description + "The length, excluding the fixed-size message header, of the + received ROUTE-REFRESH message with Message Subtype 1 and 2 + is not 4"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-global@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-global@2019-07-10.yang new file mode 100644 index 0000000..1508355 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-global@2019-07-10.yang @@ -0,0 +1,414 @@ +submodule openconfig-bgp-global { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-inet-types { prefix oc-inet; } + + // Include common submodules + include openconfig-bgp-common; + include openconfig-bgp-common-multiprotocol; + include openconfig-bgp-peer-group; + include openconfig-bgp-common-structure; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains groupings that are specific to the + global context of the OpenConfig BGP module"; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-global-config { + description + "Global configuration options for the BGP router."; + + leaf as { + type oc-inet:as-number; + mandatory true; + description + "Local autonomous system number of the router. Uses + the 32-bit as-number type from the model in RFC 6991."; + } + + leaf router-id { + type oc-yang:dotted-quad; + description + "Router id of the router - an unsigned 32-bit integer + expressed in dotted quad notation."; + reference + "RFC4271 - A Border Gateway Protocol 4 (BGP-4), + Section 4.2"; + } + } + + grouping bgp-global-state { + description + "Operational state parameters for the BGP neighbor"; + + uses bgp-common-state; + } + + grouping bgp-global-default-route-distance-config { + description + "Configuration options relating to the administrative distance + (or preference) assigned to routes received from different + sources (external, internal, and local)."; + + leaf external-route-distance { + type uint8 { + range "1..255"; + } + description + "Administrative distance for routes learned from external + BGP (eBGP)."; + } + leaf internal-route-distance { + type uint8 { + range "1..255"; + } + description + "Administrative distance for routes learned from internal + BGP (iBGP)."; + } + } + + grouping bgp-global-confederation-config { + description + "Configuration options specifying parameters when the local + router is within an autonomous system which is part of a BGP + confederation."; + + leaf identifier { + type oc-inet:as-number; + description + "Confederation identifier for the autonomous system. + Setting the identifier indicates that the local-AS is part + of a BGP confederation."; + } + + leaf-list member-as { + type oc-inet:as-number; + description + "Remote autonomous systems that are to be treated + as part of the local confederation."; + } + } + + grouping bgp-global-dynamic-neighbors { + description + "Grouping containing configuration relating to dynamic peers."; + + container dynamic-neighbor-prefixes { + description + "A list of IP prefixes from which the system should: + - Accept connections to the BGP daemon + - Dynamically configure a BGP neighbor corresponding to the + source address of the remote system, using the parameters + of the specified peer-group. + For such neighbors, an entry within the neighbor list should + be created, indicating that the peer was dynamically + configured, and referencing the peer-group from which the + configuration was derived."; + + list dynamic-neighbor-prefix { + key "prefix"; + description + "An individual prefix from which dynamic neighbor + connections are allowed."; + + leaf prefix { + type leafref { + path "../config/prefix"; + } + description + "Reference to the IP prefix from which source connections + are allowed for the dynamic neighbor group."; + } + + container config { + description + "Configuration parameters relating to the source prefix + for the dynamic BGP neighbor connections."; + + uses bgp-global-dynamic-neighbor-config; + } + + container state { + config false; + description + "Operational state parameters relating to the source + prefix for the dynamic BGP neighbor connections."; + + uses bgp-global-dynamic-neighbor-config; + } + } + } + } + + grouping bgp-global-dynamic-neighbor-config { + description + "Configuration parameters relating to an individual prefix from + which dynamic neighbors are accepted."; + + leaf prefix { + type oc-inet:ip-prefix; + description + "The IP prefix within which the source address of the remote + BGP speaker must fall to be considered eligible to the + dynamically configured."; } + + leaf peer-group { + type leafref { + // At bgp/global/dynamic-neighbor-prefixes/dynamic-neighbor + // prefix/config/peer-group + path "../../../../../peer-groups/peer-group/config/" + + "peer-group-name"; + } + description + "The peer-group within which the dynamic neighbor will be + configured. The configuration parameters used for the dynamic + neighbor are those specified within the referenced peer + group."; + } + } + + grouping bgp-global-mp-all-afi-safi-list-contents { + description + "A grouping used for contents of the list of AFI-SAFI + entries at the global BGP level."; + + // import and export policy included for the afi/safi + + uses bgp-common-mp-ipv4-unicast-group; + uses bgp-common-mp-ipv6-unicast-group; + uses bgp-common-mp-ipv4-labeled-unicast-group; + uses bgp-common-mp-ipv6-labeled-unicast-group; + uses bgp-common-mp-l3vpn-ipv4-unicast-group; + uses bgp-common-mp-l3vpn-ipv6-unicast-group; + uses bgp-common-mp-l3vpn-ipv4-multicast-group; + uses bgp-common-mp-l3vpn-ipv6-multicast-group; + uses bgp-common-mp-l2vpn-vpls-group; + uses bgp-common-mp-l2vpn-evpn-group; + uses bgp-common-mp-srte-policy-ipv4-group; + uses bgp-common-mp-srte-policy-ipv6-group; + } + + grouping bgp-global-afi-safi-list { + description + "List of address-families associated with the BGP instance"; + + list afi-safi { + key "afi-safi-name"; + + description + "AFI,SAFI configuration available for the + neighbour or group"; + + leaf afi-safi-name { + type leafref { + path "../config/afi-safi-name"; + } + description + "Reference to the AFI-SAFI name used as a key + for the AFI-SAFI list"; + } + + container config { + description + "Configuration parameters for the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + } + container state { + config false; + description + "State information relating to the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + uses bgp-common-state; + } + + container graceful-restart { + description + "Parameters relating to BGP graceful-restart"; + container config { + description + "Configuration options for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + } + container state { + config false; + description + "State information for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + } + } + + uses bgp-common-route-selection-options; + uses bgp-common-global-group-use-multiple-paths; + uses bgp-common-structure-neighbor-group-add-paths; + uses bgp-global-mp-all-afi-safi-list-contents; + } + } + + // Structural groupings + grouping bgp-global-base { + description + "Global configuration parameters for the BGP router"; + + container config { + description + "Configuration parameters relating to the global BGP router"; + uses bgp-global-config; + } + container state { + config false; + description + "State information relating to the global BGP router"; + uses bgp-global-config; + uses bgp-global-state; + } + + container default-route-distance { + description + "Administrative distance (or preference) assigned to + routes received from different sources + (external, internal, and local)."; + + container config { + description + "Configuration parameters relating to the default route + distance"; + uses bgp-global-default-route-distance-config; + } + container state { + config false; + description + "State information relating to the default route distance"; + uses bgp-global-default-route-distance-config; + } + } + + container confederation { + description + "Parameters indicating whether the local system acts as part + of a BGP confederation"; + + container config { + description + "Configuration parameters relating to BGP confederations"; + uses bgp-global-confederation-config; + } + container state { + config false; + description + "State information relating to the BGP confederations"; + uses bgp-global-confederation-config; + } + } + + container graceful-restart { + description + "Parameters relating the graceful restart mechanism for BGP"; + container config { + description + "Configuration parameters relating to graceful-restart"; + uses bgp-common-graceful-restart-config; + } + container state { + config false; + description + "State information associated with graceful-restart"; + uses bgp-common-graceful-restart-config; + } + } + + uses bgp-common-global-group-use-multiple-paths; + uses bgp-common-route-selection-options; + + container afi-safis { + description + "Address family specific configuration"; + uses bgp-global-afi-safi-list; + } + + uses bgp-global-dynamic-neighbors; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-neighbor@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-neighbor@2019-07-10.yang new file mode 100644 index 0000000..5b83a0c --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-neighbor@2019-07-10.yang @@ -0,0 +1,754 @@ +submodule openconfig-bgp-neighbor { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-routing-policy { prefix oc-rpol; } + import openconfig-types { prefix oc-types; } + import openconfig-bgp-types { prefix oc-bgp-types; } + import openconfig-inet-types { prefix oc-inet; } + import openconfig-yang-types { prefix oc-yang; } + + // Include the common submodule + include openconfig-bgp-common; + include openconfig-bgp-common-multiprotocol; + include openconfig-bgp-peer-group; + include openconfig-bgp-common-structure; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains groupings that are specific to the + neighbor context of the OpenConfig BGP module."; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-neighbor-config { + description + "Configuration parameters relating to a base BGP neighbor that + are not also applicable to any other context + (e.g., peer group)"; + + leaf peer-group { + type leafref { + path "../../../../peer-groups/peer-group/peer-group-name"; + } + description + "The peer-group with which this neighbor is associated"; + } + + leaf neighbor-address { + type oc-inet:ip-address; + description + "Address of the BGP peer, either in IPv4 or IPv6"; + } + + leaf enabled { + type boolean; + default true; + description + "Whether the BGP peer is enabled. In cases where the + enabled leaf is set to false, the local system should not + initiate connections to the neighbor, and should not + respond to TCP connections attempts from the neighbor. If + the state of the BGP session is ESTABLISHED at the time + that this leaf is set to false, the BGP session should be + ceased."; + } + } + + grouping bgp-neighbor-use-multiple-paths { + description + "Multipath configuration and state applicable to a BGP + neighbor"; + + container use-multiple-paths { + description + "Parameters related to the use of multiple-paths for the same + NLRI when they are received only from this neighbor"; + + container config { + description + "Configuration parameters relating to multipath"; + uses bgp-common-use-multiple-paths-config; + } + container state { + config false; + description + "State parameters relating to multipath"; + uses bgp-common-use-multiple-paths-config; + } + + container ebgp { + description + "Multipath configuration for eBGP"; + container config { + description + "Configuration parameters relating to eBGP multipath"; + uses bgp-common-use-multiple-paths-ebgp-as-options-config; + } + container state { + config false; + description + "State information relating to eBGP multipath"; + uses bgp-common-use-multiple-paths-ebgp-as-options-config; + } + } + } + } + + grouping bgp-neighbor-state { + description + "Operational state parameters relating only to a BGP neighbor"; + + leaf session-state { + type enumeration { + enum IDLE { + description + "neighbor is down, and in the Idle state of the + FSM"; + } + enum CONNECT { + description + "neighbor is down, and the session is waiting for + the underlying transport session to be established"; + } + enum ACTIVE { + description + "neighbor is down, and the local system is awaiting + a conncetion from the remote peer"; + } + enum OPENSENT { + description + "neighbor is in the process of being established. + The local system has sent an OPEN message"; + } + enum OPENCONFIRM { + description + "neighbor is in the process of being established. + The local system is awaiting a NOTIFICATION or + KEEPALIVE message"; + } + enum ESTABLISHED { + description + "neighbor is up - the BGP session with the peer is + established"; + } + } + description + "Operational state of the BGP peer"; + } + + leaf last-established { + type oc-types:timeticks64; + description + "This timestamp indicates the time that the + BGP session last transitioned in or out of the Established + state. The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + + The BGP session uptime can be computed by clients as the + difference between this value and the current time in UTC + (assuming the session is in the ESTABLISHED state, per the + session-state leaf)."; + } + + leaf established-transitions { + type oc-yang:counter64; + description + "Number of transitions to the Established state for + the neighbor session. This value is analogous to the + bgpPeerFsmEstablishedTransitions object from the standard + BGP-4 MIB"; + reference + "RFC 4273 - Definitions of Managed Objects for BGP-4"; + } + + leaf-list supported-capabilities { + type identityref { + base oc-bgp-types:BGP_CAPABILITY; + } + description + "BGP capabilities negotiated as supported with the peer"; + } + + container messages { + description + "Counters for BGP messages sent and received from the + neighbor"; + container sent { + description + "Counters relating to BGP messages sent to the neighbor"; + uses bgp-neighbor-counters-message-types-state; + } + + container received { + description + "Counters for BGP messages received from the neighbor"; + uses bgp-neighbor-counters-message-types-state; + } + } + + container queues { + description + "Counters related to queued messages associated with the + BGP neighbor"; + uses bgp-neighbor-queue-counters-state; + } + + leaf dynamically-configured { + type boolean; + default false; + description + "When this leaf is set to true, the peer was configured dynamically + due to an inbound connection request from a specified source prefix + within a dynamic-neighbor-prefix."; + } + } + + grouping bgp-neighbor-counters-message-types-state { + description + "Grouping of BGP message types, included for re-use + across counters"; + + leaf UPDATE { + type uint64; + description + "Number of BGP UPDATE messages announcing, withdrawing + or modifying paths exchanged."; + } + + leaf NOTIFICATION { + type uint64; + description + "Number of BGP NOTIFICATION messages indicating an + error condition has occurred exchanged."; + } + + leaf last-notification-time { + type oc-types:timeticks64; + description + "This timestamp indicates the time that a NOTIFICATION + message was sent or received on the peering session + (based on whether this leaf is associated with + sent or received messages). + + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf last-notification-error-code { + type identityref { + base oc-bgp-types:BGP_ERROR_CODE; + } + description + "Indicates the last BGP error sent or received on the peering + session (based on whether this leaf is associated with + sent or received messages)."; + } + + leaf last-notification-error-subcode { + type identityref { + base oc-bgp-types:BGP_ERROR_SUBCODE; + } + description + "Indicates the last BGP error subcode sent or received on + the peering session (based on whether this leaf is associated + with sent or received messages)"; + } + } + + grouping bgp-neighbor-queue-counters-state { + description + "Counters relating to the message queues associated with the + BGP peer"; + + leaf input { + type uint32; + description + "The number of messages received from the peer currently + queued"; + } + + leaf output { + type uint32; + description + "The number of messages queued to be sent to the peer"; + } + } + + grouping bgp-neighbor-transport-state { + description + "Operational state parameters relating to the transport session + used for the BGP session"; + + leaf local-port { + type oc-inet:port-number; + description + "Local TCP port being used for the TCP session supporting + the BGP session"; + } + + leaf remote-address { + type oc-inet:ip-address; + description + "Remote address to which the BGP session has been + established"; + } + + leaf remote-port { + type oc-inet:port-number; + description + "Remote port being used by the peer for the TCP session + supporting the BGP session"; + } + } + + grouping bgp-neighbor-error-handling-state { + description + "Operational state parameters relating to enhanced error + error handling for BGP"; + + leaf erroneous-update-messages { + type uint32; + description + "The number of BGP UPDATE messages for which the + treat-as-withdraw mechanism has been applied based + on erroneous message contents"; + } + } + + grouping bgp-neighbor-timers-state { + description + "Operational state parameters relating to BGP timers associated + with the BGP session"; + + leaf negotiated-hold-time { + type decimal64 { + fraction-digits 2; + } + description + "The negotiated hold-time for the BGP session"; + } + } + + grouping bgp-neighbor-afi-safi-graceful-restart-state { + description + "Operational state variables relating to the graceful-restart + mechanism on a per-AFI-SAFI basis"; + + leaf received { + type boolean; + description + "This leaf indicates whether the neighbor advertised the + ability to support graceful-restart for this AFI-SAFI"; + } + + leaf advertised { + type boolean; + description + "This leaf indicates whether the ability to support + graceful-restart has been advertised to the peer"; + } + } + + grouping bgp-neighbor-graceful-restart-state { + description + "Operational state information relevant to graceful restart + for BGP"; + + leaf peer-restart-time { + type uint16 { + range 0..4096; + } + description + "The period of time (advertised by the peer) that + the peer expects a restart of a BGP session to + take"; + } + + leaf peer-restarting { + type boolean; + description + "This flag indicates whether the remote neighbor is currently + in the process of restarting, and hence received routes are + currently stale"; + } + + leaf local-restarting { + type boolean; + description + "This flag indicates whether the local neighbor is currently + restarting. The flag is unset after all NLRI have been + advertised to the peer, and the End-of-RIB (EOR) marker has + been unset"; + } + + leaf mode { + type enumeration { + enum HELPER_ONLY { + description + "The local router is operating in helper-only mode, and + hence will not retain forwarding state during a local + session restart, but will do so during a restart of the + remote peer"; + } + enum BILATERAL { + description + "The local router is operating in both helper mode, and + hence retains forwarding state during a remote restart, + and also maintains forwarding state during local session + restart"; + } + enum REMOTE_HELPER { + description + "The local system is able to retain routes during restart + but the remote system is only able to act as a helper"; + } + } + description + "Ths leaf indicates the mode of operation of BGP graceful + restart with the peer"; + } + } + + grouping bgp-neighbor-afi-safi-state { + description + "Operational state parameters relating to an individual AFI, + SAFI for a neighbor"; + + leaf active { + type boolean; + description + "This value indicates whether a particular AFI-SAFI has + been succesfully negotiated with the peer. An AFI-SAFI + may be enabled in the current running configuration, but a + session restart may be required in order to negotiate the new + capability."; + } + + container prefixes { + description "Prefix counters for the BGP session"; + leaf received { + type uint32; + description + "The number of prefixes that are received from the + neighbor after applying any policies. This count is the + number of prefixes present in the post-policy Adj-RIB-In + for the neighbor"; + } + + leaf received-pre-policy { + type uint32; + description + "The number of prefixes that are received from the + neighbor before applying any policies. This count is + the number of prefixes present in the pre-policy + Adj-RIB-In for the neighbor"; + } + + leaf sent { + type uint32; + description + "The number of prefixes that are advertised to the + neighbor after applying any policies. This count is + the number of prefixes present in the post-policy + Adj-RIB-Out for the neighbor"; + } + + leaf installed { + type uint32; + description + "The number of prefices received from the neighbor that + are installed in the network instance RIB and actively used + for forwarding. + + Routes that are actively used for forwarding are + defined to be those that: + - are selected, after the application of policies, to be + included in the Adj-RIB-In-Post, AND + - are selected by best path selection and hence installed + in the Loc-RIB (either as the only route, or as part of + a multipath set, AND + - are selected, after the application of protocol + preferences (e.g., administrative distance) as the + route to be used by the system's RIB"; + } + } + } + + grouping bgp-neighbor-afi-safi-list { + description + "List of address-families associated with the BGP neighbor"; + + list afi-safi { + key "afi-safi-name"; + + description + "AFI,SAFI configuration available for the + neighbour or group"; + + + leaf afi-safi-name { + type leafref { + path "../config/afi-safi-name"; + } + description + "Reference to the AFI-SAFI name used as a key + for the AFI-SAFI list"; + } + + container config { + description + "Configuration parameters for the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + } + container state { + config false; + description + "State information relating to the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + uses bgp-neighbor-afi-safi-state; + } + + + container graceful-restart { + description + "Parameters relating to BGP graceful-restart"; + container config { + description + "Configuration options for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + } + container state { + config false; + description + "State information for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + uses bgp-neighbor-afi-safi-graceful-restart-state; + } + } + + uses bgp-common-structure-neighbor-group-add-paths; + uses bgp-common-mp-all-afi-safi-list-contents; + uses bgp-neighbor-use-multiple-paths; + } + } + + grouping bgp-neighbor-base { + description + "Parameters related to a BGP neighbor"; + + container config { + description + "Configuration parameters relating to the BGP neighbor or + group"; + uses bgp-neighbor-config; + uses bgp-common-neighbor-group-config; + } + container state { + config false; + description + "State information relating to the BGP neighbor"; + uses bgp-neighbor-config; + uses bgp-common-neighbor-group-config; + uses bgp-neighbor-state; + } + + container timers { + description + "Timers related to a BGP neighbor"; + container config { + description + "Configuration parameters relating to timers used for the + BGP neighbor"; + uses bgp-common-neighbor-group-timers-config; + } + container state { + config false; + description + "State information relating to the timers used for the BGP + neighbor"; + uses bgp-common-neighbor-group-timers-config; + uses bgp-neighbor-timers-state; + } + } + + container transport { + description + "Transport session parameters for the BGP neighbor"; + container config { + description + "Configuration parameters relating to the transport + session(s) used for the BGP neighbor"; + uses bgp-common-neighbor-group-transport-config; + } + container state { + config false; + description + "State information relating to the transport session(s) + used for the BGP neighbor"; + uses bgp-common-neighbor-group-transport-config; + uses bgp-neighbor-transport-state; + } + } + + container error-handling { + description + "Error handling parameters used for the BGP neighbor or + group"; + container config { + description + "Configuration parameters enabling or modifying the + behavior or enhanced error handling mechanisms for the BGP + neighbor"; + uses bgp-common-neighbor-group-error-handling-config; + } + container state { + config false; + description + "State information relating to enhanced error handling + mechanisms for the BGP neighbor"; + uses bgp-common-neighbor-group-error-handling-config; + uses bgp-neighbor-error-handling-state; + } + } + + container graceful-restart { + description + "Parameters relating the graceful restart mechanism for BGP"; + container config { + description + "Configuration parameters relating to graceful-restart"; + uses bgp-common-graceful-restart-config; + } + container state { + config false; + description + "State information associated with graceful-restart"; + uses bgp-common-graceful-restart-config; + uses bgp-neighbor-graceful-restart-state; + } + } + + uses bgp-common-structure-neighbor-group-logging-options; + uses bgp-common-structure-neighbor-group-ebgp-multihop; + uses bgp-common-structure-neighbor-group-route-reflector; + uses bgp-common-structure-neighbor-group-as-path-options; + uses bgp-neighbor-use-multiple-paths; + uses oc-rpol:apply-policy-group; + + container afi-safis { + description + "Per-address-family configuration parameters associated with + the neighbor"; + uses bgp-neighbor-afi-safi-list; + } + } + + grouping bgp-neighbor-list { + description + "The list of BGP neighbors"; + + list neighbor { + key "neighbor-address"; + description + "List of BGP neighbors configured on the local system, + uniquely identified by peer IPv[46] address"; + + leaf neighbor-address { + type leafref { + path "../config/neighbor-address"; + } + description + "Reference to the address of the BGP neighbor used as + a key in the neighbor list"; + } + + uses bgp-neighbor-base; + } + + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-peer-group@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp-peer-group@2019-07-10.yang new file mode 100644 index 0000000..a8787dd --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-peer-group@2019-07-10.yang @@ -0,0 +1,290 @@ +submodule openconfig-bgp-peer-group { + + belongs-to openconfig-bgp { + prefix "oc-bgp"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-routing-policy { prefix oc-rpol; } + + // Include the common submodule + include openconfig-bgp-common; + include openconfig-bgp-common-multiprotocol; + include openconfig-bgp-common-structure; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This sub-module contains groupings that are specific to the + peer-group context of the OpenConfig BGP module."; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + grouping bgp-peer-group-config { + description + "Configuration parameters relating to a base BGP peer group that + are not also applicable to any other context (e.g., neighbor)"; + + leaf peer-group-name { + type string; + description + "Name of the BGP peer-group"; + } + + } + + grouping bgp-peer-group-afi-safi-list { + description + "List of address-families associated with the BGP peer-group"; + + list afi-safi { + key "afi-safi-name"; + + description + "AFI,SAFI configuration available for the + neighbour or group"; + + leaf afi-safi-name { + type leafref { + path "../config/afi-safi-name"; + } + description + "Reference to the AFI-SAFI name used as a key + for the AFI-SAFI list"; + } + + container config { + description + "Configuration parameters for the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + } + container state { + config false; + description + "State information relating to the AFI-SAFI"; + uses bgp-common-mp-afi-safi-config; + } + + container graceful-restart { + description + "Parameters relating to BGP graceful-restart"; + container config { + description + "Configuration options for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + } + container state { + config false; + description + "State information for BGP graceful-restart"; + uses bgp-common-mp-afi-safi-graceful-restart-config; + } + } + + uses bgp-common-structure-neighbor-group-add-paths; + uses bgp-common-global-group-use-multiple-paths; + uses bgp-common-mp-all-afi-safi-list-contents; + } + } + + grouping bgp-peer-group-base { + description + "Parameters related to a BGP group"; + + container config { + description + "Configuration parameters relating to the BGP neighbor or + group"; + uses bgp-peer-group-config; + uses bgp-common-neighbor-group-config; + } + container state { + config false; + description + "State information relating to the BGP peer-group"; + uses bgp-peer-group-config; + uses bgp-common-neighbor-group-config; + uses bgp-common-state; + } + + container timers { + description + "Timers related to a BGP peer-group"; + + container config { + description + "Configuration parameters relating to timers used for the + BGP neighbor or peer group"; + uses bgp-common-neighbor-group-timers-config; + } + container state { + config false; + description + "State information relating to the timers used for the BGP + group"; + uses bgp-common-neighbor-group-timers-config; + } + } + + container transport { + description + "Transport session parameters for the BGP peer-group"; + + container config { + description + "Configuration parameters relating to the transport + session(s) used for the BGP neighbor or group"; + uses bgp-common-neighbor-group-transport-config; + } + container state { + config false; + description + "State information relating to the transport session(s) + used for the BGP neighbor or group"; + uses bgp-common-neighbor-group-transport-config; + } + } + + container error-handling { + description + "Error handling parameters used for the BGP peer-group"; + + container config { + description + "Configuration parameters enabling or modifying the + behavior or enhanced error handling mechanisms for the BGP + group"; + uses bgp-common-neighbor-group-error-handling-config; + } + container state { + config false; + description + "State information relating to enhanced error handling + mechanisms for the BGP group"; + uses bgp-common-neighbor-group-error-handling-config; + } + } + + container graceful-restart { + description + "Parameters relating the graceful restart mechanism for BGP"; + container config { + description + "Configuration parameters relating to graceful-restart"; + uses bgp-common-graceful-restart-config; + } + container state { + config false; + description + "State information associated with graceful-restart"; + uses bgp-common-graceful-restart-config; + } + } + + uses bgp-common-structure-neighbor-group-logging-options; + uses bgp-common-structure-neighbor-group-ebgp-multihop; + uses bgp-common-structure-neighbor-group-route-reflector; + uses bgp-common-structure-neighbor-group-as-path-options; + uses bgp-common-global-group-use-multiple-paths; + uses oc-rpol:apply-policy-group; + + container afi-safis { + description + "Per-address-family configuration parameters associated with + thegroup"; + uses bgp-peer-group-afi-safi-list; + } + } + + grouping bgp-peer-group-list { + description + "The list of BGP peer groups"; + + list peer-group { + key "peer-group-name"; + description + "List of BGP peer-groups configured on the local system - + uniquely identified by peer-group name"; + + leaf peer-group-name { + type leafref { + path "../config/peer-group-name"; + } + description + "Reference to the name of the BGP peer-group used as a + key in the peer-group list"; + } + + uses bgp-peer-group-base; + } + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-policy@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-bgp-policy@2019-11-28.yang new file mode 100644 index 0000000..b81c89e --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-policy@2019-11-28.yang @@ -0,0 +1,1161 @@ +module openconfig-bgp-policy { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/bgp-policy"; + + prefix "oc-bgp-pol"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-routing-policy {prefix oc-rpol; } + import openconfig-policy-types { prefix oc-pol-types; } + import openconfig-bgp-types { prefix oc-bgp-types; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module contains data definitions for BGP routing policy. + It augments the base routing-policy module with BGP-specific + options for conditions and actions."; + + oc-ext:openconfig-version "6.0.1"; + + revision "2019-11-28" { + description + "Fix quotes on literals in when statements"; + reference "6.0.1"; + } + + revision "2019-02-01" { + description + "Move BGP community match-set-options from + policy-definitions/statements/.../bgp-conditions to + defined-sets/bgp-defined-sets/community-set for wider platform + support."; + reference "6.0.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedef statements + + typedef bgp-set-community-option-type { + type enumeration { + enum ADD { + description + "add the specified communities to the existing + community attribute"; + } + enum REMOVE { + description + "remove the specified communities from the + existing community attribute"; + } + enum REPLACE { + description + "replace the existing community attribute with + the specified communities. If an empty set is + specified, this removes the community attribute + from the route."; + } + } + description + "Type definition for options when setting the community + attribute in a policy action"; + } + + typedef bgp-next-hop-type { + type union { + type oc-inet:ip-address; + type enumeration { + enum SELF { + description "special designation for local router's own + address, i.e., next-hop-self"; + } + } + } + description + "type definition for specifying next-hop in policy actions"; + } + + typedef bgp-set-med-type { + type union { + type uint32; + type string { + pattern '^[+-][0-9]+$'; + } + type enumeration { + enum IGP { + description "set the MED value to the IGP cost toward the + next hop for the route"; + } + } + } + description + "Type definition for specifying how the BGP MED can + be set in BGP policy actions. The three choices are to set + the MED directly, increment/decrement using +/- notation, + and setting it to the IGP cost (predefined value)."; + } + + // grouping statements + + grouping match-as-path-config { + description + "Configuration data for match conditions on AS path set"; + + leaf as-path-set { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + + "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:as-path-sets/" + + "oc-bgp-pol:as-path-set/oc-bgp-pol:as-path-set-name"; + } + description "References a defined AS path set"; + } + uses oc-rpol:match-set-options-group; + } + + grouping match-as-path-state { + description + "Operational state data for match conditions on AS path set"; + } + + grouping match-as-path-top { + description + "Top-level grouping for match conditions on AS path set"; + + container match-as-path-set { + description + "Match a referenced as-path set according to the logic + defined in the match-set-options leaf"; + + container config { + description + "Configuration data for match conditions on AS path set"; + + uses match-as-path-config; + } + + container state { + + config false; + + description + "Operational state data for match conditions on AS + path set"; + + uses match-as-path-config; + uses match-as-path-state; + } + } + } + + grouping bgp-match-set-conditions { + description + "Condition statement definitions for checking membership in a + defined set"; + + uses match-as-path-top; + } + + grouping community-count-config { + description + "Configuration data for community count condition"; + + uses oc-pol-types:attribute-compare-operators; + } + + grouping community-count-state { + description + "Operational state data for community count condition"; + } + + grouping community-count-top { + description + "Top-level grouping for community count condition"; + + container community-count { + description + "Value and comparison operations for conditions based on the + number of communities in the route update"; + + container config { + description + "Configuration data for community count condition"; + + uses community-count-config; + } + + container state { + + config false; + + description + "Operational state data for community count condition"; + + uses community-count-config; + uses community-count-state; + } + } + } + + grouping as-path-length-config { + description + "Configuration data for AS path length condition"; + + uses oc-pol-types:attribute-compare-operators; + } + + grouping as-path-length-state { + description + "Operational state data for AS path length condition"; + } + + grouping as-path-length-top { + description + "Top-level grouping for AS path length condition"; + + container as-path-length { + description + "Value and comparison operations for conditions based on the + length of the AS path in the route update"; + + container config { + description + "Configuration data for AS path length condition"; + + uses as-path-length-config; + } + + container state { + + config false; + + description + "Operational state data for AS path length condition"; + + uses as-path-length-config; + uses as-path-length-state; + } + } + } + + grouping bgp-conditions-config { + description + "Configuration data for BGP-specific policy conditions"; + + leaf med-eq { + type uint32; + description + "Condition to check if the received MED value is equal to + the specified value"; + } + + leaf origin-eq { + type oc-bgp-types:bgp-origin-attr-type; + description + "Condition to check if the route origin is equal to the + specified value"; + } + + leaf-list next-hop-in { + type oc-inet:ip-address; + description + "List of next hop addresses to check for in the route + update"; + } + + leaf-list afi-safi-in { + type identityref { + base oc-bgp-types:AFI_SAFI_TYPE; + } + description + "List of address families which the NLRI may be + within"; + } + + leaf local-pref-eq { + type uint32; + // TODO: add support for other comparisons if needed + description + "Condition to check if the local pref attribute is equal to + the specified value"; + } + + leaf route-type { + // TODO: verify extent of vendor support for this comparison + type enumeration { + enum INTERNAL { + description "route type is internal"; + } + enum EXTERNAL { + description "route type is external"; + } + } + description + "Condition to check the route type in the route update"; + } + + leaf community-set { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + + "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:community-sets/" + + "oc-bgp-pol:community-set/oc-bgp-pol:community-set-name"; + } + description + "References a defined community set"; + } + + leaf ext-community-set { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + + "oc-bgp-pol:bgp-defined-sets/oc-bgp-pol:ext-community-sets/" + + "oc-bgp-pol:ext-community-set/" + + "oc-bgp-pol:ext-community-set-name"; + } + description "References a defined extended community set"; + } + } + + grouping bgp-conditions-state { + description + "Operational state data for BGP-specific policy conditions"; + } + + grouping bgp-conditions-top { + description + "Top-level grouping for BGP-specific policy conditions"; + + container bgp-conditions { + description + "Top-level container "; + + container config { + description + "Configuration data for BGP-specific policy conditions"; + + uses bgp-conditions-config; + } + + container state { + + config false; + + description + "Operational state data for BGP-specific policy + conditions"; + + uses bgp-conditions-config; + uses bgp-conditions-state; + } + + uses community-count-top; + uses as-path-length-top; + uses bgp-match-set-conditions; + } + } + + grouping community-set-config { + description + "Configuration data for BGP community sets"; + + leaf community-set-name { + type string; + mandatory true; + description + "name / label of the community set -- this is used to + reference the set in match conditions"; + } + + leaf-list community-member { + type union { + type oc-bgp-types:bgp-std-community-type; + type oc-bgp-types:bgp-community-regexp-type; + type oc-bgp-types:bgp-well-known-community-type; + } + description + "members of the community set. + For an ADD operation these are the communities that will be added; + the regexp type is not valid in this operation. + For REMOVE or REPLACE operations then matching communities will + be removed unless match-set-options is INVERT which will + reverse this to mean that anything that does not match will be + removed."; + } + + uses oc-rpol:match-set-options-group; + } + + grouping community-set-state { + description + "Operational state data for BGP community sets"; + } + + grouping community-set-top { + description + "Top-level grouping for BGP community sets"; + + container community-sets { + description + "Enclosing container for list of defined BGP community sets"; + + list community-set { + key "community-set-name"; + description + "List of defined BGP community sets"; + + leaf community-set-name { + type leafref { + path "../config/community-set-name"; + } + description + "Reference to list key"; + } + + container config { + description + "Configuration data for BGP community sets"; + + uses community-set-config; + } + + container state { + + config false; + + description + "Operational state data for BGP community sets"; + + uses community-set-config; + uses community-set-state; + } + } + } + } + + grouping ext-community-set-config { + description + "Configuration data for extended BGP community sets"; + + leaf ext-community-set-name { + type string; + description + "name / label of the extended community set -- this is + used to reference the set in match conditions"; + } + + leaf-list ext-community-member { + type union { + type oc-bgp-types:bgp-ext-community-type; + type oc-bgp-types:bgp-community-regexp-type; + } + description + "members of the extended community set + For an ADD operation these are the communities that will be added; + the regexp type is not valid in this operation. + For REMOVE or REPLACE operations then matching communities will + be removed unless match-set-options is INVERT which will + reverse this to mean that anything that does not match will be + removed."; + } + + uses oc-rpol:match-set-options-group; + } + + grouping ext-community-set-state { + description + "Operational state data for extended BGP community sets"; + } + + grouping ext-community-set-top { + description + "Top-level grouping for extended BGP community sets"; + + container ext-community-sets { + description + "Enclosing container for list of extended BGP community + sets"; + + list ext-community-set { + key "ext-community-set-name"; + description + "List of defined extended BGP community sets"; + + leaf ext-community-set-name { + type leafref { + path "../config/ext-community-set-name"; + } + description + "Reference to list key"; + } + + container config { + description + "Configuration data for extended BGP community sets"; + + uses ext-community-set-config; + } + + container state { + + config false; + + description + "Operational state data for extended BGP community sets"; + + uses ext-community-set-config; + uses ext-community-set-state; + } + } + } + } + + grouping as-path-set-config { + description + "Configuration data for AS path sets"; + + leaf as-path-set-name { + type string; + description + "name of the AS path set -- this is used to reference + the set in match conditions"; + } + + leaf-list as-path-set-member { + // TODO: need to refine typedef for AS path expressions + type string; + description + "AS path expression -- list of ASes in the set"; + } + } + + grouping as-path-set-state { + description + "Operational state data for AS path sets"; + } + + grouping as-path-set-top { + description + "Top-level grouping for AS path sets"; + + container as-path-sets { + description + "Enclosing container for list of define AS path sets"; + + list as-path-set { + key "as-path-set-name"; + description + "List of defined AS path sets"; + + leaf as-path-set-name { + type leafref { + path "../config/as-path-set-name"; + } + description + "Reference to list key"; + } + + container config { + description + "Configuration data for AS path sets"; + + uses as-path-set-config; + } + + container state { + + config false; + + description + "Operational state data for AS path sets"; + + uses as-path-set-config; + uses as-path-set-state; + } + } + } + } + + // augment statements + + augment "/oc-rpol:routing-policy/oc-rpol:defined-sets" { + description "adds BGP defined sets container to routing policy + model"; + + container bgp-defined-sets { + description + "BGP-related set definitions for policy match conditions"; + + uses community-set-top; + uses ext-community-set-top; + uses as-path-set-top; + } + } + + grouping as-path-prepend-config { + description + "Configuration data for the AS path prepend action"; + + leaf repeat-n { + type uint8 { + range 1..max; + } + description + "Number of times to prepend the value specified in the asn + leaf to the AS path. If no value is specified by the asn + leaf, the local AS number of the system is used. The value + should be between 1 and the maximum supported by the + implementation."; + } + + leaf asn { + type oc-inet:as-number; + description + "The AS number to prepend to the AS path. If this leaf is + not specified and repeat-n is set, then the local AS + number will be used for prepending."; + } + } + + grouping as-path-prepend-state { + description + "Operational state data for the AS path prepend action"; + } + + grouping as-path-prepend-top { + description + "Top-level grouping for the AS path prepend action"; + + container set-as-path-prepend { + description + "Action to prepend the specified AS number to the AS-path a + specified number of times"; + + container config { + description + "Configuration data for the AS path prepend action"; + + uses as-path-prepend-config; + } + + container state { + + config false; + + description + "Operational state data for the AS path prepend action"; + + uses as-path-prepend-config; + uses as-path-prepend-state; + } + } + } + + grouping set-community-action-common { + description + "Common leaves for set-community and set-ext-community + actions"; + + leaf method { + type enumeration { + enum INLINE { + description + "The extended communities are specified inline as a + list"; + } + enum REFERENCE { + description + "The extended communities are specified by referencing a + defined ext-community set"; + } + } + description + "Indicates the method used to specify the extended + communities for the set-ext-community action"; + } + + leaf options { + type bgp-set-community-option-type; + description + "Options for modifying the community attribute with + the specified values. These options apply to both + methods of setting the community attribute."; + } + } + + grouping set-community-inline-config { + description + "Configuration data for inline specification of set-community + action"; + + leaf-list communities { + type union { + type oc-bgp-types:bgp-std-community-type; + type oc-bgp-types:bgp-well-known-community-type; + } + description + "Set the community values for the update inline with + a list."; + } + } + + grouping set-community-inline-state { + description + "Operational state data or inline specification of + set-community action"; + } + + grouping set-community-inline-top { + description + "Top-level grouping or inline specification of set-community + action"; + + container inline { + when "../config/method='INLINE'" { + description + "Active only when the set-community method is INLINE"; + } + description + "Set the community values for the action inline with + a list."; + + container config { + description + "Configuration data or inline specification of set-community + action"; + + uses set-community-inline-config; + } + + container state { + + config false; + + description + "Operational state data or inline specification of + set-community action"; + + uses set-community-inline-config; + uses set-community-inline-state; + } + } + } + + grouping set-community-reference-config { + description + "Configuration data for referening a community-set in the + set-community action"; + + leaf community-set-ref { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + + "oc-bgp-pol:bgp-defined-sets/" + + "oc-bgp-pol:community-sets/oc-bgp-pol:community-set/" + + "oc-bgp-pol:community-set-name"; + } + description + "References a defined community set by name"; + } + } + + grouping set-community-reference-state { + description + "Operational state data for referening a community-set in the + set-community action"; + } + + grouping set-community-reference-top { + description + "Top-level grouping for referening a community-set in the + set-community action"; + + container reference { + when "../config/method='REFERENCE'" { + description + "Active only when the set-community method is REFERENCE"; + } + description + "Provide a reference to a defined community set for the + set-community action"; + + container config { + description + "Configuration data for referening a community-set in the + set-community action"; + + uses set-community-reference-config; + } + + container state { + + config false; + + description + "Operational state data for referening a community-set + in the set-community action"; + + uses set-community-reference-config; + uses set-community-reference-state; + } + } + } + + grouping set-community-action-config { + description + "Configuration data for the set-community action"; + + uses set-community-action-common; + } + + grouping set-community-action-state { + description + "Operational state data for the set-community action"; + } + + grouping set-community-action-top { + description + "Top-level grouping for the set-community action"; + + container set-community { + description + "Action to set the community attributes of the route, along + with options to modify how the community is modified. + Communities may be set using an inline list OR + reference to an existing defined set (not both)."; + + container config { + description + "Configuration data for the set-community action"; + + uses set-community-action-config; + } + + container state { + + config false; + + description + "Operational state data for the set-community action"; + + uses set-community-action-config; + uses set-community-action-state; + } + + uses set-community-inline-top; + uses set-community-reference-top; + } + } + + grouping set-ext-community-inline-config { + description + "Configuration data for inline specification of + set-ext-community action"; + + leaf-list communities { + type union { + type oc-bgp-types:bgp-ext-community-type; + type oc-bgp-types:bgp-well-known-community-type; + } + description + "Set the extended community values for the update inline + with a list."; + } + } + + grouping set-ext-community-inline-state { + description + "Operational state data or inline specification of + set-ext-community action"; + } + + grouping set-ext-community-inline-top { + description + "Top-level grouping or inline specification of set-ext-community + action"; + + container inline { + when "../config/method='INLINE'" { + description + "Active only when the set-community method is INLINE"; + } + description + "Set the extended community values for the action inline with + a list."; + + container config { + description + "Configuration data or inline specification of + set-ext-community action"; + + uses set-ext-community-inline-config; + } + + container state { + + config false; + + description + "Operational state data or inline specification of + set-ext-community action"; + + uses set-ext-community-inline-config; + uses set-ext-community-inline-state; + } + } + } + + grouping set-ext-community-reference-config { + description + "Configuration data for referening a extended community-set + in the set-ext-community action"; + + leaf ext-community-set-ref { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:defined-sets/" + + "oc-bgp-pol:bgp-defined-sets/" + + "oc-bgp-pol:ext-community-sets/" + + "oc-bgp-pol:ext-community-set/" + + "oc-bgp-pol:ext-community-set-name"; + } + description + "References a defined extended community set by + name"; + } + } + + grouping set-ext-community-reference-state { + description + "Operational state data for referening an extended + community-set in the set-ext-community action"; + } + + grouping set-ext-community-reference-top { + description + "Top-level grouping for referening an extended community-set + in the set-community action"; + + container reference { + when "../config/method='REFERENCE'" { + description + "Active only when the set-community method is REFERENCE"; + } + description + "Provide a reference to an extended community set for the + set-ext-community action"; + + container config { + description + "Configuration data for referening an extended + community-set in the set-ext-community action"; + + uses set-ext-community-reference-config; + } + + container state { + + config false; + + description + "Operational state data for referening an extended + community-set in the set-ext-community action"; + + uses set-ext-community-reference-config; + uses set-ext-community-reference-state; + } + } + } + + grouping set-ext-community-action-config { + description + "Configuration data for the set-ext-community action"; + + uses set-community-action-common; + } + + grouping set-ext-community-action-state { + description + "Operational state data for the set-ext-community action"; + } + + grouping set-ext-community-action-top { + description + "Top-level grouping for the set-ext-community action"; + + container set-ext-community { + description + "Action to set the extended community attributes of the + route, along with options to modify how the community is + modified. Extended communities may be set using an inline + list OR a reference to an existing defined set (but not + both)."; + + container config { + description + "Configuration data for the set-ext-community action"; + + uses set-ext-community-action-config; + } + + container state { + + config false; + + description + "Operational state data for the set-ext-community action"; + + uses set-ext-community-action-config; + uses set-ext-community-action-state; + } + uses set-ext-community-inline-top; + uses set-ext-community-reference-top; + } + } + + grouping bgp-actions-config { + description + "Configuration data for BGP-specific actions"; + + leaf set-route-origin { + type oc-bgp-types:bgp-origin-attr-type; + description "set the origin attribute to the specified + value"; + } + + leaf set-local-pref { + type uint32; + description "set the local pref attribute on the route + update"; + } + + leaf set-next-hop { + type bgp-next-hop-type; + description "set the next-hop attribute in the route update"; + } + + leaf set-med { + type bgp-set-med-type; + description "set the med metric attribute in the route + update"; + } + } + + grouping bgp-actions-state { + description + "Operational state data for BGP-specific actions"; + } + + grouping bgp-actions-top { + description + "Top-level grouping for BGP-specific actions"; + + container bgp-actions { + description + "Top-level container for BGP-specific actions"; + + container config { + description + "Configuration data for BGP-specific actions"; + + uses bgp-actions-config; + } + + container state { + + config false; + + description + "Operational state data for BGP-specific actions"; + + uses bgp-actions-config; + uses bgp-actions-state; + } + uses as-path-prepend-top; + uses set-community-action-top; + uses set-ext-community-action-top; + } + } + + augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + + "oc-rpol:conditions" { + description + "BGP policy conditions added to routing policy module"; + + uses bgp-conditions-top; + } + + augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + + "oc-rpol:actions" { + description "BGP policy actions added to routing policy + module"; + + uses bgp-actions-top; + } + + // rpc statements + + // notification statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp-types@2020-03-24.yang b/exp/yangcli/h3c-yang/openconfig-bgp-types@2020-03-24.yang new file mode 100644 index 0000000..28038ac --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp-types@2020-03-24.yang @@ -0,0 +1,658 @@ +module openconfig-bgp-types { + yang-version "1"; + + namespace "http://openconfig.net/yang/bgp-types"; + + prefix "oc-bgp-types"; + + import openconfig-types { prefix "oc-types"; } + import openconfig-inet-types { prefix "oc-inet"; } + import openconfig-extensions { prefix "oc-ext"; } + + // Include definitions of BGP error notifications + include openconfig-bgp-errors; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module contains general data definitions for use in BGP + policy. It can be imported by modules that make use of BGP + attributes"; + + oc-ext:openconfig-version "5.1.0"; + + revision "2020-03-24" { + description + "Add FlowSpec, BGP-LS and LSVR AFI-SAFI identities."; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2018-03-20" { + description + "Added color extended community"; + reference "4.0.2"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + identity BGP_CAPABILITY { + description "Base identity for a BGP capability"; + } + + identity MPBGP { + base BGP_CAPABILITY; + description + "Multi-protocol extensions to BGP"; + reference "RFC2858"; + } + + identity ROUTE_REFRESH { + base BGP_CAPABILITY; + description + "The BGP route-refresh functionality"; + reference "RFC2918"; + } + + identity ASN32 { + base BGP_CAPABILITY; + description + "4-byte (32-bit) AS number functionality"; + reference "RFC6793"; + } + + identity GRACEFUL_RESTART { + base BGP_CAPABILITY; + description + "Graceful restart functionality"; + reference "RFC4724"; + } + + identity ADD_PATHS { + base BGP_CAPABILITY; + description + "BGP add-paths"; + reference "draft-ietf-idr-add-paths"; + } + + identity AFI_SAFI_TYPE { + description + "Base identity type for AFI,SAFI tuples for BGP-4"; + reference "RFC4760 - multiprotocol extensions for BGP-4"; + } + + identity IPV4_UNICAST { + base AFI_SAFI_TYPE; + description + "IPv4 unicast (AFI,SAFI = 1,1)"; + reference "RFC4760"; + } + + identity IPV6_UNICAST { + base AFI_SAFI_TYPE; + description + "IPv6 unicast (AFI,SAFI = 2,1)"; + reference "RFC4760"; + } + + identity IPV4_LABELED_UNICAST { + base AFI_SAFI_TYPE; + description + "Labeled IPv4 unicast (AFI,SAFI = 1,4)"; + reference "RFC3107"; + } + + identity IPV6_LABELED_UNICAST { + base AFI_SAFI_TYPE; + description + "Labeled IPv6 unicast (AFI,SAFI = 2,4)"; + reference "RFC3107"; + } + + identity L3VPN_IPV4_UNICAST { + base AFI_SAFI_TYPE; + description + "Unicast IPv4 MPLS L3VPN (AFI,SAFI = 1,128)"; + reference "RFC4364"; + } + + identity L3VPN_IPV6_UNICAST { + base AFI_SAFI_TYPE; + description + "Unicast IPv6 MPLS L3VPN (AFI,SAFI = 2,128)"; + reference "RFC4659"; + } + + identity L3VPN_IPV4_MULTICAST { + base AFI_SAFI_TYPE; + description + "Multicast IPv4 MPLS L3VPN (AFI,SAFI = 1,129)"; + reference "RFC6514"; + } + + identity L3VPN_IPV6_MULTICAST { + base AFI_SAFI_TYPE; + description + "Multicast IPv6 MPLS L3VPN (AFI,SAFI = 2,129)"; + reference "RFC6514"; + } + + identity L2VPN_VPLS { + base AFI_SAFI_TYPE; + description + "BGP-signalled VPLS (AFI,SAFI = 25,65)"; + reference "RFC4761"; + } + + identity L2VPN_EVPN { + base AFI_SAFI_TYPE; + description + "BGP MPLS Based Ethernet VPN (AFI,SAFI = 25,70)"; + } + + identity SRTE_POLICY_IPV4 { + base AFI_SAFI_TYPE; + description + "Segment Routing Traffic Engineering (SRTE) Policy + for IPv4 (AFI,SAFI = 1,73)"; + } + + identity SRTE_POLICY_IPV6 { + base AFI_SAFI_TYPE; + description + "Segment Routing Traffic Engineering (SRTE) Policy + for IPv6 (AFI,SAFI = 2,73)"; + } + + identity IPV4_FLOWSPEC { + base AFI_SAFI_TYPE; + description + "IPv4 dissemination of flow specification rules + (AFI,SAFI = 1,133)"; + reference "RFC5575"; + } + + identity VPNV4_FLOWSPEC { + base AFI_SAFI_TYPE; + description + "IPv4 dissemination of flow specification rules + (AFI,SAFI = 1,134)"; + reference "RFC5575"; + } + + identity LINKSTATE { + base AFI_SAFI_TYPE; + description + "BGP-LS (AFI,SAFI = 16388,71)"; + reference "RFC7752"; + } + + identity LINKSTATE_VPN { + base AFI_SAFI_TYPE; + description + "BGP-LS-VPN (AFI,SAFI = 16388,72)"; + reference "RFC7752"; + } + + identity LINKSTATE_SPF { + base AFI_SAFI_TYPE; + description + "BGP-LS SPF (AFI,SAFI = 16388,TBD)"; + reference "draft-ietf-lsvr-bgp-spf"; + } + + + identity BGP_WELL_KNOWN_STD_COMMUNITY { + description + "Reserved communities within the standard community space + defined by RFC1997. These communities must fall within the + range 0x00000000 to 0xFFFFFFFF"; + reference "RFC1997"; + } + + identity NO_EXPORT { + base BGP_WELL_KNOWN_STD_COMMUNITY; + description + "Do not export NLRI received carrying this community outside + the bounds of this autonomous system, or this confederation if + the local autonomous system is a confederation member AS. This + community has a value of 0xFFFFFF01."; + reference "RFC1997"; + } + + identity NO_ADVERTISE { + base BGP_WELL_KNOWN_STD_COMMUNITY; + description + "All NLRI received carrying this community must not be + advertised to other BGP peers. This community has a value of + 0xFFFFFF02."; + reference "RFC1997"; + } + + identity NO_EXPORT_SUBCONFED { + base BGP_WELL_KNOWN_STD_COMMUNITY; + description + "All NLRI received carrying this community must not be + advertised to external BGP peers - including over confederation + sub-AS boundaries. This community has a value of 0xFFFFFF03."; + reference "RFC1997"; + } + + identity NOPEER { + base BGP_WELL_KNOWN_STD_COMMUNITY; + description + "An autonomous system receiving NLRI tagged with this community + is advised not to readvertise the NLRI to external bi-lateral + peer autonomous systems. An AS may also filter received NLRI + from bilateral peer sessions when they are tagged with this + community value"; + reference "RFC3765"; + } + + typedef bgp-session-direction { + type enumeration { + enum INBOUND { + description + "Refers to all NLRI received from the BGP peer"; + } + enum OUTBOUND { + description + "Refers to all NLRI advertised to the BGP peer"; + } + } + description + "Type to describe the direction of NLRI transmission"; + } + + typedef bgp-well-known-community-type { + type identityref { + base BGP_WELL_KNOWN_STD_COMMUNITY; + } + description + "Type definition for well-known IETF community attribute + values"; + reference + "IANA Border Gateway Protocol (BGP) Well Known Communities"; + } + + + typedef bgp-std-community-type { + // TODO: further refine restrictions and allowed patterns + // 4-octet value: + // 2 octets + // 2 octets + type union { + type uint32 { + // per RFC 1997, 0x00000000 - 0x0000FFFF and 0xFFFF0000 - + // 0xFFFFFFFF are reserved + } + type string { + pattern '^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + } + description + "Type definition for standard commmunity attributes represented as + a integer value, or a string of the form N:M where N and M are + integers between 0 and 65535."; + reference "RFC 1997 - BGP Communities Attribute"; + } + + typedef bgp-ext-community-type { + type union { + type string { + // Type 1: 2-octet global and 4-octet local + // (AS number) (Integer) + pattern '^(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])$'; + } + type string { + // Type 2: 4-octet global and 2-octet local + // (ipv4-address) (integer) + pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + + '2[0-4][0-9]|25[0-5]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // RFC5668: 4-octet global and 2-octet local + // (AS number) (integer) + pattern '^(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // route-target with Type 1 + // route-target:(ASN):(local-part) + pattern '^route\-target:' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])$'; + } + type string { + // route-target with Type 2 + // route-target:(IPv4):(local-part) + pattern '^route\-target:' + + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + + '2[0-4][0-9]|25[0-5]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // 4-byte AS Type 1 route-target + pattern '^route\-target:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // route-origin with Type 1 + pattern '^route\-origin:' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9]):' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])$'; + } + type string { + // route-origin with Type 2 + pattern '^route\-origin:' + + '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|' + + '2[0-4][0-9]|25[0-5]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // 4-byte AS Type 1 route-origin + pattern '^route\-origin:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9]):' + + '(6553[0-5]|655[0-2][0-9]|654[0-9]{2}|65[0-4][0-9]{2}' + + '|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{1,3}|[0-9])$'; + } + type string { + // Extended Color Community + pattern '^color:' + + '[0-1]{2}:' + + '(429496729[0-5]|42949672[0-8][0-9]|4294967[0-1][0-9]{2}' + + '|429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|4294[0-8][0-9]{5}|' + + '429[0-3][0-9]{6}|4[0-1][0-9]{7}|[1-3][0-9]{9}|' + + '[1-9][0-9]{1,8}|[0-9])$'; + } + } + description + "Type definition for extended community attributes. In the case that + common communities are utilised, they are represented as a string + of the form: + - <2b AS>:<4b value> per RFC4360 section 3.1 + - <4b IPv4>:<2b value> per RFC4360 section 3.2 + - <4b AS>:<2b value> per RFC5668 section 2. + - route-target:<2b AS>:<4b value> per RFC4360 section 4 + - route-target:<4b IPv4>:<2b value> per RFC4360 section 4 + - route-origin:<2b ASN>:<4b value> per RFC4360 section 5 + - route-origin:<4b IPv4>:<2b value> per RFC4360 section 5 + - color::<4b value> per draft-ietf-idr-segment-routing-te-policy + section 3"; + reference + "RFC 4360 - BGP Extended Communities Attribute + RFC 5668 - 4-Octet AS Specific BGP Extended Community + draft-ietf-idr-segment-routing-te-policy"; + } + + typedef bgp-ext-community-recv-type { + type union { + type bgp-ext-community-type; + type binary { + length 8; + } + } + description + "A type definition utilised to define the extended community + in a context where the system is receiving the extended + community from an external source, such that the value may be + unknown. In the case that the received extended community is + unknown it is defined to be a 8-octet quantity formatted + according to RFC4360: + + Type Field: 1 or 2 octets. + Value Field: Remaining octets. + + The high-order octet of the type field is encoded such that + bit 0 indicates whether the extended community type is IANA + assigned; and bit 1 indicates whether the extended community + is transitive. The remaining bits of the high-order type + field must be interpreted to determine whether the low-order + type field should be parsed, or whether the entire remainder + of the extended community is a value."; + reference + "RFC 4360 - BGP Extended Communities Attribute + RFC 5668 - 4-Octet AS Specific BGP Extended Community"; + } + + typedef bgp-community-regexp-type { + // TODO: needs more work to decide what format these regexps can + // take. + type oc-types:std-regexp; + description + "Type definition for communities specified as regular + expression patterns"; + } + + typedef bgp-origin-attr-type { + type enumeration { + enum IGP { + description + "Origin of the NLRI is internal"; + } + enum EGP { + description + "Origin of the NLRI is EGP"; + } + enum INCOMPLETE { + description + "Origin of the NLRI is neither IGP or EGP"; + } + } + description + "Type definition for standard BGP origin attribute"; + reference "RFC 4271 - A Border Gateway Protocol 4 (BGP-4), + Sec 4.3"; + } + + typedef peer-type { + type enumeration { + enum INTERNAL { + description + "Internal (iBGP) peer"; + } + enum EXTERNAL { + description + "External (eBGP) peer"; + } + } + description + "Labels a peer or peer group as explicitly internal or + external"; + } + + identity REMOVE_PRIVATE_AS_OPTION { + description + "Base identity for options for removing private autonomous + system numbers from the AS_PATH attribute"; + } + + identity PRIVATE_AS_REMOVE_ALL { + base REMOVE_PRIVATE_AS_OPTION; + description + "Strip all private autonmous system numbers from the AS_PATH. + This action is performed regardless of the other content of the + AS_PATH attribute, and for all instances of private AS numbers + within that attribute."; + } + + identity PRIVATE_AS_REPLACE_ALL { + base REMOVE_PRIVATE_AS_OPTION; + description + "Replace all instances of private autonomous system numbers in + the AS_PATH with the local BGP speaker's autonomous system + number. This action is performed regardless of the other + content of the AS_PATH attribute, and for all instances of + private AS number within that attribute."; + } + + typedef remove-private-as-option { + type identityref { + base REMOVE_PRIVATE_AS_OPTION; + } + description + "Set of options for configuring how private AS path numbers + are removed from advertisements"; + } + + typedef rr-cluster-id-type { + type union { + type uint32; + type oc-inet:ipv4-address; + } + description + "Union type for route reflector cluster ids: + option 1: 4-byte number + option 2: IP address"; + } + + typedef community-type { + type enumeration { + enum STANDARD { + description "Send only standard communities"; + } + enum EXTENDED { + description "Send only extended communities"; + } + enum BOTH { + description "Send both standard and extended communities"; + } + enum NONE { + description "Do not send any community attribute"; + } + } + description + "type describing variations of community attributes: + STANDARD: standard BGP community [rfc1997] + EXTENDED: extended BGP community [rfc4360] + BOTH: both standard and extended community"; + } + + + typedef as-path-segment-type { + type enumeration { + enum AS_SEQ { + description + "Ordered set of autonomous systems that a route in + the UPDATE message has traversed"; + } + enum AS_SET { + description + "Unordered set of autonomous systems that a route in + the UPDATE message has traversed"; + } + enum AS_CONFED_SEQUENCE { + description + "Ordered set of Member Autonomous + Systems in the local confederation that the UPDATE message + has traversed"; + } + enum AS_CONFED_SET { + description + "Unordered set of Member Autonomous Systems + in the local confederation that the UPDATE message has + traversed"; + } + } + description + "Defines the types of BGP AS path segments."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-bgp@2019-07-10.yang b/exp/yangcli/h3c-yang/openconfig-bgp@2019-07-10.yang new file mode 100644 index 0000000..2692513 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-bgp@2019-07-10.yang @@ -0,0 +1,189 @@ +module openconfig-bgp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/bgp"; + + prefix "oc-bgp"; + + // import some basic inet types + import openconfig-extensions { prefix oc-ext; } + import openconfig-rib-bgp { prefix oc-bgprib; } + import openconfig-routing-policy {prefix oc-rpol; } + + // Include the OpenConfig BGP submodules + // Common: defines the groupings that are common across more than + // one context (where contexts are neighbor, group, global) + include openconfig-bgp-common; + // Multiprotocol: defines the groupings that are common across more + // than one context, and relate to Multiprotocol + include openconfig-bgp-common-multiprotocol; + // Structure: defines groupings that are shared but are solely used for + // structural reasons. + include openconfig-bgp-common-structure; + // Include peer-group/neighbor/global - these define the groupings + // that are specific to one context + include openconfig-bgp-peer-group; + include openconfig-bgp-neighbor; + include openconfig-bgp-global; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module describes a YANG model for BGP protocol + configuration.It is a limited subset of all of the configuration + parameters available in the variety of vendor implementations, + hence it is expected that it would be augmented with vendor- + specific configuration data as needed. Additional modules or + submodules to handle other aspects of BGP configuration, + including policy, VRFs, VPNs, and additional address families + are also expected. + + This model supports the following BGP configuration level + hierarchy: + + BGP + | + +-> [ global BGP configuration ] + +-> AFI / SAFI global + +-> peer group + +-> [ peer group config ] + +-> AFI / SAFI [ per-AFI overrides ] + +-> neighbor + +-> [ neighbor config ] + +-> [ optional pointer to peer-group ] + +-> AFI / SAFI [ per-AFI overrides ]"; + + oc-ext:openconfig-version "6.0.0"; + + revision "2019-07-10" { + description + "Normalise timestamp units to nanoseconds."; + reference "6.0.0"; + } + + revision "2019-05-28" { + description + "Clarify prefix counter descriptions, add received-pre-policy + counter."; + reference "5.2.0"; + } + + revision "2019-04-16" { + description + "Add BGP RIB to the top-level BGP container"; + reference "5.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "5.0.2"; + } + + revision "2018-08-20" { + description + "Correct description of AFI-SAFI enabled leaf."; + reference "5.0.1"; + } + + revision "2018-04-11" { + description + "Correct naming of BGP maximum prefix warning percentage leaf."; + reference "5.0.0"; + } + + revision "2018-03-20" { + description + "Added SR-TE policy SAFI"; + reference "4.1.0"; + } + + revision "2017-07-30" { + description + "Clarification of add-paths send-max leaf"; + reference "4.0.1"; + } + + revision "2017-07-10" { + description + "Add error notifications; moved add-paths config; add AS + prepend policy features; removed unneeded config leaves"; + reference "4.0.0"; + } + + revision "2017-02-02" { + description + "Bugfix to remove remaining global-level policy data"; + reference "3.0.1"; + } + + revision "2017-01-26" { + description + "Add dynamic neighbor support, migrate to OpenConfig types"; + reference "3.0.0"; + } + + revision "2016-06-21" { + description + "OpenConfig BGP refactor"; + reference "2.1.1"; + } + + revision "2016-06-06" { + description + "OpenConfig public release"; + reference "2.1.0"; + } + + revision "2016-03-31" { + description + "OpenConfig public release"; + reference "2.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping bgp-top { + description + "Top-level grouping for the BGP model data"; + + container bgp { + description + "Top-level configuration and state for the BGP router"; + + container global { + description + "Global configuration for the BGP router"; + uses bgp-global-base; + } + + container neighbors { + description + "Configuration for BGP neighbors"; + uses bgp-neighbor-list; + } + + container peer-groups { + description + "Configuration for BGP peer-groups"; + uses bgp-peer-group-list; + } + + uses oc-bgprib:bgp-rib-top; + } + } + + uses bgp-top; + +} diff --git a/exp/yangcli/h3c-yang/openconfig-extensions@2018-10-17.yang b/exp/yangcli/h3c-yang/openconfig-extensions@2018-10-17.yang new file mode 100644 index 0000000..5fe060f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-extensions@2018-10-17.yang @@ -0,0 +1,177 @@ +module openconfig-extensions { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/openconfig-ext"; + + prefix "oc-ext"; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module provides extensions to the YANG language to allow + OpenConfig specific functionality and meta-data to be defined."; + + revision "2018-10-17" { + description + "Add extension for regular expression type."; + reference "0.4.0"; + } + + revision "2017-04-11" { + description + "rename password type to 'hashed' and clarify description"; + reference "0.3.0"; + } + + revision "2017-01-29" { + description + "Added extension for annotating encrypted values."; + reference "0.2.0"; + } + + revision "2015-10-09" { + description + "Initial OpenConfig public release"; + reference "0.1.0"; + } + + + // extension statements + extension openconfig-version { + argument "semver" { + yin-element false; + } + description + "The OpenConfig version number for the module. This is + expressed as a semantic version number of the form: + x.y.z + where: + * x corresponds to the major version, + * y corresponds to a minor version, + * z corresponds to a patch version. + This version corresponds to the model file within which it is + defined, and does not cover the whole set of OpenConfig models. + + Individual YANG modules are versioned independently -- the + semantic version is generally incremented only when there is a + change in the corresponding file. Submodules should always + have the same semantic version as their parent modules. + + A major version number of 0 indicates that this model is still + in development (whether within OpenConfig or with industry + partners), and is potentially subject to change. + + Following a release of major version 1, all modules will + increment major revision number where backwards incompatible + changes to the model are made. + + The minor version is changed when features are added to the + model that do not impact current clients use of the model. + + The patch-level version is incremented when non-feature changes + (such as bugfixes or clarifications to human-readable + descriptions that do not impact model functionality) are made + that maintain backwards compatibility. + + The version number is stored in the module meta-data."; + } + + extension openconfig-hashed-value { + description + "This extension provides an annotation on schema nodes to + indicate that the corresponding value should be stored and + reported in hashed form. + + Hash algorithms are by definition not reversible. Clients + reading the configuration or applied configuration for the node + should expect to receive only the hashed value. Values written + in cleartext will be hashed. This annotation may be used on + nodes such as secure passwords in which the device never reports + a cleartext value, even if the input is provided as cleartext."; + } + + extension regexp-posix { + description + "This extension indicates that the regular expressions included + within the YANG module specified are conformant with the POSIX + regular expression format rather than the W3C standard that is + specified by RFC6020 and RFC7950."; + } + + extension telemetry-on-change { + description + "The telemetry-on-change annotation is specified in the context + of a particular subtree (container, or list) or leaf within the + YANG schema. Where specified, it indicates that the value stored + by the nodes within the context change their value only in response + to an event occurring. The event may be local to the target, for + example - a configuration change, or external - such as the failure + of a link. + + When a telemetry subscription allows the target to determine whether + to export the value of a leaf in a periodic or event-based fashion + (e.g., TARGET_DEFINED mode in gNMI), leaves marked as + telemetry-on-change should only be exported when they change, + i.e., event-based."; + } + + extension telemetry-atomic { + description + "The telemetry-atomic annotation is specified in the context of + a subtree (containre, or list), and indicates that all nodes + within the subtree are always updated together within the data + model. For example, all elements under the subtree may be updated + as a result of a new alarm being raised, or the arrival of a new + protocol message. + + Transport protocols may use the atomic specification to determine + optimisations for sending or storing the corresponding data."; + } + + extension operational { + description + "The operational annotation is specified in the context of a + grouping, leaf, or leaf-list within a YANG module. It indicates + that the nodes within the context are derived state on the device. + + OpenConfig data models divide nodes into the following three categories: + + - intended configuration - these are leaves within a container named + 'config', and are the writable configuration of a target. + - applied configuration - these are leaves within a container named + 'state' and are the currently running value of the intended configuration. + - derived state - these are the values within the 'state' container which + are not part of the applied configuration of the device. Typically, they + represent state values reflecting underlying operational counters, or + protocol statuses."; + } + + extension catalog-organization { + argument "org" { + yin-element false; + } + description + "This extension specifies the organization name that should be used within + the module catalogue on the device for the specified YANG module. It stores + a pithy string where the YANG organization statement may contain more + details."; + } + + extension origin { + argument "origin" { + yin-element false; + } + description + "This extension specifies the name of the origin that the YANG module + falls within. This allows multiple overlapping schema trees to be used + on a single network element without requiring module based prefixing + of paths."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-if-aggregate@2016-12-22.yang b/exp/yangcli/h3c-yang/openconfig-if-aggregate@2016-12-22.yang new file mode 100644 index 0000000..0fd5b3f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-if-aggregate@2016-12-22.yang @@ -0,0 +1,192 @@ +module openconfig-if-aggregate { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/interfaces/aggregate"; + + prefix "oc-lag"; + + // import some basic types + import openconfig-interfaces { prefix oc-if; } + import openconfig-if-ethernet { prefix oc-eth; } + import iana-if-type { prefix ift; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Model for managing aggregated (aka bundle, LAG) interfaces."; + + oc-ext:openconfig-version "1.1.0"; + + revision "2016-12-22" { + description + "Fixes to Ethernet interfaces model"; + reference "1.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + + + typedef aggregation-type { + type enumeration { + enum LACP { + description "LAG managed by LACP"; + } + enum STATIC { + description "Statically configured bundle / LAG"; + } + } + description + "Type to define the lag-type, i.e., how the LAG is + defined and managed"; + } + + // grouping statements + + + grouping aggregation-logical-config { + description + "Configuration data for aggregate interfaces"; + + + leaf lag-type { + type aggregation-type; + description + "Sets the type of LAG, i.e., how it is + configured / maintained"; + } + + leaf min-links { + type uint16; + description + "Specifies the mininum number of member + interfaces that must be active for the aggregate interface + to be available"; + } + } + + grouping aggregation-logical-state { + description + "Operational state data for aggregate interfaces"; + + leaf lag-speed { + type uint32; + units Mbps; + description + "Reports effective speed of the aggregate interface, + based on speed of active member interfaces"; + } + + leaf-list member { + when "oc-lag:lag-type = 'STATIC'" { + description + "The simple list of member interfaces is active + when the aggregate is statically configured"; + } + type oc-if:base-interface-ref; + description + "List of current member interfaces for the aggregate, + expressed as references to existing interfaces"; + } + } + + grouping aggregation-logical-top { + description "Top-level data definitions for LAGs"; + + container aggregation { + + description + "Options for logical interfaces representing + aggregates"; + + container config { + description + "Configuration variables for logical aggregate / + LAG interfaces"; + + uses aggregation-logical-config; + } + + container state { + + config false; + description + "Operational state variables for logical + aggregate / LAG interfaces"; + + uses aggregation-logical-config; + uses aggregation-logical-state; + + } + } + } + + grouping ethernet-if-aggregation-config { + description + "Adds configuration items for Ethernet interfaces + belonging to a logical aggregate / LAG"; + + leaf aggregate-id { + type leafref { + path "/oc-if:interfaces/oc-if:interface/oc-if:name"; + } + description + "Specify the logical aggregate interface to which + this interface belongs"; + } + } + + // data definition statements + + // augment statements + + augment "/oc-if:interfaces/oc-if:interface" { + when "oc-if:type = 'ift:ieee8023adLag'" { + description "active when the interface is set to type LAG"; + } + description "Adds LAG configuration to the interface module"; + + uses aggregation-logical-top; + } + + augment "/oc-if:interfaces/oc-if:interface/oc-eth:ethernet/" + + "oc-eth:config" { + when "oc-if:type = 'ift:ethernetCsmacd'" { + description "active when the interface is Ethernet"; + } + description "Adds LAG settings to individual Ethernet + interfaces"; + + uses ethernet-if-aggregation-config; + } + + augment "/oc-if:interfaces/oc-if:interface/oc-eth:ethernet/" + + "oc-eth:state" { + when "oc-if:type = 'ift:ethernetCsmacd'" { + description "active when the interface is Ethernet"; + } + description "Adds LAG settings to individual Ethernet + interfaces"; + + uses ethernet-if-aggregation-config; + } + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-if-ethernet@2016-12-22.yang b/exp/yangcli/h3c-yang/openconfig-if-ethernet@2016-12-22.yang new file mode 100644 index 0000000..9d26e9d --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-if-ethernet@2016-12-22.yang @@ -0,0 +1,345 @@ +module openconfig-if-ethernet { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/interfaces/ethernet"; + + prefix "oc-eth"; + + // import some basic types + import openconfig-interfaces { prefix oc-if; } + import iana-if-type { prefix ift; } + import ietf-yang-types { prefix yang; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Model for managing Ethernet interfaces -- augments the IETF YANG + model for interfaces described by RFC 7223"; + + oc-ext:openconfig-version "1.1.0"; + + revision "2016-12-22" { + description + "Fixes to Ethernet interfaces model"; + reference "1.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + identity ETHERNET_SPEED { + description "base type to specify available Ethernet link + speeds"; + } + + identity SPEED_10MB { + base ETHERNET_SPEED; + description "10 Mbps Ethernet"; + } + + identity SPEED_100MB { + base ETHERNET_SPEED; + description "100 Mbps Ethernet"; + } + + identity SPEED_1GB { + base ETHERNET_SPEED; + description "1 GBps Ethernet"; + } + + identity SPEED_10GB { + base ETHERNET_SPEED; + description "10 GBps Ethernet"; + } + + identity SPEED_25GB { + base ETHERNET_SPEED; + description "25 GBps Ethernet"; + } + + identity SPEED_40GB { + base ETHERNET_SPEED; + description "40 GBps Ethernet"; + } + + identity SPEED_50GB { + base ETHERNET_SPEED; + description "50 GBps Ethernet"; + } + + identity SPEED_100GB { + base ETHERNET_SPEED; + description "100 GBps Ethernet"; + } + + identity SPEED_UNKNOWN { + base ETHERNET_SPEED; + description + "Interface speed is unknown. Systems may report + speed UNKNOWN when an interface is down or unpopuplated (e.g., + pluggable not present)."; + } + + // typedef statements + + + // grouping statements + + grouping ethernet-interface-config { + description "Configuration items for Ethernet interfaces"; + + leaf mac-address { + type yang:mac-address; + description + "Assigns a MAC address to the Ethernet interface. If not + specified, the corresponding operational state leaf is + expected to show the system-assigned MAC address."; + } + + leaf auto-negotiate { + type boolean; + default true; + description + "Set to TRUE to request the interface to auto-negotiate + transmission parameters with its peer interface. When + set to FALSE, the transmission parameters are specified + manually."; + reference + "IEEE 802.3-2012 auto-negotiation transmission parameters"; + } + + leaf duplex-mode { + type enumeration { + enum FULL { + description "Full duplex mode"; + } + enum HALF { + description "Half duplex mode"; + } + } + description + "When auto-negotiate is TRUE, this optionally sets the + duplex mode that will be advertised to the peer. If + unspecified, the interface should negotiate the duplex mode + directly (typically full-duplex). When auto-negotiate is + FALSE, this sets the duplex mode on the interface directly."; + } + + leaf port-speed { + type identityref { + base ETHERNET_SPEED; + } + description + "When auto-negotiate is TRUE, this optionally sets the + port-speed mode that will be advertised to the peer for + negotiation. If unspecified, it is expected that the + interface will select the highest speed available based on + negotiation. When auto-negotiate is set to FALSE, sets the + link speed to a fixed value -- supported values are defined + by ETHERNET_SPEED identities"; + } + + leaf enable-flow-control { + type boolean; + default false; + description + "Enable or disable flow control for this interface. + Ethernet flow control is a mechanism by which a receiver + may send PAUSE frames to a sender to stop transmission for + a specified time. + + This setting should override auto-negotiated flow control + settings. If left unspecified, and auto-negotiate is TRUE, + flow control mode is negotiated with the peer interface."; + reference + "IEEE 802.3x"; + } + } + + grouping ethernet-interface-state-counters { + description + "Ethernet-specific counters and statistics"; + + // ingress counters + + leaf in-mac-control-frames { + type yang:counter64; + description + "MAC layer control frames received on the interface"; + } + + leaf in-mac-pause-frames { + type yang:counter64; + description + "MAC layer PAUSE frames received on the interface"; + } + + leaf in-oversize-frames { + type yang:counter64; + description + "Number of oversize frames received on the interface"; + } + + leaf in-jabber-frames { + type yang:counter64; + description + "Number of jabber frames received on the + interface. Jabber frames are typically defined as oversize + frames which also have a bad CRC. Implementations may use + slightly different definitions of what constitutes a jabber + frame. Often indicative of a NIC hardware problem."; + } + + leaf in-fragment-frames { + type yang:counter64; + description + "Number of fragment frames received on the interface."; + } + + leaf in-8021q-frames { + type yang:counter64; + description + "Number of 802.1q tagged frames received on the interface"; + } + + leaf in-crc-errors { + type yang:counter64; + description + "Number of receive error events due to FCS/CRC check + failure"; + } + + // egress counters + + leaf out-mac-control-frames { + type yang:counter64; + description + "MAC layer control frames sent on the interface"; + } + + leaf out-mac-pause-frames { + type yang:counter64; + description + "MAC layer PAUSE frames sent on the interface"; + } + + leaf out-8021q-frames { + type yang:counter64; + description + "Number of 802.1q tagged frames sent on the interface"; + } + } + + grouping ethernet-interface-state { + description + "Grouping for defining Ethernet-specific operational state"; + + leaf hw-mac-address { + type yang:mac-address; + description + "Represenets the 'burned-in', or system-assigned, MAC + address for the Ethernet interface."; + } + + leaf effective-speed { + type uint32; + units Mbps; + description + "Reports the effective speed of the interface, e.g., the + negotiated speed if auto-negotiate is enabled"; + } + + leaf negotiated-duplex-mode { + type enumeration { + enum FULL { + description "Full duplex mode"; + } + enum HALF { + description "Half duplex mode"; + } + } + description + "When auto-negotiate is set to TRUE, and the interface has + completed auto-negotiation with the remote peer, this value + shows the duplex mode that has been negotiated."; + } + + leaf negotiated-port-speed { + type identityref { + base ETHERNET_SPEED; + } + description + "When auto-negotiate is set to TRUE, and the interface has + completed auto-negotiation with the remote peer, this value + shows the interface speed that has been negotiated."; + } + + container counters { + description "Ethernet interface counters"; + + uses ethernet-interface-state-counters; + + } + + } + + // data definition statements + + grouping ethernet-top { + description "top-level Ethernet config and state containers"; + + container ethernet { + description + "Top-level container for ethernet configuration + and state"; + + container config { + description "Configuration data for ethernet interfaces"; + + uses ethernet-interface-config; + + } + + container state { + + config false; + description "State variables for Ethernet interfaces"; + + uses ethernet-interface-config; + uses ethernet-interface-state; + + } + + } + } + + // augment statements + + augment "/oc-if:interfaces/oc-if:interface" { + description "Adds addtional Ethernet-specific configuration to + interfaces model"; + + uses ethernet-top { + when "oc-if:state/oc-if:type = 'ift:ethernetCsmacd'" { + description "Additional interface configuration parameters when + the interface type is Ethernet"; + } + } + } + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-if-ip@2017-07-14.yang b/exp/yangcli/h3c-yang/openconfig-if-ip@2017-07-14.yang new file mode 100644 index 0000000..81be455 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-if-ip@2017-07-14.yang @@ -0,0 +1,1191 @@ +module openconfig-if-ip { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/interfaces/ip"; + + prefix "oc-ip"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-vlan { prefix oc-vlan; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This model defines data for managing configuration and + operational state on IP (IPv4 and IPv6) interfaces. + + This model reuses data items defined in the IETF YANG model for + interfaces described by RFC 7277 with an alternate structure + (particularly for operational state data) and with + additional configuration items. + + Portions of this code were derived from IETF RFC 7277. + Please reproduce this note if possible. + + IETF code is subject to the following copyright and license: + Copyright (c) IETF Trust and the persons identified as authors of + the code. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in + Section 4.c of the IETF Trust's Legal Provisions Relating + to IETF Documents (http://trustee.ietf.org/license-info)."; + + oc-ext:openconfig-version "2.0.0"; + + revision "2017-07-14" { + description + "Added Ethernet/IP state data; Add dhcp-client; + migrate to OpenConfig types modules; Removed or + renamed opstate values"; + reference "2.0.0"; + } + + revision "2017-04-03"{ + description + "Update copyright notice."; + reference "1.1.1"; + } + + revision "2016-12-22" { + description + "Fixes to Ethernet interfaces model"; + reference "1.1.0"; + } + + + // typedef statements + + typedef ip-address-origin { + type enumeration { + enum OTHER { + description + "None of the following."; + } + enum STATIC { + description + "Indicates that the address has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum DHCP { + description + "Indicates an address that has been assigned to this + system by a DHCP server."; + } + enum LINK_LAYER { + description + "Indicates an address created by IPv6 stateless + autoconfiguration that embeds a link-layer address in its + interface identifier."; + } + enum RANDOM { + description + "Indicates an address chosen by the system at + random, e.g., an IPv4 address within 169.254/16, an + RFC 4941 temporary address, or an RFC 7217 semantically + opaque address."; + reference + "RFC 4941: Privacy Extensions for Stateless Address + Autoconfiguration in IPv6 + RFC 7217: A Method for Generating Semantically Opaque + Interface Identifiers with IPv6 Stateless + Address Autoconfiguration (SLAAC)"; + } + } + description + "The origin of an address."; + } + + typedef neighbor-origin { + type enumeration { + enum OTHER { + description + "None of the following."; + } + enum STATIC { + description + "Indicates that the mapping has been statically + configured - for example, using NETCONF or a Command Line + Interface."; + } + enum DYNAMIC { + description + "Indicates that the mapping has been dynamically resolved + using, e.g., IPv4 ARP or the IPv6 Neighbor Discovery + protocol."; + } + } + description + "The origin of a neighbor entry."; + } + + // grouping statements + + grouping ip-common-global-config { + description + "Shared configuration data for IPv4 or IPv6 assigned + globally on an interface."; + + leaf dhcp-client { + type boolean; + default false; + description + "Enables a DHCP client on the interface in order to request + an address"; + } + } + + grouping ip-common-counters-state { + description + "Operational state for IP traffic statistics for IPv4 and + IPv6"; + + container counters { + description + "Packet and byte counters for IP transmission and + reception for the address family."; + + + leaf in-pkts { + type oc-yang:counter64; + description + "The total number of IP packets received for the specified + address family, including those received in error"; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf in-octets { + type oc-yang:counter64; + description + "The total number of octets received in input IP packets + for the specified address family, including those received + in error."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf in-error-pkts { + // TODO: this counter combines several error conditions -- + // could consider breaking them out to separate leaf nodes + type oc-yang:counter64; + description + "Number of IP packets discarded due to errors for the + specified address family, including errors in the IP + header, no route found to the IP destination, invalid + address, unknown protocol, etc."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf in-forwarded-pkts { + type oc-yang:counter64; + description + "The number of input packets for which the device was not + their final IP destination and for which the device + attempted to find a route to forward them to that final + destination."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf in-forwarded-octets { + type oc-yang:counter64; + description + "The number of octets received in input IP packets + for the specified address family for which the device was + not their final IP destination and for which the + device attempted to find a route to forward them to that + final destination."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf in-discarded-pkts { + type oc-yang:counter64; + description + "The number of input IP packets for the + specified address family, for which no problems were + encountered to prevent their continued processing, but + were discarded (e.g., for lack of buffer space)."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-pkts { + type oc-yang:counter64; + description + "The total number of IP packets for the + specified address family that the device supplied + to the lower layers for transmission. This includes + packets generated locally and those forwarded by the + device."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-octets { + type oc-yang:counter64; + description + "The total number of octets in IP packets for the + specified address family that the device + supplied to the lower layers for transmission. This + includes packets generated locally and those forwarded by + the device."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-error-pkts { + // TODO: this counter combines several error conditions -- + // could consider breaking them out to separate leaf nodes + type oc-yang:counter64; + description + "Number of IP packets for the specified address family + locally generated and discarded due to errors, including + no route found to the IP destination."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-forwarded-pkts { + type oc-yang:counter64; + description + "The number of packets for which this entity was not their + final IP destination and for which it was successful in + finding a path to their final destination."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-forwarded-octets { + type oc-yang:counter64; + description + "The number of octets in packets for which this entity was + not their final IP destination and for which it was + successful in finding a path to their final destination."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + + leaf out-discarded-pkts { + type oc-yang:counter64; + description + "The number of output IP packets for the + specified address family for which no problem was + encountered to prevent their transmission to their + destination, but were discarded (e.g., for lack of + buffer space)."; + reference + "RFC 4293 - Management Information Base for the + Internet Protocol (IP)"; + } + } + + } + + + + grouping ipv4-global-config { + description + "Configuration data for IPv4 interfaces across + all addresses assigned to the interface"; + + leaf enabled { + type boolean; + default true; + description + "Controls whether IPv4 is enabled or disabled on this + interface. When IPv4 is enabled, this interface is + connected to an IPv4 stack, and the interface can send + and receive IPv4 packets."; + } + + leaf mtu { + type uint16 { + range "68..max"; + } + units octets; + description + "The size, in octets, of the largest IPv4 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 791: Internet Protocol"; + } + + uses ip-common-global-config; + + + } + + grouping ipv4-address-config { + + description + "Per IPv4 adresss configuration data for the + interface."; + + leaf ip { + type oc-inet:ipv4-address; + description + "The IPv4 address on the interface."; + } + + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the subnet prefix."; + } + } + + grouping ipv4-neighbor-config { + description + "Per IPv4 neighbor configuration data. Neighbor + entries are analagous to static ARP entries, i.e., they + create a correspondence between IP and link-layer addresses"; + + leaf ip { + type oc-inet:ipv4-address; + description + "The IPv4 address of the neighbor node."; + } + leaf link-layer-address { + type oc-yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } + + grouping ipv4-address-state { + description + "State variables for IPv4 addresses on the interface"; + + leaf origin { + type ip-address-origin; + description + "The origin of this address, e.g., statically configured, + assigned by DHCP, etc.."; + } + } + + grouping ipv4-neighbor-state { + description + "State variables for IPv4 neighbor entries on the interface."; + + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry, static or dynamic."; + } + } + + grouping ipv6-global-config { + description + "Configuration data at the global level for each + IPv6 interface"; + + leaf enabled { + type boolean; + default true; + description + "Controls whether IPv6 is enabled or disabled on this + interface. When IPv6 is enabled, this interface is + connected to an IPv6 stack, and the interface can send + and receive IPv6 packets."; + } + + leaf mtu { + type uint32 { + range "1280..max"; + } + units octets; + description + "The size, in octets, of the largest IPv6 packet that the + interface will send and receive. + + The server may restrict the allowed values for this leaf, + depending on the interface's type. + + If this leaf is not configured, the operationally used MTU + depends on the interface's type."; + reference + "RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + Section 5"; + } + + leaf dup-addr-detect-transmits { + type uint32; + default 1; + description + "The number of consecutive Neighbor Solicitation messages + sent while performing Duplicate Address Detection on a + tentative address. A value of zero indicates that + Duplicate Address Detection is not performed on + tentative addresses. A value of one indicates a single + transmission with no follow-up retransmissions."; + reference + "RFC 4862: IPv6 Stateless Address Autoconfiguration"; + } + + uses ip-common-global-config; + } + + grouping ipv6-address-config { + description "Per-address configuration data for IPv6 interfaces"; + + leaf ip { + type oc-inet:ipv6-address; + description + "The IPv6 address on the interface."; + } + + leaf prefix-length { + type uint8 { + range "0..128"; + } + mandatory true; + description + "The length of the subnet prefix."; + } + } + + grouping ipv6-address-state { + description + "Per-address operational state data for IPv6 interfaces"; + + leaf origin { + type ip-address-origin; + description + "The origin of this address, e.g., static, dhcp, etc."; + } + + leaf status { + type enumeration { + enum PREFERRED { + description + "This is a valid address that can appear as the + destination or source address of a packet."; + } + enum DEPRECATED { + description + "This is a valid but deprecated address that should + no longer be used as a source address in new + communications, but packets addressed to such an + address are processed as expected."; + } + enum INVALID { + description + "This isn't a valid address, and it shouldn't appear + as the destination or source address of a packet."; + } + enum INACCESSIBLE { + description + "The address is not accessible because the interface + to which this address is assigned is not + operational."; + } + enum UNKNOWN { + description + "The status cannot be determined for some reason."; + } + enum TENTATIVE { + description + "The uniqueness of the address on the link is being + verified. Addresses in this state should not be + used for general communication and should only be + used to determine the uniqueness of the address."; + } + enum DUPLICATE { + description + "The address has been determined to be non-unique on + the link and so must not be used."; + } + enum OPTIMISTIC { + description + "The address is available for use, subject to + restrictions, while its uniqueness on a link is + being verified."; + } + } + description + "The status of an address. Most of the states correspond + to states from the IPv6 Stateless Address + Autoconfiguration protocol."; + reference + "RFC 4293: Management Information Base for the + Internet Protocol (IP) + - IpAddressStatusTC + RFC 4862: IPv6 Stateless Address Autoconfiguration"; + } + } + + grouping ipv6-neighbor-config { + description + "Per-neighbor configuration data for IPv6 interfaces"; + + leaf ip { + type oc-inet:ipv6-address; + description + "The IPv6 address of the neighbor node."; + } + + leaf link-layer-address { + type oc-yang:phys-address; + mandatory true; + description + "The link-layer address of the neighbor node."; + } + } + + grouping ipv6-neighbor-state { + description "Per-neighbor state variables for IPv6 interfaces"; + + leaf origin { + type neighbor-origin; + description + "The origin of this neighbor entry."; + } + leaf is-router { + type empty; + description + "Indicates that the neighbor node acts as a router."; + } + leaf neighbor-state { + type enumeration { + enum INCOMPLETE { + description + "Address resolution is in progress, and the link-layer + address of the neighbor has not yet been + determined."; + } + enum REACHABLE { + description + "Roughly speaking, the neighbor is known to have been + reachable recently (within tens of seconds ago)."; + } + enum STALE { + description + "The neighbor is no longer known to be reachable, but + until traffic is sent to the neighbor no attempt + should be made to verify its reachability."; + } + enum DELAY { + description + "The neighbor is no longer known to be reachable, and + traffic has recently been sent to the neighbor. + Rather than probe the neighbor immediately, however, + delay sending probes for a short while in order to + give upper-layer protocols a chance to provide + reachability confirmation."; + } + enum PROBE { + description + "The neighbor is no longer known to be reachable, and + unicast Neighbor Solicitation probes are being sent + to verify reachability."; + } + } + description + "The Neighbor Unreachability Detection state of this + entry."; + reference + "RFC 4861: Neighbor Discovery for IP version 6 (IPv6) + Section 7.3.2"; + } + } + + grouping ip-vrrp-ipv6-config { + description + "IPv6-specific configuration data for VRRP on IPv6 + interfaces"; + + leaf virtual-link-local { + type oc-inet:ip-address; + description + "For VRRP on IPv6 interfaces, sets the virtual link local + address"; + } + } + + grouping ip-vrrp-ipv6-state { + description + "IPv6-specific operational state for VRRP on IPv6 interfaces"; + + uses ip-vrrp-ipv6-config; + } + + grouping ip-vrrp-tracking-config { + description + "Configuration data for tracking interfaces + in a VRRP group"; + + leaf-list track-interface { + type leafref { + path "/oc-if:interfaces/oc-if:interface/oc-if:name"; + } + // TODO: we may need to add some restriction to ethernet + // or IP interfaces. + description + "Sets a list of one or more interfaces that should + be tracked for up/down events to dynamically change the + priority state of the VRRP group, and potentially + change the mastership if the tracked interface going + down lowers the priority sufficiently. Any of the tracked + interfaces going down will cause the priority to be lowered. + Some implementations may only support a single + tracked interface."; + } + + leaf priority-decrement { + type uint8 { + range 0..254; + } + default 0; + description "Set the value to subtract from priority when + the tracked interface goes down"; + } + } + + grouping ip-vrrp-tracking-state { + description + "Operational state data for tracking interfaces in a VRRP + group"; + } + + grouping ip-vrrp-tracking-top { + description + "Top-level grouping for VRRP interface tracking"; + + container interface-tracking { + description + "Top-level container for VRRP interface tracking"; + + container config { + description + "Configuration data for VRRP interface tracking"; + + uses ip-vrrp-tracking-config; + } + + container state { + + config false; + + description + "Operational state data for VRRP interface tracking"; + + uses ip-vrrp-tracking-config; + uses ip-vrrp-tracking-state; + } + } + } + + grouping ip-vrrp-config { + description + "Configuration data for VRRP on IP interfaces"; + + leaf virtual-router-id { + type uint8 { + range 1..255; + } + description + "Set the virtual router id for use by the VRRP group. This + usually also determines the virtual MAC address that is + generated for the VRRP group"; + } + + leaf-list virtual-address { + type oc-inet:ip-address; + description + "Configure one or more virtual addresses for the + VRRP group"; + } + + leaf priority { + type uint8 { + range 1..254; + } + default 100; + description + "Specifies the sending VRRP interface's priority + for the virtual router. Higher values equal higher + priority"; + } + + leaf preempt { + type boolean; + default true; + description + "When set to true, enables preemption by a higher + priority backup router of a lower priority master router"; + } + + leaf preempt-delay { + type uint16 { + range 0..3600; + } + default 0; + description + "Set the delay the higher priority router waits + before preempting"; + } + + leaf accept-mode { + type boolean; + // TODO: should we adopt the RFC default given the common + // operational practice of setting to true? + default false; + description + "Configure whether packets destined for + virtual addresses are accepted even when the virtual + address is not owned by the router interface"; + } + + leaf advertisement-interval { + type uint16 { + range 1..4095; + } + // TODO this range is theoretical -- needs to be validated + // against major implementations. + units "centiseconds"; + default 100; + description + "Sets the interval between successive VRRP + advertisements -- RFC 5798 defines this as a 12-bit + value expressed as 0.1 seconds, with default 100, i.e., + 1 second. Several implementation express this in units of + seconds"; + } + } + + grouping ip-vrrp-state { + description + "Operational state data for VRRP on IP interfaces"; + + leaf current-priority { + type uint8; + description "Operational value of the priority for the + interface in the VRRP group"; + } + } + + grouping ip-vrrp-top { + description + "Top-level grouping for Virtual Router Redundancy Protocol"; + + container vrrp { + description + "Enclosing container for VRRP groups handled by this + IP interface"; + + reference "RFC 5798 - Virtual Router Redundancy Protocol + (VRRP) Version 3 for IPv4 and IPv6"; + + list vrrp-group { + key "virtual-router-id"; + description + "List of VRRP groups, keyed by virtual router id"; + + leaf virtual-router-id { + type leafref { + path "../config/virtual-router-id"; + } + description + "References the configured virtual router id for this + VRRP group"; + } + + container config { + description + "Configuration data for the VRRP group"; + + uses ip-vrrp-config; + } + + container state { + + config false; + + description + "Operational state data for the VRRP group"; + + uses ip-vrrp-config; + uses ip-vrrp-state; + } + + uses ip-vrrp-tracking-top; + } + } + } + + grouping ipv4-top { + description "Top-level configuration and state for IPv4 + interfaces"; + + container ipv4 { + description + "Parameters for the IPv4 address family."; + + container addresses { + description + "Enclosing container for address list"; + + list address { + key "ip"; + description + "The list of configured IPv4 addresses on the interface."; + + leaf ip { + type leafref { + path "../oc-ip:config/oc-ip:ip"; + } + description "References the configured IP address"; + } + + container config { + description "Configuration data for each configured IPv4 + address on the interface"; + + uses ipv4-address-config; + + } + + container state { + + config false; + description "Operational state data for each IPv4 address + configured on the interface"; + + uses ipv4-address-config; + uses ipv4-address-state; + } + + } + } + + container neighbors { + description + "Enclosing container for neighbor list"; + + list neighbor { + key "ip"; + description + "A list of mappings from IPv4 addresses to + link-layer addresses. + + Entries in this list are used as static entries in the + ARP Cache."; + reference + "RFC 826: An Ethernet Address Resolution Protocol"; + + leaf ip { + type leafref { + path "../oc-ip:config/oc-ip:ip"; + } + description "References the configured IP address"; + } + + container config { + description "Configuration data for each configured IPv4 + address on the interface"; + + uses ipv4-neighbor-config; + + } + + container state { + + config false; + description "Operational state data for each IPv4 address + configured on the interface"; + + uses ipv4-neighbor-config; + uses ipv4-neighbor-state; + } + } + } + + uses oc-if:sub-unnumbered-top; + + container config { + description + "Top-level IPv4 configuration data for the interface"; + + uses ipv4-global-config; + } + + container state { + + config false; + description + "Top level IPv4 operational state data"; + + uses ipv4-global-config; + uses ip-common-counters-state; + } + } + } + + grouping ipv6-top { + description + "Top-level configuration and state for IPv6 interfaces"; + + container ipv6 { + description + "Parameters for the IPv6 address family."; + + container addresses { + description + "Enclosing container for address list"; + + list address { + key "ip"; + description + "The list of configured IPv6 addresses on the interface."; + + leaf ip { + type leafref { + path "../oc-ip:config/oc-ip:ip"; + } + description "References the configured IP address"; + } + + container config { + description + "Configuration data for each IPv6 address on + the interface"; + + uses ipv6-address-config; + + } + + container state { + + config false; + description + "State data for each IPv6 address on the + interface"; + + uses ipv6-address-config; + uses ipv6-address-state; + } + } + } + + container neighbors { + description + "Enclosing container for list of IPv6 neighbors"; + + list neighbor { + key "ip"; + description + "List of IPv6 neighbors"; + + leaf ip { + type leafref { + path "../oc-ip:config/oc-ip:ip"; + } + description + "References the configured IP neighbor address"; + } + + container config { + description "Configuration data for each IPv6 address on + the interface"; + + uses ipv6-neighbor-config; + + } + + container state { + + config false; + description "State data for each IPv6 address on the + interface"; + + uses ipv6-neighbor-config; + uses ipv6-neighbor-state; + } + } + } + uses oc-if:sub-unnumbered-top; + + container config { + description "Top-level config data for the IPv6 interface"; + + uses ipv6-global-config; + } + + container state { + config false; + description + "Top-level operational state data for the IPv6 interface"; + + uses ipv6-global-config; + uses ip-common-counters-state; + + } + } + } + + // augment statements + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface" { + description + "IPv4 addr family configuration for + interfaces"; + + uses ipv4-top; + + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface" { + description + "IPv6 addr family configuration for + interfaces"; + + uses ipv6-top; + + } + + // VRRP for IPv4 interfaces + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface/oc-ip:ipv4/oc-ip:addresses/oc-ip:address" { + + description + "Additional IP addr family configuration for + interfaces"; + + uses ip-vrrp-top; + + } + + // VRRP for IPv6 interfaces + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address" { + description + "Additional IP addr family configuration for + interfaces"; + + uses ip-vrrp-top; + + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/" + + "vrrp/vrrp-group/config" { + description + "Additional VRRP data for IPv6 interfaces"; + + uses ip-vrrp-ipv6-config; + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/" + + "oc-if:subinterface/oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/" + + "vrrp-group/state" { + description + "Additional VRRP data for IPv6 interfaces"; + + uses ip-vrrp-ipv6-state; + } + + // Augments for for routed VLANs + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" { + description + "IPv4 addr family configuration for + interfaces"; + + uses ipv4-top; + + } + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan" { + description + "IPv6 addr family configuration for + interfaces"; + + uses ipv6-top; + + } + + // VRRP for routed VLAN interfaces + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" + + "oc-ip:ipv4/oc-ip:addresses/oc-ip:address" { + description + "Additional IP addr family configuration for + interfaces"; + + uses ip-vrrp-top; + + } + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" + + "oc-ip:ipv6/oc-ip:addresses/oc-ip:address" { + description + "Additional IP addr family configuration for + interfaces"; + + uses ip-vrrp-top; + + } + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" + + "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/config" { + description + "Additional VRRP data for IPv6 interfaces"; + + uses ip-vrrp-ipv6-config; + } + + + augment "/oc-if:interfaces/oc-if:interface/oc-vlan:routed-vlan/" + + "oc-ip:ipv6/oc-ip:addresses/oc-ip:address/vrrp/vrrp-group/state" { + description + "Additional VRRP data for IPv6 interfaces"; + + uses ip-vrrp-ipv6-state; + } + + // rpc statements + + // notification statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-igmp-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-igmp-types@2018-11-21.yang new file mode 100644 index 0000000..6e54f66 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-igmp-types@2018-11-21.yang @@ -0,0 +1,64 @@ +module openconfig-igmp-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/igmp/types"; + + prefix "oc-igmp-types"; + + // import some basic types + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines types related to the IGMP protocol model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-02-19" { + description + "Initial revision."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedef statements + + typedef igmp-version { + type uint8 { + range 1..3; + } + description + "IGMP Version."; + reference "v1 = RFC1112, v2 = RFC2236, v3 = RFC3376"; + } + + typedef igmp-interval-type { + type uint16 { + range 1..1024; + } + units "seconds"; + description + "Interval at which the router sends the IGMP query message toward + the upstream neighbor."; + reference "RFC3376 8.2 Page 40"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-igmp@2019-07-09.yang b/exp/yangcli/h3c-yang/openconfig-igmp@2019-07-09.yang new file mode 100644 index 0000000..f70580d --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-igmp@2019-07-09.yang @@ -0,0 +1,373 @@ +module openconfig-igmp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/igmp"; + + prefix "oc-igmp"; + + // import some basic types/interfaces + import openconfig-igmp-types { prefix oc-igmp-types; } + import openconfig-types { prefix "oc-types"; } + import openconfig-acl { prefix "oc-acl"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-interfaces { prefix oc-if; } + import ietf-inet-types { prefix "inet"; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "An OpenConfig model for Internet Group Management Protocol (IGMP)."; + + oc-ext:openconfig-version "0.2.0"; + + revision "2019-07-09" { + description + "Re-indent module to two spaces. + Normalise timeticks64 usage to nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-02-19" { + description + "Initial revision."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping admin-config { + description + "Re-usable grouping to enable or disable a particular feature."; + + leaf enabled { + type boolean; + default false; + description + "When set to true, the functionality within which this + leaf is defined is enabled, when set to false it is + explicitly disabled."; + } + } + + grouping igmp-interface-config { + description + "Configuration data for IGMP on each interface."; + + leaf interface-id { + type oc-if:interface-id; + description + "Reference to an interface on which IGMP is enabled."; + } + + uses admin-config; + + leaf version { + type oc-igmp-types:igmp-version; + description + "IGMP Version."; + } + + leaf query-interval { + type oc-igmp-types:igmp-interval-type; + description + "Interval at which the router sends the IGMP membership + queries."; + } + + leaf filter-prefixes { + type string; + // TODO work out what this should be. + // On Juniper it's a "policy" and on Cisco a sort of "class map" + description + "List used to filter joins."; + } + } + + grouping igmp-counters-per-version { + description + "Counters for each IGMP protocol version."; + + container state { + config false; + description + "Counters for each IGMP protocol version."; + + leaf v1 { + type uint32; + description + "IGMP v1."; + } + leaf v2 { + type uint32; + description + "IGMP v2."; + } + leaf v3 { + type uint32; + description + "IGMP v3."; + } + } + } + + grouping igmp-interface-counters { + description + "State and session data for IGMP on each interface."; + + + container counters { + description + "Counters avaiable on a per interface bases for IGMP."; + + container queries { + description + "IGMP membership queries."; + + container sent { + description + "Number of IGMP membership queries sent."; + uses igmp-counters-per-version; + } + + container received { + description + "Number of IGMP membership queries received."; + uses igmp-counters-per-version; + } + } + + container reports { + description + "Number of IGMP membership reports received."; + uses igmp-counters-per-version; + } + } + } + + grouping igmp-snooping-state { + description + "IGMP membership snooping state."; + + leaf group { + type inet:ipv4-address; + description + "Multicast address."; + } + + leaf source { + type inet:ipv4-address; + description + "Source address of multicast."; + } + + leaf reporter { + type inet:ipv4-address; + description + "Address of the last reporter."; + } + } + + grouping igmp-snooping-structural { + description + "IGMP membership information determined through snooping."; + + container membership-groups { + description + "List of IGMP Membership information."; + + list group { + key "group"; + config false; + description + "Multicast group membership."; + + leaf group { + type leafref { + path "../state/group"; + } + description + "Multicast address."; + } + + container state { + config false; + description + "Multicast group membership."; + + uses igmp-snooping-state; + } + } + } + } + + grouping igmp-interface-state { + description + "IGMP interface state."; + + leaf query-expires { + type oc-types:timeticks64; + description + "This timestamp indicates the time that the next query is sent + expressed relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + } + + grouping igmp-interface-top { + description + "Configuration and state data for IGMP on each interface."; + + container interfaces { + description + "The interfaces on which IGMP is configured."; + + list interface { + key "interface-id"; + description + "This container defines interface IGMP configuration and + state information."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to an interface on which IGMP is enabled."; + } + + container config { + description + "IGMP interface configuration."; + + uses igmp-interface-config; + } + + container state { + config false; + description + "This container defines state information for IGMP + interfaces."; + + uses igmp-interface-state; + uses igmp-interface-config; + } + + uses igmp-interface-counters; + uses igmp-snooping-structural; + uses oc-if:interface-ref; + } + } + } + + grouping igmp-ssm-maps-config { + description + "A Source Specific Multicast (SSM) mapping. This allows + IGMP v2 hosts to be able to join in SSM environments + by translating IGMP v2 reports into IGMP v3 reports. + The request in an IGMP v2 join is sent toward the source + address found by matching the multicast address."; + + leaf source { + type inet:ipv4-address; + description + "Multicast source address."; + } + + leaf ssm-ranges { + type leafref { + path "/oc-acl:acl/oc-acl:acl-sets/oc-acl:acl-set/" + + "oc-acl:config/oc-acl:name"; + } + description + "List of accepted source specific multicast (SSM) address + ranges."; + } + } + + grouping igmp-global-config { + description + "This grouping defines global config options for IGMP."; + + } + + grouping igmp-global-top { + description + "Top level grouping for global IGMP configuration."; + + container ssm { + description + "Source specific multicast (SSM)."; + + container mappings { + description + "A list of source specific multicast (SSM) mappings."; + + list mapping { + key "source"; + description + "A Source Specific Multicast (SSM) mapping. This allows + IGMP v2 hosts to be able to join in SSM environments + by translating IGMP v2 reports into IGMP v3 reports. + The request in an IGMP v2 join is sent toward the source + address found by matching the multicast address."; + + leaf source { + type leafref { + path "../config/source"; + } + description + "Multicast source address."; + } + + container config { + description + "Configuration for SSM maps."; + uses igmp-ssm-maps-config; + } + container state { + config false; + description + "State for SSM maps."; + uses igmp-ssm-maps-config; + } + } + } + } + } + + grouping igmp-top { + description + "Top-level grouping for IGMP."; + + container igmp { + description + "Top-level IGMP configuration and operational state."; + + container global { + description + "Global IGMP configuration and operational state."; + uses igmp-global-top; + } + + uses igmp-interface-top; + } + } + + // data definition statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-inet-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-inet-types@2018-11-21.yang new file mode 100644 index 0000000..7c23d2b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-inet-types@2018-11-21.yang @@ -0,0 +1,343 @@ +module openconfig-inet-types { + + yang-version "1"; + namespace "http://openconfig.net/yang/types/inet"; + prefix "oc-inet"; + + import openconfig-extensions { prefix "oc-ext"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains a set of Internet address related + types for use in OpenConfig modules. + + Portions of this code were derived from IETF RFC 6021. + Please reproduce this note if possible. + + IETF code is subject to the following copyright and license: + Copyright (c) IETF Trust and the persons identified as authors of + the code. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in + Section 4.c of the IETF Trust's Legal Provisions Relating + to IETF Documents (http://trustee.ietf.org/license-info)."; + + oc-ext:openconfig-version "0.3.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision 2017-08-24 { + description + "Minor formatting fixes."; + reference "0.3.1"; + } + + revision 2017-07-06 { + description + "Add domain-name and host typedefs"; + reference "0.3.0"; + } + + revision 2017-04-03 { + description + "Add ip-version typedef."; + reference "0.2.0"; + } + + revision 2017-04-03 { + description + "Update copyright notice."; + reference "0.1.1"; + } + + revision 2017-01-26 { + description + "Initial module for inet types"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // IPv4 and IPv6 types. + + typedef ipv4-address { + type string { + pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4]' + + '[0-9]|25[0-5])$'; + } + description + "An IPv4 address in dotted quad notation using the default + zone."; + } + + typedef ipv4-address-zoned { + type string { + pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4]' + + '[0-9]|25[0-5])(%[a-zA-Z0-9_]+)$'; + } + description + "An IPv4 address in dotted quad notation. This type allows + specification of a zone index to disambiguate identical + address values. For link-local addresses, the index is + typically the interface index or interface name."; + } + + typedef ipv6-address { + type string { + pattern + // Must support compression through different lengths + // therefore this regexp is complex. + '^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|' + + '([0-9a-fA-F]{1,4}:){1,7}:|' + + '([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|' + + '([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|' + + '([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|' + + '([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|' + + '([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|' + + '[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|' + + ':((:[0-9a-fA-F]{1,4}){1,7}|:)' + + ')$'; + } + description + "An IPv6 address represented as either a full address; shortened + or mixed-shortened formats, using the default zone."; + } + + typedef ipv6-address-zoned { + type string { + pattern + // Must support compression through different lengths + // therefore this regexp is complex. + '^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|' + + '([0-9a-fA-F]{1,4}:){1,7}:|' + + '([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|' + + '([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|' + + '([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|' + + '([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|' + + '([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|' + + '[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|' + + ':((:[0-9a-fA-F]{1,4}){1,7}|:)' + + ')(%[a-zA-Z0-9_]+)$'; + } + description + "An IPv6 address represented as either a full address; shortened + or mixed-shortened formats. This type allows specification of + a zone index to disambiguate identical address values. For + link-local addresses, the index is typically the interface + index or interface name."; + } + + typedef ipv4-prefix { + type string { + pattern '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|' + + '25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4]' + + '[0-9]|25[0-5])/(([0-9])|([1-2][0-9])|(3[0-2]))$'; + } + description + "An IPv4 prefix represented in dotted quad notation followed by + a slash and a CIDR mask (0 <= mask <= 32)."; + } + + typedef ipv6-prefix { + type string { + pattern + '^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|' + + '([0-9a-fA-F]{1,4}:){1,7}:|' + + '([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}' + + '([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|' + + '([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|' + + '([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|' + + '([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|' + + '[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|' + + ':((:[0-9a-fA-F]{1,4}){1,7}|:)' + + ')/(12[0-8]|1[0-1][0-9]|[1-9][0-9]|[0-9])$'; + } + description + "An IPv6 prefix represented in full, shortened, or mixed + shortened format followed by a slash and CIDR mask + (0 <= mask <= 128)."; + } + + typedef ip-address { + type union { + type ipv4-address; + type ipv6-address; + } + description + "An IPv4 or IPv6 address with no prefix specified."; + } + + typedef ip-prefix { + type union { + type ipv4-prefix; + type ipv6-prefix; + } + description + "An IPv4 or IPv6 prefix."; + } + + typedef ip-version { + type enumeration { + enum UNKNOWN { + value 0; + description + "An unknown or unspecified version of the Internet + protocol."; + } + enum IPV4 { + value 4; + description + "The IPv4 protocol as defined in RFC 791."; + } + enum IPV6 { + value 6; + description + "The IPv6 protocol as defined in RFC 2460."; + } + } + description + "This value represents the version of the IP protocol. + Note that integer representation of the enumerated values + are not specified, and are not required to follow the + InetVersion textual convention in SMIv2."; + reference + "RFC 791: Internet Protocol + RFC 2460: Internet Protocol, Version 6 (IPv6) Specification + RFC 4001: Textual Conventions for Internet Network Addresses"; + } + + typedef domain-name { + type string { + length "1..253"; + pattern + '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*' + + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)' + + '|\.'; + } + description + "The domain-name type represents a DNS domain name. + Fully quallified left to the models which utilize this type. + + Internet domain names are only loosely specified. Section + 3.5 of RFC 1034 recommends a syntax (modified in Section + 2.1 of RFC 1123). The pattern above is intended to allow + for current practice in domain name use, and some possible + future expansion. It is designed to hold various types of + domain names, including names used for A or AAAA records + (host names) and other records, such as SRV records. Note + that Internet host names have a stricter syntax (described + in RFC 952) than the DNS recommendations in RFCs 1034 and + 1123, and that systems that want to store host names in + schema nodes using the domain-name type are recommended to + adhere to this stricter standard to ensure interoperability. + + The encoding of DNS names in the DNS protocol is limited + to 255 characters. Since the encoding consists of labels + prefixed by a length bytes and there is a trailing NULL + byte, only 253 characters can appear in the textual dotted + notation. + + Domain-name values use the US-ASCII encoding. Their canonical + format uses lowercase US-ASCII characters. Internationalized + domain names MUST be encoded in punycode as described in RFC + 3492"; + } + + typedef host { + type union { + type ip-address; + type domain-name; + } + description + "The host type represents either an unzoned IP address or a DNS + domain name."; + } + + typedef as-number { + type uint32; + description + "A numeric identifier for an autonomous system (AS). An AS is a + single domain, under common administrative control, which forms + a unit of routing policy. Autonomous systems can be assigned a + 2-byte identifier, or a 4-byte identifier which may have public + or private scope. Private ASNs are assigned from dedicated + ranges. Public ASNs are assigned from ranges allocated by IANA + to the regional internet registries (RIRs)."; + reference + "RFC 1930 Guidelines for creation, selection, and registration + of an Autonomous System (AS) + RFC 4271 A Border Gateway Protocol 4 (BGP-4)"; + } + + typedef dscp { + type uint8 { + range "0..63"; + } + description + "A differentiated services code point (DSCP) marking within the + IP header."; + reference + "RFC 2474 Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers"; + } + + typedef ipv6-flow-label { + type uint32 { + range "0..1048575"; + } + description + "The IPv6 flow-label is a 20-bit value within the IPv6 header + which is optionally used by the source of the IPv6 packet to + label sets of packets for which special handling may be + required."; + reference + "RFC 2460 Internet Protocol, Version 6 (IPv6) Specification"; + } + + typedef port-number { + type uint16; + description + "A 16-bit port number used by a transport protocol such as TCP + or UDP."; + reference + "RFC 768 User Datagram Protocol + RFC 793 Transmission Control Protocol"; + } + + typedef uri { + type string; + description + "An ASCII-encoded Uniform Resource Identifier (URI) as defined + in RFC 3986."; + reference + "RFC 3986 Uniform Resource Identifier (URI): Generic Syntax"; + } + + typedef url { + type string; + description + "An ASCII-encoded Uniform Resource Locator (URL) as defined + in RFC 3986, section 1.1.3"; + reference + "RFC 3986, paragraph 1.1.3"; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-interfaces@2016-12-22.yang b/exp/yangcli/h3c-yang/openconfig-interfaces@2016-12-22.yang new file mode 100644 index 0000000..e5b4782 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-interfaces@2016-12-22.yang @@ -0,0 +1,933 @@ +module openconfig-interfaces { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/interfaces"; + + prefix "oc-if"; + + // import some basic types + import ietf-interfaces { prefix ietf-if; } + import ietf-yang-types { prefix yang; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Model for managing network interfaces and subinterfaces. This + module also defines convenience types / groupings for other + models to create references to interfaces: + + base-interface-ref (type) - reference to a base interface + interface-ref (grouping) - container for reference to a + interface + subinterface + interface-ref-state (grouping) - container for read-only + (opstate) reference to interface + subinterface + + This model reuses data items defined in the IETF YANG model for + interfaces described by RFC 7223 with an alternate structure + (particularly for operational state data) and and with + additional configuration items."; + + oc-ext:openconfig-version "1.1.0"; + + revision "2016-12-22" { + description + "Fixes to Ethernet interfaces model"; + reference "1.1.0"; + } + + + // typedef statements + + typedef base-interface-ref { + type leafref { + path "/oc-if:interfaces/oc-if:interface/oc-if:name"; + } + description + "Reusable type for by-name reference to a base interface. + This type may be used in cases where ability to reference + a subinterface is not required."; + } + + typedef interface-id { + type string; + description + "User-defined identifier for an interface, generally used to + name a interface reference. The id can be arbitrary but a + useful convention is to use a combination of base interface + name and subinterface index."; + } + + // grouping statements + + grouping interface-ref-common { + description + "Reference leafrefs to interface / subinterface"; + + leaf interface { + type leafref { + path "/oc-if:interfaces/oc-if:interface/oc-if:name"; + } + description + "Reference to a base interface. If a reference to a + subinterface is required, this leaf must be specified + to indicate the base interface."; + } + + leaf subinterface { + type leafref { + path "/oc-if:interfaces/" + + "oc-if:interface[oc-if:name=current()/../interface]/" + + "oc-if:subinterfaces/oc-if:subinterface/oc-if:index"; + } + description + "Reference to a subinterface -- this requires the base + interface to be specified using the interface leaf in + this container. If only a reference to a base interface + is requuired, this leaf should not be set."; + } + } + + grouping interface-ref-state-container { + description + "Reusable opstate w/container for a reference to an + interface or subinterface"; + + container state { + config false; + description + "Operational state for interface-ref"; + + uses interface-ref-common; + } + } + + grouping interface-ref { + description + "Reusable definition for a reference to an interface or + subinterface"; + + container interface-ref { + description + "Reference to an interface or subinterface"; + + container config { + description + "Configured reference to interface / subinterface"; + + uses interface-ref-common; + } + + uses interface-ref-state-container; + } + } + + grouping interface-ref-state { + description + "Reusable opstate w/container for a reference to an + interface or subinterface"; + + container interface-ref { + description + "Reference to an interface or subinterface"; + + uses interface-ref-state-container; + } + } + + + grouping interface-common-config { + description + "Configuration data data nodes common to physical interfaces + and subinterfaces"; + + leaf name { + type string; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The name of the interface. + + A device MAY restrict the allowed values for this leaf, + possibly depending on the type of the interface. + For system-controlled interfaces, this leaf is the + device-specific name of the interface. The 'config false' + list interfaces/interface[name]/state contains the currently + existing interfaces on the device. + + If a client tries to create configuration for a + system-controlled interface that is not present in the + corresponding state list, the server MAY reject + the request if the implementation does not support + pre-provisioning of interfaces or if the name refers to + an interface that can never exist in the system. A + NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case. + + The IETF model in RFC 7223 provides YANG features for the + following (i.e., pre-provisioning and arbitrary-names), + however they are omitted here: + + If the device supports pre-provisioning of interface + configuration, the 'pre-provisioning' feature is + advertised. + + If the device allows arbitrarily named user-controlled + interfaces, the 'arbitrary-names' feature is advertised. + + When a configured user-controlled interface is created by + the system, it is instantiated with the same name in the + /interfaces/interface[name]/state list."; + reference + "RFC 7223: A YANG Data Model for Interface Management"; + } + + leaf description { + type string; + description + "[adapted from IETF interfaces model (RFC 7223)] + + A textual description of the interface. + + A server implementation MAY map this leaf to the ifAlias + MIB object. Such an implementation needs to use some + mechanism to handle the differences in size and characters + allowed between this leaf and ifAlias. The definition of + such a mechanism is outside the scope of this document. + + Since ifAlias is defined to be stored in non-volatile + storage, the MIB implementation MUST map ifAlias to the + value of 'description' in the persistently stored + datastore. + + Specifically, if the device supports ':startup', when + ifAlias is read the device MUST return the value of + 'description' in the 'startup' datastore, and when it is + written, it MUST be written to the 'running' and 'startup' + datastores. Note that it is up to the implementation to + + decide whether to modify this single leaf in 'startup' or + perform an implicit copy-config from 'running' to + 'startup'. + + If the device does not support ':startup', ifAlias MUST + be mapped to the 'description' leaf in the 'running' + datastore."; + reference + "RFC 2863: The Interfaces Group MIB - ifAlias"; + } + + leaf enabled { + type boolean; + default "true"; + description + "[adapted from IETF interfaces model (RFC 7223)] + + This leaf contains the configured, desired state of the + interface. + + Systems that implement the IF-MIB use the value of this + leaf in the 'running' datastore to set + IF-MIB.ifAdminStatus to 'up' or 'down' after an ifEntry + has been initialized, as described in RFC 2863. + + Changes in this leaf in the 'running' datastore are + reflected in ifAdminStatus, but if ifAdminStatus is + changed over SNMP, this leaf is not affected."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + } + + grouping interface-phys-config { + description + "Configuration data for physical interfaces"; + + leaf type { + type identityref { + base ietf-if:interface-type; + } + mandatory true; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The type of the interface. + + When an interface entry is created, a server MAY + initialize the type leaf with a valid value, e.g., if it + is possible to derive the type from the name of the + interface. + + If a client tries to set the type of an interface to a + value that can never be used by the system, e.g., if the + type is not supported or if the type does not match the + name of the interface, the server MUST reject the request. + A NETCONF server MUST reply with an rpc-error with the + error-tag 'invalid-value' in this case."; + reference + "RFC 2863: The Interfaces Group MIB - ifType"; + } + + leaf mtu { + type uint16; + description + "Set the max transmission unit size in octets + for the physical interface. If this is not set, the mtu is + set to the operational default -- e.g., 1514 bytes on an + Ethernet interface."; + } + + uses interface-common-config; + } + + grouping interface-phys-holdtime-config { + description + "Configuration data for interface hold-time settings -- + applies to physical interfaces."; + + leaf up { + type uint32; + units milliseconds; + default 0; + description + "Dampens advertisement when the interface + transitions from down to up. A zero value means dampening + is turned off, i.e., immediate notification."; + } + + leaf down { + type uint32; + units milliseconds; + default 0; + description + "Dampens advertisement when the interface transitions from + up to down. A zero value means dampening is turned off, + i.e., immediate notification."; + } + } + + grouping interface-phys-holdtime-state { + description + "Operational state data for interface hold-time."; + } + + grouping interface-phys-holdtime-top { + description + "Top-level grouping for setting link transition + dampening on physical and other types of interfaces."; + + container hold-time { + description + "Top-level container for hold-time settings to enable + dampening advertisements of interface transitions."; + + container config { + description + "Configuration data for interface hold-time settings."; + + uses interface-phys-holdtime-config; + } + + container state { + + config false; + + description + "Operational state data for interface hold-time."; + + uses interface-phys-holdtime-config; + uses interface-phys-holdtime-state; + } + } + } + + grouping interface-common-state { + description + "Operational state data (in addition to intended configuration) + at the global level for this interface"; + + leaf ifindex { + type uint32; + description + "System assigned number for each interface. Corresponds to + ifIndex object in SNMP Interface MIB"; + reference + "RFC 2863 - The Interfaces Group MIB"; + } + + leaf admin-status { + type enumeration { + enum UP { + description + "Ready to pass packets."; + } + enum DOWN { + description + "Not ready to pass packets and not in some test mode."; + } + enum TESTING { + //TODO: This is generally not supported as a configured + //admin state, though it's in the standard interfaces MIB. + //Consider removing it. + description + "In some test mode."; + } + } + //TODO:consider converting to an identity to have the + //flexibility to remove some values defined by RFC 7223 that + //are not used or not implemented consistently. + mandatory true; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The desired state of the interface. In RFC 7223 this leaf + has the same read semantics as ifAdminStatus. Here, it + reflects the administrative state as set by enabling or + disabling the interface."; + reference + "RFC 2863: The Interfaces Group MIB - ifAdminStatus"; + } + + leaf oper-status { + type enumeration { + enum UP { + value 1; + description + "Ready to pass packets."; + } + enum DOWN { + value 2; + description + "The interface does not pass any packets."; + } + enum TESTING { + value 3; + description + "In some test mode. No operational packets can + be passed."; + } + enum UNKNOWN { + value 4; + description + "Status cannot be determined for some reason."; + } + enum DORMANT { + value 5; + description + "Waiting for some external event."; + } + enum NOT_PRESENT { + value 6; + description + "Some component (typically hardware) is missing."; + } + enum LOWER_LAYER_DOWN { + value 7; + description + "Down due to state of lower-layer interface(s)."; + } + } + //TODO:consider converting to an identity to have the + //flexibility to remove some values defined by RFC 7223 that + //are not used or not implemented consistently. + mandatory true; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The current operational state of the interface. + + This leaf has the same semantics as ifOperStatus."; + reference + "RFC 2863: The Interfaces Group MIB - ifOperStatus"; + } + + leaf last-change { + type yang:timeticks; + description + "Date and time of the last state change of the interface + (e.g., up-to-down transition). This corresponds to the + ifLastChange object in the standard interface MIB."; + reference + "RFC 2863: The Interfaces Group MIB - ifLastChange"; + } + + } + + + grouping interface-counters-state { + description + "Operational state representing interface counters + and statistics. Some of these are adapted from RFC 7223"; + + //TODO: we may need to break this list of counters into those + //that would appear for physical vs. subinterface or logical + //interfaces. For now, just replicating the full stats + //grouping to both interface and subinterface. + + container counters { + description + "A collection of interface-related statistics objects."; + + reference + "RFC 7223 - A YANG Data Model for Interface + Management"; + + leaf in-octets { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The total number of octets received on the interface, + including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInOctets"; + } + + leaf in-unicast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were not addressed to a + multicast or broadcast address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCInUcastPkts"; + } + + leaf in-broadcast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a broadcast + address at this sub-layer. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInBroadcastPkts"; + } + + leaf in-multicast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + + The number of packets, delivered by this sub-layer to a + higher (sub-)layer, that were addressed to a multicast + address at this sub-layer. For a MAC-layer protocol, + this includes both Group and Functional addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCInMulticastPkts"; + } + + leaf in-discards { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + The number of inbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being deliverable to a higher-layer + protocol. One possible reason for discarding such a + packet could be to free up buffer space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + + + reference + "RFC 2863: The Interfaces Group MIB - ifInDiscards"; + } + + leaf in-errors { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + For packet-oriented interfaces, the number of inbound + packets that contained errors preventing them from being + deliverable to a higher-layer protocol. For character- + oriented or fixed-length interfaces, the number of + inbound transmission units that contained errors + preventing them from being deliverable to a higher-layer + protocol. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInErrors"; + } + + leaf in-unknown-protos { + type yang:counter32; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + For packet-oriented interfaces, the number of packets + received via the interface that were discarded because + of an unknown or unsupported protocol. For + character-oriented or fixed-length interfaces that + support protocol multiplexing, the number of + transmission units received via the interface that were + discarded because of an unknown or unsupported protocol. + For any interface that does not support protocol + multiplexing, this counter is not present. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifInUnknownProtos"; + } + + leaf out-octets { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + The total number of octets transmitted out of the + interface, including framing characters. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutOctets"; + } + + leaf out-unicast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The total number of packets that higher-level protocols + requested be transmitted, and that were not addressed + to a multicast or broadcast address at this sub-layer, + including those that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifHCOutUcastPkts"; + } + + leaf out-broadcast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + + The total number of packets that higher-level protocols + requested be transmitted, and that were addressed to a + broadcast address at this sub-layer, including those + that were discarded or not sent. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutBroadcastPkts"; + } + + + leaf out-multicast-pkts { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + The total number of packets that higher-level protocols + requested be transmitted, and that were addressed to a + multicast address at this sub-layer, including those + that were discarded or not sent. For a MAC-layer + protocol, this includes both Group and Functional + addresses. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - + ifHCOutMulticastPkts"; + } + + leaf out-discards { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + The number of outbound packets that were chosen to be + discarded even though no errors had been detected to + prevent their being transmitted. One possible reason + for discarding such a packet could be to free up buffer + space. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutDiscards"; + } + + leaf out-errors { + type yang:counter64; + description + "[adapted from IETF interfaces model (RFC 7223)] + Changed the counter type to counter64. + + For packet-oriented interfaces, the number of outbound + packets that could not be transmitted because of errors. + For character-oriented or fixed-length interfaces, the + number of outbound transmission units that could not be + transmitted because of errors. + + Discontinuities in the value of this counter can occur + at re-initialization of the management system, and at + other times as indicated by the value of + 'discontinuity-time'."; + reference + "RFC 2863: The Interfaces Group MIB - ifOutErrors"; + } + + leaf last-clear { + type yang:date-and-time; + description + "Indicates the last time the interface counters were + cleared."; + } + } + } + + // data definition statements + + grouping sub-unnumbered-config { + description + "Configuration data for unnumbered subinterfaces"; + + leaf enabled { + type boolean; + default false; + description + "Indicates that the subinterface is unnumbered. By default + the subinterface is numbered, i.e., expected to have an + IP address configuration."; + } + } + + grouping sub-unnumbered-state { + description + "Operational state data unnumbered subinterfaces"; + } + + grouping sub-unnumbered-top { + description + "Top-level grouping unnumbered subinterfaces"; + + container unnumbered { + description + "Top-level container for setting unnumbered interfaces. + Includes reference the interface that provides the + address information"; + + container config { + description + "Configuration data for unnumbered interface"; + + uses sub-unnumbered-config; + } + + container state { + + config false; + + description + "Operational state data for unnumbered interfaces"; + + uses sub-unnumbered-config; + uses sub-unnumbered-state; + } + + uses oc-if:interface-ref; + } + } + + grouping subinterfaces-config { + description + "Configuration data for subinterfaces"; + + leaf index { + type uint32; + default 0; + description + "The index of the subinterface, or logical interface number. + On systems with no support for subinterfaces, or not using + subinterfaces, this value should default to 0, i.e., the + default subinterface."; + } + + uses interface-common-config; + + } + + grouping subinterfaces-state { + description + "Operational state data for subinterfaces"; + + uses interface-common-state; + uses interface-counters-state; + } + + grouping subinterfaces-top { + description + "Subinterface data for logical interfaces associated with a + given interface"; + + container subinterfaces { + description + "Enclosing container for the list of subinterfaces associated + with a physical interface"; + + list subinterface { + key "index"; + + description + "The list of subinterfaces (logical interfaces) associated + with a physical interface"; + + leaf index { + type leafref { + path "../config/index"; + } + description + "The index number of the subinterface -- used to address + the logical interface"; + } + + container config { + description + "Configurable items at the subinterface level"; + + uses subinterfaces-config; + } + + container state { + + config false; + description + "Operational state data for logical interfaces"; + + uses subinterfaces-config; + uses subinterfaces-state; + } + } + } + } + + grouping interfaces-top { + description + "Top-level grouping for interface configuration and + operational state data"; + + container interfaces { + description + "Top level container for interfaces, including configuration + and state data."; + + + list interface { + key "name"; + + description + "The list of named interfaces on the device."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "References the configured name of the interface"; + //TODO: need to consider whether this should actually + //reference the name in the state subtree, which + //presumably would be the system-assigned name, or the + //configured name. Points to the config/name now + //because of YANG 1.0 limitation that the list + //key must have the same "config" as the list, and + //also can't point to a non-config node. + } + + container config { + description + "Configurable items at the global, physical interface + level"; + + uses interface-phys-config; + } + + container state { + + config false; + description + "Operational state data at the global interface level"; + + uses interface-phys-config; + uses interface-common-state; + uses interface-counters-state; + } + + uses interface-phys-holdtime-top; + uses subinterfaces-top; + } + } + } + + uses interfaces-top; + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis-lsdb-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-isis-lsdb-types@2018-11-21.yang new file mode 100644 index 0000000..db6e5f7 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis-lsdb-types@2018-11-21.yang @@ -0,0 +1,703 @@ +module openconfig-isis-lsdb-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/isis-lsdb-types"; + + prefix "oc-isis-lsdb-types"; + + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains general LSDB type definitions for use in + ISIS YANG model. "; + + oc-ext:openconfig-version "0.4.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + identity ISIS_TLV_TYPE { + description + "Base identity for an ISIS TLV type."; + } + + identity ISIS_SUBTLV_TYPE { + description + "Base identity for an ISIS SUB-TLV type."; + } + + identity IS_REACHABILITY_SUBTLVS_TYPE { + base "ISIS_SUBTLV_TYPE"; + description + "Base identity for an ISIS TLV 22, 23, 222, 223, 141 SUB-TLV + type."; + } + + identity IP_REACHABILITY_SUBTLVS_TYPE { + base "ISIS_SUBTLV_TYPE"; + description + "Base identity for an ISIS TLV 135, 235, 236, 237 SUB-TLV + type."; + } + + identity ROUTER_CAPABILITY_SUBTLVS_TYPE { + base "ISIS_SUBTLV_TYPE"; + description + "Base identity for an ISIS TLV 242 SUB-TLV type."; + } + + identity AREA_ADDRESSES { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 1. Intermediate System to Intermediate System Intra- + Domain Routeing Exchange Protocol for use in Conjunction with + the Protocol for Providing the Connectionless-mode Network + Service (ISO 8473), International Standard 10589: 2002, Second + Edition, 2002."; + reference + "ISO 10589"; + } + + identity IIS_NEIGHBORS { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 2. Intermediate System to Intermediate System Intra- + Domain Routeing Exchange Protocol for use in Conjunction with + the Protocol for Providing the Connectionless-mode Network + Service (ISO 8473), International Standard 10589: 2002, Second + Edition, 2002."; + reference + "ISO 10589"; + } + + identity INSTANCE_ID { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 7. An Instance Identifier (IID) to uniquely + identify an IS-IS instance. When the IID = 0, the list of + supported ITIDs MUST NOT be present. An IID-TLV with IID = 0 + MUST NOT appear in an SNP or LSP. When the TLV appears (with a + non-zero IID) in an SNP or LSP, exactly one ITID. MUST be + present indicating the topology with which the PDU is + associated. If no ITIDs or multiple ITIDs are present or the + IID is zero, then the PDU MUST be ignored"; + reference + "RFC6822: IS-IS Multi-Instance"; + } + + identity AUTHENTICATION { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 10.Intermediate System to Intermediate System Intra- + Domain Routeing Exchange Protocol for use in Conjunction with + the Protocol for Providing the Connectionless-mode Network + Service (ISO 8473) International Standard 10589: 2002, Second + Edition, 2002."; + reference + "ISO 10589"; + } + + identity PURGE_OI { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 13. If an IS generates a purge, it SHOULD include + this TLV in the purge with its own system ID. If an IS + receives a purge that does not include this TLV, then it SHOULD + add this TLV with both its own system ID and the system ID of + the IS from which it received the purge. This allows ISs + receiving purges to log the system ID of the originator, or the + upstream source of the purge."; + reference + "RFC6232: Purge Originator Identification TLV"; + } + + identity LSP_BUFFER_SIZE { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 14. The maximum MTU that the advertising system can + receive, expressed in bytes."; + reference + "ISO 10589: LSP Buffer Size TLV"; + } + + identity EXTENDED_IS_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 22. An extended IS reachability TLV that has a + different data structure to TLV 2 that introduces the use of + sub-TLV object-group."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering"; + } + + identity IS_NEIGHBOR_ATTRIBUTE { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 23. Identical in format to TLV 22 and included in + Original LSPs or Extended LSPs. Regardless of the type of LSP + in which the TLVs appear, the information pertains to the + neighbor relationship between the Originating System and the IS + identified in the TLV"; + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) Space + for IS-IS"; + } + + identity ISIS_ALIAS_ID { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 24. IS-Alias TLV which extension-capable ISs to + recognize the Originating System of an Extended LSP set. It + identifies the Normal system-id of the Originating System"; + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) Space + for IS-IS"; + } + + identity IPV4_INTERNAL_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 128. TLV defines IP addresses within the routing + domain reachable directly via one or more interfaces on this + Intermediate system"; + reference + "RFC1195: OSI ISIS for IP and Dual Environments. RFC5302: + Domain-Wide Prefix Distribution with Two-Level IS-IS"; + } + + identity NLPID { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 129. TLV defines the set Network Layer Protocol + Identifiers for Network Layer protocols that this Intermediate + System is capable of relaying"; + reference + "RFC1195: Use of OSI IS-IS for Routing in TCP/IP and + Dual Environments"; + } + + identity IPV4_EXTERNAL_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 130. TLV defines IP addresses outside the routing + domain reachable via interfaces on this Intermediate system. + This is permitted to appear multiple times, and in an LSP with + any LSP number. However, this field must not appear in + pseudonode LSPs"; + reference " + RFC1195: OSI ISIS for IP and Dual Environments. RFC5302: + Domain-Wide Prefix Distribution with Two-Level IS-IS"; + } + + identity IPV4_INTERFACE_ADDRESSES { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 132. The IP address of one or more interfaces + corresponding to the SNPAs enabled on this Intermediate system + (i.e., one or more IP addresses of this router). This is + permitted to appear multiple times, and in an LSP with any LSP + number."; + reference + "RFC1195: Use of OSI IS-IS for Routing in TCP/IP and Dual + Environments"; + } + + identity IPV4_TE_ROUTER_ID { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 134. Traffic Engineering router ID TLV that contains + the 4-octet router ID of the router originating the LSP"; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering"; + } + + identity EXTENDED_IPV4_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 135. Extended IP reachability TLV that provides for a + 32-bit metric and adds one bit to indicate that a prefix has + been redistributed _down_ in the hierarchy"; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering"; + } + + identity DYNAMIC_NAME { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 137. The Dynamic hostname TLV is optional. This TLV + may be present in any fragment of a non-pseudonode LSP. The + value field identifies the symbolic name of the router + originating the LSP. This symbolic name can be the FQDN for the + router, it can be a subset of the FQDN, or it can be any string + operators want to use for the router."; + reference + "RFC6233: IS-IS Registry Extension for Purges, RFC 5301: Dynamic + Hostname Exchange Mechanism for IS-IS."; + } + + identity IPV4_SRLG { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 138. IPv4 Shared Risk Link Group TLV"; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + identity IPV6_SRLG { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 139. IPv6 Shared Risk Link Group"; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS"; + } + + identity IPV6_TE_ROUTER_ID { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 140. The IPv6 TE Router ID TLV contains a 16-octet + IPv6 address. A stable global IPv6 address MUST be used, so that + the router ID provides a routable address, regardless of the + state of a node's interfaces. If a router does not implement + traffic engineering, it MAY include or omit the IPv6 TE Router + ID TLV. If a router implements traffic engineering for IPv6, it + MUST include this TLV in its LSP. This TLV MUST NOT be included + more than once in an LSP."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS."; + } + + identity MT_ISN { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 222. TLV is aligned with extended IS reachability TLV + type 22 beside an additional two bytes in front at the beginning + of the TLV that. indicate MT membership."; + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in Intermediate + System to Intermediate Systems (IS-ISs)"; + } + + identity MT_IS_NEIGHBOR_ATTRIBUTE { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 223. Is is identical in format to TLV 222. In the + event that there is a need to advertise in Extended LSPs such + information associated with neighbors of the Originating System, + it is necessary to define new TLVs to carry the sub-TLV + information."; + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) Space for + IS-IS"; + } + + identity MULTI_TOPOLOGY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 229. This MT TLV can advertise up to 127 MTs. It is + announced in IIHs and LSP fragment 0, and can occur multiple + times. The resulting MT set SHOULD be the union of all the MT + TLV occurrences in the packet. Any other IS-IS PDU occurrence of + this TLV MUST be ignored. Lack of MT TLV in hellos and fragment + zero LSPs MUST be interpreted as participation of the + advertising interface or router in MT ID #0 only. If a router + advertises MT TLV, it has to advertise all the MTs it + participates in, specifically including topology ID #0 also."; + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in Intermediate + System to Intermediate Systems (IS-ISs)"; + } + + identity IPV6_INTERFACE_ADDRESSES { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 232. IPv6 Interface Address TLV that maps directly to + the IP Interface Address TLV in [RFC1195]. We necessarily modify + the contents to be 0-15 16-octet IPv6 interface addresses + instead of 0-63 4-octet IPv4 interface addresses"; + reference "RFC5308: Routing IPv6 with IS-IS."; + } + + identity MT_IPV4_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 235. TLV is aligned with extended IP reachability TLV + type 135 beside an additional two bytes in front to indicate MT + membership"; + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in Intermediate + System to Intermediate Systems (IS-ISs)"; + } + + identity IPV6_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 236. The IPv6 Reachability TLV describes network + reachability through the specification of a routing prefix, + metric information, a bit to indicate if the prefix is being + advertised down from a higher level, a bit to indicate if the + prefix is being distributed from another routing protocol, and + OPTIONALLY the existence of Sub-TLVs to allow for later + extension."; + reference + "RFC5308: Routing IPv6 with IS-IS"; + } + + identity MT_IPV6_REACHABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 237. TLV is aligned with IPv6 Reachability TLV type + 236 beside an additional two bytes in front to indicate MT + membership."; + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in Intermediate + System to Intermediate Systems (IS-ISs)."; + } + + identity ROUTER_CAPABILITY { + base "ISIS_TLV_TYPE"; + description + "ISIS TLV 242. IS-IS TLV named CAPABILITY, formed of multiple + sub-TLVs, which allows a router to announce its capabilities + within an IS-IS level or the entire routing domain."; + reference + "RFC4971: Intermediate System to Intermediate System (IS-IS) + Extensions for Advertising Router Information."; + } + + //sub-TLVs for TLVs 22, 23, 141, 222, 223 + + identity IS_REACHABILITY_ADMIN_GROUP { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 3. Administrative group(color)."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering"; + } + + identity IS_REACHABILITY_LINK_ID { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 4. Link Local/Remote Identifiers."; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + identity IS_REACHABILITY_IPV4_INTERFACE_ADDRESS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 6. IPv4 Interface Address."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_IPV4_NEIGHBOR_ADDRESS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 8. IPv4 Neighbor Address."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_MAX_LINK_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 9. Maximum Link Bandwidth."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_MAX_RESERVABLE_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 10. Maximum Reservable Bandwidth."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_UNRESERVED_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 11. Unreserved bandwidth."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_IPV6_INTERFACE_ADDRESS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 12. IPv6 Interface Address."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS."; + } + + identity IS_REACHABILITY_IPV6_NEIGHBOR_ADDRESS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 13. IPv6 Neighbor Address."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS."; + } + + identity IS_REACHABILITY_EXTENDED_ADMIN_GROUP { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 14. Extended Administrative Group."; + reference + "RFC7308: Extended Administrative Groups in MPLS Traffic + Engineering (MPLS-TE)."; + } + + identity IS_REACHABILITY_TE_DEFAULT_METRIC { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 18. TE Default Metric."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering."; + } + + identity IS_REACHABILITY_LINK_ATTRIBUTES { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 19. Link Attributes."; + reference + "RFC5209: Definition of an IS-IS Link Attribute Sub-TLV."; + } + + identity IS_REACHABILITY_LINK_PROTECTION_TYPE { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 20. Link Protection Type."; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS)"; + } + + identity IS_REACHABILITY_BANDWIDTH_CONSTRAINTS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 22. Bandwidth Constraints."; + reference + "RFC4124: Protocol Extensions for Support of Diffserv-aware MPLS + Traffic Engineering."; + } + + identity IS_REACHABILITY_UNCONSTRAINED_LSP { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 23. Unconstrained LSP."; + reference + "RFC5330: A Link-Type sub-TLV to Convey the Number of Traffic + Engineering Label Switched Paths Signalled with Zero + Reserved Bandwidth across a Link."; + } + + identity IS_REACHABILITY_ADJ_SID { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 31. Adjacency Segment Identifier."; + reference + "draft-ietf-isis-segment-routing-extensions."; + } + + identity IS_REACHABILITY_ADJ_LAN_SID { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 32. Adjacency LAN Segment Identifier."; + reference + "draft-ietf-isis-segment-routing-extensions."; + } + + identity IS_REACHABILITY_LINK_DELAY { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 33. Unidirectional Link Delay."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_MIN_MAX_LINK_DELAY { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 34. Min/Max Unidirectional Link Delay."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_LINK_DELAY_VARIATION { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 35. Unidirectional Link Delay Variation."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_LINK_LOSS { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 36. Unidirectional Link Loss Delay."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_RESIDUAL_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 37. Unidirectional Residual Bandwidth."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_AVAILABLE_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 38. Unidirectional Available Bandwidth."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + identity IS_REACHABILITY_UTILIZED_BANDWIDTH { + base "IS_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 39. Unidirectional Utilized Bandwidth."; + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions."; + } + + //sub-TLVs for TLVs 135, 235, 236, 237 + identity IP_REACHABILITY_TAG { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 1. 32-bit Administrative Tag."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and IPv6 + Reachability."; + } + + identity IP_REACHABILITY_TAG64 { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 2. 64-bit Administrative Tag."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and IPv6 + Reachability."; + } + + identity IP_REACHABILITY_PREFIX_SID { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 3. Prefix Segment Identifier."; + reference + "draft-ietf-isis-segment-routing-extension."; + } + + identity IP_REACHABILITY_PREFIX_FLAGS { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 4. Prefix Attribute Flags."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and IPv6 + Reachability."; + } + + identity IP_REACHABILITY_IPV4_ROUTER_ID { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 11. IPv4 Source Router ID."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and IPv6 + Reachability."; + } + + identity IP_REACHABILITY_IPV6_ROUTER_ID { + base "IP_REACHABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 12. IPv6 Source Router ID."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and IPv6 + Reachability."; + } + + + //sub-TLVs for TLVs 242 + + identity ROUTER_CAPABILITY_SR_CAPABILITY { + base "ROUTER_CAPABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 2. Segment Routing Capability."; + reference + "draft-ietf-isis-segment-routing-extensions."; + } + + identity ROUTER_CAPABILITY_SR_ALGORITHM { + base "ROUTER_CAPABILITY_SUBTLVS_TYPE"; + description + "sub-TLV 19. Segment Routing Algorithm."; + reference + "draft-ietf-isis-segment-routing-extensions."; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis-lsp@2020-03-24.yang b/exp/yangcli/h3c-yang/openconfig-isis-lsp@2020-03-24.yang new file mode 100644 index 0000000..f8349e1 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis-lsp@2020-03-24.yang @@ -0,0 +1,3615 @@ +submodule openconfig-isis-lsp { + + belongs-to openconfig-isis { + prefix oc-isis; + } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-inet-types { prefix "inet"; } + import openconfig-isis-types { prefix "oc-isis-types"; } + import openconfig-isis-lsdb-types { prefix "oc-isis-lsdb-types"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net "; + + description + "This sub-module describes a YANG model for the IS-IS Link State + Database (LSDB). + + Portions of this code were derived from IETF RFCs relating to the + IS-IS protocol. + Please reproduce this note if possible. + IETF code is subject to the following copyright and license: + Copyright (c) IETF Trust and the persons identified as authors of + the code. + All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in + Section 4.c of the IETF Trust's Legal Provisions Relating + to IETF Documents (http://trustee.ietf.org/license-info)."; + + oc-ext:openconfig-version "0.6.0"; + + revision "2020-03-24" { + description + "Support IGP-LDP sync per interface."; + reference "0.6.0"; + } + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "0.5.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + typedef isis-metric-flags { + type enumeration { + enum INTERNAL { + description + "When this flag is not set, internal metrics are in use."; + } + enum UNSUPPORTED { + description + "When this flag (referred to as the S-bit) is set, then + the metric is unsupported."; + } + } + description + "Type definition for flags used in IS-IS metrics"; + } + + grouping isis-lsdb-link-characteristics-a-bit { + description + "Definition of the A bit, as used in IS-IS link delay TLVs."; + + leaf a-bit { + type boolean; + description + "The A bit is set when the measured value of this parameter + exceeds its configured maximum threshold. The A bit is cleared + when the measured value falls below its configured reuse + threshold."; + } + } + + grouping isis-lsdb-tlv-nlpid-state { + description + "NLP ID parameters for IS-IS."; + + leaf-list nlpid { + type enumeration { + enum IPV4 { + description "IPv4 Address family."; + } + enum IPV6 { + description "IPv6 Address family."; + } + } + description + "Protocol supported. IPv4 is defined as (0xcc) and IPv6 - + (0x8e)"; + reference + "RFC1195: Use of OSI IS-IS for Routing in TCP/IP and + Dual Environments. TLV 129. "; + } + } + + grouping isis-lsdb-subtlv-type-state { + description + "Per-subTLV type operational state parameters for ISIS."; + + leaf type { + type identityref { + base oc-isis-lsdb-types:ISIS_SUBTLV_TYPE; + } + description + "The type of subTLV being described. The type of subTLV is + expressed as a canonical name."; + } + } + + grouping isis-lsdb-tlv-type-state { + description + "Per-subTLV type operational state parameters for ISIS."; + + leaf type { + type identityref { + base oc-isis-lsdb-types:ISIS_TLV_TYPE; + } + description + "The type of TLV being described. The type of TLV is + expressed as a canonical name."; + } + } + + grouping is-reachability-neighbor-state { + description + "This grouping defines is-reachability neighbor."; + + container subtlvs { + description + "This container describes IS Neighbor sub-TLVs."; + + list subtlv { + key "type"; + + description + "List of subTLV types in the LSDB for the specified TLV."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the sub-TLV type."; + } + + container state { + description + "State parameters of IS neighbor state"; + + uses isis-lsdb-subtlv-type-state; + } + + container admin-group { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_ADMIN_GROUP'" { + description + "Only include the administrative group container when + the sub-TLV is type 3"; + } + description + "This container defines sub-TLV 3."; + + container state { + description + "State parameters of sub-TLV 3."; + + leaf-list admin-group { + type uint32; + description + "The administrative group sub-TLV contains a 4-octet + bit mask assigned by the network administrator. Each + set bit corresponds to one administrative group + assigned to the interface. By convention, the least + significant bit is referred to as group 0, and the + most significant bit is referred to as group 31."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + sub-TLV 3: TLV 22,23,141,222, 223."; + } + } + } + + container link-id { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_ID'" { + description + "Only include the link identifier container when the + sub-TLV is type 4"; + } + description + "This container defines sub-TLV 4."; + + container state { + description + "State parameters of sub-TLV 4."; + + leaf local { + type uint32; + description + "The value field of this sub-TLV contains 4 octets of + Link Local Identifier followed by 4 octets of Link + Remote Identifier."; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS). sub-TLV 3: TLV + 22,23,141,222, 223."; + } + + leaf remote { + type uint32; + description + "If the Link Remote Identifier is unknown, it is set + to 0."; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS). sub-TLV 3: TLV + 22,23,141,222, 223."; + } + } + } + + container ipv4-interface-address { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_IPV4_INTERFACE_ADDRESS'" { + description + "Only include the IPv4 interface address group container + when the sub-TLV is type 6"; + } + description + "This container defines sub-TLV 6."; + + container state { + description + "State parameters of sub-TLV 6."; + + leaf-list address { + type inet:ipv4-address; + description + "A 4-octet IPv4 address for the interface described by + the (main) TLV. This sub-TLV can occur multiple + times."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + sub-TLV 6: TLV 22,23,41,222,223."; + } + } + } + + container ipv4-neighbor-address { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_IPV4_NEIGHBOR_ADDRESS'" { + description + "Only include the IPv4 neighbor address container when + the sub-TLV is type 8."; + } + description + "This container defines sub-TLV 8."; + + container state { + description + "State parameters of sub-TLV 8."; + + leaf-list address { + type inet:ipv4-address; + description + "A single IPv4 address for a neighboring router on + this link. This sub-TLV can occur multiple times."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + sub-TLV 8: TLV 22,23, 141,222,223."; + } + } + } + + container max-link-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_MAX_LINK_BANDWIDTH'" { + description + "Only include the maximum link bandwidth container when + the sub-TLV is type 9."; + } + description + "This container defines sub-TLV 9."; + + container state { + description + "State parameters of sub-TLV 9."; + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The maximum bandwidth that can be used on this link + in this direction (from the system originating the LSP + to its neighbors). It is encoded in 32 bits in IEEE + floating point format. The units are bytes (not + bits!) per second."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + sub-TLV 9: TLV 22,23,141,222,223."; + } + } + } + + container max-reservable-link-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_MAX_RESERVABLE_BANDWIDTH'" { + description + "Only include the maximum reservable link bandwidth + container when the sub-TLV type is 10."; + } + description + "This container defines sub-TLV 10."; + + container state { + description + "State parameters of sub-TLV 10."; + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The maximum amount of bandwidth that can be reserved + in this direction on this link. Note that for + oversubscription purposes, this can be greater than + the bandwidth of the link. It is encoded in 32 bits + in IEEE floating point format. The units are bytes + (not bits!) per second."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + Sub-TLV 10: TLV 22,23,141,222,223."; + } + } + } + + container unreserved-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_UNRESERVED_BANDWIDTH'" { + description + "Only include the unreserved bandwidth container when + the sub-TLV type is 11."; + } + description + "This container defines unreserved-bandwidth. The units + are bytes per second."; + + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. sub- + TLV 11: TLV 22,23,141,222,223"; + + list setup-priority { + key "priority"; + + leaf priority { + type leafref { + path "../state/priority"; + } + description + "Reference to the setup priority to which the + unreserved bandwidth corresponds."; + } + + description + "Setup priority (0 through 7) for unreserved + bandwidth."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 11."; + + leaf priority { + type uint8 { + range "0..7"; + } + description + "Setup priority level of 0 through 7 to be used by + Unreserved Bandwidth sub-TLV 11."; + } + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The amount of bandwidth reservable in this + direction on this link. Note that for + oversubscription purposes, this can be greater than + the bandwidth of the link. It contains eight 32-bit + IEEE floating point numbers(one for each priority). + The units are bytes (not bits!) per second. The + values correspond to the bandwidth that can be + reserved with a setup priority of 0 through 7, + arranged in increasing order with priority 0 + occurring at the start of the sub-TLV, and priority + 7 at the end of the sub-TLV."; + } + } + } + } + + container ipv6-interface-address { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_IPV6_INTERFACE_ADDRESS'" { + description + "Only include the IPv6 interface address when the + sub-TLV type is 12."; + } + description + "This container defines sub-TLV 12."; + + container state { + description + "State parameters of sub-TLV 12."; + + leaf-list address { + type inet:ipv6-address; + description + "Contains a 16-octet IPv6 address for the interface + described by the containing Extended IS Reachability + TLV. This sub-TLV can occur multiple times."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS. sub-TLV + 12: TLV 22,23,141,222,223."; + } + } + } + + container ipv6-neighbor-address { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_IPV6_NEIGHBOR_ADDRESS'" { + description + "Only include the IPv6 neighbor address when the + sub-TLV type is 13."; + } + description + "This container defines sub-TLV 13."; + + container state { + description + "State parameters of sub-TLV 13."; + + leaf-list address { + type inet:ipv6-address; + description + "Contains a 16-octet IPv6 address for a neighboring + router on the link described by the (main) TLV. This + sub-TLV can occur multiple times."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS. sub-TLV + 13: ISIS TLV 22,23,141,222,223."; + } + } + } + + container extended-admin-group { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_EXTENDED_ADMIN_GROUP'" { + description + "Only include the extended admin group when the + sub-TLV type is 14."; + } + description + "This container defines sub-TLV 14."; + container state { + description + "State parameters of sub-TLV 14."; + + leaf-list extended-admin-group { + type uint32; + description + "The extended-admin-group sub-TLV is used in addition + to the Administrative Groups when it is desirable to + make more than 32 colors available for advertisement + in a network."; + reference + "RFC7308: Extended Administrative Groups in MPLS + Traffic Engineering (MPLS-TE). sub-TLV 14: TLV + 22,23,141,222,223."; + } + } + } + + container te-default-metric { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_TE_DEFAULT_METRIC'" { + description + "Only include the default traffic engineering metric + container when the sub-TLV type is 18."; + } + description + "This container defines sub-TLV 18."; + container state { + description + "State parameters of sub-TLV 18."; + + leaf metric { + type uint32; + description + "This metric is administratively assigned and can be + used to present a differently weighted topology to + traffic engineering SPF calculations. To preclude + overflow within a traffic engineering SPF + implementation, all metrics greater than or equal to + MAX_PATH_METRIC SHALL be considered to have a metric + of MAX_PATH_METRIC."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. + sub-TLV 18: TLV 22,23,141,222,223."; + } + } + } + + container link-attributes { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_ATTRIBUTES'" { + description + "Only include the link attributes container when the + sub-TLV is type 19."; + } + description + "This container defines link-attributes."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 19."; + + leaf-list local-protection { + type enumeration { + enum LOCAL_PROTECTION { + description + "If set, local protection is available for the + link."; + } + enum LINK_EXCLUDED { + description + "If set, the link is excluded from local + protection."; + } + } + description + "Link local-protection attributes."; + + reference + "RFC5029: Definition of an IS-IS Link Attribute Sub- + TLV. TLV 22, sub-TLV 19."; + } + } + } + + container link-protection-type { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_PROTECTION_TYPE'" { + description + "Only include the link protection type container when + the sub-TLV type 20."; + } + description + "ISIS LSDB parameters relating to the type of link + protection offered."; + + container state { + description + "State parameters of sub-TLV 20."; + + leaf-list type { + type enumeration { + enum EXTRA_TRAFFIC { + description + "If set the link has extra traffic protection. If + the link is of type Extra Traffic, it means that + the link is protecting another link or links. The + LSPs on a link of this type will be lost if any of + the links it is protecting fail."; + } + enum UNPROTECTED { + description + "If set, the link is unprotected. If the link is + of type Unprotected, it means that there is no + other link protecting this link. The LSPs on a + link of this type will be lost if the link + fails."; + } + enum SHARED { + description + "If set, the link has shared protection. If the + link is of type Shared, it means that there are + one or more disjoint links of type Extra Traffic + that are protecting this link. These Extra + Traffic links are shared between one or more links + of type Shared."; + } + enum ONE_ONE { + description + "If set, the link has dedicated 1:1 protection. If + the link is of type Dedicated 1:1, it means that + there is one dedicated disjoint link of type Extra + Traffic that is protecting this link."; + } + enum PLUS_ONE { + description + "If set, the link has dedicated 1+1 protection. If + the link is of type Dedicated 1+1, it means that a + dedicated disjoint link is protecting this link. + However, the protecting link is not advertised in + the link state database and is therefore not + available for the routing of LSPs."; + } + enum ENHANCED { + description + "If set the link has enhanced protection. If the + link is of type Enhanced, it means that a + protection scheme that is more reliable than + Dedicated 1+1, e.g., 4 fiber BLSR/MS-SPRING, is + being used to protect this link."; + } + } + description + "Link protection capabilities."; + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS). sub-TLV 20: + TLV 22,23,141,222,223."; + } + } + } + + container bandwidth-constraints { + when "../state/type =" + + "'oc-isis-lsdb-types:IS_REACHABILITY_BANDWIDTH_CONSTRAINTS'" { + description + "Only include the bandwidth constraints container when + the sub-TLV is type 22."; + } + description + "This container defines bandwidth-constraints. For DS-TE, + the existing Maximum Reservable link bandwidth parameter + is retained, but its semantics is generalized and + interpreted as the aggregate bandwidth constraint across + all Class-Types"; + + reference + "RFC4124: Protocol Extensions for Support of Diffserv- + aware MPLS Traffic Engineering. sub-TLV 22: TLV 22, 23, + 141, 222,223"; + + list bandwidth-constraint { + key "model-id"; + + description + "List of the Bandwidth Constraints sub-TLV instances + present in the TLV."; + + leaf model-id { + type leafref { + path "../state/model-id"; + } + description + "Reference to the model ID associated with the + instance of the Bandwidth Constraints sub-TLV."; + } + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 22."; + + leaf model-id { + type uint8; + description + "Identifier for the Bandwidth Constraints Model + currently in use by the LSR initiating the IGP + advertisement."; + } + } + + container constraints { + description + "Constraints contained within the Bandwidth + Constraints sub-TLV"; + + list constraint { + key "constraint-id"; + + description + "List of the constraints within the Bandwidth + Constraints sub-TLV. The BC0 level is indicated by + the constraint-id leaf being set to 0, with BCN + being indicated by constraint-id N."; + + leaf constraint-id { + type leafref { + path "../state/constraint-id"; + } + description + "Reference to the unique ID for the BCN level."; + } + + container state { + description + "Operational state parameters of the BCN level"; + + leaf constraint-id { + type uint32; + description + "Unique reference for the bandwidth constraint level. BC0 + is indicated by this leaf being set to zero, with BCN + represented by this leaf being set to N."; + } + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The bandwidth constraint, expressed as a 32-bit IEEE + floating point number expressed in bytes per second."; + } + } + } + } + } + } + + container unconstrained-lsp { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_UNCONSTRAINED_LSP'" { + description + "Only include the unconstrained LSP container when the + sub-TLV is type 23."; + } + description + "This container defines sub-TLV 23."; + container state { + description + "State parameters of sub-TLV 23."; + + uses isis-lsdb-subtlv-type-state; + + leaf count { + type uint16; + description + "Unconstrained TE LSP count(TE Label Switched Paths + (LSPs) signalled with zero bandwidth)."; + reference + "RFC5330: A Link-Type sub-TLV to Convey the Number of + Traffic Engineering Label Switched Paths Signalled + with Zero Reserved Bandwidth across a Link. sub-TLV + 23: TLV 22,23,141,222,223"; + } + } + } + + container adjacency-sids { + when "../state/type = 'oc-isis-lsdb-types:IS_REACHABILITY_ADJ_SID'" { + description + "Only include the adjacency SIDs container when the + sub-TLV type is 31"; + } + + description + "This container defines segment routing adjacency SIDs."; + + list adjacency-sid { + key "value"; + + description + "Adjacency Segment-IDs List. An IGP-Adjacency Segment is + an IGP segment attached to a unidirectional adjacency or + a set of unidirectional adjacencies. By default, an IGP- + Adjacency Segment is local to the node which advertises + it."; + + leaf value { + type leafref { + path "../state/value"; + } + description + "Reference to the value of the Adjacency-SID."; + } + + container state { + description + "State parameters of Adjacency-SID."; + + leaf value { + type uint32; + description + "Adjacency-SID value."; + } + + leaf-list flags { + type enumeration { + enum ADDRESS_FAMILY { + description + "Address-family flag. When unset, the Adj-SID + refers to an adjacency with outgoing IPv4 + encapsulation. If set then the Adj-SID refers to + an adjacency with outgoing IPv6 encapsulation."; + } + enum BACKUP { + description + "Backup flag. When set, the Adj-SID refers to an + adjacency being protected (e.g.: using IPFRR or + MPLS-FRR)."; + } + enum VALUE { + description + "Value flag. When set, the SID carries a value + (instead of an index). By default the flag is + SET."; + } + enum LOCAL { + description + "Local flag. When set, the value/index carried + by the SID has local significance. By default + the flag is SET."; + } + enum SET { + description + "Set flag. When set, the S-Flag indicates that + the Adj-SID refers to a set of adjacencies."; + } + } + description + "Flags associated with Adj-Segment-ID."; + } + + leaf weight { + type uint8; + description + "Value that represents the weight of the Adj-SID for + the purpose of load balancing."; + } + } + } + + reference + "draft-ietf-isis-segment-routing-extensions. sub-TLV 31: + TLV 22, 222, 223, 141. "; + } + + container lan-adjacency-sids { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_ADJ_LAN_SID'" { + description + "Only include the LAN adjacency SID container when + the sub-TLV is type 32."; + } + description + "This container defines segment routing LAN adjacency + SIDs"; + + list lan-adjacency-sid { + key "value"; + + description + "Adjacency Segment-IDs List. An IGP-Adjacency Segment is + an IGP segment attached to a unidirectional adjacency or + a set of unidirectional adjacencies. By default, an IGP- + Adjacency Segment is local to the node which advertises + it."; + + leaf value { + type leafref { + path "../state/value"; + } + description + "Reference to the value of the LAN Adjacency-SID."; + } + + container state { + description + "State parameters of LAN Adjacency-SID."; + + leaf value { + type uint32; + description + "LAN Adjacency-SID value."; + } + + leaf-list flags { + type enumeration { + enum ADDRESS_FAMILY { + description + "Address-family flag. When unset, the Adj-SID + refers to an adjacency with outgoing IPv4 + encapsulation. If set then the Adj-SID refers to + an adjacency with outgoing IPv6 encapsulation."; + } + enum BACKUP { + description + "Backup flag. When set, the Adj-SID refers to an + adjacency being protected (e.g.: using IPFRR or + MPLS-FRR)."; + } + enum VALUE { + description + "Value flag. When set, the SID carries a value + (instead of an index). By default the flag is + SET."; + } + enum LOCAL { + description + "Local flag. When set, the value/index carried + by the SID has local significance. By default + the flag is SET."; + } + enum SET { + description + "Set flag. When set, the S-Flag indicates that + the Adj-SID refers to a set of adjacencies."; + } + } + description + "Flags associated with LAN-Adj-Segment-ID."; + } + + leaf weight { + type uint8; + description + "Value that represents the weight of the Adj-SID + for the purpose of load balancing."; + } + + leaf neighbor-id { + type oc-isis-types:system-id; + description + "System ID of the neighbor associated with the LAN- + Adj-Segment-ID value."; + } + } + } + + reference + "draft-ietf-isis-segment-routing-extensions. sub-TLV 32: + TLV 22, 222, 223, 141."; + } + + container link-delay { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_DELAY'" { + description + "Include the link delay container only when the sub-TLV + type is type 33."; + } + description + "This container defines unidirectional link delay."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 33: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 33."; + + uses isis-lsdb-link-characteristics-a-bit; + + leaf delay { + type uint32; + units microseconds; + description + "Average link delay value (in microseconds) between + two directly connected IS-IS neighbors over a + configurable interval."; + } + } + } + + container min-max-link-delay { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_MIN_MAX_LINK_DELAY'" { + description + "Only include the min/max link delay container when the + sub-TLV is type 34."; + } + description + "This container defines min/max link delay."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 34: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 34."; + + uses isis-lsdb-link-characteristics-a-bit; + + leaf min-delay { + type uint32; + units microseconds; + description + "Minimum measured link delay value(in microseconds) + between two directly connected IS-IS neighbors over a + configurable interval."; + } + + leaf max-delay { + type uint32; + units microseconds; + description + "Maximum measured link delay value(in microseconds) + between two directly connected IS-IS neighbors over a + configurable interval."; + } + } + } + + container link-delay-variation { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_DELAY_VARIATION'" { + description + "Only include the link delay variation container when + the sub-TLV is type 35."; + } + description + "This container defines unidirectional link delay + variation."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 35: TLV 22,23,141,222,223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 35."; + + leaf delay { + type uint32; + units microseconds; + description + "Average link delay between two directly connected IS- + IS neighbors over a configurable interval."; + } + } + } + + container link-loss { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_LINK_LOSS'" { + description + "Only include the link loss container when the sub-TLV + is type 36."; + } + description + "This container defines unidirectional link loss delay."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 36: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 36."; + + uses isis-lsdb-link-characteristics-a-bit; + + leaf link-loss { + type uint32; + description + "Link packet loss as a percentage of the total traffic + sent over a configurable interval. The basic unit is + 0.000003%, where (2^24 - 2) is 50.331642%. This value + is the highest packet-loss percentage that can be + expressed (the assumption being that precision is more + important on high-speed links than the ability to + advertise loss rates greater than this, and that high- + speed links with over 50% loss are unusable). + Therefore, measured values that are larger than the + field maximum SHOULD be encoded as the maximum + value."; + } + } + } + + container residual-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_RESIDUAL_BANDWIDTH'" { + description + "Only include the resdiual bandwidth container when the + sub-TLV is type 37."; + } + description + "This container defines unidirectional residual + bandwidth."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 37: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 37."; + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "Residual bandwidth on a link,forwarding adjacency + [RFC4206], or bundled link in IEEE floating-point + format with units of bytes per second. For a link or + forwarding adjacency, residual bandwidth is defined to + be the Maximum Bandwidth [RFC5305] minus the bandwidth + currently allocated to RSVP-TE label switched paths. + For a bundled link, residual bandwidth is defined to + be the sum of the component link residual + bandwidths."; + } + } + } + + container available-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_AVAILABLE_BANDWIDTH'" { + description + "Only include the available bandwdith container when the + sub-TLV is type 38."; + } + description + "This container defines unidirectional lavailable + bandwidth."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 38: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 38."; + + uses isis-lsdb-subtlv-type-state; + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The available bandwidth on a link, forwarding + adjacency, or bundled link in IEEE floating-point + format with units of bytes per second. For a link or + forwarding adjacency, available bandwidth is defined + to be residual bandwidth minus the measured bandwidth + used for the actual forwarding of non-RSVP-TE label + switched path packets. For a bundled link, available + bandwidth is defined to be the sum of the component + link available bandwidths minus the measured bandwidth + used for the actual forwarding of non-RSVP-TE label + switched path packets. For a bundled link, available + bandwidth is defined to be the sum of the component + link available bandwidths."; + } + } + } + + container utilized-bandwidth { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_REACHABILITY_UTILIZED_BANDWIDTH'" { + description + "Only include the utilized bandwidth container when the + TLV is type 39."; + } + description + "This container defines unidirectional utilized + bandwidth."; + + reference + "RFC7810: IS-IS Traffic Engineering (TE) Metric + Extensions. sub-TLV 39: TLV 22, 23, 141, 222, 223."; + + container state { + description + "State parameters of IS Extended Reachability sub-TLV + 39."; + + uses isis-lsdb-subtlv-type-state; + + leaf bandwidth { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The bandwidth utilization on a link, forwarding + adjacency, or bundled link in IEEE floating-point + format with units of bytes per second. For a link or + forwarding adjacency, bandwidth utilization represents + the actual utilization of the link (i.e., as measured + by the advertising node). For a bundled link, + bandwidth utilization is defined to be the sum of the + component link bandwidth utilizations."; + } + } + } + } + } + + uses isis-lsdb-undefined-subtlv; + } + + grouping isis-lsdb-undefined-tlv { + description + "Grouping for unknown TLVs in the IS-IS LSDB"; + + container undefined-tlvs { + description + "Surrounding container for a list of unknown TLVs."; + + list undefined-tlv { + key "type"; + description + "List of TLVs that are not defined within the model, or are + not recognised by the system."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the undefined TLV's type"; + } + + container state { + description + "State parameters of the undefined TLV."; + + uses undefined-tlv-state; + } + } + } + } + + grouping isis-lsdb-undefined-subtlv { + description + "Grouping for unknown Sub-TLVs in the IS-IS LSDB."; + + container undefined-subtlvs { + description + "This container describes undefined ISIS TLVs."; + + list undefined-subtlv { + key "type"; + + description + "Sub-TLVs that are not defined in the model or not + recognised by system."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the type of the undefined sub-TLV"; + } + + container state { + description + "State parameters of the undefined sub-TLV."; + + uses undefined-subtlv-state; + } + } + } + } + + grouping isis-lsdb-prefix-state { + description + "This grouping defines prefix reachability."; + + container subtlvs { + description + "This container describes IS prefix sub-TLVs."; + + list subtlv { + key "type"; + + description + "List of subTLV types in the LSDB for the specified TLV."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the sub-TLV type"; + } + + container state { + description + "State parameters for a prefix."; + + uses isis-lsdb-subtlv-type-state; + } + + container tag { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_TAG'" { + description + "Only include the tag container when the sub-TLV is type + 1."; + } + description + "This container defines sub-TLV 1."; + + container state { + description + "State parameters of sub-TLV 1."; + + leaf-list tag32 { + type uint32; + description + "List of 32-bit tags associated with the prefix. Example + uses of these tags include carrying BGP standard (or + extended) communities and controlling redistribution + between levels and areas, different routing protocols, + or multiple instances of IS-IS running on the same + router."; + reference + "RFC5130: A Policy Control Mechanism in IS-IS Using + Administrative Tags. sub-TLV 1."; + } + } + } + + container tag64 { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_TAG64'" { + description + "Only include the tag64 container when the sub-TLV is type + 2."; + } + description + "This container defines sub-TLV 2."; + + container state { + description + "State parameters of sub-TLV 2."; + + leaf-list tag64 { + type uint64; + description + "List of 64-bit tags associated with the prefix. Example + uses of these tags include carrying BGP standard (or + extended) communities and controlling redistribution + between levels and areas, different routing protocols, + or multiple instances of IS-IS running on the same + router."; + reference + "RFC5130: A Policy Control Mechanism in IS-IS Using + Administrative Tags. sub-TLV 2."; + } + } + } + + container flags { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_PREFIX_FLAGS'" { + description + "Only include the flags container when the sub-TLV is type + 4."; + } + description + "This container defines sub-TLV 4."; + + container state { + description + "State parameters of sub-TLV 4."; + + uses isis-lsdb-subtlv-type-state; + + leaf-list flags { + type enumeration { + enum EXTERNAL_FLAG { + description + "External prefix flag. Set if the prefix has been + redistributed from another protocol. This includes + the case where multiple virtual routers are + supported and the source of the redistributed prefix + is another IS-IS instance."; + } + enum READVERTISEMENT_FLAG { + description + "Readvertisement flag. Set when the prefix has been + leaked from one level to another (upwards or + downwards)."; + } + enum NODE_FLAG { + description + "Node flag. Set when the prefix identifies the + advertising router, i.e., the prefix is a host + prefix advertising a globally reachable address + typically associated with a loopback address."; + } + } + description + "Additional prefix reachability flags."; + + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 and + IPv6 Reachability. sub-TLV 4."; + } + } + } + + container ipv4-source-router-id { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_IPV4_ROUTER_ID'" { + description + "Only include the IPv4 Source Router ID container when + the sub-TLV is type 11."; + } + description + "This container defines sub-TLV 11."; + + container state { + description + "State parameters of sub-TLV 11."; + + uses isis-lsdb-subtlv-type-state; + + leaf router-id { + type inet:ipv4-address; + description + "IPv4 Source router ID address. In cases where the + advertisement is an identifier for the advertising + router (e.g., with the N-flag set in the Prefix + Attribute Flags sub-TLV), it may be useful for other + routers to know the source of the advertisement. When + reachability advertisement is leaked from one level to + another, Router ID advertised is always the Router ID + of the IS-IS instance that originated the + advertisement. This would be true even if the prefix + had been learned from another protocol."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 + and IPv6 Reachability. sub-TLV 11"; + } + } + } + + container ipv6-source-router-id { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_IPV6_ROUTER_ID'" { + description + "Only include the IPv6 Source Router ID container when + the sub-TLV is type 12."; + } + description + "This container defines sub-TLV 12."; + + container state { + description + "State parameters of sub-TLV 12."; + + uses isis-lsdb-subtlv-type-state; + + leaf router-id { + type inet:ipv6-address; + description + "IPv6 Source router ID address. In cases where the + advertisement is an identifier for the advertising + router (e.g., with the N-flag set in the Prefix + Attribute Flags sub-TLV), it may be useful for other + routers to know the source of the advertisement. When + reachability advertisement is leaked from one level to + another, Router ID advertised is always the Router ID + of the IS-IS instance that originated the + advertisement. This would be true even if the prefix + had been learned from another protocol."; + reference + "RFC7794: IS-IS Prefix Attributes for Extended IPv4 + and IPv6 Reachability. sub-TLV 12."; + } + } + } + + uses isis-lsdb-prefix-sid-state; + } + } + + uses isis-lsdb-undefined-subtlv; + } + + grouping isis-lsdb-prefix-sid-state { + description + "This grouping defines ISIS Prefix SID."; + + container prefix-sids { + when "../state/type = " + + "'oc-isis-lsdb-types:IP_REACHABILITY_PREFIX_SID'" { + description + "Only include the Prefix SID container when + the sub-TLV is type 3."; + } + description + "This container defines segment routing extensions for + prefixes."; + + reference + "draft-ietf-isis-segment-routing-extensions. sub-TLV 3: TLV + 135, 235, 236, 237."; + + list prefix-sid { + key "value"; + + description + "Prefix Segment-ID list. IGP-Prefix Segment is an IGP segment + attached to an IGP prefix. An IGP-Prefix Segment is global + (unless explicitly advertised otherwise) within the SR/IGP + domain."; + + leaf value { + type leafref { + path "../state/value"; + } + description + "Reference to the value of the prefix SID."; + } + + container state { + description + "State parameters for Prefix-SID."; + + leaf value { + type uint32; + description + "IGP Prefix-SID value."; + } + + leaf-list flags { + type enumeration { + enum READVERTISEMENT { + description + "Readvertisment flag. When set, the prefix to which + this Prefix-SID is attached, has been propagated by + the router either from another level or from + redistribution."; + } + enum NODE { + description + "Node flag. When set, the Prefix-SID refers to the + router identified by the prefix. Typically, the + N-Flag is set on Prefix-SIDs attached to a router + loopback address."; + } + enum NO_PHP { + description + "Penultimate-Hop-Popping flag. When set, then the + penultimate hop MUST NOT pop the Prefix-SID before + delivering the packet to the node that advertised + the Prefix-SID."; + } + enum EXPLICIT_NULL { + description + "Explicit-Null flag. When set, any upstream neighbor + of the Prefix-SID originator MUST replace the + Prefix-SID with a Prefix-SID having an Explicit-NULL + value (0 for IPv4 and 2 for IPv6) before forwarding + the packet."; + } + enum VALUE { + description + "Value flag. When set, the Prefix-SID carries a + value (instead of an index). By default the flag is + UNSET."; + } + enum LOCAL { + description + "Local flag. When set, the value/index carried by + the Prefix-SID has local significance. By default + the flag is UNSET."; + } + } + description + "Flags associated with Prefix Segment-ID."; + } + + leaf algorithm { + type uint8; + description + "Prefix-SID algorithm to be used for path computation."; + } + } + } + } + } + + grouping isis-lsdb-common-metric-specification { + description + "Common definitions of the metric in IS-IS."; + + container default-metric { + description + "This container defines ISIS Default Metric."; + + container state { + description + "State parameters for default-metric."; + + leaf flags { + type enumeration { + enum INTERNAL { + description + "When set to zero, indicates internal metrics."; + } + } + description + "ISIS Default-Metric Flags."; + } + + leaf metric { + type oc-isis-types:narrow-metric; + description + "ISIS default metric value. This is a metric understood by + every Intermediate system in the domain. Each circuit + shall have a positive integral value assigned for this + metric. The value may be associated with any objective + function of the circuit, but by convention is intended to + measure the capacity of the circuit for handling traffic, + for example, its throughput in bits-per-second. Higher + values indicate a lower capacity."; + } + } + } + + container delay-metric { + description + "This container defines the ISIS delay metric."; + + container state { + description + "State parameters of delay-metric."; + + leaf metric { + type oc-isis-types:narrow-metric; + description + "ISIS delay metric value. This metric measures the transit + delay of the associated circuit. It is an optional metric, + which if assigned to a circuit shall have a positive + integral value. Higher values indicate a longer transit + delay."; + } + + leaf-list flags { + type isis-metric-flags; + description + "ISIS Delay Metric Flags."; + } + } + } + + container expense-metric { + description + "This container defines the ISIS expense metric."; + + container state { + description + "State parameters of expense-metric."; + + leaf metric { + type oc-isis-types:narrow-metric; + description + "ISIS expense metric value. This metric measures the + monetary cost of utilising the associated circuit. It is + an optional metric, which if assigned to a circuit shall + have a positive integral value1). Higher values indicate a + larger monetary expense."; + } + + leaf-list flags { + type isis-metric-flags; + description + "ISIS Expense Metric Flags."; + } + } + } + + container error-metric { + description + "This container defines the ISIS error metric."; + + container state { + description + "State parameters of error-metric."; + + leaf metric { + type oc-isis-types:narrow-metric; + description + "ISIS error metric value. This metric measures the + residual error probability of the associated circuit. It + is an optional metric, which if assigned to a circuit + shall have a non-zero value. Higher values indicate a + larger probability of undetected errors on the circuit."; + } + + leaf-list flags { + type isis-metric-flags; + description + "IS-IS error metric flags."; + } + } + } + } + + grouping isis-lsdb-neighbor { + description + "This grouping defines attributes of an ISIS standard + neighbor."; + + container state { + description + "State parameters of IS standard neighbor."; + + leaf system-id { + type oc-isis-types:system-id; + description + "System-ID of IS neighbor."; + } + } + + uses isis-lsdb-common-metric-specification; + + } + + grouping ipv4-prefix-attributes-state { + description + "This group defines attributes of an IPv4 standard prefix."; + + container state { + description + "State parameters of IPv4 standard prefix."; + + leaf up-down { + type boolean; + description + "The up/down bit. Set if a prefix is advertised from a + higher level to a lower level (e.g., level 2 to level 1), + indicating that the prefix has traveled down the hierarchy. + Prefixes that have the up/down bit set may only be + advertised down the hierarchy, i.e., to lower levels. When a + prefix is first injected into IS-IS, the bit is UNSET."; + } + + leaf prefix { + type inet:ipv4-prefix; + description + "IPv4 prefix contained within reachability TLVs."; + } + } + + uses isis-lsdb-common-metric-specification; + } + + grouping isis-lsdb-common-mt-id { + description + "Common definition of the multi-topology ID"; + + leaf mt-id { + type uint16 { + range "0..4095"; + } + description + "Multi-topology ID"; + } + } + + grouping ipv4-prefix-extended-state { + description + "This grouping defines attributes of an IPv4 extended prefix."; + + container state { + description + "State parameters of an IPv4 extended prefix."; + uses ipv4-prefix-extended-params-state; + } + + uses isis-lsdb-prefix-state; + } + + grouping ipv4-mt-prefix-extended-state { + description + "State parameters that relate to an IPv4 prefix in a + multi-topology context."; + + container state { + description + "State parameters of an IPv4 extended prefix."; + uses ipv4-prefix-extended-params-state; + uses isis-lsdb-common-mt-id; + } + + uses isis-lsdb-prefix-state; + } + + grouping ipv4-prefix-extended-params-state { + description + "State parameters that relate to an IPv4 prefix"; + + leaf up-down { + type boolean; + description + "The up/down bit. Set if a prefix is advertised from a + higher level to a lower level (e.g., level 2 to level 1), + indicating that the prefix has traveled down the hierarchy. + Prefixes that have the up/down bit set may only be + advertised down the hierarchy, i.e., to lower levels. When a + prefix is first injected into IS-IS, the bit is UNSET."; + } + + leaf s-bit { + type boolean; + description + "The Sub-TLV present bit. If UNSET, the octets of Sub-TLVs + are not present. Otherwise, the bit is set and the octet + following the prefix will contain the length of the Sub-TLV + portion of the structure."; + } + + leaf prefix { + type inet:ipv4-prefix; + description + "IPv4 prefix contained within extended reachability TLVs."; + } + + leaf metric { + type oc-isis-types:wide-metric; + description + "ISIS metric value."; + } + } + + grouping ipv6-prefix-extended-state { + description + "State parameters relating to an IPv6 prefix."; + + container state { + description + "State parameters of IPv6 prefix attributes"; + + uses ipv6-prefix-extended-params-state; + } + + uses isis-lsdb-prefix-state; + } + + grouping ipv6-mt-prefix-extended-state { + description + "State parameters relating to a multi-topology IPv6 + prefix."; + + container state { + description + "State parameters relating an IPv6 prefix attribute"; + uses ipv6-prefix-extended-params-state; + uses isis-lsdb-common-mt-id; + } + + uses isis-lsdb-prefix-state; + } + + grouping ipv6-prefix-extended-params-state { + description + "Common parameters of an IPv6 extended prefix."; + + leaf up-down { + type boolean; + description + "The up/down bit. Set if a prefix is advertised from a + higher level to a lower level (e.g., level 2 to level 1), + indicating that the prefix has traveled down the hierarchy. + Prefixes that have the up/down bit set may only be + advertised down the hierarchy, i.e., to lower levels. When a + prefix is first injected into IS-IS, the bit is UNSET."; + } + + leaf x-bit { + type boolean; + description + "The external bit. Set when the prefix was distributed into + IS-IS from another routing protocol."; + } + + leaf s-bit { + type boolean; + description + "The sub-tlv present bit. If UNSET, the octets of Sub-TLVs + are not present. Otherwise, the bit is set and the octet + following the prefix will contain the length of the Sub-TLV + portion of the structure."; + } + + leaf prefix { + type inet:ipv6-prefix; + description + "IPv6 prefix contained within extended reachability TLVs."; + } + + leaf metric { + type oc-isis-types:wide-metric; + description + "ISIS metric value."; + } + } + + grouping isis-lsdb-common-extisreach-neighbors { + description + "Common structure for the Extended IS Reachability and IS + Reachability Neighbour attributes."; + + container neighbors { + description + "This container describes IS neighbors."; + + list neighbor { + key "system-id"; + description + "This list describes ISIS extended neighbors and + reachability attributes."; + + leaf system-id { + type leafref { + path "../state/system-id"; + } + description + "Reference to the neighboring system's system ID."; + } + + container state { + description + "State parameters corresponding to the extended + neighbour."; + + leaf system-id { + type oc-isis-types:system-id; + description + "System-id of the neighbor."; + } + } + + container instances { + description + "This list contains all instances of an adjacency + between the originating IS and the remote IS. + Multiple instances are used where there are + parallel adjacencies between two systems."; + + list instance { + key "id"; + + description + "Instance of the TLV to the remote IS neighbor."; + + leaf id { + type leafref { + path "../state/id"; + } + description + "Reference to the unique identifier for + the instance of the extended IS + reachability sub-TLV."; + } + + container state { + description + "State parameters of extended neighbor"; + + leaf id { + type uint64; + description + "Unique identifier for the instance of the + TLV for the IS neighbor. The instance + ID is not required to be consistent across + across readvertisements of the LSP."; + } + + leaf metric { + type oc-isis-types:wide-metric; + description + "Metric value."; + } + } + uses is-reachability-neighbor-state; + } + } + } + } + } + + grouping isis-lsdb-mtis-common { + description + "Common grouping for structure used within the multi-topology IS + neighbour and multi-topology IS neighbour attribute TLVs."; + + container neighbors { + description + "MT-IS neigbor attributes."; + + list neighbor { + key "mt-id system-id"; + description + "This container describes IS neighbors."; + + leaf mt-id { + type leafref { + path "../state/mt-id"; + } + description + "Reference to the topology that the neighbor is + within."; + } + + leaf system-id { + type leafref { + path "../state/system-id"; + } + description + "Reference to the System ID of the neighbor."; + } + + container state { + description + "Operational state parameters related to the + MT ISN TLV."; + + uses mt-isis-neighbor-state; + } + + container instances { + description + "This list contains all instances of an adjacency + between the originating and remote IS. Multiple + instances are used to indicate where there are + parallel adjacencies between systems."; + + list instance { + key "id"; + + description + "Instance of TLV-222 between the originating + and remote IS."; + + leaf id { + type leafref { + path "../state/id"; + } + description + "Reference to the unique identifier for the + instance of the multi-topology IS neighbor + TLV instance."; + } + + uses mt-isis-neighbor-instance; + } + } + } + } + } + + grouping mt-isis-neighbor-state { + description + "This grouping defines state parameters that are related to + each neighbour entry for the MT ISN TLV."; + + leaf mt-id { + type uint16 { + range "0..4095"; + } + description + "Identifier of a topology being announced."; + } + + leaf system-id { + type oc-isis-types:system-id; + description + "System-id of the IS neighbor."; + } + } + + grouping mt-isis-neighbor-instance { + description + "This grouping defines list of ISIS multi-topology neighbors for + extended ISIS LSP (multiple system IDs)."; + + container state { + description + "State parameters of MT neighbor."; + + leaf metric { + type oc-isis-types:wide-metric; + description + "ISIS metric value."; + } + + leaf id { + type uint64; + description + "Unique identifier for the TLV instance for the + neighbor. The ID is not required to be consistent + across readvertisements of the LSP."; + } + } + uses is-reachability-neighbor-state; + } + + grouping isis-lsdb-generic-tlv { + description + "Generic TLV encoding grouping."; + + leaf type { + type uint8; + description + "TLV Type."; + } + + leaf length { + type uint8; + description + "TLV length."; + } + + leaf value { + type binary; + description + "TLV value."; + } + } + + grouping undefined-tlv-state { + description + "Generic grouping defining an unknown TLV."; + + uses isis-lsdb-generic-tlv; + } + + grouping undefined-subtlv-state { + description + "Generic grouping defining an unknown sub-TLV."; + + uses isis-lsdb-generic-tlv; + } + + grouping lsp-state { + description + "This grouping defines ISIS LSP state information."; + + leaf lsp-id { + type leafref { + path "../state/lsp-id"; + } + + description + "A reference to the Link State PDU ID."; + } + + container state { + description + "State parameters of Link State PDU."; + + leaf lsp-id { + type oc-isis-types:lsp-id; + description + "LSP ID of the LSP."; + } + + leaf maximum-area-addresses { + type uint8; + description + "Number of area addresses permitted for this ISs area. 0 + indicates the IS only supports three area addresses (by + default). Any number inclusive of 1 and 254 indicates the + number of areas allowed."; + } + + leaf version { + type uint8; + default 1; + description + "PDU version. This is set to 1."; + } + + leaf version2 { + type uint8; + default 1; + description + "PDU version2. This is set to 1"; + } + + leaf id-length { + type uint8; + description + "Length of the ID field of NSAP addresses and NETs used in + this routing domain."; + } + + leaf pdu-type { + type enumeration { + enum LEVEL_1 { + description "This enum describes ISIS level 1 PDU."; + } + enum LEVEL_2 { + description "This enum describes ISIS level 2 PDU."; + } + } + description + "Link State PDU type."; + } + + leaf remaining-lifetime { + type uint16; + units "seconds"; + description + "Remaining lifetime in seconds before the LSP expiration."; + } + + leaf sequence-number { + type uint32; + description + "Sequence number of the LSP."; + } + + leaf checksum { + type uint16; + description + "Checksum of the LSP."; + } + + leaf pdu-length { + type uint16; + description + "Total length of the LSP."; + } + + leaf-list flags { + type enumeration { + enum PARTITION_REPAIR { + description + "When set, the originator supports partition + repair."; + } + enum ATTACHED_ERROR { + description + "When set, the originator is attached to another + area using the referred metric."; + } + enum ATTACHED_EXPENSE { + description + "When set, the originator is attached to another + area using the referred metric."; + } + enum ATTACHED_DELAY { + description + "When set, the originator is attached to another + area using the referred metric."; + } + enum ATTACHED_DEFAULT { + description + "When set, the originator is attached to another + area using the referred metric."; + } + enum OVERLOAD { + description + "When set, the originator is overloaded, and must + be avoided in path calculation."; + } + } + description + "LSP Type-Block flags."; + } + + leaf is-type { + type oc-isis-types:level-number; + description + "Type of neighboring system."; + } + } + + container tlvs { + description + "This container defines Link State PDU State TLVs."; + + list tlv { + key "type"; + + description + "List of TLV types in the LSDB for the specified LSP."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the TLV's type."; + } + + container state { + config false; + description + "Operational state parameters relating to the specified + LSP"; + + uses isis-lsdb-tlv-type-state; + } + + container area-address { + when "../state/type = 'oc-isis-lsdb-types:AREA_ADDRESSES'" { + description + "Include area address parameters only when the TLV type + is TLV 1."; + } + + description + "This container defines TLV 1."; + + container state { + description + "State parameters of ISIS TLV 1."; + + leaf-list address { + type oc-isis-types:area-address; + description + "Area adress(es) of the IS. Set of manual area + addresses of this IS."; + reference + "ISO 10589 Intermediate System to Intermediate System + Intra- Domain Routeing Exchange Protocol for use in + Conjunction with the Protocol for Providing the + Connectionless-mode Network Service (ISO 8473 ) + International Standard 10589: 2002, Second Edition, + 2002. TLV 1."; + } + } + } + + container lsp-buffer-size { + when "../state/type = " + + "'oc-isis-lsdb-types:LSP_BUFFER_SIZE'" { + description + "Include the LSP buffer size parameters only when the + TLV type is TLV 14."; + } + + description + "This container defines TLV 14 - the LSP Buffer Size + TLV."; + + container state { + description + "State parameters of TLV 14."; + + leaf size { + type uint16; + units "bytes"; + description + "The maximum MTU that the advertising system can + receive, expressed in bytes."; + reference + "ISO 10589 Intermediate System to Intermediate System + Intra- Domain Routeing Exchange Protocol for use in + Conjunction with the Protocol for Providing the + Connectionless-mode Network Service (ISO 8473 ) + International Standard 10589: 2002, Second Edition, + 2002. TLV 14."; + } + } + } + + container nlpid { + when "../state/type = 'oc-isis-lsdb-types:NLPID'" { + description + "Include NLPID specification only when the TLV type is + TLV 129."; + } + + description + "This container defines TLV 129."; + + container state { + description + "State parameters of ISIS TLV 129."; + + uses isis-lsdb-tlv-nlpid-state; + } + } + + container hostname { + when "../state/type = 'oc-isis-lsdb-types:DYNAMIC_NAME'" { + description + "Include the dynamic hostname TLV only when the TLV is + type 137."; + } + description + "This container defines TLV 137."; + + container state { + description + "State parameters of ISIS TLV 137."; + + leaf-list hostname { + type string; + description + "Name of the node."; + + reference + "RFC6233: IS-IS Registry Extension for Purges, RFC + 5301: Dynamic Hostname Exchange Mechanism for IS-IS. + TLV 137"; + } + } + } + + container ipv4-interface-addresses { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV4_INTERFACE_ADDRESSES'" { + description + "Include the IPv4 interface addresses TLV only when the + TLV is type 132."; + } + description + "This container defines TLV 132."; + + container state { + description + "State parameters of ISIS TLV 132."; + + leaf-list address { + type inet:ipv4-address; + description + "IPv4 address(es) of the interface corresponding to + the SNPA over which this PDU is to be transmitted."; + reference + "RFC1195: Use of OSI IS-IS for Routing in TCP/IP and + Dual Environments. TLV 132."; + } + } + } + + container ipv6-interface-addresses { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV6_INTERFACE_ADDRESSES'" { + description + "Include the IPv6 interface addresses TLV only when the + TLV is type 232."; + } + description + "This container defines TLV 232."; + + container state { + description + "State parameters of ISIS TLV 232."; + + leaf-list address { + type inet:ipv6-address; + description + "IPv6 interface addresses of the node. MUST contain + only the non-link-local IPv6 addresses assigned to the + IS."; + reference + "RFC5308: Routing IPv6 with IS-IS. TLV 232."; + } + } + } + + container ipv4-te-router-id { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV4_TE_ROUTER_ID'" { + description + "Include the IPv4 traffic engineering router ID TLV only + when the TLV is type 134."; + } + description + "This container defines TLV 134."; + + container state { + description + "State parameters of ISIS TLV 134."; + + leaf-list router-id { + type inet:ipv4-address; + description + "IPv4 Traffic Engineering router ID of the node. For + traffic engineering, it guarantees that we have a + single stable address that can always be referenced in + a path that will be reachable from multiple hops away, + regardless of the state of the node's interfaces."; + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. TLV + 134."; + } + } + } + + container ipv6-te-router-id { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV6_TE_ROUTER_ID'" { + description + "Include the IPv6 traffic engineering router ID TLV only + when the TLV is type 140."; + } + description + "This container defines TLV 140."; + + container state { + description + "State parameters of ISIS TLV 140."; + + leaf-list router-id { + type inet:ipv6-address; + description + "IPv6 Traffic Engineering router ID of the node. For + traffic engineering, it guarantees that we have a + single stable address that can always be referenced in + a path that will be reachable from multiple hops away, + regardless of the state of the node's interfaces."; + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS. TLV + 140."; + } + } + } + + container instance-ids { + when "../state/type = 'oc-isis-lsdb-types:INSTANCE_ID'" { + description + "Include the ISIS Instance Identifier TLV only when the + TLV is type 7."; + } + description + "This container defines ISIS Instance Identifier TLV."; + reference "RFC6822: IS-IS Multi-Instance. TLV 7."; + + list instance-id { + key "instance-id"; + + description + "A list of instance IDs received within TLV 7 within an + IS-IS LSP. In the case that more than one instance of + TLV 7 is included in the LSP, the instance IDs specified + within the instances are concatenated within this + list."; + + leaf instance-id { + type leafref { + path "../state/instance-id"; + } + description + "Reference to the unique instance ID."; + } + container state { + description + "State parameters of ISIS TLV 7."; + + leaf instance-id { + type uint16; + description + "An Instance Identifier (IID) to uniquely identify + an IS-IS instance. When the IID = 0, the list of + supported ITIDs MUST NOT be present. An IID-TLV with + IID = 0 MUST NOT appear in an SNP or LSP. When the + TLV appears (with a non-zero IID) in an SNP or LSP, + exactly one ITID. MUST be present indicating the + topology with which the PDU is associated. If no + ITIDs or multiple ITIDs are present or the IID is + zero, then the PDU MUST be ignored."; + } + + leaf-list topology-id { + type uint16; + description + "Instance-Specific Topology Identifiers (ITIDs)."; + } + } + } + } + + container ipv4-srlgs { + when "../state/type = 'oc-isis-lsdb-types:IPV4_SRLG'" { + description + "Include the IPv4 SRLG TLV only when the TLV is type + 138."; + } + description + "This container defines ISIS SRLG TLV 138."; + + reference + "RFC5307: IS-IS Extensions in Support of Generalized + Multi-Protocol Label Switching (GMPLS). TLV 138."; + + list ipv4-srlg { + key "instance-number"; + + description + "Instance of the IPv4 SRLG TLV"; + + leaf instance-number { + type leafref { + path "../state/instance-number"; + } + description + "Reference to the instance number of TLV 138."; + } + + container state { + description + "State parameters of TLV 138."; + + leaf instance-number { + type uint32; + description + "An arbitrary unsigned 32-bit integer used to + disambiguate the instance of TLV 138. The instance + identifier is synthesised by the system + and may be renumbered for the same SRLG definition + in subsequent advertised LSPs if (and only if) the + entire list of SRLGs is replaced."; + } + + leaf system-id { + type oc-isis-types:system-id; + description + "Neighbor system ID."; + } + + leaf psn-number { + type uint8; + description + "Pseudonode number if the neighbor is on a LAN + interface."; + } + + leaf-list flags { + type enumeration { + enum NUMBERED { + description + "When set, the interface is numbered, whereas if + unset indicates that the interface is + unnumbered."; + } + } + description + "SRLG flags."; + } + + leaf ipv4-interface-address { + type inet:ipv4-address; + description + "IPv4 interface address."; + } + + leaf ipv4-neighbor-address { + type inet:ipv4-address; + description + "IPv4 neighbor address."; + } + + leaf-list srlg-value { + type uint32; + description + "List of SRLG values."; + } + } + } + } + + container ipv6-srlgs { + when "../state/type = 'oc-isis-lsdb-types:IPV6_SRLG'" { + description + "Include the IPv6 SRLG TLV only when the TLV is type + 139."; + } + description + "This container defines ISIS SRLG TLV."; + + reference + "RFC6119: IPv6 Traffic Engineering in IS-IS. TLV 139."; + + list ipv6-srlg { + key "instance-number"; + + description + "Instance of the IPv6 SRLG TLV."; + + leaf instance-number { + type leafref { + path "../state/instance-number"; + } + description + "Reference to the instance number of the IPv6 Shared + Risk Link Group (SRLG) TLV."; + } + + container state { + description + "State parameters of TLV 139."; + + leaf instance-number { + type uint32; + description + "An arbitrary unsigned 32-bit integer used to + disambiguate the instance of TLV 138. The instance + identifier is synthesised by the system + and may be renumbered for the same SRLG definition + in subsequent advertised LSPs if (and only if) the + entire list of SRLGs is replaced."; + } + + leaf system-id { + type oc-isis-types:system-id; + description + "Neighbor system ID."; + } + + leaf psn-number { + type uint8; + description + "Pseudonode number if the neighbor is on a LAN + interface."; + } + + leaf-list flags { + type enumeration { + enum NA { + description + "When set, the IPv6 neighbour address is + included, whereas if unset, it is omitted"; + } + } + description + "IPv6 SRLG flags."; + } + + leaf ipv6-interface-address { + type inet:ipv6-address; + description + "IPv6 interface address or Link Local Identifier."; + } + + leaf ipv6-neighbor-address { + type inet:ipv6-address; + description + "IPv6 neighbor address or Link Remote Identifier."; + } + + leaf-list srlg-value { + type uint32; + description + "SRLG values."; + } + } + } + } + + container purge-oi { + when "../state/type = 'oc-isis-lsdb-types:PURGE_OI'" { + description + "Only include the purge originator identitication TLV + when the TLV type is 13."; + } + description + "This container defines ISIS purge TLV."; + + reference + "RFC6232: Purge Originator Identification TLV for IS-IS. + TLV 13."; + + container state { + description + "State parameters of TLV 13."; + + leaf system-id-count { + type uint8; + description + "Number of system IDs carried in this TLV."; + } + + leaf source-system-id { + type oc-isis-types:system-id; + description + "System ID of the Intermediate System that inserted + this TLV."; + } + + leaf received-system-id { + type oc-isis-types:system-id; + description + "System ID of the Intermediate System from which the + purge was received."; + } + } + } + + container router-capabilities { + when "../state/type = " + + "'oc-isis-lsdb-types:ROUTER_CAPABILITY'" { + description + "Only include the router capability TLV when the TLV is + type 242."; + } + description + "This container defines router capabilities."; + + list capability { + key "instance-number"; + + description + "This list describes IS Router capabilities."; + + reference + "RFC4971: Intermediate System to Intermediate System + (IS-IS) Extensions for Advertising Router Information. + TLV 242."; + + leaf instance-number { + type leafref { + path "../state/instance-number"; + } + description + "Reference to the instance number of the router + capability TLV."; + } + + container state { + description + "State parameters of TLV 242."; + + leaf instance-number { + type uint32; + description + "A unique instance number for the instance of the + router capabilities TLV. The instance number should + be autogenerated by the producer of the data and may + be renumbered if the entire LSP contents are + replaced in subsequent advertisements."; + } + + leaf router-id { + type inet:ipv4-address; + description + "IPv4 router-id."; + } + + leaf-list flags { + type enumeration { + enum FLOOD { + description + "When the S bit is set(1), the IS - IS Router + CAPABILITY TLV MUST be flooded across the entire + routing domain. When the S bit is not set(0), + the TLV MUST NOT be leaked between levels . This + bit MUST NOT be altered during the TLV + leaking."; + } + enum DOWN { + description + "When the IS-IS Router CAPABILITY TLV is leaked + from level - 2 to level-1, the Down bit MUST be + set. Otherwise, this bit MUST be clear. IS - IS + Router capability TLVs with the Down bit set + MUST NOT be leaked from level - 1 to level-2. + This is to prevent TLV looping."; + } + } + description + "Router capability flags."; + } + } + + container subtlvs { + description + "This container describes router capability TLV + sub-TLVs"; + + list subtlv { + key "type"; + description + "List of subTLV types in the LSDB for the specified + TLV"; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the sub-TLV type"; + } + + container state { + description + "State parameters of IS Router Capabilities"; + + uses isis-lsdb-subtlv-type-state; + } + + container segment-routing-algorithms { + when "../state/type = " + + "'oc-isis-lsdb-types:ROUTER_CAPABILITY_SR_ALGORITHM'" { + description + "Only include segment routing algorithm when the + sub-TLV is type 19."; + } + description + "This container defines SR algorithm sub-TLV 19."; + + reference + "draft-ietf-isis-segment-routing-extensions. + TLV 242, sub-TLV 19"; + + container state { + description + "State parameters of sub-TLV 19 - Segment + Routing Algorithm."; + + leaf-list algorithm { + type enumeration { + enum SPF { + value 0; + description + "Shortest Path First (SPF) algorithm + based on link metric. This is the + well-known shortest path algorithm as + computed by the IS-IS Decision process. + Consistent with the deployed practice + for link-state protocols, algorithm 0 + permits any node to overwrite the SPF + path with a different path based on + local policy."; + } + enum STRICT_SPF { + value 1; + description + "Strict Shortest Path First (SPF) + algorithm based on link metric. The + algorithm is identical to algorithm 0 + but algorithm 1 requires that all nodes + along the path will honor the SPF + routing decision. Local policy MUST NOT + alter the forwarding decision computed + by algorithm 1 at the node claiming to + support algorithm 1."; + } + } + description + "The Segment Routing algorithm that is + described by the TLV."; + } + } + } + + container segment-routing-capability { + when "../state/type = " + + "'oc-isis-lsdb-types:ROUTER_CAPABILITY_SR_CAPABILITY'" { + description + "Only include the SR capability sub-TLV when + the sub-TLV type is 2."; + } + description + "This container defines SR Capability sub-TLV 2."; + + reference + "draft-ietf-isis-segment-routing-extensions. TLV + 242, sub-TLV 2."; + + container state { + description + "State parameters of IS SR Router Capability"; + + leaf-list flags { + type enumeration { + enum IPV4_MPLS { + description + "When set, the router is capable of + processing SR MPLS encapsulated IPv4 + packets on all interfaces."; + } + enum IPV6_MPLS { + description + "When set, the router is capable of + processing SR MPLS encapsulated IPv6 + packets on all interfaces."; + } + enum IPV6_SR { + description + "When set, the router is capable of + processing the IPv6 Segment Routing Header + on all interfaces."; + } + } + description + "Segment Routing Capability Flags."; + } + } + + container srgb-descriptors { + description + "SRGB Descriptors included within the SR + capability sub-TLV"; + + list srgb-descriptor { + key "range"; + description + "Descriptor entry within the SR capabilty + sub-TLV"; + + leaf range { + type leafref { + path "../state/range"; + } + description + "Reference to unique SRGB Descriptor."; + } + + container state { + description + "State parameters of the SR range"; + + leaf range { + type uint32; + description + "Number of SRGB elements. The range + value MUST be greater than 0."; + } + + leaf label { + type oc-mplst:mpls-label; + description + "The first value of the SRGB when + expressed as an MPLS label."; + } + } + } + } + } + } + } + uses isis-lsdb-undefined-subtlv; + } + } + + container is-reachability { + when "../state/type = 'oc-isis-lsdb-types:IIS_NEIGHBORS'" { + description + "Include IIS_NEIGHBORS sub-TLV when the TLV type is 2."; + } + description + "This container describes list of ISIS neighbors and + attributes."; + + reference + "ISO 10589, Intermediate System to Intermediate System + Intra- Domain Routeing Exchange Protocol for use in + Conjunction with the Protocol for Providing the + Connectionless-mode Network Service (ISO 8473), + International Standard 10589: 2002, Second Edition, + 2002. TLV 2."; + + container neighbors { + description + "This container describes IS neighbors."; + + list neighbor { + key "system-id"; + description + "IS reachability neighbor attributes."; + + leaf system-id { + type leafref { + path "../state/system-id"; + } + description + "Reference to the system ID of the neighbor."; + } + + uses isis-lsdb-neighbor; + } + } + } + + container ipv4-internal-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV4_INTERNAL_REACHABILITY'" { + description + "Include IPv4 internal reachability TLV when the TLV + type is specified as 128."; + } + description + "This container defines list of IPv4 internal reachability + information."; + + reference + "RFC1195: OSI ISIS for IP and Dual Environments. RFC5302: + Domain-Wide Prefix Distribution with Two-Level IS-IS. TLV + 128"; + + container prefixes { + description + "This container describes IS prefixes."; + + list prefix { + key "prefix"; + + description + "IPv4 prefixes and internal reachability attributes."; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the IPv4 prefix"; + } + + uses ipv4-prefix-attributes-state; + } + } + } + + container ipv4-external-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV4_EXTERNAL_REACHABILITY'" { + description + "Include IPv4 external reachability when the TLV type + is set to 130."; + } + description + "This container defines list of IPv4 external reachability + information."; + + reference + "RFC1195: OSI ISIS for IP and Dual Environments. RFC5302: + Domain-Wide Prefix Distribution with Two-Level IS-IS. TLV + 130"; + + container prefixes { + description + "This container describes IS neighbors."; + + list prefix { + key "prefix"; + + description + "IPv4 external prefixes and reachability attributes."; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the IPv4 prefix."; + } + + uses ipv4-prefix-attributes-state; + } + } + } + + container authentication { + when "../state/type = 'oc-isis-lsdb-types:AUTHENTICATION'" { + description + "Only include the authentication TLV when the TLV is + type 10."; + } + description + "This container defines authentication information of the + node."; + + reference + "ISO 10589 Intermediate System to Intermediate System + Intra- Domain Routeing Exchange Protocol for use in + Conjunction with the Protocol for Providing the + Connectionless-mode Network Service (ISO 8473) + International Standard 10589: 2002, Second Edition, 2002. + TLV 10."; + + container state { + description + "State parameters of TLV 10."; + + leaf crypto-type { + type enumeration { + enum HMAC_MD5 { + description + "HMAC-MD5 Authentication type."; + } + enum CLEARTEXT { + description + "Cleartext Authentication type."; + } + } + description + "Authentication type to be used."; + } + + leaf authentication-key { + type string; + description + "Authentication key to be used."; + } + } + } + + container extended-is-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:EXTENDED_IS_REACHABILITY'" { + description + "Only included the extended IS reachability TLV when the + TLV is type 22."; + } + + description + "This container defines list of ISIS extended reachability + neighbors."; + + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. TLV + 22."; + + uses isis-lsdb-common-extisreach-neighbors; + } + + container extended-ipv4-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:EXTENDED_IPV4_REACHABILITY'" { + description + "Only include the extended IPv4 reachability container + when the TLV type is 135."; + } + description + "This container defines list of IPv4 extended reachability + information."; + + reference + "RFC5305: IS-IS Extensions for Traffic Engineering. TLV + 135"; + + container prefixes { + description + "This container describes IS prefixes."; + + list prefix { + key "prefix"; + + description + "This list describes IPv4 extended prefixes and + attributes."; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the IPv4 prefix that the TLV describes + the attributes of."; + } + + uses ipv4-prefix-extended-state; + } + } + } + + container ipv6-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:IPV6_REACHABILITY'" { + description + "Only include the IPv6 reachability container when the + TLV type is 236."; + } + description + "This container defines list of IPv6 reachability + information."; + + reference + "RFC5308: Routing IPv6 with IS-IS. TLV 236"; + + container prefixes { + description + "This container describes IS prefixes."; + + list prefix { + key "prefix"; + + description + "This list defines IPv6 extended prefix attributes."; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the IPv6 prefix that the TLV + corresponds to."; + } + + uses ipv6-prefix-extended-state; + } + } + } + + container multi-topology { + when "../state/type = 'oc-isis-lsdb-types:MULTI_TOPOLOGY'" { + description + "Only include the multi-topology container when the TLV + is type 229."; + } + + description + "This container defines the topology supported."; + + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in + Intermediate System to Intermediate Systems (IS-ISs). TLV + 229"; + + container topologies { + description + "This container describes IS topologies."; + + list topology { + key "mt-id"; + + description + "This list describes a topology."; + + leaf mt-id { + type leafref { + path "../state/mt-id"; + } + description + "Reference to the multi-topology ID being described + by the list entry."; + } + + container state { + description + "State parameters of IS multi-topology TLV 229."; + + leaf mt-id { + type uint16 { + range "0 .. 4095"; + } + description + "Multi-topology ID."; + } + + leaf attributes { + type enumeration { + enum OVERLOAD { + description + "When set, node is overloaded, still part of + the topology but cannot be used for transit."; + } + enum ATTACHED { + description + "When set, node is attached to another area + using the referred metric and can be used as + default gateway."; + } + } + description + "Attributes of the LSP for the associated + topology."; + } + } + } + } + } + + container isis-neighbor-attribute { + when "../state/type = " + + "'oc-isis-lsdb-types:IS_NEIGHBOR_ATTRIBUTE'" { + description + "Only include the neighbor attribute container when the + TLV is type 23."; + } + description + "This container defines list of ISIS topology neighbors + for extended ISIS LSP (multiple system IDs). "; + + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) + Space for IS-IS. TLV 23. It is identical in format to the + extended IS reachability TLV 22."; + + uses isis-lsdb-common-extisreach-neighbors; + } + + container is-alias-id { + when "../state/type = 'oc-isis-lsdb-types:ISIS_ALIAS_ID'" { + description + "Only include the ISIS alias ID container when the TLV + is type 24."; + } + + description + "This container defines the IS-Alias TLV which allows + extension-capable ISs to recognize the Originating System + of an Extended LSP set. It identifies the Normal system- + id of the Originating System."; + + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) + Space for IS-IS TLV 24."; + + container state { + config false; + description + "State parameters of alias ID."; + + leaf alias-id { + type oc-isis-types:system-id; + description + "List of alias ID(s)."; + } + } + } + + container mt-isn { + when "../state/type = 'oc-isis-lsdb-types:MT_ISN'" { + description + "Only include the MT ISN container when the TLV is type + 222."; + } + description + "This container defines list of ISIS multi-topology + neighbors."; + + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in + Intermediate System to Intermediate Systems (IS-ISs). TLV + 222."; + + uses isis-lsdb-mtis-common; + } + + container mt-isis-neighbor-attribute { + when "../state/type = " + + "'oc-isis-lsdb-types:MT_IS_NEIGHBOR_ATTRIBUTE'" { + description + "Only include the MT ISIS neighbor attribute container + when the TLV is type 223."; + } + + description + "This container defines list of ISIS multi-topology + neighbors."; + + reference + "RFC5311: Simplified Extension of Link State PDU (LSP) + Space for IS-IS. TLV 223. It is identical in format to the + MT-ISN TLV 222."; + + uses isis-lsdb-mtis-common; + } + + container mt-ipv4-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:MT_IPV4_REACHABILITY'" { + description + "Only include the multi-topology IPv4 reachability + container when the TLV is type 235."; + } + description + "This container defines list of IPv4 reachability + Information in multi-topology environment."; + + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in + Intermediate System to Intermediate Systems (IS-ISs). TLV + 235."; + + container prefixes { + description + "This container describes IS prefixes."; + + list prefix { + key "mt-id prefix"; + + leaf mt-id { + type leafref { + path "../state/mt-id"; + } + description + "Reference to the topology ID of the topology that + the prefix is within."; + } + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the prefix to which reachability is + being advertised."; + } + + description + "IPv4 prefixes that are contained within MT + reachability TLV."; + + uses ipv4-mt-prefix-extended-state; + } + } + } + + container mt-ipv6-reachability { + when "../state/type = " + + "'oc-isis-lsdb-types:MT_IPV6_REACHABILITY'" { + description + "Only include the multi-topology IPv6 reachability + container when the TLV is type 237."; + } + description + "This container defines list of IPv6 reachability + information in multi - topology environment."; + + reference + "RFC5120: M-ISIS: Multi Topology (MT) Routing in + Intermediate System to Intermediate Systems (IS-ISs). TLV + 237."; + + container prefixes { + description + "This container describes IS prefixes."; + + list prefix { + key "prefix mt-id"; + description + "List of IPv6 prefixes contained within MT + reachability TLV."; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the IPv6 prefix described by the + TLV."; + } + + leaf mt-id { + type leafref { + path "../state/mt-id"; + } + description + "Reference to the multi-topology ID."; + } + + uses ipv6-mt-prefix-extended-state; + } + } + } + } + } + + uses isis-lsdb-undefined-tlv; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis-policy@2020-02-04.yang b/exp/yangcli/h3c-yang/openconfig-isis-policy@2020-02-04.yang new file mode 100644 index 0000000..c9ef83a --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis-policy@2020-02-04.yang @@ -0,0 +1,212 @@ +module openconfig-isis-policy { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/openconfig-isis-policy"; + + prefix "oc-isis-pol"; + + // import some basic types + import openconfig-routing-policy {prefix rpol; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-isis-types { prefix isis-types; } + + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net "; + + description + "This module contains data definitions for ISIS routing policy. + It augments the base routing-policy module with BGP-specific + options for conditions and actions."; + + oc-ext:openconfig-version "0.5.0"; + + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "0.5.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + // grouping statements + + grouping isis-match-conditions { + description + "Criteria used to match IS-IS routes within the policy"; + + container isis-conditions { + description + "Match conditions relating to the IS-IS protocol"; + + container config { + description + "Configuration parameters relating to IS-IS match + conditions"; + + uses isis-match-conditions-config; + } + + container state { + config false; + description + "Operational state parameters relating to IS-IS match + conditions"; + uses isis-match-conditions-config; + } + } + } + + grouping isis-match-conditions-config { + description + "Match conditions for IS-IS"; + + leaf level-eq { + type isis-types:level-number; + description + "Match the level that the IS-IS prefix is within. This can + be used in the case that import or export policies refer + to an IS-IS instance that has multiple levels configured + within it"; + } + } + + grouping isis-actions { + description + "Actions supplied by the IS-IS protocol to be set on a + route within the policy"; + + container isis-actions { + description + "Actions that can be performed by IS-IS within a policy"; + + container config { + description + "Configuration parameters relating to IS-IS actions"; + + uses isis-actions-config; + } + + container state { + config false; + description + "Operational state associated with IS-IS actions"; + + uses isis-actions-config; + } + } + } + + grouping isis-actions-config { + description + "Actions for IS-IS"; + + leaf set-level { + type isis-types:level-number; + description + "Set the level that a prefix is to be imported into."; + } + + leaf set-metric-type { + type isis-types:level-number; + description + "Set the type of metric that is to be specified when the + set metric leaf is specified"; + } + + leaf set-metric { + type isis-types:wide-metric; + description + "Set the metric of the IS-IS prefix"; + } + } + + // augment statements + augment "/rpol:routing-policy/rpol:policy-definitions/" + + "rpol:policy-definition/rpol:statements/rpol:statement/" + + "rpol:actions" { + description "This augments igp-actions with ISIS conditions"; + uses isis-actions; + + } + + augment "/rpol:routing-policy/rpol:policy-definitions/" + + "rpol:policy-definition/rpol:statements/rpol:statement/" + + "rpol:conditions" { + description "This augments igp-conditions with ISIS conditions"; + uses isis-match-conditions; + } + + // rpc statements + + // notification statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis-routing@2020-03-24.yang b/exp/yangcli/h3c-yang/openconfig-isis-routing@2020-03-24.yang new file mode 100644 index 0000000..aab25d9 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis-routing@2020-03-24.yang @@ -0,0 +1,408 @@ +submodule openconfig-isis-routing { + + belongs-to openconfig-isis { + prefix "oc-isis"; + } + + // import some basic types + import openconfig-isis-types { prefix oc-isis-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-mpls-types { prefix oc-mplst; } + import openconfig-segment-routing { prefix oc-sr; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module describes YANG model for ISIS Routing"; + + oc-ext:openconfig-version "0.6.0"; + + revision "2020-03-24" { + description + "Support IGP-LDP sync per interface."; + reference "0.6.0"; + } + + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "0.5.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + // grouping statements + + grouping rt-admin-config { + description + "Re-usable grouping to enable or disable a particular IS-IS feature."; + + leaf enabled { + type boolean; + description + "When set to true, the functionality within which this leaf is + defined is enabled, when set to false it is explicitly disabled."; + } + } + + grouping isis-afi-safi-config { + description + "This grouping defines Address-Family configuration parameters"; + + leaf afi-name { + type identityref { + base oc-isis-types:AFI_TYPE; + } + description + "Address-family type."; + } + + leaf safi-name { + type identityref { + base oc-isis-types:SAFI_TYPE; + } + description + "Subsequent address-family type."; + } + } + + grouping isis-shortcuts-afi-config { + description + "This grouping defines ISIS Shortcuts configuration parameters"; + + leaf afi-name { + type identityref { + base oc-isis-types:AFI_TYPE; + } + description "Address-family type."; + } + + leaf-list nh-type { + type identityref { + base oc-mplst:PATH_SETUP_PROTOCOL; + } + description "Tunnel NH Type(RSVP,SR). When present it implies + that nh-type shortcut is enabled for a specified AFI."; + } + } + + grouping isis-shortcuts-config { + description + "This grouping defines ISIS Shortcuts consfiguration parameters"; + + container config { + description "This container defines ISIS shortcuts configuration."; + uses rt-admin-config; + } + + container state { + config false; + description "This container defines state for ISIS shortcuts."; + uses rt-admin-config; + } + } + + grouping isis-mt-config { + description + "This grouping defines ISIS multi-topology configuration parameters"; + + leaf afi-name { + type identityref { + base oc-isis-types:AFI_TYPE; + } + description + "Address-family type."; + } + leaf safi-name { + type identityref { + base oc-isis-types:SAFI_TYPE; + } + description + "Subsequent address-family type."; + } + //prefer single topology + } + + + + // *********** STRUCTURE GROUPINGS ********************** + + grouping isis-metric-config { + description + "This grouping defines ISIS metric configuration"; + + leaf metric { + type uint32; + default 10; + description "ISIS metric value(default=10)."; + } + } + + grouping isis-afi-safi-list { + description + "This grouping defines address-family configuration and state + information"; + + list af { + key "afi-name safi-name"; + + description + "Address-family/Subsequent Address-family list."; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Reference to address-family type"; + } + + leaf safi-name { + type leafref { + path "../config/safi-name"; + } + description + "Reference to subsequent address-family type"; + } + + container config { + description + "This container defines AFI-SAFI configuration parameters"; + + uses isis-afi-safi-config; + uses isis-metric-config; + uses rt-admin-config; + } + + container state { + config false; + description + "This container defines AFI-SAFI State information"; + + uses isis-afi-safi-config; + uses isis-metric-config; + uses rt-admin-config; + } + + uses isis-mt-list; + } + } + + grouping isis-if-afi-safi-list { + description + "This grouping defines address-family configuration and state + information"; + + list af { + key "afi-name safi-name"; + + description + "Address-family/Subsequent Address-family list."; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Reference to address-family type"; + } + + leaf safi-name { + type leafref { + path "../config/safi-name"; + } + description + "Reference to subsequent address-family type"; + } + + container config { + description + "This container defines AFI-SAFI configuration parameters. Single + topology is the default setting."; + uses isis-afi-safi-config; + uses isis-metric-config; + uses rt-admin-config; + } + + container state { + config false; + description + "This container defines AFI-SAFI State information"; + uses isis-afi-safi-config; + uses isis-metric-config; + uses rt-admin-config; + } + + uses oc-sr:sr-igp-interface-top; + } + } + + grouping isis-if-global-afi-safi-list { + description + "This grouping defines address-family configuration and state + information"; + + list af { + key "afi-name safi-name"; + + description + "Address-family/Subsequent Address-family list."; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Reference to address-family type"; + } + + leaf safi-name { + type leafref { + path "../config/safi-name"; + } + description + "Reference to subsequent address-family type"; + } + + container config { + description + "This container defines AFI-SAFI configuration parameters. Single + topology is the default setting."; + uses isis-afi-safi-config; + uses rt-admin-config; + } + + container state { + config false; + description + "This container defines AFI-SAFI State information"; + uses isis-afi-safi-config; + uses rt-admin-config; + } + } + } + + grouping isis-shortcuts-afi-list { + description + "This grouping defines ISIS Shorcuts configuration and + state information"; + + list afi { + key "afi-name"; + + description + "Address-family list."; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Reference to address-family type."; + } + + container config { + description + "This container defines ISIS Shortcuts configuration parameters"; + uses isis-shortcuts-afi-config; + } + + container state { + config false; + description + "This container defines ISIS Shortcuts state information"; + uses isis-shortcuts-afi-config; + } + } + } + + grouping isis-mt-list { + description + "This grouping defines multi-topology address-family configuration and + state information. MT0 - IPv4 Unicast, MT2 - IPv6 Unicast, MT3 - + IPv4 Multicast, MT4 - IPv6 Multicast"; + + container multi-topology { + description + "This container defines multi-topology address-family configuration + and state information. ISIS TLV 235, 237."; + + container config { + description + "This container defines AFI-SAFI multi-topology configuration + parameters"; + uses isis-mt-config; + } + + container state { + config false; + description + "This container defines AFI-SAFI multi-topology state information"; + uses isis-mt-config; + uses rt-admin-config; + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-isis-types@2018-11-21.yang new file mode 100644 index 0000000..a35caf4 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis-types@2018-11-21.yang @@ -0,0 +1,356 @@ +module openconfig-isis-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/isis-types"; + + prefix "oc-isis-types"; + + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains general data definitions for use in ISIS YANG + model."; + + oc-ext:openconfig-version "0.4.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + identity OVERLOAD_RESET_TRIGGER_TYPE { + description + "Base identify type for triggers that reset Overload Bit"; + } + + identity WAIT_FOR_BGP { + base OVERLOAD_RESET_TRIGGER_TYPE; + description + "Base identity type for resetting Overload Bit when BGP has converged. "; + } + + identity WAIT_FOR_SYSTEM { + base OVERLOAD_RESET_TRIGGER_TYPE; + description + "Base identity type for resetting Overload Bit when system resources have + been restored. "; + } + + identity MT_TYPE { + description + "Base identify type for multi-topology"; + } + + identity SAFI_TYPE { + description + "Base identify type for SAFI"; + } + + identity AFI_TYPE { + description + "Base identify type for AFI"; + } + + identity AFI_SAFI_TYPE { + description + "Base identify type for AFI/SAFI"; + } + + identity IPV4_UNICAST { + base AFI_SAFI_TYPE; + description + "Base identify type for IPv4 Unicast address family"; + } + + identity IPV6_MULTICAST { + base AFI_SAFI_TYPE; + description + "Base identify type for IPv6 multicast address family"; + } + + identity IPV4_MULTICAST { + base AFI_SAFI_TYPE; + description + "Base identify type for IPv4 multicast address family"; + } + + identity IPV6_UNICAST { + base AFI_SAFI_TYPE; + description + "Base identify type for IPv6 unicast address family"; + } + + identity UNICAST { + base SAFI_TYPE; + description + "Base identify type for IPv4 Unicast address family"; + } + + identity MULTICAST { + base SAFI_TYPE; + description + "Base identify type for IPv6 multicast address family"; + } + + identity IPV4 { + base AFI_TYPE; + description + "Base identify type for IPv4 address family"; + } + + identity IPV6 { + base AFI_TYPE; + description + "Base identify type for IPv6 address family"; + } + + // typedef statements + typedef level-type { + type enumeration { + enum LEVEL_1 { + description "This enum describes ISIS level 1"; + } + enum LEVEL_2 { + description "This enum describes ISIS level 2"; + } + enum LEVEL_1_2 { + description "This enum describes ISIS level 1-2"; + } + } + description + "This type defines ISIS level types"; + } + + typedef level-number { + type uint8 { + range "1..2"; + } + description + "This type defines ISIS level."; + } + + typedef adaptive-timer-type { + type enumeration { + enum LINEAR { + description "This enum describes linear algorithm timer"; + } + enum EXPONENTIAL { + description "This enum describes exponential algorithm timer"; + } + } + description + "This type defines ISIS adaptive timer types"; + } + + typedef hello-padding-type { + type enumeration { + enum STRICT { + description "This enum describes strict padding"; + } + enum LOOSE { + description "This enum describes loose padding"; + } + enum ADAPTIVE { + description "This enum describes adaptive padding"; + } + enum DISABLE { + description "This enum disables padding"; + } + } + description + "This type defines ISIS hello padding type"; + } + + typedef circuit-type { + type enumeration { + enum POINT_TO_POINT { + description "This enum describes a point-to-point interface"; + } + enum BROADCAST { + description "This enum describes a broadcast interface"; + } + } + description + "This type defines ISIS interface types "; + } + + typedef metric-type { + type enumeration { + enum INTERNAL { + description "This enum describes internal route type"; + } + enum EXTERNAL { + description "This enum describes external route type"; + } + } + description + "This type defines ISIS metric type"; + } + + typedef wide-metric { + type uint32 { + range "1..16777215"; + } + description + "This type defines ISIS wide metric."; + } + + typedef narrow-metric { + type uint8 { + range "1..63"; + } + description + "This type defines ISIS narrow metric."; + } + + typedef metric-style { + type enumeration { + enum NARROW_METRIC { + description + "This enum describes narrow metric style"; + reference "RFC1195"; + } + enum WIDE_METRIC { + description + "This enum describes wide metric style"; + reference "RFC5305"; + } + } + description + "This type defines ISIS metric styles"; + } + + typedef isis-interface-adj-state { + type enumeration { + enum UP { + description + "This state describes that adjacency is established."; + } + enum DOWN { + description + "This state describes that adjacency is NOT established."; + } + enum INIT { + description + "This state describes that adjacency is establishing."; + } + enum FAILED { + description + "This state describes that adjacency is failed."; + } + } + description + "This type defines the state of the interface."; + } + + typedef net { + type string { + pattern '^[a-fA-F0-9]{2}(\.[a-fA-F0-9]{4}){3,9}\.[a-fA-F0-9]{2}$'; + } + description + "This type defines OSI NET address. A NET should should be in + the form xx.yyyy.yyyy.yyyy.00 with up to 9 sets of yyyy."; + } + + typedef area-address { + type string { + pattern '^[0-9A-Fa-f]{2}\.([0-9A-Fa-f]{4}\.){0,3}$'; + } + description + "This type defines the ISIS area address."; + } + + typedef system-id { + type string { + pattern '^[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}$'; + } + description + "This type defines ISIS system id using pattern, system id looks + like : 0143.0438.AeF0"; + } + + typedef extended-circuit-id { + type uint32; + description + "This type defines interface circuit ID."; + } + + typedef lsp-id { + type string { + pattern + '^[0-9A-Fa-f]{4}\.[0-9A-Fa-f]{4}\.[0-9A-Fa-f]' + + '{4}\.[0-9][0-9]-[0-9][0-9]$'; + } + description + "This type defines ISIS LSP ID. ISIS LSP ID type should be in + the form of xxxx.xxxx.xxxx.xx-xx"; + } + typedef snpa { + type string { + length "0 .. 20"; + } + description + "This type defines Subnetwork Point of Attachment format."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-isis@2020-03-24.yang b/exp/yangcli/h3c-yang/openconfig-isis@2020-03-24.yang new file mode 100644 index 0000000..51a42cf --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-isis@2020-03-24.yang @@ -0,0 +1,2096 @@ +module openconfig-isis { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/openconfig-isis"; + + prefix "oc-isis"; + + // import some basic types + import ietf-inet-types { prefix "inet"; } + import ietf-yang-types { prefix "yang"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-isis-types { prefix "oc-isis-types"; } + import openconfig-routing-policy { prefix "oc-rpol"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-interfaces { prefix "oc-if"; } + import openconfig-segment-routing { prefix "oc-sr"; } + // TODO(robjs): Import authentication and keychain following merge of these + // modules. + //import openconfig-authentication-types { prefix "oc-auth-types"; } + //import openconfig-keychain { prefix "oc-keychain"; } + + // Include submodules: + // IS-IS LSP is the LSDB for IS-IS. + include openconfig-isis-lsp; + // IS-IS RT is routing-related features for IS-IS + include openconfig-isis-routing; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net "; + + description + "This module describes a YANG model for ISIS protocol configuration. + It is a limited subset of all of the configuration parameters + available in the variety of vendor implementations, hence it is + expected that it would be augmented with vendor - specific configuration + data as needed. Additional modules or submodules to handle other + aspects of ISIS configuration, including policy, routing, types, + LSDB and additional address families are also expected. This model + supports the following ISIS configuration level hierarchy: + + ISIS + +-> { global ISIS configuration} + +-> levels +-> { level config} + +-> { system-level-counters } + +-> { level link-state-database} + +-> interface +-> { interface config } + +-> { circuit-counters } + +-> { levels config } + +-> { level adjacencies }"; + + oc-ext:openconfig-version "0.6.0"; + + revision "2020-03-24" { + description + "Support IGP-LDP sync per interface."; + reference "0.6.0"; + } + + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "0.5.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements."; + reference "0.4.1"; + } + + revision "2018-05-14" { + description + "Update LSDB model to correct Extended IS reach TLV + bug. This change is backwards incompatible due to + adding an additional level of hierarchy to support + multiple instances of the TLV."; + reference "0.4.0"; + } + + revision "2017-07-26" { + description + "Update LSDB and fix bugs."; + reference "0.3.2"; + } + + revision "2017-05-15" { + description + "Refactor LSDB."; + reference "0.3.0"; + } + + revision "2017-01-13" { + description + "Remove top-level /isis container"; + reference "0.2.1"; + } + + revision "2016-12-15" { + description + "Add segment routing to IS-IS module"; + reference "0.2.0"; + } + + revision "2016-10-18" { + description + "Initial revision of IS-IS models."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + // grouping statements + + grouping isis-global-config { + description + "This grouping defines lobal configuration options for ISIS router."; + + // multi-instance + leaf instance { + type string; + default 0; + description + "ISIS Instance."; + } + + leaf-list net { + type oc-isis-types:net; + description + "ISIS network entity title (NET). The first 8 bits are usually + 49 (private AFI), next 16 bits represent area, next 48 bits represent + system id and final 8 bits are set to 0."; + reference + "International Organization for Standardization, Information + technology - Open Systems Interconnection-Network service + Definition - ISO/ IEC 8348:2002."; + } + + leaf maximum-area-addresses { + type uint8; + default 3; + description + "Maximum areas supported."; + } + + leaf level-capability { + type oc-isis-types:level-type; + default "LEVEL_1_2"; + description + "ISIS level capability(level-1, level-2, level-1-2)."; + } + + leaf max-ecmp-paths { + type uint8; + description + "ISIS max-paths count."; + } + + leaf poi-tlv { + type boolean; + default false; + description + "ISIS purge TLV. When set to true, a TLV is added to purges to record + the system ID of the IS generating the purge."; + reference "RFC6232: Purge Originator Identification TLV for IS-IS. TLV 13."; + } + + leaf iid-tlv { + type boolean; + default false; + description + "ISIS Instance Identifier TLV. When set to trues, the IID-TLV identifies + the unique instance as well as the topology/topologies to which the + PDU applies."; + reference "RFC6822: IS-IS Multi-Instance. TLV 7"; + } + + leaf fast-flooding { + type boolean; + default true; + description + "When set to true, IS will always flood the LSP that triggered an SPF + before the router actually runs the SPF computation."; + } + } + + grouping admin-config { + description + "Re-usable grouping to enable or disable a particular IS-IS feature."; + + leaf enabled { + type boolean; + default false; + description + "When set to true, the functionality within which this leaf is + defined is enabled, when set to false it is explicitly disabled."; + } + } + + grouping isis-bfd-config { + description + "This grouping defines Bidirectionl-Forwarding-Detection + configuration."; + + //There is also BFD state under adjacency + leaf bfd-tlv { + type boolean; + description + "When set to true, BFD TLV is used. This enables support for the IS-IS + BFD TLV options, which specify that a BFD session must be established + before an IS-IS adjacency can transition to the established state. + This option should be enabled on all IS-IS neighbors on a shared + interface."; + reference "RFC6213. TLV 148"; + } + reference "RFC5880: Bidirectional Forwarding Detection (BFD)."; + } + + grouping isis-authentication-check-config { + description + "This grouping defines ISIS authentication check."; + + leaf authentication-check { + type boolean; + default true; + description + "When set to true, reject all ISIS protocol PDUs that either have a mismatch + in authentication-type or authentication-key."; + } + } + + grouping isis-metric-style-config { + description + "This grouping defines ISIS metric style."; + + leaf metric-style { + type oc-isis-types:metric-style; + description + "ISIS metric style types(narrow, wide)."; + } + } + + grouping authentication-key-config { + description + "This grouping defines authentication key configuration."; + + leaf auth-password { + type oc-types:routing-password; + description + "Authentication key string."; + } + } + + grouping keychain-base-group { + description + "This grouping defines keychain configuration."; + + container keychain { + description + "This container defines keychain parameters."; + + // TODO(robjs): Import keychain parameters following merge of the auth + // models. + //uses oc-keychain:keychain-common-base; + //uses oc-keychain:tolerance-base; + //uses oc-keychain:keychain-key-base; + } + } + + grouping isis-authentication-config { + description + "This grouping defines ISIS authentication configuration."; + + // TODO(robjs): Add authentication following merge of auth modules. + //leaf auth-type { + // type oc-auth-types:auth-type; + // description + // "ISIS authentication type (key, key-chain)."; + //} + + leaf csnp-authentication { + type boolean; + default false; + description + "Enable or disable for IS-IS CSNPs."; + } + + leaf psnp-authentication { + type boolean; + default false; + description + "Enable or disable authentication for IS-IS PSNPs."; + } + + leaf lsp-authentication { + type boolean; + default false; + description + "Enable or disable authentication for IS-IS LSPs."; + } + } + + grouping isis-authentication-group { + description + "This grouping defines ISIS authentication."; + + container config { + description + "This container defines ISIS authentication configuration."; + + uses isis-authentication-config; + } + + container state { + config false; + description + "This container defines ISIS authentication state."; + + uses isis-authentication-config; + } + + container key { + description + "This container defines ISIS authentication key"; + container config { + description + "This container defines ISIS authentication key configuration."; + + uses authentication-key-group-config { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY'"; + } + } + + container state { + config false; + description + "This container defines ISIS authentication key state."; + + uses authentication-key-group-config { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY'"; + } + } + } + + uses keychain-base-group { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY_CHAIN'"; + } + } + + grouping isis-hello-authentication-config { + description + "Configuration options for IS-IS hello authentication."; + + leaf hello-authentication { + type boolean; + default false; + description + "Enabled or disable ISIS Hello authentication."; + } + + // TODO(robjs): Add hello-auth-type following merge of auth models. + //leaf hello-auth-type { + // type oc-auth-types:auth-type; + // description + // "ISIS authentication type (key, key-chain)."; + //} + } + + grouping isis-hello-authentication-group { + description + "This grouping defines ISIS hello-authentication."; + + container config { + description + "This container defines ISIS authentication configuration."; + + uses isis-hello-authentication-config; + } + + container state { + config false; + description + "This container defines ISIS authentication state."; + + uses isis-hello-authentication-config; + } + + container key { + description + "This container defines ISIS authentication key"; + + container config { + description + "This container defines ISIS authentication key configuration."; + + uses authentication-key-group-config { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY'"; + } + } + + container state { + config false; + description + "This container defines ISIS authentication key state."; + + uses authentication-key-group-config { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY'"; + } + } + } + + uses keychain-base-group { + // TODO(aashaikh): Add auth-type conditions after merge of + // auth models. + // when "../auth-type = 'KEY_CHAIN'"; + } + } + + grouping isis-ldp-igp-config { + description + "This grouping defines ISIS/LDP Synchronization configuration."; + + leaf enabled { + type boolean; + default true; + description + "When set to true, rely on IGP/LDP synchronization. IGP cost for + link is maintained at max until LDP adjacencies are established "; + reference "RFC5443: LDP IGP Synchronization."; + } + + leaf post-session-up-delay { + type uint16; + units seconds; + description + "Specifies a delay, expressed in units of seconds, + between the LDP session to the IGP neighbor being established, and + it being considered synchronized by the IGP."; + } + } + + grouping isis-te-config { + description + "This grouping defines ISIS Traffic Engineering configuration."; + + leaf ipv4-router-id { + type inet:ipv4-address-no-zone; + description + "IPv4 MPLS Traffic Engineering Router-ID."; + } + + leaf ipv6-router-id { + type inet:ipv6-address-no-zone; + description + "IPv6 MPLS Traffic Engineering Router-ID."; + } + } + + grouping isis-reference-bandwidth-config { + description + "This grouping defines ISIS Reference Bandwidth Configuration."; + + leaf reference-bandwidth { + type uint32; + description + "ISIS Reference Bandwidth value"; + } + } + + grouping isis-overload-bit-set-config { + description + "This grouping defines ISIS Overload Bit."; + + leaf set-bit { + type boolean; + default false; + description + "When set to true, IS-IS overload bit is set."; + } + + leaf set-bit-on-boot { + type boolean; + default false; + description + "When set to true, the IS-IS overload bit is set on system boot."; + } + + leaf advertise-high-metric { + type boolean; + default false; + description + "When set to true, the local IS advertises links with the highest + available metric regardless of their configured metric. The metric + value is based on the metric style - if wide metrics are utilised + the metric is advertised as 16777214, otherwise they are advertised + with a value of 63."; + } + } + + grouping isis-overload-bit-reset-config { + description + "This grouping defines ISIS Overload Bit Reset Triggers"; + + leaf reset-trigger { + type identityref { + base oc-isis-types:OVERLOAD_RESET_TRIGGER_TYPE; + } + description + "In the case that the system sets the overload bit on start, the + system should reset the bit (i.e., clear the overload bit) upon + the specified trigger."; + } + + leaf delay { + type uint16; + units seconds; + description + "If a reset trigger is specified, the system should delay resetting + the overload bit for the specified number of seconds after the + trigger occurs."; + } + } + + grouping isis-attached-bit-config { + description + "This grouping defines ISIS Attached Bit"; + + leaf ignore-bit { + type boolean; + default false; + description + "When set to true, if the attached bit is set on an incoming Level 1 + IS-IS, the local system ignores it. In this case the local system + does not set a default route to the L1L2 router advertising the PDU + with the attached bit set."; + } + + leaf suppress-bit { + type boolean; + default false; + description + "When set to true, if the local IS acts as a L1L2 router, then the + attached bit is not advertised in locally generated PDUs."; + } + } + + grouping overload-bit-group { + description + "This grouping defines ISIS Overload Bit."; + + container config { + description + "This container defines ISIS Overload Bit configuration."; + + uses isis-overload-bit-set-config; + } + + container state { + config false; + description + "This container defines state for ISIS Overload Bit."; + + uses isis-overload-bit-set-config; + } + + container reset-triggers { + description + "This container defines state for ISIS Overload Bit reset triggers"; + + list reset-trigger { + key "reset-trigger"; + + description + "This list describes ISIS Overload reset trigger reasons."; + + leaf reset-trigger { + type leafref { + path "../config/reset-trigger"; + } + description + "Reference to the reset trigger reason"; + } + + container config { + description + "This container defines ISIS Overload Bit reset trigger + configuration."; + + uses isis-overload-bit-reset-config; + } + + container state { + config false; + description + "This container defines state for ISIS Overload Bit reset + triggers."; + + uses isis-overload-bit-reset-config; + } + } + } + } + + + grouping isis-base-level-config { + description + "This grouping defines ISIS Level configuration."; + + leaf level-number { + type oc-isis-types:level-number; + description + "ISIS level number (level-1, level-2)."; + } + } + + grouping isis-interface-level-config { + description + "This grouping defines ISIS Interface Level configuration."; + + leaf level-number { + type oc-isis-types:level-number; + description + "ISIS level number(level-1, level-2)."; + } + + leaf passive { + type boolean; + default false; + description + "ISIS passive interface admin enable/disable function."; + } + + leaf priority { + type uint8 { + range "0 .. 127"; + } + description + "ISIS neighbor priority(LAN hello PDU only)."; + } + } + + grouping isis-hello-timers-config { + description + "This grouping defines ISIS hello timers configuration."; + + leaf hello-interval { + type uint32; + description + "ISIS hello-interval value."; + } + + leaf hello-multiplier { + type uint8; + description + "ISIS hello-multiplier value."; + } + } + + grouping isis-interface-config { + description + "This grouping defines ISIS interface configuration."; + + leaf interface-id { + type oc-if:interface-id; + description + "Interface for which ISIS configuration is to be applied."; + } + + leaf passive { + type boolean; + default false; + description + "When set to true, the referenced interface is a passive interface + such that it is not eligible to establish adjacencies with other + systems, but is advertised into the IS-IS topology."; + } + + leaf hello-padding { + type oc-isis-types:hello-padding-type; + description + "This leaf controls padding type for IS-IS Hello PDUs."; + } + + leaf circuit-type { + type oc-isis-types:circuit-type; + description + "ISIS circuit type (p2p, broadcast)."; + } + } + + grouping isis-adaptive-timers-state { + description + "This grouping defines ISIS adaptive timers state"; + + leaf adaptive-timer { + type oc-isis-types:adaptive-timer-type; + description + "ISIS adaptive timer types (linear, exponential)."; + } + } + + grouping isis-lsp-generation-timers-config { + description + "This grouping defines ISIS LSP Generation timers configuration"; + + leaf lsp-max-wait-interval { + type uint64; + units milliseconds; + description + "Time interval in milliseconds that specifies max interval between + two consecutive occurrences of an LSP being generated."; + } + + leaf lsp-first-wait-interval { + type uint64; + units milliseconds; + description + "Time interval in milliseconds that specifies the first LSP generation + delay."; + } + + leaf lsp-second-wait-interval { + type uint64; + units milliseconds; + description + "Time interval in milliseconds that specifies the millisecond LSP + generation delay."; + } + } + + grouping isis-lsp-timers-config { + description + "This grouping defines ISIS LSP timers configuration"; + + leaf lsp-lifetime-interval { + type uint16; + units seconds; + default 1200; + description + "Time interval in seconds that specifies how long an LSP remains in + LSDB without being refreshed."; + } + + leaf lsp-refresh-interval { + type uint16; + units seconds; + description + "Time interval in seconds that specifies how often route topology + that a device originates is transmitted in LSPs."; + } + } + + grouping isis-spf-timers-config { + description + "This grouping defines ISIS SPF timers configuration."; + + leaf spf-hold-interval { + type uint64; + units milliseconds; + default 5000; + description + "SPF Hold Down time interval in milliseconds."; + } + + leaf spf-first-interval { + type uint64; + units milliseconds; + description + "Time interval in milliseconds between the + detection of topology change and when the SPF algorithm runs."; + } + leaf spf-second-interval { + type uint64; + units milliseconds; + description + "Time interval in milliseconds between the first and second + SPF calculation."; + } + } + + grouping isis-interface-timers-config { + description + "This grouping defines ISIS interface timers configuration."; + + leaf csnp-interval { + type uint16; + units seconds; + description + "The interval, specified in seconds, at which periodic CSNP packets + should be transmitted by the local IS."; + } + + leaf lsp-pacing-interval { + type uint64; + units milliseconds; + description + "The interval interval in milliseconds between the + detection of topology change and when the SPF algorithm runs."; + } + } + + grouping isis-transport-config { + description + "This grouping defines configuration parameters relating to the + transport protocol used by the ISIS."; + + leaf lsp-mtu-size { + type uint16; + description + "The maximum size in bytes of an IS-IS Link state PDU."; + } + } + + grouping isis-graceful-restart-config { + description + "This grouping defines ISIS graceful restart configuration."; + + leaf helper-only { + type boolean; + description + "Enable or disable the IS-IS graceful restart helper function. When + this leaf is set, the local system does not utilise the IS-IS + graceful restart procedures during its own restart, but supports + retaining forwarding information during a remote speaker's restart."; + } + reference "RFC 5306: Restart Signaling for IS-IS."; + } + + // configuration context containers + grouping inter-level-propagation-policies-structural { + description + "Propagate prefixes between IS-IS levels."; + + container inter-level-propagation-policies { + description + "Policies to propagate prefixes between IS-IS levels."; + + container level1-to-level2 { + description + "Policies relating to prefixes to be propagated from + Level 1 to Level 2."; + + container config { + description + "Configuration parameters relating to the propagation + of prefixes from IS-IS Level 1 to Level 2."; + + uses inter-level-propagation-policy-config; + } + + container state { + config false; + description + "Operational state parameters relating to the + propagation of prefixes from IS-IS Level 1 to Level 2."; + + uses inter-level-propagation-policy-config; + } + + } + + container level2-to-level1 { + description + "Policies relating to prefixes to be propagated from + Level2 to Level 1."; + + container config { + description + "Configuration parameters relating to the propagation + of prefixes from IS-IS Level 2 to Level 1."; + + uses inter-level-propagation-policy-config; + } + + container state { + config false; + description + "Operational state parameters relating to the propagation + of prefixes from IS-IS Level 2 to Level 1."; + + uses inter-level-propagation-policy-config; + } + } + } + } + + grouping inter-level-propagation-policy-config { + description + "Policy governing the propagation of prefixes between levels."; + + uses oc-rpol:apply-policy-import-config; + } + + grouping authentication-key-group-config { + description + "This grouping defines ISIS authentication key configuration."; + + uses authentication-key-config; + + // TODO(robjs): Add crypto-algorithm after merge of authentication modules. + //leaf crypto-algorithm { + // type identityref { + // base oc-auth-types:CRYPTO_TYPE; + // } + // description + // "Authentication key cryptographic algorithm to be used for key encryption."; + //} + } + + grouping isis-mpls-config { + description + "This grouping defines MPLS-related features in IS-IS"; + + container mpls { + description + "Configuration and operational state relating to MPLS-related + features in IS-IS"; + + container igp-ldp-sync { + description + "Configuration and operational state relating to synchronisation + between the LDP and IS-IS"; + + container config { + description + "This container defines ISIS/IGP configuration."; + + uses isis-ldp-igp-config; + } + + container state { + config false; + description + "This container defines state information for ISIS/LDP Sync."; + + uses isis-ldp-igp-config; + } + } + } + } + + grouping isis-global-base { + description + "This grouping describes ISIS Global router."; + + container config { + description + "This container defines ISIS global configuration router."; + + uses isis-authentication-check-config; + uses isis-global-config; + } + + container state { + config false; + description + "This container defines state for ISIS global router."; + + uses isis-authentication-check-config; + uses isis-global-config; + } + + container lsp-bit { + description + "This container defines ISIS LSP Operational Bits."; + + container overload-bit { + description + "This container defines Overload Bit configuration."; + uses overload-bit-group; + } + + container attached-bit { + description + "This container defines Attached Bit."; + + container config { + description + "This container defines Attached Bit configuration."; + + uses isis-attached-bit-config; + } + + container state { + config false; + description + "This container defines state for Link State PDU Bit."; + + uses isis-attached-bit-config; + } + } + } + + container reference-bandwidth { + description + "This container defines ISIS Reference Bandwidth."; + + container config { + description + "This container defines Reference Bandwidth configuration"; + uses isis-reference-bandwidth-config; + } + + container state { + config false; + description + "This container defines state for Reference Bandwidth."; + + uses isis-reference-bandwidth-config; + } + } + + container nsr { + description + "This container defines ISIS Non-Stop Routing."; + + container config { + description + "This container defines Non-Stop-Routing configuration."; + + uses admin-config; + } + + container state { + config false; + description + "This container defines state for Non-Stop-Routing"; + + uses admin-config; + } + } + + container graceful-restart { + description + "This container defines ISIS Graceful Restart."; + + container config { + description + "This container defines ISIS graceful-restart configuration."; + + uses admin-config; + uses isis-graceful-restart-config; + } + + container state { + config false; + description + "This container defines state information for ISIS graceful-restart."; + + uses admin-config; + uses isis-graceful-restart-config; + } + } + + container timers { + description + "This container defines ISIS timers."; + + container config { + description + "This container defines ISIS global timers configuration."; + + uses isis-lsp-timers-config; + } + + container state { + config false; + description + "This container defines state information for ISIS global timers."; + + uses isis-lsp-timers-config; + } + + container spf { + description + "This container defines ISIS SPF timer settings."; + + container config { + description + "This container defines ISIS SPF timers configuration."; + + uses isis-spf-timers-config; + } + + container state { + config false; + description + "This container defines state information for ISIS SPF timers."; + + uses isis-spf-timers-config; + uses isis-adaptive-timers-state; + } + } + + container lsp-generation { + description + "This container defines ISIS LSP Generation."; + + container config { + description + "This container defines ISIS LSP Generation timers + configuration."; + + uses isis-lsp-generation-timers-config; + } + + container state { + config false; + description + "This container defines state information for ISIS LSP Generation + timers."; + + uses isis-lsp-generation-timers-config; + uses isis-adaptive-timers-state; + } + } + } + + container transport { + description + "This container defines ISIS transport."; + + container config { + description + "This container defines ISIS transport related configuration."; + + uses isis-transport-config; + } + + container state { + config false; + description + "This container defines state information for ISIS transport + parameters."; + + uses isis-transport-config; + } + } + + uses isis-mpls-config; + + container igp-shortcuts { + description + "This container defines IGP shortcuts configuration and state + information."; + + uses isis-shortcuts-afi-list; + } + + container afi-safi { + description + "This container defines address-family specific configuration + and state information."; + + uses isis-afi-safi-list; + } + + uses oc-sr:sr-igp-top; + } + + grouping isis-route-preference-config { + description + "This grouping defines ISIS route preference configuration"; + + leaf external-route-preference { + type uint8 { + range "1..max"; + } + description + "Administrative Distance(preference) for external ISIS routes."; + } + + leaf internal-route-preference { + type uint8 { + range "1..max"; + } + description + "Administrative Distance(preference) for internal ISIS routes."; + } + } + + grouping isis-interfaces { + description + "This grouping defines ISIS interfaces configured on local system."; + + list interface { + key "interface-id"; + + description + "This list contains ISIS interfaces."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to interface-id"; + } + + uses isis-interface-group; + uses isis-mpls-config; + uses oc-if:interface-ref; + } + } + + grouping isis-interface-group { + description + "This grouping defines ISIS interfaces configured on local system."; + + container config { + description + "This container defines ISIS interface configuration."; + + uses admin-config; + uses isis-interface-config; + } + + container state { + config false; + description + "This container defines state information for ISIS interfaces."; + + uses admin-config; + uses isis-interface-config; + } + + container circuit-counters { + description + "This container defines state information for ISIS circuit counters."; + + uses circuit-counters-structural; + } + + container authentication { + description + "This container defines ISIS authentication."; + + uses isis-hello-authentication-group; + } + + container afi-safi { + description + "This container defines address-family specific configuration + and state information."; + + uses isis-if-global-afi-safi-list; + } + + container levels { + description + "This container defines ISIS level specific configuration and + state information."; + + uses isis-interface-levels; + } + + container timers { + description + "This container describes ISIS interface timers configuration"; + + container config { + description + "Configuration parameters relating to interface + timers for IS-IS"; + + uses isis-interface-timers-config; + } + + container state { + config false; + description + "This container defines state information for ISIS interface timers."; + + uses isis-interface-timers-config; + } + } + + container bfd { + //TODO(bogdanov): Integrate BFD model/module + description + "This container defines BFD."; + + container config { + description + "This container defines BFD configuration parameters."; + + uses isis-bfd-config; + } + + container state { + config false; + description + "This container defines BFD state information."; + + uses isis-bfd-config; + } + } + } + + grouping isis-levels { + description + "This grouping defines global ISIS Levels."; + + list level { + key "level-number"; + + description + "Configuration and operational state parameters related to a + particular level within the IS-IS protocol instance"; + + leaf level-number { + type leafref { + path "../config/level-number"; + } + description + "Reference to ISIS level-number."; + } + + uses isis-level-group; + } + } + + grouping isis-interface-levels { + description + "This grouping defines ISIS interface Levels."; + + list level { + key "level-number"; + description + "Configuration and operational state parameters related to a + particular level on an IS-IS enabled interface."; + + leaf level-number { + type leafref { + path "../config/level-number"; + } + description + "Reference to ISIS level-number."; + } + + uses isis-interface-level-group; + } + } + + grouping isis-level-group { + description + "This grouping defines ISIS level configuration and state + information."; + + container config { + description + "This container defines ISIS level based configuration."; + + uses admin-config; + uses isis-base-level-config; + uses isis-metric-style-config; + uses isis-authentication-check-config; + } + + container state { + config false; + description + "This container defines ISIS level state information."; + + uses admin-config; + uses isis-base-level-config; + uses isis-metric-style-config; + uses isis-authentication-check-config; + } + + container system-level-counters { + description + "This container defines ISIS system level counters."; + + uses system-level-counters-structural; + } + + container link-state-database { + config false; + description + "This container defines ISIS LSDB."; + + list lsp { + key "lsp-id"; + description + "This list describes LSPs in the LSDB."; + uses lsp-state; + } + } + + container traffic-engineering { + description + "This container defines ISIS TE."; + + container config { + description + "This container defines ISIS TE configuration."; + + uses admin-config; + uses isis-te-config; + } + + container state { + config false; + description + "This container defines ISIS TE state information."; + + uses admin-config; + uses isis-te-config; + } + } + + container route-preference { + description + "This container defines Administrative Distance (or preference) + assigned to ISIS routes (level1 internal, level2 internal, level1 + external, level2 external)."; + + container config { + description + "This container defines route preference configuration."; + uses isis-route-preference-config; + } + + container state { + config false; + description + "This container defines ISIS route preference state information."; + uses isis-route-preference-config; + } + } + + container authentication { + description + "This container defines ISIS authentication."; + uses isis-authentication-group; + } + + } + + grouping isis-interface-level-group { + description + "This grouping defines ISIS interface level."; + + container config { + description + "This container defines interface ISIS level configuration."; + + uses isis-interface-level-config; + uses admin-config; + } + + container state { + config false; + description + "This container defines interface ISIS level state information."; + + uses isis-interface-level-config; + uses admin-config; + } + + container packet-counters { + description + "This container defines ISIS interface packet counters."; + + uses packet-counters-structural; + } + + container adjacencies { + config false; + description + "This container defines ISIS adjacencies."; + + list adjacency { + key "system-id"; + + description + "List of the local system's IS-IS adjacencies."; + + leaf system-id { + type leafref { + path "../state/system-id"; + } + description + "Reference to the IS neighbor."; + } + + container state { + description + "Operational state relating to the IS-IS adjacency with the + remote system"; + + uses adjacency-state; + } + } + } + + container timers { + description + "This container defines ISIS timers."; + + container config { + description + "This container defines ISIS interface hello-timers configuration."; + + uses isis-hello-timers-config; + } + + container state { + config false; + description + "This container defines ISIS interface hello-timers state."; + + uses isis-hello-timers-config; + } + } + + container afi-safi { + description + "This container defines address-family specific configuration + and state information."; + + uses isis-if-afi-safi-list; + } + + container hello-authentication { + description + "This container defines ISIS authentication."; + + uses isis-hello-authentication-group; + } + } + + + grouping isis-top { + description + "This grouping define top-level ISIS model data."; + + container isis { + description + "This container defines top-level ISIS configuration and state + information."; + + container global { + description + "This container defines global ISIS configuration and state + information."; + + uses isis-global-base; + uses inter-level-propagation-policies-structural; + } + + container levels { + description + "This container defines ISIS level configuration and state + information."; + uses isis-levels; + } + + container interfaces { + description + "This container defines global ISIS interface configuration and + state information."; + uses isis-interfaces; + } + } + } + + grouping adjacency-state { + description + "This grouping defines ISIS adjacency."; + + leaf system-id { + type oc-isis-types:system-id; + description + "ISIS neighbor system-id."; + } + + leaf neighbor-ipv4-address { + type inet:ipv4-address-no-zone; + description + "ISIS Neighbor IPv4 address."; + } + + leaf neighbor-ipv6-address { + type inet:ipv6-address-no-zone; + description + "ISIS Neighbor IPv6 address."; + } + + leaf neighbor-snpa { + type oc-isis-types:snpa; + description + "ISIS neighbor SNPA."; + } + + leaf local-extended-circuit-id { + type oc-isis-types:extended-circuit-id; + description + "Local extended circuit ID."; + } + leaf neighbor-extended-circuit-id { + type oc-isis-types:extended-circuit-id; + description + "ISIS neighbor extended circuit ID."; + } + + leaf priority { + type uint8 { + range "0..127"; + } + description + "Priority of the neighboring IS(LAN Hello only)."; + } + + leaf dis-system-id { + type oc-isis-types:system-id; + description + "DIS System ID(LAN hello only)."; + } + + leaf neighbor-circuit-type { + type oc-isis-types:level-type; + description + "Received ISIS circuit type (level-1, level-2, level-1-2)."; + } + + leaf adjacency-type { + type oc-isis-types:level-type; + description + "Formed ISIS adjacency type(level-1, level-2, level-1-2)."; + } + + leaf adjacency-state { + type oc-isis-types:isis-interface-adj-state; + description + "P2P 3-way ISIS adjacency state(up, down, init, failed)."; + reference "RFC4303. TLV 240."; + } + + leaf remaining-hold-time { + type uint16; + units seconds; + description + "Holding time in seconds for adjacency. This value is based on received + hello PDUs and the elapsed time since receipt."; + } + + leaf up-time { + type yang:timestamp; + description + "Adjacency up time."; + } + + leaf multi-topology { + type boolean; + description + "When set to true, ISIS multi-topology is supported."; + reference "RFC5129. TLV 229."; + } + + leaf-list topology { + type identityref { + base oc-isis-types:AFI_SAFI_TYPE; + } + description + "ISIS topology type support(ipv4-unicast, ipv6-unicast, + ipv4-multicast, ipv6-multicast)."; + } + + leaf restart-support { + type boolean; + description + "When set to true, Graceful-restart signaling is supported."; + } + + leaf restart-suppress { + type boolean; + description + "When set to true, adjacency is not advertised. The SA bit is used by a + starting router to request that its neighbor suppress advertisement of + the adjacency to the starting router in the neighbor's LSPs."; + } + + leaf restart-status { + type boolean; + description + "When set to true, neighbor is being helped. The RR bit is used by a + (re)starting router to signal to its neighbors that a (re)start is in + progress."; + } + + leaf-list area-address { + type oc-isis-types:area-address; + description + "List of ISIS area-address(es)."; + } + + leaf-list nlpid { + type enumeration { + enum IPV4 { + description + "IPv4 Address family."; + } + enum IPV6 { + description + "IPv6 Address family."; + } + } + description + "Supported Protocol. IPv4 is defined as (0xcc) + and IPv6 - (0x8e). ISIS reference is TLV 129."; + } + + // TODO(bogdanov): update when BFD model is integrated. + //leaf ipv4-bfd-status { + //type oc-isis-types:bfd-state; + //description + // "IPv4 BFD session status."; + //} + //leaf ipv6-bfd-status { + //type oc-isis-types:bfd-state; + //description + // "IPv4 BFD session status. "; + //} + + } + + grouping packet-counters-generic-state { + description + "Operational state parameters relating to LSP packet counters."; + + leaf received { + type yang:counter32; + description + "The number of the specified type of PDU received on the interface."; + } + leaf processed { + type yang:counter32; + description + "The number of the specified type of PDU received on the interface + that have been processed by the local system."; + } + leaf dropped { + type yang:counter32; + description + "The number of the specified type of PDU received on the interface + that have been dropped."; + } + + leaf sent { + type yang:counter32; + description + "The number of the specified type of PDU that have been sent by the + local system on the interface."; + } + + leaf retransmit { + type yang:counter32; + description + "The number of the specified type of PDU that that have been + retransmitted by the local system on the interface."; + } + } + + grouping packet-counters-structural { + description + "This grouping defines ISIS packet counter state."; + + container lsp { + description + "This container defines LSP packet counters."; + + container state { + config false; + description + "This container defines LSP PDU counters."; + + uses packet-counters-generic-state; + } + } + + container iih { + description + "This container defines IIH packet counters."; + + container state { + config false; + description + "Operational counters relating to IIH PDUs"; + + uses packet-counters-generic-state; + } + } + + container ish { + description + "This container defines ISH packet counters."; + + container state { + config false; + description + "Operational state relating to ISH PDUs."; + + uses packet-counters-generic-state; + } + } + + container esh { + description + "This container defines ESH packet counters."; + container state { + config false; + description + "Operational state relating to ESH PDUs"; + + uses packet-counters-generic-state; + } + } + + container psnp { + description + "This container defines PSNP packet counters."; + + container state { + config false; + description + "Packet counters relating to PSNPs."; + + uses packet-counters-generic-state; + } + } + + container csnp { + description + "Operational state parameters relating to CSNPs."; + + container state { + config false; + description + "Packet counters relating to CSNPs."; + + uses packet-counters-generic-state; + } + } + + container unknown { + description + "Operational state parameters relating to IS-IS PDUs that are not + otherwise classified - referred to as Unknown PDUs."; + + container state { + config false; + description + "Packet counters relating to unknown PDUs."; + + uses packet-counters-generic-state; + } + } + } + + grouping system-level-counters-state { + description + "IS-IS counters that are relevant to the system IS-IS context."; + + leaf corrupted-lsps { + type yang:counter32; + description + "Number of corrupted in-memory LSPs detected. LSPs received from the + wire with a bad checksum are silently dropped and not counted. LSPs + received from the wire with parse errors are counted by lsp-errors. MIB + Entry: SysCorrLSPs."; + } + + leaf database-overloads { + type yang:counter32; + description + "Number of times the database has become + overloaded. + MIB entry: SysLSPL(Level)DbaseOloads."; + } + + leaf manual-address-drop-from-areas { + type yang:counter32; + description + "Number of times a manual address has been dropped from area. + MIB Entry: SysManAddrDropFromAreas."; + } + + leaf exceed-max-seq-nums { + type yang:counter32; + description + "The number of times the system has attempted to exceed the maximum + sequence number. MIB Entry: SysAttmptToExMaxSeqNums."; + } + leaf seq-num-skips { + type yang:counter32; + description + "Number of times a sequence number skip has occurred. MIB Entry: + SysSeqNumSkips."; + } + + leaf own-lsp-purges { + type yang:counter32; + description + "Number of times a zero-aged copy of the system's + own LSP is received from some other node. + MIB Entry: isisSysOwnLSPPurges."; + } + + leaf id-len-mismatch { + type yang:counter32; + description + "Number of times a PDU is received with a different value for ID field + length from that of the receiving system. MIB Entry: + isisSysIDFieldLenMismatches."; + } + + leaf part-changes { + type yang:counter32; + description + "The number of partition changes detected. MIB Entry: SysPartChanges."; + } + + leaf max-area-address-mismatches { + type yang:counter32; + description + "Number of times a PDU is received with a different value for + MaximumAreaAddresses from that of the receiving system. MIB Entry: + SysMaxAreaAddrMismatches."; + } + + leaf auth-fails { + type yang:counter32; + description + "The number of authentication key failures. + MIB Entry: SysAuthFails."; + } + + leaf spf-runs { + type yang:counter32; + description + "The number of times SPF was ran at this level."; + } + + leaf auth-type-fails { + type yang:counter32; + description + "The number of authentication type mismatches."; + } + + leaf lsp-errors { + type yang:counter32; + description + "The number of received LSPs with errors."; + } + } + + grouping system-level-counters-structural { + description + "This grouping defines system level counters."; + + container state { + config false; + description + "The container defines a list of system counters for the IS."; + + uses system-level-counters-state; + } + } + + grouping circuit-counters-state { + description + "Operational state parameters relating to counters specific to one + interface or circuit."; + + leaf adj-changes { + type yang:counter32; + description + "Number of times an adjacency state change has occurred on this circuit. + MIB Entry: CircAdjChanges."; + } + + leaf init-fails { + type yang:counter32; + description + "Number of times initialization of this circuit has failed. This counts + events such as PPP NCP failures. MIB Entry: CircInitFails."; + } + + leaf rejected-adj { + type yang:counter32; + description + "Number of times an adjacency has been rejected on this circuit. MIB + Entry: CircRejAdjs."; + } + + leaf id-field-len-mismatches { + type yang:counter32; + description + "Number of times an IS-IS control PDU with an ID field length different + from that for this system has been received. + MIB Entry: CircIDFieldLenMismatches."; + } + + leaf max-area-address-mismatches { + type yang:counter32; + description + "Number of times an IS-IS control PDU with a max area address field + different from that for this system has been received. MIB Entry: + CircMaxAreaAddrMismatches."; + } + + leaf auth-type-fails { + type yang:counter32; + description + "Number of times an IS-IS control PDU with an auth type field different + from that for this system has been received. MIB Entry: + CircAuthTypeFails."; + } + + leaf auth-fails { + type yang:counter32; + description + "Number of times an IS-IS control PDU with the correct auth type has + failed to pass authentication validation. MIB Entry: CircAuthFails."; + } + + leaf lan-dis-changes { + type yang:counter32; + description + "Number of times the Designated IS has changed on this circuit at this + level. If the circuit is point to point, this count is zero. MIB Entry: + CircLANDesISChanges."; + } + + leaf adj-number { + type uint32; + description + "Number of adjacencies on this circuit. + MIB Entry: CircNumAdj."; + } + } + + grouping circuit-counters-structural { + description + "This grouping defines circuit counters."; + + container state { + config false; + description + "The container defines a list of counters for IS circuit."; + + uses circuit-counters-state; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-lldp-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-lldp-types@2018-11-21.yang new file mode 100644 index 0000000..6c4a0ac --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-lldp-types@2018-11-21.yang @@ -0,0 +1,306 @@ +module openconfig-lldp-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/lldp/types"; + + prefix "oc-lldp-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines types related to the LLDP protocol model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2016-05-16" { + description + "Initial public revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity LLDP_SYSTEM_CAPABILITY { + description + "Base identity for standard LLDP system capabilities. + The system capabilities field contains a bit-map of the + capabilities that define the primary function(s) of + the system. A system may advertise more than one capability."; + reference + "Table 8-4 System Capabilities, IEEE 802.1AB-2009"; + } + + identity OTHER { + base LLDP_SYSTEM_CAPABILITY; + description + "Other capability not specified; bit position 1"; + } + + identity REPEATER { + base LLDP_SYSTEM_CAPABILITY; + description + "Repeater capability; bit position 2"; + reference + "IETF RFC 2108"; + } + + identity MAC_BRIDGE { + base LLDP_SYSTEM_CAPABILITY; + description + "MAC bridge capability; bit position 3"; + reference + "IEEE Std 802.1D"; + } + + identity WLAN_ACCESS_POINT { + base LLDP_SYSTEM_CAPABILITY; + description + "WLAN access point capability; bit position 4"; + reference + "IEEE Std 802.11 MIB"; + } + + identity ROUTER { + base LLDP_SYSTEM_CAPABILITY; + description + "Router; bit position 5"; + reference + "IETF RFC 1812"; + } + + identity TELEPHONE { + base LLDP_SYSTEM_CAPABILITY; + description + "Telephone capability; bit position 6"; + reference + "IETF RFC 4293"; + } + + identity DOCSIS_CABLE_DEVICE { + base LLDP_SYSTEM_CAPABILITY; + description + "DOCSIS cable device; bit position 7"; + reference + "IETF RFC 4639 and IETF RFC 4546"; + } + + identity STATION_ONLY { + base LLDP_SYSTEM_CAPABILITY; + description + "Station only capability, for devices that implement only an + end station capability, and for which none of the other + capabilities apply; bit position 8"; + reference + "IETF RFC 4293"; + } + + identity C_VLAN { + base LLDP_SYSTEM_CAPABILITY; + description + "C-VLAN component of a VLAN Bridge; bit position 9"; + reference + "IEEE Std 802.1Q"; + } + + identity S_VLAN { + base LLDP_SYSTEM_CAPABILITY; + description + "S-VLAN component of a VLAN Bridge; bit position 10"; + reference + "IEEE Std 802.1Q"; + } + + identity TWO_PORT_MAC_RELAY { + base LLDP_SYSTEM_CAPABILITY; + description + "Two-port MAC Relay (TPMR) capability; bit position 11"; + reference + "IEEE Std 802.1Q"; + } + + identity LLDP_TLV { + description + "A base identity which describes the TLVs in LLDP"; + } + + identity CHASSIS_ID { + base LLDP_TLV; + description + "The chassis identifier of the device associated with + the transmitting LLDP agent"; + reference "IEEE Std 802.1AB"; + } + + identity PORT_ID { + base LLDP_TLV; + description + "The port identifier associated with the interface + on with the LLDP agent is transmitting"; + reference "IEEE Std 802.1AB"; + } + + identity PORT_DESCRIPTION { + base LLDP_TLV; + description + "The description of the port that is associated with + the interface on which the LLDP agent is transmitting"; + reference "IEEE Std 802.1AB"; + } + + identity SYSTEM_NAME { + base LLDP_TLV; + description + "The assigned name (sysName or hostname) of the device + which is transmitting the LLDP PDU"; + reference "IEEE Std 802.1AB"; + } + + identity SYSTEM_DESCRIPTION { + base LLDP_TLV; + description + "The description (sysDescr) of the device which is + transmitting the LLDP PDU"; + reference "IEEE Std 802.1AB"; + } + + identity SYSTEM_CAPABILITIES { + base LLDP_TLV; + description + "The primary functions of the device transmitting the + LLDP PDU and their administrative status"; + reference "IEEE Std 802.1AB"; + } + + identity MANAGEMENT_ADDRESS { + base LLDP_TLV; + description + "The address associated with the device transmitting the + LLDP PDU which can be used for higher-layer network + management"; + reference "IEEE Std 802.1AB"; + } + + // typedef statements + + typedef chassis-id-type { + type enumeration { + enum CHASSIS_COMPONENT { + description + "Chassis identifier based on the value of entPhysicalAlias + object defined in IETF RFC 2737"; + } + enum INTERFACE_ALIAS { + description + "Chassis identifier based on the value of ifAlias object + defined in IETF RFC 2863"; + } + enum PORT_COMPONENT { + description + "Chassis identifier based on the value of entPhysicalAlias + object defined in IETF RFC 2737 for a port or backplane + component"; + } + enum MAC_ADDRESS { + description + "Chassis identifier based on the value of a unicast source + address (encoded in network byte order and IEEE 802.3 + canonical bit order), of a port on the containing chassis + as defined in IEEE Std 802-2001"; + } + enum NETWORK_ADDRESS { + description + "Chassis identifier based on a network address, + associated with a particular chassis. The encoded address + is composed of two fields. The first field is a single + octet, representing the IANA AddressFamilyNumbers value + for the specific address type, and the second field is the + network address value"; + } + enum INTERFACE_NAME { + description + "Chassis identifier based on the name of the interface, + e.g., the value of ifName object defined in IETF RFC 2863"; + } + enum LOCAL { + description + "Chassis identifier based on a locally defined value"; + } + } + description + "Type definition with enumerations describing the source of + the chassis identifier"; + reference + "IEEE 802.1AB LLDP MIB"; + } + + typedef port-id-type { + type enumeration { + enum INTERFACE_ALIAS { + description + "Chassis identifier based on the value of ifAlias object + defined in IETF RFC 2863"; + } + enum PORT_COMPONENT { + description + "Port identifier based on the value of entPhysicalAlias + object defined in IETF RFC 2737 for a port component"; + } + enum MAC_ADDRESS { + description + "Port identifier based on the value of a unicast source + address (encoded in network byte order and IEEE 802.3 + canonical bit order) associated with a port"; + } + enum NETWORK_ADDRESS { + description + "Port identifier based on a network address, + associated with a particular port"; + } + enum INTERFACE_NAME { + description + "Port identifier based on the name of the interface, + e.g., the value of ifName object defined in IETF RFC 2863"; + } + enum AGENT_CIRCUIT_ID { + description + "Port identifer based on the circuit id in the DHCP + relay agent information option as defined in IETF + RFC 3046"; + } + enum LOCAL { + description + "Port identifier based on a locally defined alphanumeric + string"; + } + } + description + "Type definition with enumerations describing the basis of + the port identifier"; + reference + "IEEE 802.1AB LLDP MIB"; + } + + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-lldp@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-lldp@2018-11-21.yang new file mode 100644 index 0000000..e687b7c --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-lldp@2018-11-21.yang @@ -0,0 +1,660 @@ +module openconfig-lldp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/lldp"; + + prefix "oc-lldp"; + + import openconfig-lldp-types { prefix oc-lldp-types; } + import openconfig-interfaces { prefix oc-if; } + import ietf-yang-types { prefix yang; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + for the LLDP protocol."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2018-07-17" { + description + "Adds ttl to lldp-neighbor-state"; + reference "0.2.0"; + } + + revision "2016-05-16" { + description + "Initial public revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + + // grouping statements + + grouping lldp-common-counters { + description + "Definition of global and per-interface counters"; + + leaf frame-in { + type yang:counter64; + description + "The number of lldp frames received."; + } + + leaf frame-out { + type yang:counter64; + description + "The number of frames transmitted out."; + } + + leaf frame-error-in { + type yang:counter64; + description + "The number of LLDP frames received with errors."; + } + + leaf frame-discard { + type yang:counter64; + description + "The number of LLDP frames received and discarded."; + } + + leaf tlv-discard { + type yang:counter64; + description + "The number of TLV frames received and discarded."; + } + + leaf tlv-unknown { + type yang:counter64; + description + "The number of frames received with unknown TLV."; + } + + leaf last-clear { + type yang:date-and-time; + description + "Indicates the last time the counters were + cleared."; + } + } + + grouping lldp-global-counters { + description + "Definition of global LLDP counters"; + + uses lldp-common-counters; + + leaf tlv-accepted { + type yang:counter64; + description + "The number of valid TLVs received."; + } + + leaf entries-aged-out { + type yang:counter64; + description + "The number of entries aged out due to timeout."; + } + + } + + grouping lldp-interface-counters { + description + "Definition of per-interface LLDP counters"; + + uses lldp-common-counters; + + leaf frame-error-out { + type yang:counter64; + description + "The number of frame transmit errors on the + interface."; + } + } + + grouping lldp-system-info-config { + description + "Configuration data for system-level local and remote + LLDP information"; + + leaf system-name { + type string { + length 0..255; + } + description + "The system name field shall contain an alpha-numeric string + that indicates the system's administratively assigned name. + The system name should be the system's fully qualified domain + name. If implementations support IETF RFC 3418, the sysName + object should be used for this field."; + } + + leaf system-description { + type string { + length 0..255; + } + description + "The system description field shall contain an alpha-numeric + string that is the textual description of the network entity. + The system description should include the full name and + version identification of the system's hardware type, + software operating system, and networking software. If + implementations support IETF RFC 3418, the sysDescr object + should be used for this field."; + } + + leaf chassis-id { + type string; + description + "The Chassis ID is a mandatory TLV which identifies the + chassis component of the endpoint identifier associated with + the transmitting LLDP agent"; + } + + leaf chassis-id-type { + type oc-lldp-types:chassis-id-type; + description + "This field identifies the format and source of the chassis + identifier string. It is an enumerator defined by the + LldpChassisIdSubtype object from IEEE 802.1AB MIB."; + } + } + + grouping lldp-system-info-state { + description + "Operational state data reported for the local and remote + systems"; + + } + + grouping lldp-neighbor-config { + description + "Configuration data for LLDP neighbors"; + + } + + grouping lldp-neighbor-state { + description + "Operational state data for LLDP neighbors"; + + leaf id { + type string; + description + "System generated identifier for the neighbor on the + interface."; + } + + leaf age { + type uint64; + units "seconds"; + description + "Age since discovery"; + } + + leaf last-update { + type int64; + description + "Seconds since last update received."; + } + + leaf ttl { + type uint16; + units "seconds"; + description + "The time-to-live (TTL) is a mandatory TLV which indicates + how long information from the neighbor should be considered + valid."; + } + + leaf port-id { + type string; + description + "The Port ID is a mandatory TLV which identifies the port + component of the endpoint identifier associated with the + transmitting LLDP agent. If the specified port is an IEEE + 802.3 Repeater port, then this TLV is optional."; + } + + leaf port-id-type { + type oc-lldp-types:port-id-type; + description + "This field identifies the format and source of the port + identifier string. It is an enumerator defined by the + PtopoPortIdType object from RFC2922."; + } + + leaf port-description { + type string; + description + "The binary string containing the actual port identifier for + the port which this LLDP PDU was transmitted. The source and + format of this field is defined by PtopoPortId from + RFC2922."; + } + + leaf management-address { + type string; + description + "The Management Address is a mandatory TLV which identifies a + network address associated with the local LLDP agent, which + can be used to reach the agent on the port identified in the + Port ID TLV."; + } + + leaf management-address-type { + type string; + description + "The enumerated value for the network address type + identified in this TLV. This enumeration is defined in the + 'Assigned Numbers' RFC [RFC3232] and the + ianaAddressFamilyNumbers object."; + } + } + + grouping lldp-capabilities-config { + description + "Configuration data for LLDP capabilities"; + } + + grouping lldp-capabilities-state { + description + "Operational state data for LLDP capabilities"; + + leaf name { + type identityref { + base oc-lldp-types:LLDP_SYSTEM_CAPABILITY; + } + description + "Name of the system capability advertised by the neighbor. + Capabilities are represented in a bitmap that defines the + primary functions of the system. The capabilities are + defined in IEEE 802.1AB."; + } + + leaf enabled { + type boolean; + description + "Indicates whether the corresponding system capability is + enabled on the neighbor."; + reference + "Sec 8.5.8.2 of IEEE 802.1AB-2009"; + } + } + + grouping lldp-capabilities-top { + description + "Top-level grouping for LLDP capabilities"; + + container capabilities { + config false; + description + "Enclosing container for list of LLDP capabilities"; + + list capability { + key "name"; + description + "List of LLDP system capabilities advertised by the + neighbor"; + + leaf name { + type leafref { + path "../state/name"; + } + description + "Reference to capabilities list key"; + } + + container config { + description + "Configuration data for LLDP capabilities"; + + uses lldp-capabilities-config; + } + + container state { + + config false; + + description + "Operational state data for LLDP capabilities"; + + uses lldp-capabilities-config; + uses lldp-capabilities-state; + } + } + } + } + + grouping lldp-custom-tlv-config { + description + "Configuration data for custom LLDP TLVs"; + } + + grouping lldp-custom-tlv-state { + description + "Operational state data for custom LLDP TLVs"; + + leaf type { + type int32; + description + "The integer value identifying the type of information + contained in the value field."; + } + + leaf oui { + type string; + description + "The organizationally unique identifier field shall contain + the organization's OUI as defined in Clause 9 of IEEE Std + 802. The high-order octet is 0 and the low-order 3 octets + are the SMI Network Management Private Enterprise Code of + the Vendor in network byte order, as defined in the + 'Assigned Numbers' RFC [RFC3232]."; + } + + leaf oui-subtype { + type string; + description + "The organizationally defined subtype field shall contain a + unique subtype value assigned by the defining organization."; + } + + // TODO: consider making this string type + leaf value { + type binary; + description + "A variable-length octet-string containing the + instance-specific information for this TLV."; + } + } + + grouping lldp-custom-tlv-top { + description + "Top-level grouping for custom LLDP TLVs"; + + container custom-tlvs { + config false; + description + "Enclosing container for list of custom TLVs from a + neighbor"; + + list tlv { + key "type oui oui-subtype"; + description + "List of custom LLDP TLVs from a neighbor"; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to type list key"; + } + + leaf oui { + type leafref { + path "../state/oui"; + } + description + "Reference to oui list key"; + } + + leaf oui-subtype { + type leafref { + path "../state/oui-subtype"; + } + description + "Reference to oui-subtype list key"; + } + + container config { + description + "Configuration data "; + + uses lldp-custom-tlv-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses lldp-custom-tlv-config; + uses lldp-custom-tlv-state; + } + } + } + } + + grouping lldp-neighbor-top { + description + "Top-level grouping for the LLDP neighbor list"; + + container neighbors { + config false; + description + "Enclosing container for list of LLDP neighbors on an + interface"; + + list neighbor { + key "id"; + description + "List of LLDP neighbors"; + + leaf id { + type leafref { + path "../state/id"; + } + description + " "; + } + + container config { + description + "Configuration data "; + + uses lldp-neighbor-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses lldp-system-info-config; + uses lldp-system-info-state; + uses lldp-neighbor-config; + uses lldp-neighbor-state; + } + + uses lldp-custom-tlv-top; + uses lldp-capabilities-top; + } + } + } + + grouping lldp-interface-config { + description + "Configuration data for LLDP on each interface"; + + leaf name { + type oc-if:base-interface-ref; + description + "Reference to the LLDP Ethernet interface"; + } + + leaf enabled { + type boolean; + default "true"; + description + "Enable or disable the LLDP protocol on the interface."; + } + } + + grouping lldp-interface-state { + description + "Operational state data for LLDP on each interface"; + + container counters { + description + "LLDP counters on each interface"; + + uses lldp-interface-counters; + } + } + + grouping lldp-interface-top { + description + "Top-level grouping "; + + container interfaces { + description + "Enclosing container "; + + list interface { + key "name"; + description + "List of interfaces on which LLDP is enabled / available"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the list key"; + } + + container config { + description + "Configuration data for LLDP on each interface"; + + uses lldp-interface-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses lldp-interface-config; + uses lldp-interface-state; + } + + uses lldp-neighbor-top; + } + } + } + + + grouping lldp-config { + description + "Configuration data for global LLDP parameters"; + + leaf enabled { + type boolean; + default "true"; + description + "System level state of the LLDP protocol."; + } + + leaf hello-timer { + type uint64; + units "seconds"; + description + "System level hello timer for the LLDP protocol."; + } + + leaf-list suppress-tlv-advertisement { + type identityref { + base oc-lldp-types:LLDP_TLV; + } + description + "Indicates whether the local system should suppress the + advertisement of particular TLVs with the LLDP PDUs that it + transmits. Where a TLV type is specified within this list, it + should not be included in any LLDP PDU transmitted by the + local agent."; + } + } + + grouping lldp-state { + description + "Operational state data for global LLDP parameters"; + + container counters { + description + "Global LLDP counters"; + + uses lldp-global-counters; + } + } + + grouping lldp-top { + description + "Top-level grouping for LLDP model"; + + container lldp { + description + "Top-level container for LLDP configuration and state data"; + + container config { + description + "Configuration data "; + + uses lldp-config; + uses lldp-system-info-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses lldp-config; + uses lldp-system-info-config; + uses lldp-system-info-state; + uses lldp-state; + } + + uses lldp-interface-top; + } + } + + // data definition statements + + uses lldp-top; + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-local-routing@2020-03-24.yang b/exp/yangcli/h3c-yang/openconfig-local-routing@2020-03-24.yang new file mode 100644 index 0000000..97503cd --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-local-routing@2020-03-24.yang @@ -0,0 +1,430 @@ +module openconfig-local-routing { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/local-routing"; + + prefix "oc-loc-rt"; + + // import some basic types + import openconfig-inet-types { prefix inet; } + import openconfig-policy-types { prefix oc-pt; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-interfaces { prefix oc-if; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module describes configuration and operational state data + for routes that are locally generated, i.e., not created by + dynamic routing protocols. These include static routes, locally + created aggregate routes for reducing the number of constituent + routes that must be advertised, summary routes for IGPs, etc. + + This model expresses locally generated routes as generically as + possible, avoiding configuration of protocol-specific attributes + at the time of route creation. This is primarily to avoid + assumptions about how underlying router implementations handle + route attributes in various routing table data structures they + maintain. Hence, the definition of locally generated routes + essentially creates 'bare' routes that do not have any protocol- + specific attributes. + + When protocol-specific attributes must be attached to a route + (e.g., communities on a locally defined route meant to be + advertised via BGP), the attributes should be attached via a + protocol-specific policy after importing the route into the + protocol for distribution (again via routing policy)."; + + oc-ext:openconfig-version "1.1.0"; + + revision "2020-03-24" { + description + "Add a description statement to static routes."; + reference "1.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.0.2"; + } + + revision "2017-05-15" { + description + "Update to resolve style guide non-compliance."; + reference "1.0.1"; + } + + revision "2016-05-11" { + description + "OpenConfig public release"; + reference "1.0.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity LOCAL_DEFINED_NEXT_HOP { + description + "A base identity type of local defined next-hops"; + } + + identity DROP { + base LOCAL_DEFINED_NEXT_HOP; + description + "Discard traffic for the corresponding destination"; + } + + identity LOCAL_LINK { + base LOCAL_DEFINED_NEXT_HOP; + description + "Treat traffic towards addresses within the specified + next-hop prefix as though they are connected to a local + link. When the LOCAL_LINK next-hop type is specified, + an interface must also be specified such that + the local system can determine which link to trigger + link-layer address discovery against"; + } + + // typedef statements + + typedef local-defined-next-hop { + type identityref { + base LOCAL_DEFINED_NEXT_HOP; + } + description + "Pre-defined next-hop designation for locally generated + routes"; + } + + // grouping statements + + grouping local-generic-settings { + description + "Generic options that can be set on local routes When + they are defined"; + + leaf set-tag { + type oc-pt:tag-type; + description + "Set a generic tag value on the route. This tag can be + used for filtering routes that are distributed to other + routing protocols."; + } + + leaf description { + type string; + description + "An optional textual description for the route."; + } + } + + grouping local-static-config { + description + "Configuration data for static routes."; + + leaf prefix { + type inet:ip-prefix; + description + "Destination prefix for the static route, either IPv4 or + IPv6."; + } + + uses local-generic-settings; + } + + grouping local-static-state { + description + "Operational state data for static routes"; + } + + + grouping local-static-nexthop-config { + description + "Configuration parameters related to each next-hop entry + specified for a static route"; + + leaf index { + type string; + description + "An user-specified identifier utilised to uniquely reference + the next-hop entry in the next-hop list. The value of this + index has no semantic meaning other than for referencing + the entry."; + } + + leaf next-hop { + type union { + type inet:ip-address; + type local-defined-next-hop; + } + description + "The next-hop that is to be used for the static route + - this may be specified as an IP address, an interface + or a pre-defined next-hop type - for instance, DROP or + LOCAL_LINK. When this leaf is not set, and the interface-ref + value is specified for the next-hop, then the system should + treat the prefix as though it is directly connected to the + interface."; + } + + leaf metric { + type uint32; + description + "A metric which is utilised to specify the preference of + the next-hop entry when it is injected into the RIB. The + lower the metric, the more preferable the prefix is. When + this value is not specified the metric is inherited from + the default metric utilised for static routes within the + network instance that the static routes are being + instantiated. When multiple next-hops are specified for a + static route, the metric is utilised to determine which of + the next-hops is to be installed in the RIB. When multiple + next-hops have the same metric (be it specified, or simply + the default) then these next-hops should all be installed + in the RIB"; + } + + leaf recurse { + type boolean; + default false; + description + "Determines whether the next-hop should be allowed to + be looked up recursively - i.e., via a RIB entry which has + been installed by a routing protocol, or another static route + - rather than needing to be connected directly to an + interface of the local system within the current network + instance. When the interface reference specified within the + next-hop entry is set (i.e., is not null) then forwarding is + restricted to being via the interface specified - and + recursion is hence disabled."; + } + } + + grouping local-static-nexthop-state { + description + "Operational state parameters relating to a next-hop entry + for a static route"; + } + + + grouping local-static-top { + description + "Top-level grouping for the list of static route definitions"; + + container static-routes { + description + "Enclosing container for the list of static routes"; + + list static { + key "prefix"; + description + "List of locally configured static routes"; + + leaf prefix { + type leafref { + path "../config/prefix"; + } + description + "Reference to the destination prefix list key."; + } + + container config { + description + "Configuration data for static routes"; + + uses local-static-config; + } + + container state { + + config false; + + description + "Operational state data for static routes"; + + uses local-static-config; + uses local-static-state; + } + + container next-hops { + description + "Configuration and state parameters relating to the + next-hops that are to be utilised for the static + route being specified"; + + list next-hop { + key "index"; + + description + "A list of next-hops to be utilised for the static + route being specified."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "A reference to the index of the current next-hop. + The index is intended to be a user-specified value + which can be used to reference the next-hop in + question, without any other semantics being + assigned to it."; + } + + container config { + description + "Configuration parameters relating to the next-hop + entry"; + + uses local-static-nexthop-config; + } + + container state { + config false; + description + "Operational state parameters relating to the + next-hop entry"; + + uses local-static-nexthop-config; + uses local-static-nexthop-state; + } + + uses oc-if:interface-ref; + } + } + } + } + } + + grouping local-aggregate-config { + description + "Configuration data for aggregate routes"; + + leaf prefix { + type inet:ip-prefix; + description + "Aggregate prefix to be advertised"; + } + + leaf discard { + type boolean; + default false; + description + "When true, install the aggregate route with a discard + next-hop -- traffic destined to the aggregate will be + discarded with no ICMP message generated. When false, + traffic destined to an aggregate address when no + constituent routes are present will generate an ICMP + unreachable message."; + } + + uses local-generic-settings; + + } + + grouping local-aggregate-state { + description + "Operational state data for local aggregate advertisement + definitions"; + } + + grouping local-aggregate-top { + description + "Top-level grouping for local aggregates"; + + container local-aggregates { + description + "Enclosing container for locally-defined aggregate + routes"; + + list aggregate { + key "prefix"; + description + "List of aggregates"; + + leaf prefix { + type leafref { + path "../config/prefix"; + } + description + "Reference to the configured prefix for this aggregate"; + } + + container config { + description + "Configuration data for aggregate advertisements"; + + uses local-aggregate-config; + } + + container state { + + config false; + + description + "Operational state data for aggregate + advertisements"; + + uses local-aggregate-config; + uses local-aggregate-state; + } + } + } + } + + grouping local-routes-config { + description + "Configuration data for locally defined routes"; + } + + grouping local-routes-state { + description + "Operational state data for locally defined routes"; + } + + grouping local-routes-top { + description + "Top-level grouping for local routes"; + + container local-routes { + description + "Top-level container for local routes"; + + container config { + description + "Configuration data for locally defined routes"; + + uses local-routes-config; + } + + container state { + + config false; + + description + "Operational state data for locally defined routes"; + + uses local-routes-config; + uses local-routes-state; + } + + uses local-static-top; + uses local-aggregate-top; + } + } + + uses local-routes-top; + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-igp@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-mpls-igp@2018-11-21.yang new file mode 100644 index 0000000..9409138 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-igp@2018-11-21.yang @@ -0,0 +1,131 @@ +submodule openconfig-mpls-igp { + + yang-version "1"; + + belongs-to "openconfig-mpls" { + prefix "oc-mpls"; + } + + // import some basic types + import openconfig-mpls-ldp { prefix oc-ldp; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Configuration generic configuration parameters for IGP-congruent + LSPs"; + + oc-ext:openconfig-version "3.0.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // grouping statements + + grouping igp-lsp-common { + description + "common definitions for IGP-congruent LSPs"; + + } + + + grouping igp-lsp-setup { + description + "signaling protocol definitions for IGP-based LSPs"; + + container path-setup-protocol { + description + "select and configure the signaling method for + the LSP"; + + // uses path-setup-common; + uses oc-ldp:igp-lsp-ldp-setup; + } + } + + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-ldp@2019-07-09.yang b/exp/yangcli/h3c-yang/openconfig-mpls-ldp@2019-07-09.yang new file mode 100644 index 0000000..baa6ed2 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-ldp@2019-07-09.yang @@ -0,0 +1,890 @@ +module openconfig-mpls-ldp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/ldp"; + + prefix "oc-ldp"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-inet-types { prefix oc-inet; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-types { prefix oc-types; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Configuration of Label Distribution Protocol global and LSP- + specific parameters for IGP-congruent LSPs. + + This model reuses data items defined in the IETF YANG model for + LDP described by draft-ietf-mpls-ldp-yang-04, YANG Data Model for + MPLS LDP, following an alternate structure. + + Portions of this code were derived from draft-ietf-mpls-ldp-yang-04. + Please reproduce this note if possible. + + IETF code is subject to the following copyright and license: + Copyright (c) IETF Trust and the persons identified as authors of + the code. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, is permitted pursuant to, and subject to the license + terms contained in, the Simplified BSD License set forth in + Section 4.c of the IETF Trust's Legal Provisions Relating + to IETF Documents (http://trustee.ietf.org/license-info)."; + + oc-ext:openconfig-version "3.0.2"; + + revision "2019-07-09" { + description + "Remove units for timeticks64 leaves, since the type + specifies the units."; + reference "3.0.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedef statements + + typedef mpls-ldp-adjacency-type { + type enumeration { + enum LINK { + description + "Link LDP adjacency"; + } + enum TARGETED { + description + "Targeted LDP adjacency"; + } + } + description + "enumerated type for specifying LDP adjacencies"; + } + + typedef mpls-ldp-afi { + type enumeration { + enum IPV4 { + description + "IPv4 AFI for LDP adjancencies"; + } + enum IPV6 { + description + "IPv6 AFI for LDP adjancencies"; + } + } + description + "enumerated type for specifying LDP AFIs"; + } + + // grouping statements + + grouping ldp-global { + description + "Global LDP signaling configuration"; + + container ldp { + description + "LDP global signaling configuration"; + + container global { + description + "Platform wide LDP configuration and state"; + + uses mpls-ldp-global; + uses mpls-ldp-graceful-restart; + uses mpls-ldp-authentication-top; + } + + uses mpls-ldp-interface-attributes-top; + uses mpls-ldp-targeted-top; + uses mpls-ldp-neighbors-top; + + } + } + + grouping mpls-ldp-authentication-top { + description + "Grouping containing LDP authentication attributes"; + + container authentication { + description + "Global LDP authentication"; + + container config { + description + "Configuration of LDP authentication attributes"; + uses mpls-ldp-authentication-config; + } + + container state { + config false; + description + "LDP authentication state."; + uses mpls-ldp-authentication-config; + } + } + } + + grouping mpls-ldp-neighbors-top { + description + "Global LDP neighbor attributes"; + + container neighbors { + description + "State and configuration LDP neighbors attributes"; + + list neighbor { + key "lsr-id label-space-id"; + + description + "List of LDP neighbors and their attributes."; + + leaf lsr-id { + type leafref { + path "../config/lsr-id"; + } + description + "Neighbor label switch router identifier."; + } + + leaf label-space-id { + type leafref { + path "../config/label-space-id"; + } + description + "Label space ID of the neighbor."; + } + + container config { + description + "Neighbor configuration attributes."; + uses mpls-ldp-neighbor-config; + } + + container state { + config false; + description + "Neighbor state attributes."; + uses mpls-ldp-neighbor-config; + } + + container hello-adjacencies { + config false; + description "Top container for hello adjacencies + for a given LDP neighbor."; + + list hello-adjacency { + key "remote-address local-address"; + config false; + description + "List of hello adjacencies for a given LDP + neighbor."; + + leaf remote-address { + config false; + description + "Within the LDP adjacency, this attribute + shows the neighbor address."; + type leafref { + path "../state/remote-address"; + } + } + + leaf local-address { + config false; + description + "Within the LDP adjacency, this attribute + shows the local address."; + type leafref { + path "../state/local-address"; + } + } + + container state { + description + "State information for a particular LDP + hello adjacency."; + uses mpls-ldp-adjacency-state; + } + + uses oc-if:interface-ref-state; + + container hello-holdtime { + + description + "Specifies the time the sending LSR will + maintain its record of Hellos from the + receiving LSR"; + + container state { + description + "State attributes related to the + hello-holdtime."; + config false; + uses mpls-ldp-hello-holdtime-state; + } + } + + } + } + + uses mpls-ldp-authentication-top; + + } + } + } + + grouping mpls-ldp-neighbor-config { + description + "Global configuration for LDP neighbors."; + + leaf lsr-id { + type oc-inet:ip-address; + description + "Neighbor label switch router identifier."; + } + + leaf label-space-id { + type uint16; + description + "Label space ID of the neighbor."; + } + + } + + grouping mpls-ldp-adjacency-state { + + description + "Set of LDP neighbor related state attributes."; + + leaf remote-address { + description + "Within the LDP adjacency, this attribute + shows the neighbor address."; + type oc-inet:ip-address; + } + + leaf local-address { + description + "Within the LDP adjacency, this attribute + shows the local address."; + type oc-inet:ip-address; + } + + leaf adjacency-type { + description + "This attributes defines if the LDP + adjacency is from a direct link or from + targeted discovery."; + type oc-ldp:mpls-ldp-adjacency-type; + } + + leaf last-clear { + type oc-types:timeticks64; + description + "Timestamp of the last time the interface counters + were cleared expressed relative to the Unix Epoch + (January 1, 1970 00:00:00 UTC)."; + } + + leaf hello-received { + type oc-yang:counter64; + description + "Number of Hello messaged received by the device"; + } + + leaf hello-dropped { + type oc-yang:counter64; + description + "Number of Hello messaged dropped by the device"; + } + + } + + grouping mpls-ldp-hello-holdtime-state { + description + "Grouping containing the state attributes + for hello holdtime."; + + leaf adjacent { + description + "Hello holdtime attribute learned from the + LDP neighbor"; + type uint16; + } + + leaf negotiated { + description + "Hello holdtime attribute negotiated between + the LDP neighbor and the local router."; + type uint16; + } + + leaf hello-expiration { + description + "Expiration time for the hello holdtime."; + type oc-types:timeticks64; + } + + leaf next-hello { + description + "Time when the next LDP hello will be sent to + the adjacent neighbor."; + type oc-types:timeticks64; + } + + } + + grouping mpls-ldp-global { + description + "Global LDP attributes"; + + container config { + description + "Global LDP configuration attributes."; + uses mpls-ldp-global-config; + } + + container state { + config false; + description + "Global LDP state information."; + uses mpls-ldp-global-config; + } + } + + grouping mpls-ldp-global-config { + description + "Grouping containing platform wide LDP information"; + + leaf lsr-id { + type oc-inet:ip-address; + description + "Global label switch router identifier + configuration."; + reference "RFC5036 LDP Specification"; + } + + } + + grouping mpls-ldp-interface-attributes-top { + description + "Top-level structure grouping for interface + attributes"; + + container interface-attributes { + description + "Container including attributes for LDP-enabled + interfaces"; + + container config { + description + "Configuration of per-interface LDP parameters"; + uses mpls-ldp-hello-timers-top-config; + } + + container state { + config false; + description + "Per-interface LDP protocol and state information"; + uses mpls-ldp-hello-timers-top-config; + } + + container interfaces { + description + "Container aggregating all interfaces and their + LDP-specific attributes."; + + list interface { + key "interface-id"; + description + "list of per-interface LDP configurations"; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "reference to the interface-id data"; + } + + container config { + description + "Configuration of per-interface LDP parameters"; + uses mpls-ldp-interfaces-config; + uses mpls-ldp-hello-timers-top-config; + } + + container state { + config false; + description + "Per-interface LDP protocol and state information"; + + uses mpls-ldp-interfaces-config; + uses mpls-ldp-hello-timers-top-config; + + container counters { + config false; + description + "Interface specific LDP statistics and counters"; + } + } + + uses oc-if:interface-ref; + uses mpls-ldp-address-families-ldp-top; + + } + } + } + } + + grouping mpls-ldp-address-families-ldp-top { + description + "Grouping containing the state and configuration + attributes for adress families."; + + container address-families { + description + "Top container comprising the adress families + attributes"; + list address-family { + key "afi-name"; + description + "List for attributes related to address-families for LDP."; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Adress-family name atttibute (IPv4, IPv6)."; + } + + container config { + description + "Configuration attributes related to address-families + for LDP."; + uses mpls-ldp-address-family-config; + uses admin-config; + } + + container state { + description + "State attributes related to address-families for LDP."; + config false; + uses mpls-ldp-address-family-config; + uses admin-config; + } + } + } + } + + grouping mpls-ldp-hello-timers-top-config { + + description + "Grouping containing interface-related attributes + that can be configured for LDP."; + + leaf hello-holdtime { + type uint16; + description + "Defines the time for which a neighbor adjacency will + be kept by the router while it waits for a new link + Hello message."; + reference "RFC5036 LDP Specification"; + } + + leaf hello-interval { + type uint16; + description + "Defines the interval for sending Hello messages on + each link LDP adjacency."; + } + + } + + grouping mpls-ldp-targeted-top { + + description + "Grouping containing attributes for targeted LDP"; + + container targeted { + description + "Top container for targeted LDP state and configuration + attributes."; + + container config { + description + "Configuration attributes related to targeted LDP."; + uses mpls-ldp-targeted-attributes-top-config; + } + + container state { + config false; + description + "State attributes related to targeted LDP."; + uses mpls-ldp-targeted-attributes-top-config; + } + + uses mpls-ldp-address-targeted-ldp-top; + } + } + + grouping mpls-ldp-address-targeted-ldp-top { + description + "Grouping containing address attributes for targeted LDP."; + + container address-families { + description + "Global container for IPv4 and IPv6 attributes for LDP."; + + list address-family { + key "afi-name"; + description + "List of address families for targeted LDP + configuration"; + + leaf afi-name { + type leafref { + path "../config/afi-name"; + } + description + "Adress-family name atttibute (IPv4, IPv6)."; + } + + container config { + description + "Address-family configuration for targeted LDP"; + uses mpls-ldp-address-family-config; + } + + container state { + config false; + description + "Address-family state for targeted LDP"; + uses mpls-ldp-address-family-config; + } + + container targets { + description + "Container aggregating all targeted sessions and + their LDP-specific attributes."; + + list target { + key "remote-address"; + + description + "List of LDP targets configuration"; + + leaf remote-address { + type leafref { + path "../config/remote-address"; + } + description + "Neighbor address of the targeted LDP session"; + } + + container config { + + description + "Configuration parameters of a targeted LDP + adjacency"; + + leaf remote-address { + type oc-inet:ip-address; + description + "Configuration of neighbor address of the + targeted LDP adjacency"; + } + + leaf local-address { + type oc-inet:ip-address; + description + "Local IP address of the LDP adjacency"; + } + + uses admin-config; + uses mpls-ldp-hello-timers-top-config; + } + + container state { + config false; + description + "State attributes of a targeted LDP adjacency"; + + leaf remote-address { + config false; + type oc-inet:ip-address; + description + "Neighbor address of the targeted LDP adjacency"; + } + + leaf local-address { + config false; + type oc-inet:ip-address; + description + "Local IP address of the LDP adjacency"; + } + + uses admin-config; + uses mpls-ldp-hello-timers-top-config; + } + } + } + } + } + } + + grouping mpls-ldp-address-family-config { + description + "Grouping containing adress-family name atttibute"; + + leaf afi-name { + description + "Adress-family name atttibute (IPv4, IPv6)."; + type oc-ldp:mpls-ldp-afi; + } + + } + + grouping mpls-ldp-targeted-attributes-top-config { + + description + "Grouping containing targeted LDP configuration + attributes."; + + uses mpls-ldp-hello-timers-top-config; + + leaf hello-accept { + type boolean; + description + "Enables or disables the acceptance of targeted LDP + hello messages."; + reference "RFC5036 LDP Specification"; + } + + } + + grouping mpls-ldp-interfaces-config { + description + "LDP configuration information relevant to an interface"; + + leaf interface-id { + type oc-if:interface-id; + description + "Identifier for the interface"; + } + } + + grouping mpls-ldp-graceful-restart { + description + "Attributes relating to LDP Graceful-Restart"; + + container graceful-restart { + description + "Top container for LDP graceful-restart attributes"; + + container config { + description + "LDP graceful-restart configuration attributes."; + uses mpls-ldp-graceful-restart-config; + } + + container state { + config false; + description + "LDP graceful-restart state attributes."; + uses mpls-ldp-graceful-restart-config; + } + } + } + + grouping mpls-ldp-graceful-restart-config { + description + "Configuration parameters relating to LDP Graceful-Restart"; + + uses admin-config; + + leaf reconnect-time { + type uint16; + description + "Interval for which the remote LDP peers + will wait for the local node to reconnect after a + failure"; + reference "RFC3478 Graceful Restart Mechanism for Label + Distribution Protocol"; + } + + leaf recovery-time { + type uint16; + description + "Interval used to specify the time for the remote + peer to maintain the MPLS forwarding state after + the local node has succesfully reconnected"; + reference "RFC3478 Graceful Restart Mechanism for Label + Distribution Protocol"; + } + + leaf forwarding-holdtime { + type uint16; + description + "Time that defines the interval for keeping the + node in recovery mode."; + reference "RFC3478 Graceful Restart Mechanism for Label + Distribution Protocol"; + } + + leaf helper-enable { + type boolean; + description + "Enables the graceful restart helper for LDP."; + } + } + + grouping igp-tunnel-ldp { + description + "common defintiions for LDP-signaled LSP tunnel + types"; + } + + grouping igp-lsp-ldp-setup { + description + "grouping for LDP setup attributes"; + + container ldp { + description + "LDP signaling setup for IGP-congruent LSPs"; + uses igp-tunnel-ldp; + } + } + + grouping mpls-ldp-authentication-config { + description + "LDP authentication parameters container."; + + leaf enable { + type boolean; + default false; + description + "Enables LDP authentication on the node."; + } + + leaf authentication-key { + type oc-types:routing-password; + description + "authenticate LDP signaling + messages"; + reference + "RFC1321 The MD5 Message-Digest Algorithm + RFC5036 LDP Specification"; + } + } + + grouping admin-config { + description + "Re-usable grouping to enable or disable a particular LDP feature."; + + leaf enabled { + type boolean; + default false; + description + "When set to true, the functionality within which this leaf is + defined is enabled, when set to false it is explicitly disabled."; + } + } + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-rsvp@2020-02-04.yang b/exp/yangcli/h3c-yang/openconfig-mpls-rsvp@2020-02-04.yang new file mode 100644 index 0000000..2507aa9 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-rsvp@2020-02-04.yang @@ -0,0 +1,1455 @@ +module openconfig-mpls-rsvp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/rsvp"; + + prefix "oc-rsvp"; + + // import some basic types + import openconfig-inet-types { prefix inet; } + import openconfig-mpls-types { prefix oc-mplst; } + import openconfig-yang-types { prefix yang; } + import openconfig-types { prefix oc-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-interfaces { prefix oc-if; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Configuration for RSVP-TE signaling, including global protocol + parameters and LSP-specific configuration for constrained-path + LSPs"; + + oc-ext:openconfig-version "3.0.2"; + + revision "2020-02-04" { + description + "Changed peak-data-rate leaf type to ieeefloat32 only."; + reference "3.0.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + grouping mpls-rsvp-soft-preemption-config { + description + "Configuration for MPLS soft preemption"; + leaf enable { + type boolean; + default false; + description + "Enables soft preemption on a node."; + } + + leaf soft-preemption-timeout { + type uint16 { + range 0..max; + } + default 30; + description + "Timeout value for soft preemption to revert + to hard preemption. The default timeout for + soft-preemption is 30 seconds - after which + the local system reverts to hard pre-emption."; + reference "RFC5712 MPLS-TE soft preemption"; + } + } + + grouping mpls-rsvp-soft-preemption { + description + "Top level group for MPLS soft preemption"; + container soft-preemption { + description + "Protocol options relating to RSVP + soft preemption"; + container config { + description + "Configuration parameters relating to RSVP + soft preemption support"; + uses mpls-rsvp-soft-preemption-config; + } + container state { + config false; + description + "State parameters relating to RSVP + soft preemption support"; + uses mpls-rsvp-soft-preemption-config; + } + } + } + + grouping mpls-rsvp-hellos-config { + description + "RSVP protocol options configuration."; + + leaf hello-interval { + type uint16 { + range 1000..60000; + } + units milliseconds; + default 9000; + description + "set the interval in ms between RSVP hello + messages"; + reference + "RFC 3209: RSVP-TE: Extensions to RSVP for + LSP Tunnels. + RFC 5495: Description of the Resource + Reservation Protocol - Traffic-Engineered + (RSVP-TE) Graceful Restart Procedures"; + } + + leaf refresh-reduction { + type boolean; + default true; + description + "enables all RSVP refresh reduction message + bundling, RSVP message ID, reliable message delivery + and summary refresh"; + reference + "RFC 2961 RSVP Refresh Overhead Reduction + Extensions"; + } + } + + grouping mpls-rsvp-hellos { + description + "Top level grouping for RSVP hellos parameters"; + // TODO: confirm that the described semantics are supported + // on various implementations. Finer grain configuration + // will be vendor-specific + + container hellos { + description + "Top level container for RSVP hello parameters"; + + container config { + description + "Configuration parameters relating to RSVP + hellos"; + uses mpls-rsvp-hellos-config; + } + container state { + config false; + description + "State information associated with RSVP hellos"; + uses mpls-rsvp-hellos-config; + } + } + } + + grouping mpls-rsvp-subscription-config { + description + "RSVP subscription configuration"; + + leaf subscription { + type oc-types:percentage; + description + "percentage of the interface bandwidth that + RSVP can reserve"; + } + } + + grouping mpls-rsvp-subscription-state { + description + "Operational state parameters relating to the + bandwidth subscription on an interface"; + + leaf calculated-absolute-subscription-bw { + type uint64; + units "kbps"; + description + "The calculated absolute value of the bandwidth + which is reservable to RSVP-TE on the interface + prior to any adjustments that may be made from + external sources."; + } + } + + grouping mpls-rsvp-subscription { + description + "Top level group for RSVP subscription options"; + + container subscription { + description + "Bandwidth percentage reservable by RSVP + on an interface"; + + container config { + description + "Configuration parameters relating to RSVP + subscription options"; + uses mpls-rsvp-subscription-config; + } + + container state { + config false; + description + "State parameters relating to RSVP + subscription options"; + uses mpls-rsvp-subscription-config; + uses mpls-rsvp-subscription-state; + } + } + } + + grouping mpls-rsvp-graceful-restart-config { + description + "Configuration parameters relating to RSVP Graceful-Restart"; + + leaf enable { + type boolean; + default false; + description + "Enables graceful restart on the node."; + } + + leaf restart-time { + type uint32; + description + "Graceful restart time (seconds)."; + reference + "RFC 5495: Description of the Resource + Reservation Protocol - Traffic-Engineered + (RSVP-TE) Graceful Restart Procedures"; + } + leaf recovery-time { + type uint32; + description + "RSVP state recovery time"; + } + } + + grouping mpls-rsvp-graceful-restart { + description + "Top level group for RSVP graceful-restart + parameters"; + + container graceful-restart { + description + "Operational state and configuration parameters relating to + graceful-restart for RSVP"; + + container config { + description + "Configuration parameters relating to + graceful-restart"; + uses mpls-rsvp-graceful-restart-config; + } + + container state { + config false; + description + "State information associated with + RSVP graceful-restart"; + uses mpls-rsvp-graceful-restart-config; + } + } + } + + grouping mpls-rsvp-authentication-config { + description + "RSVP authentication parameters container."; + + leaf enable { + type boolean; + default false; + description + "Enables RSVP authentication on the node."; + } + + leaf authentication-key { + type string { + // Juniper supports 1..16 while + // Cisco has a much bigger range, up to 60. + length "1..32"; + } + description + "authenticate RSVP signaling + messages"; + reference + "RFC 2747: RSVP Cryptographic Authentication"; + } + } + + grouping mpls-rsvp-authentication { + description + "Top level group for RSVP authentication, + as per RFC2747"; + + container authentication { + description + "Configuration and state parameters relating to RSVP + authentication as per RFC2747"; + + container config { + description + "Configuration parameters relating + to authentication"; + uses mpls-rsvp-authentication-config; + } + + container state { + config false; + description + "State information associated + with authentication"; + uses mpls-rsvp-authentication-config; + } + } + } + + grouping mpls-rsvp-protection-config { + description + "RSVP facility (link/node) protection configuration"; + + leaf link-protection-style-requested { + type identityref { + base oc-mplst:PROTECTION_TYPE; + } + default oc-mplst:LINK_NODE_PROTECTION_REQUESTED; + description + "Style of mpls frr protection desired: + link, link-node, or unprotected"; + } + + leaf bypass-optimize-interval { + type uint16; + units seconds; + description + "interval between periodic optimization + of the bypass LSPs"; + // note: this is interface specific on juniper + // on iox, this is global. need to resolve. + } + // to be completed, things like enabling link protection, + // optimization times, etc. + } + + grouping mpls-rsvp-link-protection { + description + "Top level group for RSVP protection"; + container protection { + description + "link-protection (NHOP) related configuration"; + + container config { + description + "Configuration for link-protection"; + uses mpls-rsvp-protection-config; + } + + container state { + config false; + description + "State for link-protection"; + uses mpls-rsvp-protection-config; + } + } + } + + grouping mpls-rsvp-statistics { + description + "Top level grouping for RSVP protocol state"; + + uses mpls-rsvp-protocol-state; + } + + grouping rsvp-global { + description + "Global RSVP protocol configuration"; + container rsvp-te { + description + "RSVP-TE global signaling protocol configuration"; + + uses mpls-rsvp-session-state; + + container neighbors { + description + "Configuration and state for RSVP neighbors connecting + to the device"; + + list neighbor { + key "address"; + + config false; + + description + "List of RSVP neighbors of the local system"; + + leaf address { + type leafref { + path "../state/address"; + } + description + "Reference to the address of the RSVP neighbor"; + } + + container state { + config false; + description + "Operational state parameters relating to the + RSVP neighbor"; + uses mpls-rsvp-neighbor-state; + } + } + } + + container global { + description + "Platform wide RSVP configuration and state"; + uses mpls-rsvp-graceful-restart; + uses mpls-rsvp-soft-preemption; + uses mpls-rsvp-hellos; + + container state { + config false; + description + "Platform wide RSVP state, including counters"; + // TODO - reconcile global and per-interface + // protocol-related statistics + + container counters { + config false; + description + "Platform wide RSVP statistics and counters"; + uses mpls-rsvp-global-protocol-state; + uses mpls-rsvp-statistics; + + container errors { + description + "Error counters associated with the global RSVP-TE + instance."; + uses mpls-rsvp-error-counters; + } + } + } + } + + container interface-attributes { + description + "Attributes relating to RSVP-TE enabled interfaces"; + + list interface { + key "interface-id"; + description + "list of per-interface RSVP configurations"; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "reference to the interface-id data"; + } + + + container config { + description + "Configuration of per-interface RSVP parameters"; + uses mpls-rsvp-interfaces-config; + } + + container state { + config false; + description + "Per-interface RSVP protocol and state information"; + + uses mpls-rsvp-interfaces-state; + uses mpls-rsvp-interfaces-config; + + container counters { + config false; + description + "Interface specific RSVP statistics and counters"; + uses mpls-rsvp-protocol-state; + uses mpls-rsvp-rate-limited-messages-state; + + container errors { + description + "Interface specific RSVP error counters"; + uses mpls-rsvp-error-counters; + } + } + } + + uses oc-if:interface-ref; + uses mpls-rsvp-interface-reservations; + uses mpls-rsvp-hellos; + uses mpls-rsvp-authentication; + uses mpls-rsvp-subscription; + uses mpls-rsvp-link-protection; + } + } + } + } + + grouping rsvp-p2p-tunnel-attributes-config { + description + "properties of RSVP point-to-point paths"; + + leaf source { + when "../signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type inet:ip-address; + description + "RSVP-TE tunnel source address"; + } + + leaf soft-preemption { + when "../signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type boolean; + default false; + description + "Enables RSVP soft-preemption on this LSP"; + } + + uses rsvp-priorities-tunnel-config; + } + + grouping rsvp-priorities-tunnel-config { + description + "Configuration paramters related to RSVP-TE priorities for + an LSP tunnel"; + + leaf setup-priority { + when "../signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type uint8 { + range 0..7; + } + default 7; + description + "RSVP-TE preemption priority during LSP setup, lower is + higher priority; default 7 indicates that LSP will not + preempt established LSPs during setup"; + reference "RFC 3209 - RSVP-TE: Extensions to RSVP for + LSP Tunnels"; + } + + leaf hold-priority { + when "../signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type uint8 { + range 0..7; + } + default 0; + description + "preemption priority once the LSP is established, + lower is higher priority; default 0 indicates other LSPs + will not preempt the LSPs once established"; + reference "RFC 3209 - RSVP-TE: Extensions to RSVP for + LSP Tunnels"; + } + } + + grouping rsvp-priorities-path-config { + description + "Configuration paramters related to RSVP-TE priorities on + a primary/secondary path associated with an LSP."; + + leaf setup-priority { + when "../../../../../" + + "config/signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type uint8 { + range 0..7; + } + default 7; + description + "RSVP-TE preemption priority during LSP setup, lower is + higher priority; default 7 indicates that LSP will not + preempt established LSPs during setup"; + reference "RFC 3209 - RSVP-TE: Extensions to RSVP for + LSP Tunnels"; + } + + leaf hold-priority { + when "../../../../../" + + "config/signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type uint8 { + range 0..7; + } + default 0; + description + "preemption priority once the LSP is established, + lower is higher priority; default 0 indicates other LSPs + will not preempt the LSPs once established"; + reference "RFC 3209 - RSVP-TE: Extensions to RSVP for + LSP Tunnels"; + } + } + + grouping rsvp-p2p-path-attributes-config { + description + "properties of RSPP point-to-point paths"; + + uses rsvp-priorities-path-config; + + leaf retry-timer { + when "../../../../../" + + "config/signaling-protocol = 'PATH_SETUP_RSVP'" { + description + "When the signaling protocol is RSVP-TE "; + } + type uint16 { + range 1..600; + } + units seconds; + description + "sets the time between attempts to establish the + LSP"; + } + } + + grouping mpls-rsvp-neighbor-state { + description + "State information for RSVP neighbors"; + + leaf address { + type inet:ip-address; + description + "Address of RSVP neighbor"; + } + + leaf detected-interface { + type string; + description + "Interface where RSVP neighbor was detected"; + } + + leaf neighbor-status { + type enumeration { + enum UP { + description + "RSVP hello messages are detected from the neighbor"; + } + enum DOWN { + description + "RSVP neighbor not detected as up, due to a + communication failure or IGP notification + the neighbor is unavailable"; + } + } + description + "Enumuration of possible RSVP neighbor states"; + } + + leaf refresh-reduction { + type boolean; + description + "Suppport of neighbor for RSVP refresh reduction"; + reference + "RFC 2961 RSVP Refresh Overhead Reduction + Extensions"; + } + + } + + grouping mpls-rsvp-session-state { + description + "State information for RSVP TE sessions"; + + container sessions { + description + "Enclosing container for sessions"; + + list session { + key "local-index"; + config false; + + description + "List of RSVP sessions"; + + leaf local-index { + type leafref { + path "../state/local-index"; + } + description + "Reference to the local index for the RSVP + session"; + } + + uses mpls-rsvp-record-route-object-top; + uses mpls-rsvp-explicit-route-object-top; + + container state { + description + "Operational state parameters relating to the + RSVP session"; + + leaf local-index { + type uint64; + description + "The index used to identify the RSVP session + on the local network element. This index is + generated by the device and is unique only + to the local network element."; + } + + leaf source-address { + type inet:ip-address; + description + "Origin address of RSVP session"; + } + + leaf destination-address { + type inet:ip-address; + description + "Destination address of RSVP session"; + } + + leaf tunnel-id { + type uint16; + description + "The tunnel ID is an identifier used in the + RSVP session, which remains constant over + the life of the tunnel."; + reference "RFC 3209"; + } + + leaf lsp-id { + type uint16; + description + "The LSP ID distinguishes between two LSPs + originated from the same headend, and is + commonly used to distinguish RSVP sessions + during make before break operations."; + reference "RFC 3209"; + } + + leaf session-name { + type string; + description + "The signaled name of this RSVP session."; + } + + leaf status { + type enumeration { + enum UP { + description + "RSVP session is up"; + } + enum DOWN { + description + "RSVP session is down"; + } + } + description + "Enumeration of RSVP session states"; + } + + leaf type { + type identityref { + base oc-mplst:LSP_ROLE; + } + description + "The type/role of the RSVP session, signifing + the session's role on the current device, such as + a transit session vs. an ingress session."; + } + + leaf protection-requested { + type identityref { + base oc-mplst:PROTECTION_TYPE; + } + description + "The type of protection requested for the RSVP session"; + } + + leaf label-in { + type oc-mplst:mpls-label; + description + "Incoming MPLS label associated with this RSVP session"; + } + + leaf label-out { + type oc-mplst:mpls-label; + description + "Outgoing MPLS label associated with this RSVP session"; + } + + container sender-tspec { + description + "Operational state statistics relating to the SENDER_TSPEC + received for the RSVP session"; + + leaf rate { + type oc-types:ieeefloat32; + units "Bps"; + description + "The rate at which the head-end device generates traffic, + expressed in bytes per second."; + reference + "RFC2210: RSVP with INTSERV"; + } + + leaf size { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The size of the token bucket that is used to determine + the rate at which the head-end device generates traffic, + expressed in bytes per second."; + reference + "RFC2210: RSVP with INTSERV"; + } + + leaf peak-data-rate { + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The maximum traffic generation rate that the head-end + device sends traffic at."; + reference + "RFC2210: RSVP with INTSERV"; + } + } + } + } + } + } //rsvp-session-state + + grouping mpls-rsvp-interfaces-config { + description + "RSVP configuration information relevant to an interface"; + + leaf interface-id { + type oc-if:interface-id; + description + "Identifier for the interface"; + } + } + + grouping mpls-rsvp-interfaces-state { + description + "RSVP state information relevant to an interface"; + + leaf max-link-bandwidth { + type oc-mplst:bandwidth-kbps; + description + "The maximum link bandwidth expressed in kilobits + per second. This value should be the same (other than + the units) as the value that is advertised into the + IGP traffic engineering database."; + } + } + + grouping mpls-rsvp-interface-reservations { + description + "Operational state related to interface bandwidth + reservations"; + + container bandwidth-reservations { + description + "Enclosing container for bandwidth reservation"; + list bandwidth-reservation { + key "priority"; + config false; + description + "Available and reserved bandwidth by priority on + the interface."; + + leaf priority { + type leafref { + path "../state/priority"; + } + description "Reference to the RSVP priority level"; + } + + container state { + description + "Operational state parameters relating to a + bandwidth reservation at a certain priority"; + + leaf priority { + type union { + type uint8 { + range 0..7; + } + type enumeration { + enum ALL { + description + "The ALL keyword represents the overall + state of the interface - i.e., the union + of all of the priority levels"; + } + } + } + description + "RSVP priority level for LSPs traversing the interface"; + } + + leaf available-bandwidth { + type oc-mplst:bandwidth-mbps; + description + "Bandwidth currently available with the priority level, + or for the entire interface when the priority is set to + ALL"; + } + + leaf reserved-bandwidth { + type oc-mplst:bandwidth-mbps; + description + "Bandwidth currently reserved within the priority level, + or the sum of all priority levels when the keyword is set + to ALL"; + } + + leaf active-reservations-count { + type yang:gauge64; + description + "Number of active RSVP reservations in the associated + priority, or the sum of all reservations when the priority + level is set to ALL"; + } + + leaf highwater-mark { + type oc-mplst:bandwidth-mbps; + description + "Maximum bandwidth reserved on the interface within the + priority, or across all priorities in the case that the + priority level is set to ALL"; + } + } + } + } + } + + grouping mpls-rsvp-global-protocol-state { + description + "RSVP protocol statistics which may not apply + on an interface, but are significant globally."; + + leaf path-timeouts { + type yang:counter64; + description + "The number of Path State Blocks (PSBs) that + have been timed out by the local system."; + } + + leaf reservation-timeouts { + type yang:counter64; + description + "The number of Reservation State Blocks (RSBs) that + have been timed out by the local system."; + } + + uses mpls-rsvp-rate-limited-messages-state; + } + + grouping mpls-rsvp-rate-limited-messages-state { + description + "Common grouping for rate limit messages"; + + leaf rate-limited-messages { + type yang:counter64; + description + "RSVP messages dropped due to rate limiting"; + } + } + + grouping mpls-rsvp-protocol-state { + description + "RSVP protocol statistics and message counters"; + + leaf in-path-messages { + type yang:counter64; + description + "Number of received RSVP Path messages"; + } + + leaf in-path-error-messages { + type yang:counter64; + description + "Number of received RSVP Path Error messages"; + } + + leaf in-path-tear-messages { + type yang:counter64; + description + "Number of received RSVP Path Tear messages"; + } + + leaf in-reservation-messages { + type yang:counter64; + description + "Number of received RSVP Resv messages"; + } + + leaf in-reservation-error-messages { + type yang:counter64; + description + "Number of received RSVP Resv Error messages"; + } + + leaf in-reservation-tear-messages { + type yang:counter64; + description + "Number of received RSVP Resv Tear messages"; + } + + leaf in-hello-messages { + type yang:counter64; + description + "Number of received RSVP hello messages"; + } + + leaf in-srefresh-messages { + type yang:counter64; + description + "Number of received RSVP summary refresh messages"; + } + + leaf in-ack-messages { + type yang:counter64; + description + "Number of received RSVP refresh reduction ack + messages"; + } + + leaf out-path-messages { + type yang:counter64; + description + "Number of sent RSVP PATH messages"; + } + + leaf out-path-error-messages { + type yang:counter64; + description + "Number of sent RSVP Path Error messages"; + } + + leaf out-path-tear-messages { + type yang:counter64; + description + "Number of sent RSVP Path Tear messages"; + } + + leaf out-reservation-messages { + type yang:counter64; + description + "Number of sent RSVP Resv messages"; + } + + leaf out-reservation-error-messages { + type yang:counter64; + description + "Number of sent RSVP Resv Error messages"; + } + + leaf out-reservation-tear-messages { + type yang:counter64; + description + "Number of sent RSVP Resv Tear messages"; + } + + leaf out-hello-messages { + type yang:counter64; + description + "Number of sent RSVP hello messages"; + } + + leaf out-srefresh-messages { + type yang:counter64; + description + "Number of sent RSVP summary refresh messages"; + } + + leaf out-ack-messages { + type yang:counter64; + description + "Number of sent RSVP refresh reduction ack messages"; + } + } + + grouping mpls-rsvp-record-route-object-top { + description + "Top-level structure grouping for list of record route + objects."; + + container record-route-objects { + description + "Enclosing container for MPLS RRO objects associated with the + traffic engineered tunnel."; + + list record-route-object { + key "index"; + config false; + + description + "Read-only list of record route objects associated with the + traffic engineered tunnel. Each entry in the list + may contain a hop IP address, MPLS label allocated + at the hop, and the flags associated with the entry."; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the index of the record route object. + The index is used to indicate the ordering of hops in + the path."; + } + + container state { + config false; + + description + "Information related to RRO objects. The hop, label, and + optional flags are present for each entry in the list."; + + uses mpls-rsvp-record-route-object-state; + } + } + } + } + + grouping mpls-rsvp-record-route-object-state { + description + "Grouping to hold information relating to record route + objects relevant to a traffic engineering LSP."; + + leaf index { + type uint8; + description + "Index of object in the list. Used for ordering."; + } + + leaf address { + type inet:ip-address; + description + "IP router hop for RRO entry"; + } + + leaf reported-label { + type oc-mplst:mpls-label; + description + "Label reported for RRO hop"; + } + + leaf reported-flags { + type uint8; + description + "Subobject flags for MPLS label"; + } + } + + grouping mpls-rsvp-explicit-route-object-top { + description + "Top-level structure for explicit-route objects."; + + container explicit-route-objects { + description + "Enclosing container for MPLS ERO objects associated + with the traffic engineered tunnel."; + + list explicit-route-object { + key "index"; + + config false; + + description + "Read-only list of explicit route objects associated with the + traffic-engineered tunnel. Each entry in the list contains + a hop IP address, and the MPLS label allocated at the hop."; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the index of the entry in the explicit route + object. The index is used to indicate the ordering of hops + in the path."; + } + + container state { + config false; + description + "Information related to the ERO index."; + uses mpls-rsvp-explicit-route-object-state; + } + } + } + } + + grouping mpls-rsvp-explicit-route-object-state { + description + "Grouping defining information related to an individual hop + of an ERO."; + + leaf index { + type uint64; + description + "Index of the entry in the ERO. Entries are ordered in + ascending order from the source to destination of the + LSP."; + } + + leaf loose { + type boolean; + description + "When set to true, indicates that the hop of the ERO is + a loose hop within the explicit route. If unset, indicates + that the hop must explicitly traverse the entity specified + in the ERO hop as the next-entity."; + } + + leaf type { + type enumeration { + enum IPV4 { + description + "The hop represents an IPv4 prefix."; + reference "RFC3209"; + } + enum IPV6 { + description + "The hop represents an IPv6 prefix."; + reference "RFC3209"; + } + enum ASN { + description + "The hop represents an autonomous system number."; + reference "RFC3209"; + } + enum ASN4 { + description + "The hop represents a 4-byte autonomous system number."; + } + enum LABEL { + description + "The hop represents an MPLS label."; + reference "RFC3473"; + } + enum UNNUMBERED_INTERFACE { + description + "The hop represents an unnumbered interface."; + reference "RFC3477"; + } + } + description + "The type of hop indicated by the ERO entry."; + } + + leaf ip-prefix { + type inet:ip-prefix; + description + "The IPv4 or IPv6 prefix indicated by the ERO. Specified + only when the ERO hop is an IPv4 or IPv6 prefix."; + } + + leaf asn { + type inet:as-number; + description + "The autonomous system number indicated by the ERO. Specified + only when the ERO hop is an 2 or 4-byte AS number."; + } + + leaf label { + type oc-mplst:mpls-label; + description + "The MPLS label specified in the ERO hop. Specified only when + the hop is an MPLS label."; + } + + leaf interface-id { + type uint32; + description + "The interface ID for an unnumbered interface. Specified only + when the ERO hop is a unnumbered interface."; + } + reference + "RFC3477 - Signalling Unnumbered Links in Resource + ReSerVation Protocol - Traffic Engineering (RSVP-TE)"; + + } + + grouping mpls-rsvp-error-counters { + description + "Grouping containing definitions of leaves relating to + errors in RSVP-TE. This grouping can be used in different + contexts - e.g., per-RSVP-TE protocol instance, or per- + interface such that the errors represented should + correspond to the number of errors that have occurred for + the context in which the grouping is used."; + + leaf authentication-fail { + type yang:counter64; + description + "The number of packets received that have failed RSVP-TE + authentication checks in the specified context."; + } + + leaf bad-checksum { + type yang:counter64; + description + "The number of packets received that have an incorrect RSVP-TE + checksum in the context."; + } + + leaf bad-packet-format { + type yang:counter64; + description + "The number of packets received that were dropped due to being + badly formed in the context."; + } + + leaf bad-packet-length { + type yang:counter64; + description + "The number of packets received that were dropped due to having + an invalid length specified in the context."; + } + + leaf out-of-order { + type yang:counter64; + description + "The number of messages received out of order in the context."; + } + + leaf received-nack { + type yang:counter64; + description + "The number of NACK RESV messages received in the context."; + } + + leaf transmit-failure { + type yang:counter64; + description + "The total number of packets dropped on transmit in the context."; + } + + leaf transmit-queue-full { + type yang:counter64; + description + "The number of packets dropped due to the transmit queue being + full in the context."; + } + + leaf unknown-ack { + type yang:counter64; + description + "The number of packets received containing an ACK for an unknown + message ID in the context."; + } + + leaf unknown-nack { + type yang:counter64; + description + "The number of packets received containing a NACK for an unknown + message ID in the context."; + } + } + + + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-sr@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-mpls-sr@2018-11-21.yang new file mode 100644 index 0000000..8fc670f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-sr@2018-11-21.yang @@ -0,0 +1,149 @@ +module openconfig-mpls-sr { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/mpls-sr"; + + prefix "oc-mpls-sr"; + + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Configuration for MPLS with segment routing-based LSPs, + including global parameters, and LSP-specific configuration for + both constrained-path and IGP-congruent LSPs"; + + oc-ext:openconfig-version "3.0.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping sr-path-attributes-config { + description + "Configuration parameters relating to SR-TE LSPs"; + + leaf sid-selection-mode { + type enumeration { + enum ADJ_SID_ONLY { + description + "The SR-TE tunnel should only use adjacency SIDs + to build the SID stack to be pushed for the LSP"; + } + enum MIXED_MODE { + description + "The SR-TE tunnel can use a mix of adjacency + and prefix SIDs to build the SID stack to be pushed + to the LSP"; + } + } + default MIXED_MODE; + description + "The restrictions placed on the SIDs to be selected by the + calculation method for the explicit path when it is + instantiated for a SR-TE LSP"; + } + + leaf sid-protection-required { + type boolean; + default "false"; + description + "When this value is set to true, only SIDs that are + protected are to be selected by the calculating method + when the explicit path is instantiated by a SR-TE LSP."; + } + } + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-static@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-mpls-static@2018-11-21.yang new file mode 100644 index 0000000..f3d0512 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-static@2018-11-21.yang @@ -0,0 +1,318 @@ +submodule openconfig-mpls-static { + + yang-version "1"; + + belongs-to "openconfig-mpls" { + prefix "mpls"; + } + + // import some basic types + import openconfig-mpls-types {prefix oc-mplst; } + import openconfig-inet-types { prefix inet; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Defines static LSP configuration"; + + + oc-ext:openconfig-version "3.0.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // grouping statements + + grouping static-lsp-common-config { + description + "common definitions for static LSPs"; + + leaf next-hop { + type inet:ip-address; + description + "next hop IP address for the LSP"; + } + + leaf incoming-label { + type oc-mplst:mpls-label; + description + "label value on the incoming packet"; + } + + leaf push-label { + type oc-mplst:mpls-label; + description + "label value to push at the current hop for the + LSP"; + } + } + + grouping static-lsp-ingress-config { + description + "Configuration data for ingress LSPs"; + + uses static-lsp-common-config; + } + + grouping static-lsp-ingress-state { + description + "Operational state data for ingress LSPs"; + } + + grouping static-lsp-ingress-top { + description + "Top-level grouping for ingress LSP data"; + + container ingress { + description + "Static LSPs for which the router is an + ingress node"; + + container config { + description + "Configuration data for ingress LSPs"; + + uses static-lsp-ingress-config; + } + + container state { + + config false; + + description + "Operational state data for ingress LSPs"; + + uses static-lsp-ingress-config; + uses static-lsp-ingress-state; + } + } + } + + grouping static-lsp-transit-config { + description + "Configuration data for transit LSPs"; + + uses static-lsp-common-config; + } + + grouping static-lsp-transit-state { + description + "Operational state data for transit LSPs"; + } + + grouping static-lsp-transit-top { + description + "Top-level grouping for transit LSP data"; + + container transit { + description + "Static LSPs for which the router is an + transit node"; + + container config { + description + "Configuration data for transit LSPs"; + + uses static-lsp-transit-config; + } + + container state { + + config false; + + description + "Operational state data for transit LSPs"; + + uses static-lsp-transit-config; + uses static-lsp-transit-state; + } + } + } + + grouping static-lsp-egress-config { + description + "Configuration data for egress LSPs"; + + uses static-lsp-common-config; + } + + grouping static-lsp-egress-state { + description + "Operational state data for egress LSPs"; + } + + grouping static-lsp-egress-top { + description + "Top-level grouping for egress LSP data"; + + container egress { + description + "Static LSPs for which the router is an + egress node"; + + container config { + description + "Configuration data for egress LSPs"; + + uses static-lsp-egress-config; + } + + container state { + + config false; + + description + "Operational state data for egress LSPs"; + + uses static-lsp-egress-config; + uses static-lsp-egress-state; + } + } + } + + grouping static-lsp-config { + description + "Configuration data for static LSPs"; + + leaf name { + type string; + description + "name to identify the LSP"; + } + } + + grouping static-lsp-state { + description + "Operational state data for static LSPs"; + + } + + grouping static-lsp-top { + description + "grouping for top level list of static LSPs"; + + + list static-lsp { + key "name"; + description + "list of defined static LSPs"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference the name list key"; + } + + container config { + description + "Configuration data for the static lsp"; + + uses static-lsp-config; + } + + container state { + config false; + + description + "Operational state data for the static lsp"; + + uses static-lsp-config; + uses static-lsp-state; + + } + + // TODO: separation into ingress, transit, egress may help + // to figure out what exactly is configured, but need to + // consider whether implementations can support the + // separation + uses static-lsp-ingress-top; + uses static-lsp-transit-top; + uses static-lsp-egress-top; + } + } + + // data definition statements + + // augment statements + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-te@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-mpls-te@2018-11-21.yang new file mode 100644 index 0000000..4a9953e --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-te@2018-11-21.yang @@ -0,0 +1,1386 @@ +submodule openconfig-mpls-te { + + yang-version "1"; + + belongs-to "openconfig-mpls" { + prefix "oc-mpls"; + } + + + // import some basic types + import openconfig-inet-types { prefix inet; } + import openconfig-mpls-rsvp { prefix oc-rsvp; } + import openconfig-mpls-sr { prefix oc-sr; } + import openconfig-mpls-types {prefix oc-mplst; } + import openconfig-types { prefix oc-types; } + import openconfig-yang-types { prefix yang; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Configuration related to constrained-path LSPs and traffic + engineering. These definitions are not specific to a particular + signaling protocol or mechanism (see related submodules for + signaling protocol-specific configuration)."; + + oc-ext:openconfig-version "3.0.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // typedef statements + + typedef te-bandwidth-type { + type enumeration { + enum SPECIFIED { + description + "Bandwidth is explicitly specified"; + } + enum AUTO { + description + "Bandwidth is automatically computed"; + } + } + description + "enumerated type for specifying whether bandwidth is + explicitly specified or automatically computed"; + } + + typedef mpls-srlg-flooding-type { + type enumeration { + enum FLOODED_SRLG { + description + "SRLG is flooded in the IGP"; + } + enum STATIC_SRLG { + description + "SRLG is not flooded, the members are + statically configured"; + } + } + description + "Enumerated bype for specifying how the SRLG is flooded"; + } + + typedef mpls-hop-type { + type enumeration { + enum LOOSE { + description + "loose hop in an explicit path"; + } + enum STRICT { + description + "strict hop in an explicit path"; + } + } + description + "enumerated type for specifying loose or strict + paths"; + } + + typedef te-metric-type { + type union { + type enumeration { + enum IGP { + description + "set the LSP metric to track the underlying + IGP metric"; + } + } + type uint32; + } + description + "union type for setting the LSP TE metric to a + static value, or to track the IGP metric"; + } + + typedef cspf-tie-breaking { + type enumeration { + enum RANDOM { + description + "CSPF calculation selects a random path among + multiple equal-cost paths to the destination"; + } + enum LEAST_FILL { + description + "CSPF calculation selects the path with greatest + available bandwidth"; + } + enum MOST_FILL { + description + "CSPF calculation selects the path with the least + available bandwidth"; + } + } + default RANDOM; + description + "type to indicate the CSPF selection policy when + multiple equal cost paths are available"; + } + + + // grouping statements + + grouping te-tunnel-reoptimize-config { + description + "Definition for reoptimize timer configuration"; + + leaf reoptimize-timer { + type uint16; + units seconds; + description + "frequency of reoptimization of + a traffic engineered LSP"; + } + } + + grouping te-lsp-auto-bandwidth-config { + description + "Configuration parameters related to autobandwidth"; + + leaf enabled { + type boolean; + default false; + description + "enables mpls auto-bandwidth on the + lsp"; + } + + leaf min-bw { + type oc-mplst:bandwidth-kbps; + description + "set the minimum bandwidth in Kbps for an + auto-bandwidth LSP"; + } + + leaf max-bw { + type oc-mplst:bandwidth-kbps; + description + "set the maximum bandwidth in Kbps for an + auto-bandwidth LSP"; + } + + leaf adjust-interval { + type uint32; + description + "time in seconds between adjustments to + LSP bandwidth"; + } + + leaf adjust-threshold { + type oc-types:percentage; + description + "percentage difference between the LSP's + specified bandwidth and its current bandwidth + allocation -- if the difference is greater than the + specified percentage, auto-bandwidth adjustment is + triggered"; + } + } + + grouping te-lsp-auto-bandwidth-state { + description + "Operational state parameters relating to auto-bandwidth"; + + leaf interval-high-bw { + type oc-mplst:bandwidth-kbps; + description + "The maximum measured bandwidth during the current + auto-bandwidth adjust interval expressed in kilobits + per second."; + } + } + + grouping te-lsp-overflow-config { + description + "configuration for mpls lsp bandwidth + overflow adjustment"; + + leaf enabled { + type boolean; + default false; + description + "enables mpls lsp bandwidth overflow + adjustment on the lsp"; + } + + leaf overflow-threshold { + type oc-types:percentage; + description + "bandwidth percentage change to trigger + an overflow event"; + + } + + leaf trigger-event-count { + type uint16; + description + "number of consecutive overflow sample + events needed to trigger an overflow adjustment"; + } + } + + grouping te-lsp-underflow-config { + description + "configuration for mpls lsp bandwidth + underflow adjustment"; + + leaf enabled { + type boolean; + default false; + description + "enables bandwidth underflow + adjustment on the lsp"; + } + + leaf underflow-threshold { + type oc-types:percentage; + description + "bandwidth percentage change to trigger + and underflow event"; + } + + leaf trigger-event-count { + type uint16; + description + "number of consecutive underflow sample + events needed to trigger an underflow adjustment"; + } + } + + grouping te-path-placement-constraints-config { + description + "Configuration data for link affinities"; + + leaf-list exclude-group { + type leafref { + path "../../../../../../../../../../te-global-attributes" + + "/mpls-admin-groups/admin-group/admin-group-name"; + } + description + "list of references to named admin-groups to exclude in + path calculation."; + } + + leaf-list include-all-group { + type leafref { + path "../../../../../../../../../../te-global-attributes" + + "/mpls-admin-groups/admin-group/admin-group-name"; + } + description + "list of references to named admin-groups of which all must + be included"; + } + + leaf-list include-any-group { + type leafref { + path "../../../../../../../../../../te-global-attributes" + + "/mpls-admin-groups/admin-group/admin-group-name"; + } + description + "list of references to named admin-groups of which one must + be included"; + } + } + + grouping te-path-placement-constraints-state { + description + "Operational state data for link affinities"; + //TODO: currently a placeholder + } + + grouping te-path-placement-constraints-top { + description + "Top-level grouping "; + + container admin-groups { + description + "Top-level container for include/exclude constraints for + link affinities"; + + container config { + description + "Configuration data "; + + uses te-path-placement-constraints-config; + } + + container state { + config false; + + description + "Operational state data "; + + uses te-path-placement-constraints-config; + uses te-path-placement-constraints-state; + } + } + } + + grouping te-tunnel-protection-config { + description + "Configuration parameters related to LSP + protection"; + leaf protection-style-requested { + type identityref { + base oc-mplst:PROTECTION_TYPE; + } + default oc-mplst:UNPROTECTED; + description + "style of mpls frr protection desired: can be + link, link-node or unprotected."; + } + } + + grouping explicit-route-subobject-config { + description + "The explicit route subobject grouping"; + + leaf address { + type inet:ip-address; + description + "router hop for the LSP path"; + } + + leaf hop-type { + type mpls-hop-type; + description + "strict or loose hop"; + } + + leaf index { + type uint8 { + range "0..255"; + } + description + "Index of this explicit route object to express + the order of hops in the path"; + } + + } + + grouping named-explicit-path-config { + description + "Configuration parameters relating to a named + explicit path"; + + leaf name { + type string; + description + "A string name that uniquely identifies an explicit + path"; + } + } + + // Explicit paths config somewhat following the IETF model + grouping explicit-paths-top { + description + "Top level global explicit path configuration + grouping"; + + container named-explicit-paths { + description + "Enclosing container for the named explicit paths"; + list named-explicit-path { + key "name"; + description + "A list of explicit paths"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "A string name that uniquely identifies + an explicit path"; + } + + container config { + description + "Configuration parameters relating to named explicit + paths"; + uses named-explicit-path-config; + uses oc-sr:sr-path-attributes-config; + } + + container state { + config false; + description + "Operational state parameters relating to the named + explicit paths"; + uses named-explicit-path-config; + uses oc-sr:sr-path-attributes-config; + } + + container explicit-route-objects { + description + "Enclosing container for EROs"; + + list explicit-route-object { + key "index"; + description + "List of explicit route objects"; + + leaf index { + type leafref { + path "../config/index"; + } + + description + "Index of this explicit route object, + to express the order of hops in path"; + } + + container config { + description + "Configuration parameters relating to an explicit + route"; + uses explicit-route-subobject-config; + } + + + container state { + config false; + description + "State parameters relating to an explicit route"; + uses explicit-route-subobject-config; + } + } + } + } + } + } + + grouping mpls-te-srlg-config { + description + "Configuration of various attributes associated + with the SRLG"; + + leaf name { + type string; + description + "SRLG group identifier"; + } + + leaf value { + type uint32; + description + "group ID for the SRLG"; + } + + leaf cost { + type uint32; + description + "The cost of the SRLG to the computation + algorithm"; + } + + leaf flooding-type { + type mpls-srlg-flooding-type; + default FLOODED_SRLG; + description + "The type of SRLG, either flooded in the IGP or + statically configured"; + } + } + + grouping mpls-te-srlg-members-config { + description + "Configuration of the membership of the SRLG"; + + leaf from-address { + type inet:ip-address; + description + "IP address of the a-side of the SRLG link"; + } + + leaf to-address { + type inet:ip-address; + description + "IP address of the z-side of the SRLG link"; + } + } + + grouping mpls-te-srlg-top { + description + "Top level grouping for MPLS shared + risk link groups."; + + container srlgs { + description + "Shared risk link groups attributes"; + list srlg { + key "name"; + description + "List of shared risk link groups"; + + leaf name { + type leafref { + path "../config/name"; + // Requires YANG 1.1 + //require-instance true; + } + description + "The SRLG group identifier"; + } + + container config { + description + "Configuration parameters related to the SRLG"; + uses mpls-te-srlg-config; + } + + container state { + config false; + description + "State parameters related to the SRLG"; + uses mpls-te-srlg-config; + } + + container static-srlg-members { + when "../config/flooding-type = 'STATIC_SRLG'" { + description + "Include this container for static + SRLG specific configuration"; + } + description + "SRLG members for static (not flooded) SRLGs "; + + list members-list { + key "from-address"; + description + "List of SRLG members, which are expressed + as IP address endpoints of links contained in the + SRLG"; + + leaf from-address { + type leafref { + path "../config/from-address"; + // Requires YANG 1.1 + //require-instance true; + } + description + "The from address of the link in the SRLG"; + } + + container config { + description + "Configuration parameters relating to the + SRLG members"; + uses mpls-te-srlg-members-config; + } + + container state { + config false; + description + "State parameters relating to the SRLG + members"; + uses mpls-te-srlg-members-config; + } + } + } + } + } + } + + grouping te-global-tunnel-config { + description + "Configuration parameters relevant to a single + traffic engineered tunnel."; + + leaf name { + type string; + description + "The tunnel name"; + } + + leaf type { + type identityref { + base oc-mplst:TUNNEL_TYPE; + } + description + "Tunnel type, p2p or p2mp"; + } + + leaf signaling-protocol { + type identityref { + base oc-mplst:PATH_SETUP_PROTOCOL; + } + description + "Signaling protocol used to set up this tunnel"; + } + + leaf description { + type string; + description + "optional text description for the tunnel"; + } + + leaf admin-status { + type identityref { + base oc-mplst:TUNNEL_ADMIN_STATUS; + } + default oc-mplst:ADMIN_UP; + description + "TE tunnel administrative state."; + } + + leaf preference { + type uint8 { + range "1..255"; + } + description + "Specifies a preference for this tunnel. + A lower number signifies a better preference"; + } + + leaf metric-type { + type identityref { + base oc-mplst:LSP_METRIC_TYPE; + } + default oc-mplst:LSP_METRIC_INHERITED; + description + "The type of metric specification that should be used to set + the LSP(s) metric"; + } + + leaf metric { + type int32; + description + "The value of the metric that should be specified. The value + supplied in this leaf is used in conjunction with the metric + type to determine the value of the metric used by the system. + Where the metric-type is set to LSP_METRIC_ABSOLUTE - the + value of this leaf is used directly; where it is set to + LSP_METRIC_RELATIVE, the relevant (positive or negative) + offset is used to formulate the metric; where metric-type + is LSP_METRIC_INHERITED, the value of this leaf is not + utilised"; + } + + leaf shortcut-eligible { + type boolean; + default "true"; + description + "Whether this LSP is considered to be eligible for us as a + shortcut in the IGP. In the case that this leaf is set to + true, the IGP SPF calculation uses the metric specified to + determine whether traffic should be carried over this LSP"; + } + + leaf protection-style-requested { + type identityref { + base oc-mplst:PROTECTION_TYPE; + } + default oc-mplst:UNPROTECTED; + description + "style of mpls frr protection desired: can be + link, link-node or unprotected."; + } + + uses te-tunnel-reoptimize-config; + uses oc-rsvp:rsvp-p2p-tunnel-attributes-config; + + } + + grouping tunnel-p2p-attributes-config { + description + "Configuration related to p2p LSPs"; + leaf destination { + type inet:ip-address; + description + "P2P tunnel destination address"; + } + } + + grouping p2p-path-state { + description + "Operational state parameters for p2p paths"; + + leaf-list associated-rsvp-sessions { + type leafref { + path "../../../../../../../../../signaling-protocols/" + + "rsvp-te/sessions/session/local-index"; + } + description + "If the signalling protocol specified for this path is + RSVP-TE, this leaf-list provides a reference to the associated + sessions within the RSVP-TE protocol sessions list, such + that details of the signaling can be retrieved. More than + one session may exist during re-signalling such as + make-before-break."; + } + + leaf spf-metric { + type uint64; + description + "The IGP metric of the shortest path to the LSP destination. + This value is used to compare the current metric of the + constrained path to the shortest path that is available in + the network topology."; + } + + leaf cspf-metric { + type uint64; + description + "The IGP metric of the path currently used by the LSP. + This value is used to represent the metric of the path + used by the LSP following the execution of the CSPF + algorithm and signalling of the LSP."; + } + } + + grouping p2p-path-config { + description + "Configuration parameters for p2p paths"; + + leaf name { + type string; + description + "Path name"; + } + + leaf path-computation-method { + type identityref { + base oc-mplst:PATH_COMPUTATION_METHOD; + } + default oc-mplst:LOCALLY_COMPUTED; + description + "The method used for computing the path, either + locally computed, queried from a server or not + computed at all (explicitly configured)."; + } + + leaf use-cspf { + when "../path-computation-method = 'LOCALLY_COMPUTED'" { + description + "The use of cspf when the path-computation method is + local computation"; + } + type boolean; + description + "Flag to enable CSPF for locally computed LSPs"; + } + + leaf cspf-tiebreaker { + when "../path-computation-method = 'LOCALLY_COMPUTED'" { + description + "The cspf tiebreaking method when the path is + locally computed"; + } + type cspf-tie-breaking; + description + "Determine the tie-breaking method to choose between + equally desirable paths during CSFP computation"; + } + + + leaf path-computation-server { + when "../path-computation-method = 'EXTERNALLY_QUERIED'" { + description + "The path-computation server when the path is + externally queried"; + } + type inet:ip-address; + description + "Address of the external path computation + server"; + } + + leaf explicit-path-name { + when "../path-computation-method = 'EXPLICITLY_DEFINED'" { + description + "The name of the explicitly defined path used"; + } + + type leafref { + path "../../../../../../../" + + "named-explicit-paths/named-explicit-path/" + + "config/name"; + // Requires YANG 1.1 + //require-instance true; + } + description + "reference to a defined path"; + } + + leaf preference { + type uint8 { + range "1..255"; + } + description + "Specifies a preference for this path. The lower the + number higher the preference"; + } + + uses oc-rsvp:rsvp-p2p-path-attributes-config; + } + + + grouping te-tunnel-p2p-top { + description + "Top level grouping for p2p configuration"; + + container p2p-tunnel-attributes { + when "../config/type = 'P2P'" { + description + "Include this container for LSPs of type P2P"; + } + description + "Parameters related to LSPs of type P2P"; + + container config { + description + "Configuration parameters for P2P LSPs"; + uses tunnel-p2p-attributes-config; + } + + container state { + config false; + description + "State parameters for P2P LSPs"; + uses tunnel-p2p-attributes-config; + } + + uses p2p-primary-paths-top; + uses p2p-secondary-paths-top; + } + } + + + grouping te-tunnel-state { + description + "Counters and statistical data relevent to a single + tunnel."; + + leaf oper-status { + type identityref { + base oc-mplst:LSP_OPER_STATUS; + } + description + "The operational status of the TE tunnel"; + } + + leaf role { + type identityref { + base oc-mplst:LSP_ROLE; + } + description + "The lsp role at the current node, whether it is headend, + transit or tailend."; + } + + leaf auto-generated { + type boolean; + description + "If the LSP was auto-generated by the system this leaf + should be set to true. Examples of auto-generated LSPs + are dynamically created backup LSPs to meet a FRR + policy."; + } + + container counters { + description + "State data for MPLS label switched paths. This state + data is specific to a single label switched path."; + + leaf bytes { + type yang:counter64; + description + "Number of bytes that have been forwarded over the + label switched path."; + } + + leaf packets { + type yang:counter64; + description + "Number of pacets that have been forwarded over the + label switched path."; + } + + leaf path-changes { + type yang:counter64; + description + "Number of path changes for the label switched path"; + } + + leaf state-changes { + type yang:counter64; + description + "Number of state changes for the label switched path"; + } + + leaf online-time { + type oc-types:timeticks64; + description + "Indication of the time the label switched path + transitioned to an Oper Up or in-service state. + + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf current-path-time { + type oc-types:timeticks64; + description + "Indicates the time the LSP switched onto its + current path. The value is reset upon a LSP path + change. + + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + + } + + leaf next-reoptimization-time { + type oc-types:timeticks64; + description + "Indicates the next scheduled time the LSP + will be reoptimized. + + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + + } + } + } + + grouping te-tunnel-bandwidth-config { + description + "Configuration parameters related to bandwidth for a tunnel"; + + leaf specification-type { + type te-bandwidth-type; + default SPECIFIED; + description + "The method used for settign the bandwidth, either explicitly + specified or configured"; + } + + leaf set-bandwidth { + when "../specification-type = 'SPECIFIED'" { + description + "The bandwidth value when bandwidth is explicitly + specified"; + } + type oc-mplst:bandwidth-kbps; + description + "set bandwidth explicitly, e.g., using + offline calculation"; + } + } + + grouping te-tunnel-bandwidth-state { + description + "Operational state parameters relating to bandwidth for a tunnel"; + + leaf signaled-bandwidth { + type oc-mplst:bandwidth-kbps; + description + "The currently signaled bandwidth of the LSP. In the case where + the bandwidth is specified explicitly, then this will match the + value of the set-bandwidth leaf; in cases where the bandwidth is + dynamically computed by the system, the current value of the + bandwidth should be reflected."; + } + } + + grouping te-tunnel-bandwidth-top { + description + "Top level grouping for specifying bandwidth for a tunnel"; + + container bandwidth { + description + "Bandwidth configuration for TE LSPs"; + + container config { + description + "Configuration parameters related to bandwidth on TE + tunnels:"; + uses te-tunnel-bandwidth-config; + } + + container state { + config false; + description + "State parameters related to bandwidth + configuration of TE tunnels"; + uses te-tunnel-bandwidth-config; + uses te-tunnel-bandwidth-state; + } + + container auto-bandwidth { + when "../config/specification-type = 'AUTO'" { + description + "Include this container for auto bandwidth + specific configuration"; + } + description + "Parameters related to auto-bandwidth"; + + container config { + description + "Configuration parameters relating to MPLS + auto-bandwidth on the tunnel."; + uses te-lsp-auto-bandwidth-config; + } + + container state { + config false; + description + "State parameters relating to MPLS + auto-bandwidth on the tunnel."; + uses te-lsp-auto-bandwidth-config; + uses te-lsp-auto-bandwidth-state; + } + + container overflow { + description + "configuration of MPLS overflow bandwidth + adjustement for the LSP"; + + container config { + description + "Config information for MPLS overflow bandwidth + adjustment"; + uses te-lsp-overflow-config; + } + + container state { + config false; + description + "Config information for MPLS overflow bandwidth + adjustment"; + uses te-lsp-overflow-config; + } + } + + container underflow { + description + "configuration of MPLS underflow bandwidth + adjustement for the LSP"; + + container config { + description + "Config information for MPLS underflow bandwidth + adjustment"; + uses te-lsp-underflow-config; + } + + container state { + config false; + description + "State information for MPLS underflow bandwidth + adjustment"; + uses te-lsp-underflow-config; + } + } + } + } + } + + grouping p2p-path-candidate-secondary-path-config { + description + "Configuration parameters relating to a secondary path which + is a candidate for a particular primary path"; + + leaf secondary-path { + type leafref { + path "../../../../../../p2p-secondary-paths/" + + "p2p-secondary-path/config/name"; + } + description + "A reference to the secondary path that should be utilised + when the containing primary path option is in use"; + } + + leaf priority { + type uint16; + description + "The priority of the specified secondary path option. Higher + priority options are less preferable - such that a secondary + path reference with a priority of 0 is the most preferred"; + } + } + + grouping p2p-path-candidate-secondary-path-state { + description + "Operational state parameters relating to a secondary path + which is a candidate for a particular primary path"; + + leaf active { + type boolean; + description + "Indicates the current active path option that has + been selected of the candidate secondary paths"; + } + } + + grouping p2p-primary-paths-top { + description + "Top level grouping for p2p primary paths"; + + container p2p-primary-path { + description + "Primary paths associated with the LSP"; + + list p2p-primary-path { + key "name"; + description + "List of p2p primary paths for a tunnel"; + + leaf name { + type leafref { + path "../config/name"; + // Requires YANG 1.1 + //require-instance true; + } + description + "Path name"; + } + + container config { + description + "Configuration parameters related to paths"; + uses p2p-path-config; + } + + container state { + config false; + description + "State parameters related to paths"; + uses p2p-path-config; + uses p2p-path-state; + } + + container candidate-secondary-paths { + description + "The set of candidate secondary paths which may be used + for this primary path. When secondary paths are specified + in the list the path of the secondary LSP in use must be + restricted to those path options referenced. The + priority of the secondary paths is specified within the + list. Higher priority values are less preferred - that is + to say that a path with priority 0 is the most preferred + path. In the case that the list is empty, any secondary + path option may be utilised when the current primary path + is in use."; + + list candidate-secondary-path { + key "secondary-path"; + + description + "List of secondary paths which may be utilised when the + current primary path is in use"; + + leaf secondary-path { + type leafref { + path "../config/secondary-path"; + } + description + "A reference to the secondary path option reference + which acts as the key of the candidate-secondary-path + list"; + } + + container config { + description + "Configuration parameters relating to the candidate + secondary path"; + + uses p2p-path-candidate-secondary-path-config; + } + + container state { + config false; + description + "Operational state parameters relating to the candidate + secondary path"; + + uses p2p-path-candidate-secondary-path-config; + uses p2p-path-candidate-secondary-path-state; + } + } + } + + uses te-path-placement-constraints-top; + + } + } + } + + grouping p2p-secondary-paths-top { + description + "Top level grouping for p2p secondary paths"; + + container p2p-secondary-paths { + description + "Secondary paths for the LSP"; + + list p2p-secondary-path { + key "name"; + description + "List of p2p primary paths for a tunnel"; + + leaf name { + type leafref { + path "../config/name"; + // Requires YANG 1.1 + //require-instance true; + } + description + "Path name"; + } + + container config { + description + "Configuration parameters related to paths"; + uses p2p-path-config; + } + + container state { + config false; + description + "State parameters related to paths"; + uses p2p-path-config; + uses p2p-path-state; + } + + uses te-path-placement-constraints-top; + } + } + } + + grouping te-tunnels-top { + description + "Top level grouping for TE tunnels"; + + container tunnels { + description + "Enclosing container for tunnels"; + list tunnel { + key "name"; + description + "List of TE tunnels. This list contains only the LSPs that the + current device originates (i.e., for which it is the head-end). + Where the signaling protocol utilised for an LSP allows a mid-point + or tail device to be aware of the LSP (e.g., RSVP-TE), then the + associated sessions are maintained per protocol"; + + leaf name { + type leafref { + path "../config/name"; + // Requires YANG 1.1 + //require-instance true; + } + description + "The tunnel name"; + } + + container config { + description + "Configuration parameters related to TE tunnels:"; + uses te-global-tunnel-config; + } + + container state { + config false; + description + "State parameters related to TE tunnels"; + uses te-global-tunnel-config; + uses te-tunnel-state; + + } + + uses te-tunnel-bandwidth-top; + uses te-tunnel-p2p-top; + // TODO - add the p2mp configuration + } + } + } + +// data definition statements + +// augment statements + +// rpc statements + +// notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls-types@2020-02-04.yang b/exp/yangcli/h3c-yang/openconfig-mpls-types@2020-02-04.yang new file mode 100644 index 0000000..8c0b4de --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls-types@2020-02-04.yang @@ -0,0 +1,465 @@ +module openconfig-mpls-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/mpls-types"; + + prefix "oc-mplst"; + + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "General types for MPLS / TE data model"; + + oc-ext:openconfig-version "3.2.0"; + + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "3.2.0"; + } + + revision "2019-03-26" { + description + "Add Pseudowire encapsulation."; + reference "3.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // identity statements + + identity PATH_COMPUTATION_METHOD { + description + "base identity for supported path computation + mechanisms"; + } + + identity LOCALLY_COMPUTED { + base PATH_COMPUTATION_METHOD; + description + "indicates a constrained-path LSP in which the + path is computed by the local LER"; + } + + identity EXTERNALLY_QUERIED { + base PATH_COMPUTATION_METHOD; + description + "Constrained-path LSP in which the path is + obtained by querying an external source, such as a PCE server. + In the case that an LSP is defined to be externally queried, it may + also have associated explicit definitions (which are provided to the + external source to aid computation); and the path that is returned by + the external source is not required to provide a wholly resolved + path back to the originating system - that is to say, some local + computation may also be required"; + } + + identity EXPLICITLY_DEFINED { + base PATH_COMPUTATION_METHOD; + description + "constrained-path LSP in which the path is + explicitly specified as a collection of strict or/and loose + hops"; + } + + + // using identities rather than enum types to simplify adding new + // signaling protocols as they are introduced and supported + identity PATH_SETUP_PROTOCOL { + description + "base identity for supported MPLS signaling + protocols"; + } + + identity PATH_SETUP_RSVP { + base PATH_SETUP_PROTOCOL; + description + "RSVP-TE signaling protocol"; + } + + identity PATH_SETUP_SR { + base PATH_SETUP_PROTOCOL; + description + "Segment routing"; + } + + identity PATH_SETUP_LDP { + base PATH_SETUP_PROTOCOL; + description + "LDP - RFC 5036"; + } + + + identity PROTECTION_TYPE { + description + "base identity for protection type"; + } + + identity UNPROTECTED { + base PROTECTION_TYPE; + description + "no protection is desired"; + } + + identity LINK_PROTECTION_REQUIRED { + base PROTECTION_TYPE; + description + "link protection is desired"; + } + + identity LINK_NODE_PROTECTION_REQUESTED { + base PROTECTION_TYPE; + description + "node and link protection are both desired"; + } + + identity LSP_ROLE { + description + "Base identity for describing the role of + label switched path at the current node"; + } + + identity INGRESS { + base LSP_ROLE; + description + "Label switched path is an ingress (headend) + LSP"; + } + + identity EGRESS { + base LSP_ROLE; + description + "Label switched path is an egress (tailend) + LSP"; + } + + identity TRANSIT { + base LSP_ROLE; + description + "Label switched path is a transit LSP"; + } + + + identity TUNNEL_TYPE { + description + "Base identity from which specific tunnel types are + derived."; + } + + identity P2P { + base TUNNEL_TYPE; + description + "TE point-to-point tunnel type."; + } + + identity P2MP { + base TUNNEL_TYPE; + description + "TE point-to-multipoint tunnel type."; + } + + + identity LSP_OPER_STATUS { + description + "Base identity for LSP operational status"; + } + + identity DOWN { + base LSP_OPER_STATUS; + description + "LSP is operationally down or out of service"; + } + + identity UP { + base LSP_OPER_STATUS; + description + "LSP is operationally active and available + for traffic."; + } + + identity TUNNEL_ADMIN_STATUS { + description + "Base identity for tunnel administrative status"; + } + + identity ADMIN_DOWN { + base TUNNEL_ADMIN_STATUS; + description + "LSP is administratively down"; + } + + identity ADMIN_UP { + base TUNNEL_ADMIN_STATUS; + description + "LSP is administratively up"; + } + + identity NULL_LABEL_TYPE { + description + "Base identity from which specific null-label types are + derived."; + } + + identity EXPLICIT { + base NULL_LABEL_TYPE; + description + "Explicit null label is used."; + } + + identity IMPLICIT { + base NULL_LABEL_TYPE; + description + "Implicit null label is used."; + } + + identity LSP_METRIC_TYPE { + description + "Base identity for types of LSP metric specification"; + } + + identity LSP_METRIC_RELATIVE { + base LSP_METRIC_TYPE; + description + "The metric specified for the LSPs to which this identity refers + is specified as a relative value to the IGP metric cost to the + LSP's tail-end."; + } + + identity LSP_METRIC_ABSOLUTE { + base LSP_METRIC_TYPE; + description + "The metric specified for the LSPs to which this identity refers + is specified as an absolute value"; + } + + identity LSP_METRIC_INHERITED { + base LSP_METRIC_TYPE; + description + "The metric for for the LSPs to which this identity refers is + not specified explicitly - but rather inherited from the IGP + cost directly"; + } + + // Note: The IANA PWE3 Types Registry has several more values than these + identity PSEUDOWIRE_ENCAPSULATION { + description + "Sets the PDU type of the PSEUDOWIRE Example in RFC4448. This value + should be enumerated from the IANA Pseudowire types registry"; + } + + identity PWE_ETHERNET_TAGGED_MODE { + base PSEUDOWIRE_ENCAPSULATION; + description + "Ethernet Tagged Mode RFC4448"; + reference "IANA PWE3 0x0004"; + } + + identity PWE_ETHERNET_RAW_MODE { + base PSEUDOWIRE_ENCAPSULATION; + description + "Ethernet Raw Mode RFC4448"; + reference "IANA PWE3 0x0005"; + } + + // typedef statements + typedef mpls-label { + type union { + type uint32 { + range 16..1048575; + } + type enumeration { + enum IPV4_EXPLICIT_NULL { + value 0; + description + "valid at the bottom of the label stack, + indicates that stack must be popped and packet forwarded + based on IPv4 header"; + } + enum ROUTER_ALERT { + value 1; + description + "allowed anywhere in the label stack except + the bottom, local router delivers packet to the local CPU + when this label is at the top of the stack"; + } + enum IPV6_EXPLICIT_NULL { + value 2; + description + "valid at the bottom of the label stack, + indicates that stack must be popped and packet forwarded + based on IPv6 header"; + } + enum IMPLICIT_NULL { + value 3; + description + "assigned by local LSR but not carried in + packets"; + } + enum ENTROPY_LABEL_INDICATOR { + value 7; + description + "Entropy label indicator, to allow an LSR + to distinguish between entropy label and applicaiton + labels RFC 6790"; + } + enum NO_LABEL { + description + "This value is utilised to indicate that the packet that + is forwarded by the local system does not have an MPLS + header applied to it. Typically, this is used at the + egress of an LSP"; + } + } + } + description + "type for MPLS label value encoding"; + reference "RFC 3032 - MPLS Label Stack Encoding"; + } + + typedef tunnel-type { + type enumeration { + enum P2P { + description + "point-to-point label-switched-path"; + } + enum P2MP { + description + "point-to-multipoint label-switched-path"; + } + enum MP2MP { + description + "multipoint-to-multipoint label-switched-path"; + } + } + description + "defines the tunnel type for the LSP"; + reference + "RFC 6388 - Label Distribution Protocol Extensions for + Point-to-Multipoint and Multipoint-to-Multipoint Label Switched + Paths + RFC 4875 - Extensions to Resource Reservation Protocol + - Traffic Engineering (RSVP-TE) for Point-to-Multipoint TE + Label Switched Paths (LSPs)"; + } + + typedef bandwidth-kbps { + type uint64; + units "Kbps"; + description + "Bandwidth values expressed in kilobits per second"; + } + + typedef bandwidth-mbps { + type uint64; + units "Mbps"; + description + "Bandwidth values expressed in megabits per second"; + } + + typedef bandwidth-gbps { + type uint64; + units "Gbps"; + description + "Bandwidth values expressed in gigabits per second"; + } + + typedef mpls-tc { + type uint8 { + range "0..7"; + } + description + "Values of the MPLS Traffic Class (formerly known as + Experimental, EXP) bits"; + } + + // grouping statements + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-mpls@2019-03-26.yang b/exp/yangcli/h3c-yang/openconfig-mpls@2019-03-26.yang new file mode 100644 index 0000000..64c3847 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-mpls@2019-03-26.yang @@ -0,0 +1,769 @@ +module openconfig-mpls { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/mpls"; + + prefix "oc-mpls"; + + + // import some basic types + import openconfig-mpls-types { prefix oc-mplst; } + import openconfig-mpls-rsvp { prefix oc-rsvp; } + import openconfig-mpls-ldp { prefix oc-ldp; } + import openconfig-types { prefix oc-types; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-segment-routing { prefix oc-sr; } + + // include submodules + include openconfig-mpls-te; + include openconfig-mpls-igp; + include openconfig-mpls-static; + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module provides data definitions for configuration of + Multiprotocol Label Switching (MPLS) and associated protocols for + signaling and traffic engineering. + + RFC 3031: Multiprotocol Label Switching Architecture + + The MPLS / TE data model consists of several modules and + submodules as shown below. The top-level MPLS module describes + the overall framework. Three types of LSPs are supported: + + i) traffic-engineered (or constrained-path) + + ii) IGP-congruent (LSPs that follow the IGP path) + + iii) static LSPs which are not signaled + + The structure of each of these LSP configurations is defined in + corresponding submodules. Companion modules define the relevant + configuration and operational data specific to key signaling + protocols used in operational practice. + + + +-------+ + +---------------->| MPLS |<--------------+ + | +-------+ | + | ^ | + | | | + +----+-----+ +--------+-------+ +-----+-----+ + | TE LSPs | | IGP-based LSPs | |static LSPs| + | | | | | | + +----------+ +----------------+ +-----------+ + ^ ^ ^ ^ + | +----------------+ | +--------+ + | | | | + | +------+ +-+---+-+ +--+--+ + +---+ RSVP | |SEGMENT| | LDP | + +------+ |ROUTING| +-----+ + +-------+ + "; + + oc-ext:openconfig-version "3.1.0"; + + revision "2019-03-26" { + description + "Add Pseudowire encapsulation."; + reference "3.1.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.0.1"; + } + + revision "2018-07-02" { + description + "Add new RSVP-TE statistics, remove associated-rsvp-session + leaf. Remove use of date-and-time."; + reference "3.0.0"; + } + + revision "2018-06-16" { + description + "Included attributes for base LDP configuration."; + reference "2.6.0"; + } + + revision "2018-06-13" { + description + "Add ttl-propagation to global MPLS config"; + reference "2.5.0"; + } + + revision "2018-06-05" { + description + "Fixed bugs in when statements on RSVP-TE attributes"; + reference "2.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "2.4.1"; + } + + revision "2017-06-21" { + description + "Add TC bits typedef."; + reference "2.4.0"; + } + + revision "2017-03-22" { + description + "Add RSVP calculated-absolute-subscription-bw"; + reference "2.3.0"; + } + + revision "2017-01-26" { + description + "Add RSVP Tspec, clarify units for RSVP, remove unused LDP"; + reference "2.2.0"; + } + + revision "2016-12-15" { + description + "Add additional MPLS parameters"; + reference "2.1.0"; + } + + revision "2016-09-01" { + description + "Revisions based on implementation feedback"; + reference "2.0.0"; + } + + revision "2016-08-08" { + description + "Public release of MPLS models"; + reference "1.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + grouping mpls-admin-group-config { + description + "configuration data for MPLS link admin groups"; + + leaf admin-group-name { + type string; + description + "name for mpls admin-group"; + } + + leaf bit-position { + type uint32; + description + "bit-position value for mpls admin-group. The value + for the admin group is an integer that represents one + of the bit positions in the admin-group bitmask. Values + between 0 and 31 are interpreted as the original limit + of 32 admin groups. Values >=32 are interpreted as + extended admin group values as per RFC7308."; + } + + } + + grouping mpls-admin-groups-top { + + description + "top-level mpls admin-groups config + and state containers"; + + container mpls-admin-groups { + description + "Top-level container for admin-groups configuration + and state"; + + list admin-group { + key "admin-group-name"; + description + "configuration of value to name mapping + for mpls affinities/admin-groups"; + + leaf admin-group-name { + type leafref { + path "../config/admin-group-name"; + } + description + "name for mpls admin-group"; + } + container config { + description + "Configurable items for admin-groups"; + uses mpls-admin-group-config; + } + + container state { + config false; + description + "Operational state for admin-groups"; + uses mpls-admin-group-config; + } + } + } + } + + grouping mpls-te-igp-flooding-bandwidth-config { + description + "Configurable items for igp flooding bandwidth + threshold configuration."; + leaf threshold-type { + type enumeration { + enum DELTA { + description + "DELTA indicates that the local + system should flood IGP updates when a + change in reserved bandwidth >= the specified + delta occurs on the interface."; + } + enum THRESHOLD_CROSSED { + description + "THRESHOLD-CROSSED indicates that + the local system should trigger an update (and + hence flood) the reserved bandwidth when the + reserved bandwidth changes such that it crosses, + or becomes equal to one of the threshold values."; + } + } + description + "The type of threshold that should be used to specify the + values at which bandwidth is flooded. DELTA indicates that + the local system should flood IGP updates when a change in + reserved bandwidth >= the specified delta occurs on the + interface. Where THRESHOLD_CROSSED is specified, the local + system should trigger an update (and hence flood) the + reserved bandwidth when the reserved bandwidth changes such + that it crosses, or becomes equal to one of the threshold + values"; + } + + leaf delta-percentage { + when "../threshold-type = 'DELTA'" { + description + "The percentage delta can only be specified when the + threshold type is specified to be a percentage delta of + the reserved bandwidth"; + } + type oc-types:percentage; + description + "The percentage of the maximum-reservable-bandwidth + considered as the delta that results in an IGP update + being flooded"; + } + + leaf threshold-specification { + when "../threshold-type = 'THRESHOLD_CROSSED'" { + description + "The selection of whether mirrored or separate threshold + values are to be used requires user specified thresholds to + be set"; + } + type enumeration { + enum MIRRORED_UP_DOWN { + description + "MIRRORED_UP_DOWN indicates that a single set of + threshold values should be used for both increasing + and decreasing bandwidth when determining whether + to trigger updated bandwidth values to be flooded + in the IGP TE extensions."; + } + enum SEPARATE_UP_DOWN { + description + "SEPARATE_UP_DOWN indicates that a separate + threshold values should be used for the increasing + and decreasing bandwidth when determining whether + to trigger updated bandwidth values to be flooded + in the IGP TE extensions."; + } + } + description + "This value specifies whether a single set of threshold + values should be used for both increasing and decreasing + bandwidth when determining whether to trigger updated + bandwidth values to be flooded in the IGP TE extensions. + MIRRORED-UP-DOWN indicates that a single value (or set of + values) should be used for both increasing and decreasing + values, where SEPARATE-UP-DOWN specifies that the increasing + and decreasing values will be separately specified"; + } + + leaf-list up-thresholds { + when "../threshold-type = 'THRESHOLD_CROSSED'" + + "and ../threshold-specification = 'SEPARATE_UP_DOWN'" { + description + "A list of up-thresholds can only be specified when the + bandwidth update is triggered based on crossing a + threshold and separate up and down thresholds are + required"; + } + type oc-types:percentage; + description + "The thresholds (expressed as a percentage of the maximum + reservable bandwidth) at which bandwidth updates are to be + triggered when the bandwidth is increasing."; + } + + leaf-list down-thresholds { + when "../threshold-type = 'THRESHOLD_CROSSED'" + + "and ../threshold-specification = 'SEPARATE_UP_DOWN'" { + description + "A list of down-thresholds can only be specified when the + bandwidth update is triggered based on crossing a + threshold and separate up and down thresholds are + required"; + } + type oc-types:percentage; + description + "The thresholds (expressed as a percentage of the maximum + reservable bandwidth) at which bandwidth updates are to be + triggered when the bandwidth is decreasing."; + } + + leaf-list up-down-thresholds { + when "../threshold-type = 'THRESHOLD_CROSSED'" + + "and ../threshold-specification = 'MIRRORED_UP_DOWN'" { + description + "A list of thresholds corresponding to both increasing + and decreasing bandwidths can be specified only when an + update is triggered based on crossing a threshold, and + the same up and down thresholds are required."; + } + type oc-types:percentage; + description + "The thresholds (expressed as a percentage of the maximum + reservable bandwidth of the interface) at which bandwidth + updates are flooded - used both when the bandwidth is + increasing and decreasing"; + } + } + + + grouping mpls-te-igp-flooding-bandwidth { + description + "Top level group for traffic engineering + database flooding options"; + container igp-flooding-bandwidth { + description + "Interface bandwidth change percentages + that trigger update events into the IGP traffic + engineering database (TED)"; + container config { + description + "Configuration parameters for TED + update threshold "; + uses mpls-te-igp-flooding-bandwidth-config; + } + container state { + config false; + description + "State parameters for TED update threshold "; + uses mpls-te-igp-flooding-bandwidth-config; + } + } + } + + + grouping te-lsp-delay-config { + description + "Group for the timers goerning the delay + in installation and cleanup of TE LSPs"; + + leaf install-delay { + type uint16 { + range 0..3600; + } + units seconds; + description + "delay the use of newly installed te lsp for a + specified amount of time."; + } + + leaf cleanup-delay { + type uint16; + units seconds; + description + "delay the removal of old te lsp for a specified + amount of time"; + } + } + + grouping te-interface-attributes-top { + description + "Top level grouping for attributes + for TE interfaces."; + + list interface { + key "interface-id"; + description + "List of TE interfaces"; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to the interface id list key"; + } + + container config { + description + "Configuration parameters related to TE interfaces:"; + uses te-interface-attributes-config; + } + + container state { + config false; + description + "State parameters related to TE interfaces"; + uses te-interface-attributes-config; + } + + uses oc-if:interface-ref; + + uses mpls-te-igp-flooding-bandwidth; + } + } + + grouping te-interface-attributes-config { + description + "global level definitions for interfaces + on which TE is run"; + + leaf interface-id { + type oc-if:interface-id; + description + "Id of the interface"; + } + + leaf te-metric { + type uint32; + description + "TE specific metric for the link"; + } + + leaf-list srlg-membership { + type leafref { + path "../../../../te-global-attributes/srlgs/srlg/name"; + } + description + "list of references to named shared risk link groups that the + interface belongs to."; + } + + leaf-list admin-group { + type string; + description + "list of admin groups (by name) on the interface"; + } + } + + grouping mpls-te-lsp-timers { + description + "Grouping for traffic engineering timers"; + container te-lsp-timers { + description + "Definition for delays associated with setup + and cleanup of TE LSPs"; + + container config { + description + "Configuration parameters related + to timers for TE LSPs"; + + uses te-lsp-delay-config; + uses te-tunnel-reoptimize-config; + } + + container state { + config false; + description + "State related to timers for TE LSPs"; + + uses te-lsp-delay-config; + uses te-tunnel-reoptimize-config; + } + } + } + + grouping mpls-global-config { + description + "Definition of global MPLS configuration parameters"; + + leaf null-label { + type identityref { + base oc-mplst:NULL_LABEL_TYPE; + } + default oc-mplst:IMPLICIT; + description + "The null-label type used, implicit or explicit"; + } + + leaf ttl-propagation { + type boolean; + default true; + description + "Enables TTL propagation across the MPLS domain. + When ttl-propagation is set to true, the IP TTL + is copied into the MPLS header TTL when pushing + a label to an IP packet. If false, the IP TTL is + not copied into the MPLS header TTL and, therefore, + the IP TTL is not updated in the MPLS domain."; + } + + leaf pw-encapsulation { + type identityref { + base oc-mplst:PSEUDOWIRE_ENCAPSULATION; + } + description + "The PDU type to use with pseudowires."; + } + + } + + grouping mpls-global-top { + description + "Top level grouping for global MPLS configuration "; + + container config { + description + "Top level global MPLS configuration"; + uses mpls-global-config; + } + + container state { + config false; + description + "Top level global MPLS state"; + uses mpls-global-config; + } + } + + grouping mpls-interfaces-top { + description + "Top level grouping for attributes + for MPLS-enabled interfaces."; + container interface-attributes { + description + "Parameters related to MPLS interfaces"; + list interface { + key "interface-id"; + description + "List of TE interfaces"; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to the interface id list key"; + } + + container config { + description + "Configuration parameters related to MPLS interfaces:"; + uses mpls-interface-attributes-config; + } + + container state { + config false; + description + "State parameters related to TE interfaces"; + uses mpls-interface-attributes-config; + } + + uses oc-if:interface-ref; + } + } + } + + grouping mpls-interface-attributes-config { + description + "global level definitions for interfaces + on which MPLS is run"; + + leaf interface-id { + type oc-if:interface-id; + description + "Indentifier for the MPLS interface"; + } + + leaf mpls-enabled { + type boolean; + default false; + description + "Enable MPLS forwarding on this interface"; + } + } + + grouping mpls-label-block-config { + description + "Configuration parameters relating to an MPLS label block."; + + leaf local-id { + type string; + description + "A local identifier for the global label block allocation."; + } + + leaf lower-bound { + type oc-mplst:mpls-label; + description + "Lower bound of the global label block. The block is defined to include + this label."; + } + + leaf upper-bound { + type oc-mplst:mpls-label; + description + "Upper bound for the global label block. The block is defined to include + this label."; + } + } + + grouping mpls-label-blocks-top { + description + "Top-level configuration and operational state parameters corresponding + to reserved label blocks."; + + container reserved-label-blocks { + description + "A range of labels starting with the start-label and up-to and including + the end label that should be allocated as reserved. These labels should + not be utilised by any dynamic label allocation on the local system unless + the allocating protocol is explicitly configured to specify that + allocation of labels should be out of the label block specified."; + + list reserved-label-block { + key "local-id"; + + description + "A range of labels starting with the start-label up to and including + the end label that should be allocated for use by a specific protocol."; + + leaf local-id { + type leafref { + path "../config/local-id"; + } + description + "A reference to a unique local identifier for this label block."; + } + + container config { + description + "Configuration parameters relating to the label block."; + + uses mpls-label-block-config; + } + + container state { + config false; + description + "State parameters relating to the label block."; + + uses mpls-label-block-config; + } + } + } + } + + grouping mpls-top { + description + "Top level grouping for MPLS configuration and state"; + + container mpls { + description + "Anchor point for mpls configuration and operational + data"; + + container global { + // entropy label support, label ranges will be added here. + description + "general mpls configuration applicable to any + type of LSP and signaling protocol - label ranges, + entropy label supportmay be added here"; + uses mpls-global-top; + uses mpls-interfaces-top; + uses mpls-label-blocks-top; + } + + container te-global-attributes { + description + "traffic-engineering global attributes"; + uses mpls-te-srlg-top; + uses mpls-admin-groups-top; + uses mpls-te-lsp-timers; + } + + container te-interface-attributes { + description + "traffic engineering attributes specific + for interfaces"; + uses te-interface-attributes-top; + } + + container signaling-protocols { + description + "top-level signaling protocol configuration"; + + uses oc-rsvp:rsvp-global; + uses oc-ldp:ldp-global; + uses oc-sr:sr-mpls-top; + } + + container lsps { + description + "LSP definitions and configuration"; + + container constrained-path { + description + "traffic-engineered LSPs supporting different + path computation and signaling methods"; + uses explicit-paths-top; + uses te-tunnels-top; + } + + container unconstrained-path { + description + "LSPs that use the IGP-determined path, i.e., non + traffic-engineered, or non constrained-path"; + + uses igp-lsp-common; + uses igp-lsp-setup; + } + + container static-lsps { + description + "statically configured LSPs, without dynamic + signaling"; + + uses static-lsp-top; + } + } + } + } + + // augment statements + + // rpc statements + + // notification statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-network-instance-l2@2019-04-16.yang b/exp/yangcli/h3c-yang/openconfig-network-instance-l2@2019-04-16.yang new file mode 100644 index 0000000..f41b57f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-network-instance-l2@2019-04-16.yang @@ -0,0 +1,351 @@ +submodule openconfig-network-instance-l2 { + + belongs-to openconfig-network-instance { + prefix "oc-netinst"; + } + + // import some basic types + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-interfaces { prefix "oc-if"; } + import ietf-yang-types { prefix "yang"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains groupings which specifically relate to + Layer 2 network instance configuration and operational state + parameters."; + + oc-ext:openconfig-version "0.12.0"; + + revision "2019-04-16" { + description + "Move BGP RIB into the protocol/bgp container."; + reference "0.12.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.11.1"; + } + + revision "2018-08-11" { + description + "Add vlan id as additional key in MAC table"; + reference "0.11.0"; + } + + revision "2018-06-22" { + description + "Fix typo in OSPF when statement"; + reference "0.10.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements"; + reference "0.10.1"; + } + + revision "2018-02-19" { + description + "Add PIM and IGMP to network instance"; + reference "0.10.0"; + } + + revision "2017-12-13" { + description + "Fix incorrect constraint on SR and MPLS containers"; + reference "0.9.0"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.8.1"; + } + + revision "2017-02-28" { + description + "Add OSPFv2 to network instance"; + reference "0.8.0"; + } + + revision "2017-01-26" { + description + "Add policy forwarding to network instance"; + reference "0.7.0"; + } + + revision "2017-01-13" { + description + "Add AFT to the network instance"; + reference "0.6.0"; + } + + revision "2016-12-15" { + description + "Add segment routing to network instance"; + reference "0.5.0"; + } + + revision "2016-11-10" { + description + "Update model to include IS-IS."; + reference "0.4.1"; + } + + revision "2016-10-12" { + description + "Update table connections"; + reference "0.4.0"; + } + + revision "2016-09-28" { + description + "Change L2 instance to submodule; add MAC table"; + reference "0.3.0"; + } + + revision "2016-08-11" { + description + "Resolve repeated container names in routing protocols"; + reference "0.2.3"; + } + + revision "2016-07-08" { + description + "Updated with refactored routing protocol models"; + reference "0.2.1"; + } + + revision "2016-03-29" { + description + "Initial revision"; + reference "0.2.0"; + } + + revision "2015-11-20" { + description + "Initial revision"; + reference "0.1.0"; + } + + grouping l2ni-instance { + description + "Configuration and operational state parameters relating + to a Layer 2 network instance"; + + container fdb { + description + "Operational state and configuration parameters relating to + the forwarding database of the network instance"; + + container config { + description + "Configuration parameters relating to the FDB"; + uses l2ni-fdb-mac-config; + } + container state { + config false; + description + "Operational state parameters relating to the FDB"; + uses l2ni-fdb-mac-config; + } + + uses l2ni-mac-table-top; + } + } + + grouping l2ni-instance-common-config { + description + "Common configuration options which are specific to Layer 2 + network instances"; + + leaf mtu { + type uint16; + description + "The maximum frame size which should be supported for this + instance for Layer 2 frames"; + } + + } + + grouping l2ni-fdb-mac-config { + description + "Parameters relating to FDB behaviour relating to MAC + addresses"; + + leaf mac-learning { + type boolean; + description + "When this leaf is set to true, MAC learning is enabled for + the network instance, such that MAC addresses are learned + from ingress frames and added to the FDB."; + } + + leaf mac-aging-time { + // Cisco supports one aging time for local and remote, but + // can specify this time is absolute or against inactivity. + // ALU SROS supports different aging times for local and remote + // but does not allow absolute/inactivity specification. + // JNPR supports only a single aging time, and no specification + // of whether inactivity/absolute is used. + // It is easy to augment new options in here for local remote + // and an extra leaf to allow specification of the type of aging + // so this is left as a single value. + type uint16; + units seconds; + description + "The number of seconds of inactivity after which the entry + in the local FDB is timed out."; + } + + leaf maximum-entries { + type uint16; + description + "The maximum number of MAC address entries that should be + accepted into the FDB"; + } + } + + grouping l2ni-encapsulation-config { + description + "Encapsulation related configuration parameters for a L2 + network instance"; + + leaf control-word { + type boolean; + description + "Whether the control-word should be used for the network + instance"; + reference "RFC3985"; + } + } + + grouping l2ni-mac-table-config { + description + "Configuration data for MAC table entries"; + + leaf mac-address { + type yang:mac-address; + description + "MAC address for the dynamic or static MAC table + entry"; + } + + leaf vlan { + //TODO(aashaikh): Consider whether this should just reflect the + //VLAN id or be a union type to also support displaying/setting + //the VLAN by name (i.e., global VLAN configured in the VLAN + // model). + type leafref { + path "../../../../../../vlans/vlan/config/vlan-id"; + } + description + "VLAN on which the MAC address is present. The same MAC + address may be seen on multiple VLANs in some cases."; + } + } + + grouping l2ni-mac-table-state { + description + "Operational state data for MAC table entries"; + + leaf age { + type uint64; + units seconds; + description + "The time in seconds since the MAC address has been in the + table"; + } + + leaf entry-type { + type enumeration { + enum STATIC { + description + "Statically programmed MAC table entry"; + } + enum DYNAMIC { + description + "Dynamically learned MAC table entry"; + } + } + description + "Indicates whether the entry was statically configured, or + dynamically learned."; + } + + } + + grouping l2ni-mac-table-top { + description + "Top-level grouping for MAC table list"; + + + container mac-table { + description + "Table of learned or statically configured MAC addresses and + corresponding VLANs in the bridge domain"; + + container entries { + description + "Enclosing container for list of MAC table entries"; + + list entry { + key "mac-address vlan"; + description + "List of learned MAC addresses"; + + leaf mac-address { + type leafref { + path "../config/mac-address"; + } + description + "Reference to mac-address list key"; + } + + leaf vlan { + type leafref { + path "../config/vlan"; + } + description + "Reference to vlan list key"; + } + + container config { + description + "Configuration data for MAC table entries"; + + uses l2ni-mac-table-config; + } + + container state { + + config false; + + description + "Operational state data for MAC table entries"; + + uses l2ni-mac-table-config; + uses l2ni-mac-table-state; + } + + container interface { + description + "Reference to the base and/or subinterface for the + MAC table entry"; + + uses oc-if:interface-ref; + } + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-network-instance-l3@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-network-instance-l3@2018-11-21.yang new file mode 100644 index 0000000..742f900 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-network-instance-l3@2018-11-21.yang @@ -0,0 +1,245 @@ +module openconfig-network-instance-l3 { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/network-instance-l3"; + + prefix "oc-ni-l3"; + + // import some basic types + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-types { prefix "octypes"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains groupings which specifically relate to + Layer 3 network instance configuration and operational state + parameters."; + + oc-ext:openconfig-version "0.11.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.11.1"; + } + + revision "2018-08-17" { + description + "Add a route limit for L3 network instances."; + reference "0.11.0"; + } + + revision "2017-12-13" { + description + "Fix incorrect constraint on SR and MPLS containers"; + reference "0.9.0"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.8.1"; + } + + revision "2017-02-28" { + description + "Add OSPFv2 to network instance"; + reference "0.8.0"; + } + + revision "2017-01-26" { + description + "Add policy forwarding to network instance"; + reference "0.7.0"; + } + + revision "2017-01-13" { + description + "Add AFT to the network instance"; + reference "0.6.0"; + } + + revision "2016-12-15" { + description + "Add segment routing to network instance"; + reference "0.5.0"; + } + + revision "2016-11-10" { + description + "Update model to include IS-IS."; + reference "0.4.1"; + } + + revision "2016-09-28" { + description + "Change L2 instance to submodule; add MAC table"; + reference "0.3.0"; + } + + revision "2016-08-11" { + description + "Resolve repeated container names in routing protocols"; + reference "0.2.3"; + } + + revision "2016-07-08" { + description + "Updated with refactored routing protocol models"; + reference "0.2.1"; + } + + revision "2016-03-29" { + description + "Initial revision"; + reference "0.2.0"; + } + + revision "2016-03-14" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping l3ni-instance { + description + "Configuration and operational state parameters relevant + to network instances that include a Layer 3 type"; + + } + + grouping l3ni-instance-common-config { + description + "Configuration parameters that are common to L3 network + instances other than the default instance"; + + leaf-list enabled-address-families { + type identityref { + base octypes:ADDRESS_FAMILY; + } + description + "The address families that are to be enabled for this + network instance."; + } + } + + grouping l3ni-route-limit-structural { + description + "Configuration and state for the maximum number of routes + that should be used by routing instance."; + + container route-limits { + description + "Configuration and operational state relating to the + maximum number of routes for the address family that + should be allowed within the Layer 3 network instance. + + When the specified value is reached, no further prefixes + should be installed into the system's RIB from this network + instance unless the warning only leaf is set. In this case, + new routes should still be installed. If a alarm threshold + is specified, then this should be used to generate + alarms via telemetry for the network instance."; + + list route-limit { + key "afi"; + + description + "A route limit applying to a particular address family."; + + leaf afi { + type leafref { + path "../config/afi"; + } + description + "Reference to the address family for which the route + limit is being applied."; + } + + container config { + description + "Configuration options relating to the route limit."; + uses l3ni-route-limit-config; + } + + container state { + config false; + description + "Operational state parameters relating to the route limit."; + uses l3ni-route-limit-config; + uses l3ni-route-limit-state; + } + } + } + } + + grouping l3ni-route-limit-config { + description + "Configuration options relating to the route limit for a network + instance."; + + leaf afi { + type identityref { + base octypes:ADDRESS_FAMILY; + } + description + "The address family for which the route limit applies."; + } + + leaf maximum { + type uint32; + description + "The maximum number of routes for the address family. The + system should not install more than maximum number of + prefixes into the RIB unless the warning-only leaf is specified."; + } + + leaf warning-only { + type boolean; + default false; + description + "When specified, the route limit specified is considered only as + a warning - and routes should continue to be installed into the + RIB over the limit specified in the maximum leaf."; + } + + leaf alarm-threshold { + type uint32; + description + "When specified, an alarm should be generated when the threshold + number of installed routes is reached."; + } + } + + grouping l3ni-route-limit-state { + description + "Operational state relating to the route limit for a network + instance."; + + leaf threshold-exceeded { + type boolean; + description + "This leaf should be set to true in the case that the threshold + number of routes has been exceeded."; + } + + leaf installed-routes { + type uint32; + description + "The current number of routes installed for the address family."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-network-instance-policy@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-network-instance-policy@2018-11-21.yang new file mode 100644 index 0000000..a2897dc --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-network-instance-policy@2018-11-21.yang @@ -0,0 +1,126 @@ +module openconfig-network-instance-policy { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/network-instance/policy"; + + prefix "oc-ni-pol"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-routing-policy { prefix oc-rpol; } + import openconfig-policy-types { prefix oc-pol-types; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines routing policy statements (conditions and + actions) for the network instance model. These statements are + generally added to the routing policy model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2017-02-15" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + grouping protocol-instance-policy-config { + description + "Configuration data for policy matching on protocol instance"; + + leaf protocol-identifier { + type identityref { + base oc-pol-types:INSTALL_PROTOCOL_TYPE; + } + description + "The identifier (protocol type) of the + protocol instance to match on in the local network + instance."; + } + + leaf protocol-name { + type string; + description + "The name of the protocol instance to match + on in the local network instance"; + } + } + + grouping protocol-instance-policy-state { + description + "Operational state data for policy matching on protocol + instance"; + } + + grouping protocol-instance-policy-top { + description + "Top-level grouping for policy matching on protocol instance"; + + container match-protocol-instance { + description + "Top-level container for protocol instance match condition + in policy statements. The protocol instance is referenced + by an identifier and name"; + + container config { + description + "Configuration data for policy matching on protocol + instance"; + + uses protocol-instance-policy-config; + } + + container state { + + config false; + + description + "Operational state data for policy matching on protocol instance"; + + uses protocol-instance-policy-config; + uses protocol-instance-policy-state; + } + } + } + + // data definition statements + + // augment statements + + augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + + "oc-rpol:conditions" { + description + "Add match conditions for protocol instances to the routing + policy model."; + + uses protocol-instance-policy-top; + } + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-network-instance-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-network-instance-types@2018-11-21.yang new file mode 100644 index 0000000..8ab176f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-network-instance-types@2018-11-21.yang @@ -0,0 +1,272 @@ +module openconfig-network-instance-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/network-instance-types"; + + prefix "oc-ni-types"; + + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Types associated with a network instance"; + + oc-ext:openconfig-version "0.8.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.8.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.8.1"; + } + + revision "2017-02-28" { + description + "Add OSPFv2 to network instance"; + reference "0.8.0"; + } + + revision "2017-01-26" { + description + "Add policy forwarding to network instance"; + reference "0.7.0"; + } + + revision "2017-01-13" { + description + "Add AFT to the network instance"; + reference "0.6.0"; + } + + revision "2016-12-15" { + description + "Add segment routing to network instance"; + reference "0.5.0"; + } + + revision "2016-11-10" { + description + "Update model to include IS-IS."; + reference "0.4.1"; + } + + revision "2016-10-12" { + description + "Update table connections"; + reference "0.4.0"; + } + + revision "2016-09-28" { + description + "Change L2 instance to submodule; add MAC table"; + reference "0.3.0"; + } + + revision "2016-08-11" { + description + "Resolve repeated container names in routing protocols"; + reference "0.2.3"; + } + + revision "2016-07-08" { + description + "Updated with refactored routing protocol models"; + reference "0.2.1"; + } + + revision "2016-03-29" { + description + "Initial revision"; + reference "0.2.0"; + } + + revision "2015-10-18" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + identity NETWORK_INSTANCE_TYPE { + description + "A base identity which can be extended to indicate different + types of network instance supported by a device."; + } + + identity DEFAULT_INSTANCE { + base NETWORK_INSTANCE_TYPE; + description + "A special routing instance which acts as the 'default' or + 'global' routing instance for a network device."; + } + + identity L3VRF { + base NETWORK_INSTANCE_TYPE; + description + "A private Layer 3 only routing instance which is formed of + one or more RIBs"; + } + + identity L2VSI { + base NETWORK_INSTANCE_TYPE; + description + "A private Layer 2 only switch instance which is formed of + one or more L2 forwarding tables"; + } + + identity L2P2P { + base NETWORK_INSTANCE_TYPE; + description + "A private Layer 2 only forwarding instance which acts as + a point to point connection between two endpoints"; + } + + identity L2L3 { + base NETWORK_INSTANCE_TYPE; + description + "A private Layer 2 and Layer 2 forwarding instance"; + } + + identity ENDPOINT_TYPE { + description + "Specification of the type of endpoint that is being associated + with a network instance"; + } + + identity LOCAL { + base ENDPOINT_TYPE; + description + "A local interface which is being associated with the endpoint"; + } + + identity REMOTE { + base ENDPOINT_TYPE; + description + "A remote interface which is being associated with the + endpoint"; + } + + identity LABEL_ALLOCATION_MODE { + description + "Base identity to be used to express types of label allocation + strategies to be used within a network instance"; + } + + identity PER_PREFIX { + base LABEL_ALLOCATION_MODE; + description + "A label is to be allocated per prefix entry in the RIB for the + network instance"; + } + + identity PER_NEXTHOP { + base LABEL_ALLOCATION_MODE; + description + "A label is to be allocated per nexthop entry in the RIB for + the network instance"; + } + + identity INSTANCE_LABEL { + base LABEL_ALLOCATION_MODE; + description + "A single label is to be used for the instance"; + } + + identity ENCAPSULATION { + description + "On the wire encapsulations that can be used when + differentiating network instances"; + } + + identity MPLS { + base ENCAPSULATION; + description + "Use MPLS labels to distinguish network instances on the wire"; + } + + identity VXLAN { + base ENCAPSULATION; + description + "Use VXLAN (RFC7348) VNIs to distinguish network instances on + the wire"; + } + + identity SIGNALLING_PROTOCOL { + description + "The signalling protocol that should be used to diseminate + entries within a forwarding instance"; + } + + identity LDP { + base SIGNALLING_PROTOCOL; + description + "Use LDP-based setup for signalling. Where the instance is + a point-to-point service this refers to RFC4447 ('Martini') + setup. Where the service is an L2VSI, or L2L3 instance it + refers to RFC4762 LDP-signalled VPLS instances"; + } + + identity BGP_VPLS { + base SIGNALLING_PROTOCOL; + description + "Use BGP-based signalling and autodiscovery for VPLS instances + as per RFC4761"; + } + + identity BGP_EVPN { + base SIGNALLING_PROTOCOL; + description + "Use BGP-based Ethernet VPN (RFC7432) based signalling for + the network instance"; + } + + // rjs note: + // this should move to openconfig-types when merged + typedef route-distinguisher { + type union { + // type 0: <2-byte administrator>:<4-byte assigned number> + type string { + pattern '^(65[0-5][0-3][0-5]|[1-5][1-5][0-9][0-9][0-9]|' + + '[1-9]?[1-9]?[0-9][0-9]|[1-9]):' + + '(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-5]|' + + '[0-3][0-9]{9}|[1-9][0-9]{1,8}|[1-9])$'; + } + // type 1: :<2-byte assigned number> + type string { + pattern + '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}' + + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]):' + + '(65[0-5][0-3][0-5]|[1-5][1-5][0-9][0-9][0-9]|' + + '[1-9]?[1-9]?[0-9][0-9]|[1-9])$'; + } + // type 2: <4-byte as-number>:<2-byte assigned number> + type string { + pattern + '^(4[0-2][0-9][0-4][0-9][0-6][0-7][0-2][0-9][0-5]|' + + '[0-3][0-9]{9}|[1-9][0-9]{1,8}|[1-9]):' + + '(65[0-5][0-3][0-5]|[1-5]{2}[0-9]{3}|' + + '[1-9]{0,2}[0-9][0-9]|[1-9])$'; + } + } + description "A route distinguisher value"; + reference "RFC4364"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-network-instance@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-network-instance@2019-11-28.yang new file mode 100644 index 0000000..4f0c26e --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-network-instance@2019-11-28.yang @@ -0,0 +1,1172 @@ +module openconfig-network-instance { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/network-instance"; + + prefix "oc-netinst"; + + // import some basic types + import ietf-yang-types { prefix "yang"; } + import ietf-inet-types { prefix "inet"; } + import openconfig-network-instance-types { prefix "oc-ni-types"; } + import openconfig-policy-types { prefix "oc-pol-types"; } + import openconfig-routing-policy { prefix "oc-rpol"; } + import openconfig-local-routing { prefix "oc-loc-rt"; } + import openconfig-interfaces { prefix "oc-if"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-network-instance-l3 { prefix "oc-ni-l3"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-bgp { prefix "oc-bgp"; } + import openconfig-mpls { prefix "oc-mpls"; } + import openconfig-vlan { prefix "oc-vlan"; } + import openconfig-ospfv2 { prefix "oc-ospfv2"; } + import openconfig-policy-forwarding { prefix "oc-pf"; } + import openconfig-segment-routing { prefix "oc-sr"; } + import openconfig-isis { prefix "oc-isis"; } + import openconfig-aft { prefix "oc-aft"; } + import openconfig-pim { prefix "oc-pim"; } + import openconfig-igmp { prefix "oc-igmp"; } + + // include submodules + include openconfig-network-instance-l2; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "An OpenConfig description of a network-instance. This may be + a Layer 3 forwarding construct such as a virtual routing and + forwarding (VRF) instance, or a Layer 2 instance such as a + virtual switch instance (VSI). Mixed Layer 2 and Layer 3 + instances are also supported."; + + oc-ext:openconfig-version "0.13.2"; + + revision "2019-11-28" { + description + "Revert fixes for paths in when statements"; + reference "0.13.2"; + } + + revision "2019-06-11" { + description + "Fixed paths in when statements"; + reference "0.13.1"; + } + + revision "2019-05-14" { + description + "Added support for BGP signalled VPWS and VPLS."; + reference "0.13.0"; + } + + revision "2019-04-16" { + description + "Move BGP RIB into the protocol/bgp container."; + reference "0.12.0"; + } + + revision "2019-02-03" { + description + "Extend netinst type description to link it to, for example, MPLS + service types."; + reference "0.11.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.11.1"; + } + + revision "2018-08-11" { + description + "Add vlan id as additional key in MAC table"; + reference "0.11.0"; + } + + revision "2018-06-22" { + description + "Fix typo in OSPF when statement"; + reference "0.10.2"; + } + + revision "2018-06-05" { + description + "Fix bugs in when statements"; + reference "0.10.1"; + } + + revision "2018-02-19" { + description + "Add PIM and IGMP to network instance"; + reference "0.10.0"; + } + + revision "2017-12-13" { + description + "Fix incorrect constraint on SR and MPLS containers"; + reference "0.9.0"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.8.1"; + } + + revision "2017-02-28" { + description + "Add OSPFv2 to network instance"; + reference "0.8.0"; + } + + revision "2017-01-26" { + description + "Add policy forwarding to network instance"; + reference "0.7.0"; + } + + revision "2017-01-13" { + description + "Add AFT to the network instance"; + reference "0.6.0"; + } + + revision "2016-12-15" { + description + "Add segment routing to network instance"; + reference "0.5.0"; + } + + revision "2016-11-10" { + description + "Add IS-IS to OpenConfig network instance"; + reference "0.4.1"; + } + + revision "2016-10-12" { + description + "Update table connections"; + reference "0.4.0"; + } + + revision "2016-09-28" { + description + "Change L2 instance to submodule; add MAC table"; + reference "0.3.0"; + } + + revision "2016-08-11" { + description + "Resolve repeated container names in routing protocols"; + reference "0.2.3"; + } + + revision "2016-07-08" { + description + "Updated with refactored routing protocol models"; + reference "0.2.1"; + } + + revision "2016-03-29" { + description + "Initial revision"; + reference "0.2.0"; + } + + revision "2015-10-18" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + typedef network-instance-ref { + type leafref { + path "/network-instances/network-instance/config/name"; + } + description + "A re-usable type that can be referenced within other + modules that references a network instance."; + } + + grouping network-instance-top { + description + "Top-level grouping containing a list of network instances."; + + container network-instances { + description + "The L2, L3, or L2+L3 forwarding instances that are + configured on the local system"; + + list network-instance { + key "name"; + + description + "Network instances configured on the local system"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "A unique name identifying the network instance"; + } + + uses l2ni-instance { + when "./config/type = 'L2VSI' or ./config/type = 'L2P2P'" + + " or ./config/type = 'L2L3' or ./config/type = 'DEFAULT_INSTANCE'" { + description + "Layer 2 configuration parameters included when + a network instance is a Layer 2 instance or a + combined L2L3 instance"; + } + } + + container config { + description + "Configuration parameters relating to a network + instance"; + uses network-instance-config; + uses network-instance-type-dependent-config; + } + + + container state { + config false; + description + "Operational state parameters relating to a network + instance"; + uses network-instance-config; + uses network-instance-type-dependent-config; + uses network-instance-state; + } + + container encapsulation { + when "../config/type != 'DEFAULT_INSTANCE'" { + description + "Only allow the encapsulation of the instance to be + set when the instance is not the default instance"; + } + description + "Configuration parameters relating to the encapsulation + used for the network instance"; + + container config { + description + "Configuration parameters relating to the encapsulation + of the network instance"; + + uses encapsulation-config; + + uses l2ni-encapsulation-config { + when "../../config/type = 'L2VSI' or ../../config/type = 'L2P2P' + or ../../config/type = 'L2L3'" { + description + "Only allow L2 encapsulations to be set + when the instance is of a type that supports + L2"; + } + } + } + + container state { + config false; + description + "State parameters relating to the encapsulation of + the network instance"; + uses encapsulation-config; + + uses l2ni-encapsulation-config { + when "../../config/type = 'L2VSI' or ../../config/type = 'L2P2P' + or ../../config/type = 'L2L3'" { + description + "Only allow L2 encapsulations to be set + when the instance is of a type that supports + L2"; + } + } + } + } + + container inter-instance-policies { + description + "Policies dictating how RIB or FIB entries are imported + to and exported from this instance"; + + uses oc-rpol:apply-policy-group; + } + + container table-connections { + description + "Policies dictating how RIB or FIB entries are propagated + between tables"; + + list table-connection { + key "src-protocol dst-protocol address-family"; + + description + "A list of connections between pairs of routing or + forwarding tables, the leaking of entries between + which is specified by the import policy. + + A connection connecting a source table to a destination + table implies that routes that match the policy specified + for the connection are available for the destination + protocol to advertise, or match within its policies."; + + leaf src-protocol { + type leafref { + path "../config/src-protocol"; + } + description + "The name of the protocol associated with the table + which should be utilised as the source of forwarding + or routing information"; + } + + leaf dst-protocol { + type leafref { + path "../config/dst-protocol"; + } + description + "The table to which routing entries should be + exported"; + } + + leaf address-family { + type leafref { + path "../config/address-family"; + } + description + "The address family associated with the connection"; + } + + container config { + description + "Configuration parameters relating to the connection + between tables"; + uses inter-table-policies-config; + } + container state { + config false; + description + "State parameters relating to the connection between + tables"; + uses inter-table-policies-config; + } + } + } + + container interfaces { + description + "The interfaces that are associated with this network + instance"; + + list interface { + key "id"; + unique "config/interface config/subinterface"; + + description + "An interface associated with the network instance"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "A reference to an identifier for this interface which + acts as a key for this list"; + } + + container config { + description + "Configuration parameters relating to the associated + interface"; + uses instance-interfaces-config; + } + + container state { + config false; + description + "Operational state parameters relating to the + associated interface"; + + uses instance-interfaces-config; + uses instance-interfaces-state; + } + } + } + + uses oc-ni-l3:l3ni-route-limit-structural { + when "./config/type = 'L3VRF' or ./config/type = 'L2L3'" { + description + "Layer 3 VRF or L2/L3 instances can have route limits + applied. This is not supported for the default instance."; + } + } + + container tables { + description + "The routing tables that are managed by this network + instance"; + + list table { + key "protocol address-family"; + + description + "A network instance manages one or more forwarding or + routing tables. These may reflect a Layer 2 forwarding + information base, a Layer 3 routing table, or an MPLS + LFIB. + + The table populated by a protocol within an instance is + identified by the protocol identifier (e.g., BGP, IS-IS) + and the address family (e.g., IPv4, IPv6) supported by + that protocol. Multiple instances of the same protocol + populate a single table -- such that + a single IS-IS or OSPF IPv4 table exists per network + instance. + + An implementation is expected to create entries within + this list when the relevant protocol context is enabled. + i.e., when a BGP instance is created with IPv4 and IPv6 + address families enabled, the protocol=BGP, + address-family=IPv4 table is created by the system."; + + leaf protocol { + type leafref { + path "../config/protocol"; + } + description + "A reference to the protocol that populates + the table"; + } + + leaf address-family { + type leafref { + path "../config/address-family"; + } + description + "A reference to the address-family that the + table represents"; + } + + container config { + description + "Configuration parameters relating to the + table"; + uses table-config; + } + + container state { + config false; + description + "State parameters related to the table"; + uses table-config; + } + } + } + + container connection-points { + description + "The set of connection points within a forwarding + instance"; + + list connection-point { + key "connection-point-id"; + + description + "A connection point within a Layer 2 network instance. + Each connection-point consists of a set of interfaces + only one of which is active at any one time. Other than + the specification of whether an interface is local + (i.e., exists within this network-instance), or remote, + all configuration and state parameters are common"; + + leaf connection-point-id { + type leafref { + path "../config/connection-point-id"; + } + description + "A locally significant reference for the + connection-point"; + } + + container config { + description + "Configuration parameters relating to a Layer 2 + network instance connection point"; + uses instance-connection-point-config; + } + container state { + config false; + description + "Operational state parameters relating to a Layer 2 + network instance connection point"; + + uses instance-connection-point-config; + uses instance-connection-point-state; + } + + container endpoints { + when "../../../config/type = 'L2P2P' " + + "or ../../../config/type = 'L2VSI'" { + description + "Configuration parameters to associate interfaces + into a common group for use in Layer 2 network + instances"; + } + + description + "The set of endpoints which are grouped within the + connection point"; + + list endpoint { + key "endpoint-id"; + + description + "A list of the endpoints (interfaces or remote + connection points that can be used for this + connection point). The active endpoint is selected + based on the precedence that it is configured + with"; + + leaf endpoint-id { + type leafref { + path "../config/endpoint-id"; + } + description + "A pointer to the configured identifier for the + endpoint"; + } + + container config { + description + "Configuration parameters relating to the + endpoint"; + uses instance-endpoint-config; + } + container state { + config false; + description + "Operational state parameters relating to the + endpoint"; + uses instance-endpoint-config; + uses instance-endpoint-state; + } + + container local { + when "../config/type = 'LOCAL'" { + description + "Only include the local configuration when + the endpoint is specified to be local to + the network element"; + } + + description + "Configuration and operational state parameters + relating to a local interface"; + + container config { + description + "Configuration parameters relating to a local + endpoint"; + uses instance-endpoint-local-config; + } + + container state { + config false; + description + "Operational state parameters relating to a + local endpoint"; + uses instance-endpoint-local-config; + } + } + + container remote { + when "../config/type = 'REMOTE'" { + description + "Only include the remote configuration when + the endpoint is specified to be remote to + the network element"; + } + + description + "Configuration and operational state parameters + relating to a remote interface"; + + container config { + description + "Configuration parameters relating to a remote + endpoint"; + uses instance-endpoint-remote-config; + } + + container state { + config false; + description + "Operational state parameters relating to + a remote endpoint"; + uses instance-endpoint-remote-config; + } + } + } + } + } + } + + uses oc-mpls:mpls-top { + when "./config/type = 'DEFAULT_INSTANCE'" { + description + "MPLS configuration is only valid within the default + network instance."; + } + } + + uses oc-sr:sr-top { + when "./config/type = 'DEFAULT_INSTANCE'" { + description + "Segment routing configuration is only valid with the default + network instance."; + } + } + + uses oc-vlan:vlan-top; + + uses oc-pf:policy-forwarding-top; + + uses oc-aft:aft-top; + + container protocols { + description + "The routing protocols that are enabled for this + network-instance."; + + list protocol { + key "identifier name"; + + description + "A process (instance) of a routing protocol. Some + systems may not support more than one instance of + a particular routing protocol"; + + leaf identifier { + type leafref { + path "../config/identifier"; + } + description + "The protocol name for the routing or forwarding + protocol to be instantiated"; + } + + leaf name { + type leafref { + path "../config/name"; + } + description + "An operator-assigned identifier for the routing + or forwarding protocol. For some processes this + leaf may be system defined."; + } + + container config { + description + "Configuration parameters relating to the routing + protocol instance"; + + uses protocols-config; + } + + container state { + config false; + description + "State parameters relating to the routing protocol + instance"; + + uses protocols-config; + uses protocols-state; + } + + uses oc-loc-rt:local-static-top { + when "./config/identifier = 'STATIC'" { + description + "Include static route parameters only when the + protocol is set to static"; + } + description + "Configuration and state parameters relating to + static routes"; + } + + uses oc-loc-rt:local-aggregate-top { + when "./config/identifier = 'LOCAL_AGGREGATE'" { + description + "Include aggregate route parameters only when the + protocol is set to aggregate"; + } + description + "Configuration and state parameters relating to + locally generated aggregate routes"; + } + + uses oc-bgp:bgp-top { + when "./config/identifier = 'BGP'" { + description + "Include BGP parameters only when the protocol + is of type BGP"; + } + description + "Configuration and state parameters relating to + Border Gateway Protocol (BGP)"; + } + + uses oc-ospfv2:ospfv2-top { + when "./config/identifier = 'OSPF2'" { + description + "Include OSPFv2 parameters only when the protocol + is of type OSPFv2"; + } + } + + uses oc-isis:isis-top { + when "./config/identifier = 'ISIS'" { + description + "Include IS-IS configuration when the protocol is of type + IS-IS"; + } + description + "Configuration and state parameters relating to Intermediate + System to Intermediate System (IS-IS)."; + } + + uses oc-pim:pim-top { + when "./config/identifier = 'PIM'" { + description + "Include PIM configuration when the protocol is of type + PIM"; + } + description + "Configuration and state parameters relating to Protocol + Indepdendent Multicast (PIM)."; + } + + uses oc-igmp:igmp-top { + when "./config/identifier = 'IGMP'" { + description + "Include IGMP configuration when the protocol is of type + IGMP"; + } + description + "Configuration and state parameters relating to the Internet + Group Management Protocol (IGMP)."; + } + } + } + } + } + } + + grouping network-instance-type-dependent-config { + description + "Type dependent network instance configuration"; + + uses oc-ni-l3:l3ni-instance-common-config { + when "./type = 'L3VRF' or ./type = 'L2L3'" { + description + "Layer 3 VRF configuration parameters included when a + network instance is a L3VRF or combined L2L3 instance"; + } + } + + uses l2ni-instance-common-config { + when "./type = 'L2VSI' or ./type = 'L2P2P'" + + " or ./type = 'L2L3'" { + description + "Layer 2 configuration parameters included when + a network instance is a Layer 2 instance or a + combined L2L3 instance"; + } + } + } + + grouping instance-endpoint-config { + description + "Configuration data relating to an forwarding-instance + endpoint"; + + leaf endpoint-id { + type string; + description + "An identifier for the endpoint"; + } + + leaf precedence { + type uint16; + description + "The precedence of the endpoint - the lowest precendence + viable endpoint will be utilised as the active endpoint + within a connection"; + } + + leaf type { + type identityref { + base "oc-ni-types:ENDPOINT_TYPE"; + } + description + "The type of endpoint that is referred to by the current + endpoint"; + } + + } + + grouping instance-endpoint-local-config { + description + "Configuration parameters relating to an endpoint that is local + to the current system"; + + uses oc-if:interface-ref-common; + + leaf site-id { + type uint16; + description + "The VE ID as defined in RFC4761 (VPLS) or CE ID as defined in + RFC6624 (l2vpn) to uniquely identify this endpoint (site) as part + of the BGP discovery of remote endpoints for layer 2 services."; + reference "RFC6624 Section 2.2.1, RFC4761 Section 3.2.2"; + } + + // TODO not seen this in configuration yet; is it managed by the + // PE router code? + leaf site-label-block-offset { + type uint16; + description + "The VPLS label block offset that is signaled with the 'site-id'."; + reference "RFC4761 Section 3.2.1 'VBO'"; + } + + leaf site-label-block-size { + type uint16; + description + "The VPLS label block size that is signaled with the 'site-id'."; + reference "RFC4761 Section 3.2.1 'VBS'"; + } + } + + grouping instance-endpoint-remote-config { + description + "Configuration parameters relating to an endpoint that is + remote from the local system"; + leaf remote-system { + type inet:ip-address; + description + "The IP address of the device which hosts the + remote end-point"; + } + + leaf virtual-circuit-identifier { + type uint32; + description + "The virtual-circuit identifier that identifies the + connection at the remote end-point"; + } + + leaf site-id { + type uint16; + description + "Identifies remote sites. When BGP discovery is used this + is the customer edge identifier"; + reference "RFC6624 Section 2.2.1"; + } + } + + grouping instance-endpoint-state { + description + "Operational state data relating to a forwarding-instance + endpoint"; + leaf active { + type boolean; + description + "When the backup endpoint is active, the value of this + parameter is set to true"; + } + } + + grouping instance-connection-point-config { + description + "Configuration data relating to a forwarding-instance + connection point"; + + leaf connection-point-id { + type string; + description + "An identifier for a connection point"; + } + } + + grouping instance-connection-point-state { + description + "Operational state data relating to a forwarding-instance + connection point"; + } + + grouping table-config { + description + "Config parameters relating to an L2/L2.5/L3 table that exists + within a network instance"; + + leaf protocol { + type leafref { + path "../../../../protocols/protocol/config/identifier"; + } + description + "Reference to the protocol that the table is associated with."; + } + + leaf address-family { + type identityref { + base oc-types:ADDRESS_FAMILY; + } + description + "The address family (IPv4, IPv6) of the table's entries"; + } + } + + grouping instance-interfaces-config { + description + "Configuration parameters related to an interface associated + with the network instance"; + + leaf id { + type string; + description + "A unique identifier for this interface - this is expressed + as a free-text string"; + } + + uses oc-if:interface-ref-common; + + leaf-list associated-address-families { + type identityref { + base oc-types:ADDRESS_FAMILY; + } + description + "The address families on the subinterface which are to be + associated with this network instance. When this leaf-list + is empty and the network instance requires Layer 3 information + the address families for which the network instance is + enabled should be imported. If the value of this leaf-list + is specified then the association MUST only be made for + those address families that are included in the list."; + } + } + + grouping instance-interfaces-state { + description + "Operational state parameters relating to an interface + associated with this network instance"; + } + + grouping inter-table-policies-config { + description + "Configuration entries that relate to how RIB or FIB entries + are propagated between tables within the same network + instance"; + + leaf src-protocol { + type leafref { + // we are at table-connections/table-connection/config/. + path "../../../../tables/table/config/protocol"; + } + description + "The source protocol for the table connection"; + } + + leaf address-family { + type leafref { + // we are at table-connections/table-connection/config/. + path "../../../../tables/" + + "table[protocol=current()/../src-protocol]/" + + "config/address-family"; + } + description + "The address family associated with the connection. This + must be defined for the source protocol. The target + address family is implicitly defined by the address family + specified for the source protocol."; + } + + leaf dst-protocol { + type leafref { + path "../../../../tables/table/config/protocol"; + } + description + "The destination protocol for the table connection"; + } + + uses oc-rpol:apply-policy-import-config; + } + + grouping network-instance-config { + description + "Configuration parameters relating to a top-level network + instance"; + + leaf name { + type string; + description + "An operator-assigned unique name for the forwarding + instance"; + } + + leaf type { + type identityref { + base "oc-ni-types:NETWORK_INSTANCE_TYPE"; + } + description + "The type of network instance. The value of this leaf + indicates the type of forwarding entries that should be + supported by this network instance. Signalling protocols + also use the network instance type to infer the type of + service they advertise; for example MPLS signalling + for an L2VSI network instance would infer a VPLS service + whereas a type of L2PTP would infer a VPWS (pseudo-wire) + service"; + } + + leaf enabled { + type boolean; + description + "Whether the network instance should be configured to be + active on the network element"; + } + + leaf description { + type string; + description + "A free-form string to be used by the network operator to + describe the function of this network instance"; + } + + leaf router-id { + type yang:dotted-quad; + description + "A identifier for the local network instance - typically + used within associated routing protocols or signalling + routing information in another network instance"; + } + + leaf route-distinguisher { + type oc-ni-types:route-distinguisher; + description + "The route distinguisher that should be used for the local + VRF or VSI instance when it is signalled via BGP."; + } + } + + grouping network-instance-state { + description + "Operational state parameters relating to a network instance"; + } + + grouping protocols-config { + description + "Configuration parameters relating to a generic protocol + instance within a network instance"; + + leaf identifier { + type identityref { + base "oc-pol-types:INSTALL_PROTOCOL_TYPE"; + } + description + "The protocol identifier for the instance"; + } + + leaf name { + type string; + description + "A unique name for the protocol instance"; + } + + leaf enabled { + type boolean; + description + "A boolean value indicating whether the local protocol + instance is enabled."; + } + + leaf default-metric { + type uint32; + description + "The default metric within the RIB for entries that are + installed by this protocol instance. This value may + be overridden by protocol specific configuration options. + The lower the metric specified the more preferable the RIB + entry is to be selected for use within the network instance. + Where multiple entries have the same metric value then these + equal cost paths should be treated according to the specified + ECMP path selection behaviour for the instance"; + } + } + + grouping protocols-state { + description + "Operational state parameters relating to a protocol instance"; + } + + grouping instance-interface-association-config { + description + "Grouping containing leaves that are to be augmented into an + interface or subinterface to include mapping to a network + instance"; + + leaf network-instance { + type leafref { + path "/network-instances/network-instance/name"; + } + description + "The network instance that this interface is associated + with"; + } + } + + grouping encapsulation-config { + description + "Type agnostic configuration parameters relating to the + encapsulation of the network instance"; + + leaf encapsulation-type { + type identityref { + base oc-ni-types:ENCAPSULATION; + } + description + "The on-the-wire encapsulation that should be used when + sending traffic from this network instance"; + } + + // rjs: This is left here as I suspect that this can + // be used in EVPN. Need to validate implementations, otherwise + // move to L3. (TODO) + leaf label-allocation-mode { + type identityref { + base oc-ni-types:LABEL_ALLOCATION_MODE; + } + description + "The label allocation mode to be used for L3 entries + in the network instance"; + } + } + + uses network-instance-top; +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospf-policy@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-ospf-policy@2018-11-21.yang new file mode 100644 index 0000000..c93e578 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospf-policy@2018-11-21.yang @@ -0,0 +1,199 @@ +module openconfig-ospf-policy { + yang-version "1"; + + namespace "http://openconfig.net/yang/ospf-policy"; + + prefix "oc-ospf-pol"; + + import openconfig-routing-policy { prefix "oc-rpol"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-ospf-types { prefix "oc-ospf-types"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines extensions to the OpenConfig policy + model to add extensions for OSPF. This module is intended + to be generic for both OSPFv2 and OSPFv3."; + + oc-ext:openconfig-version "0.1.3"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2016-08-22" { + description + "Initial revision"; + reference "0.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping ospf-match-config { + description + "Configuration parameters for OSPF match conditions"; + + leaf area-eq { + type oc-ospf-types:ospf-area-identifier; + description + "Match prefixes which are within a particular OSPF area"; + } + } + + grouping ospf-match-conditions { + description + "Match conditions that are added by OSPF"; + + container ospf-conditions { + description + "Match conditions specific to OSPF"; + + container config { + description + "Configuration parameters relating to OSPF match conditions"; + + uses ospf-match-config; + } + + container state { + config false; + description + "Operational state parameters relating to OSPF match conditions"; + + uses ospf-match-config; + } + } + } + + grouping ospf-actions-config { + description + "Configuration parameters for OSPF policy actions"; + + leaf set-area { + type oc-ospf-types:ospf-area-identifier; + description + "Set the area for the matched route. This action is typically + used when importing prefixes into OSPF, such that a route can + be imported into a specific area within the instance."; + } + } + + grouping ospf-actions-set-metric-config { + description + "Configuration parameters relating to setting the OSPF metric"; + + leaf metric-type { + type enumeration { + enum EXTERNAL_TYPE_1 { + description + "Set the external type 1 metric"; + } + enum EXTERNAL_TYPE_2 { + description + "Set the external type 2 metric"; + } + } + default "EXTERNAL_TYPE_2"; + description + "Specify the type of metric which is to be set by the policy"; + } + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "Set the metric of the routes matching the policy to the value + specified by this leaf."; + } + } + + grouping ospf-actions { + description + "Actions that are added by OSPF to the action framework"; + + container ospf-actions { + description + "Actions specific to OSPF"; + + container config { + description + "Configuration parameters for OSPF actions"; + + uses ospf-actions-config; + } + + container state { + config false; + description + "Operational state parameters for OSPF actions"; + + uses ospf-actions-config; + } + + container set-metric { + description + "Configuration and state parameters relating to manipulating + the OSPF metric"; + + container config { + description + "Configuration parameters relating to setting the OSPF metric"; + uses ospf-actions-set-metric-config; + } + + container state { + config false; + description + "Operational state parameters relating to setting the OSPF + metric"; + + uses ospf-actions-set-metric-config; + } + } + } + } + + // augment the groupings into the routing policy model + + // TODO: discuss whether igp-actions should be used or whether this should + // be removed. + + augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + + "oc-rpol:conditions" { + description + "Add OSPF specific match conditions to the routing policy model"; + uses ospf-match-conditions; + } + + augment "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:statements/oc-rpol:statement/" + + "oc-rpol:actions" { + description + "Add OSPF specific actions to the routing policy model"; + uses ospf-actions; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospf-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-ospf-types@2018-11-21.yang new file mode 100644 index 0000000..4ab7256 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospf-types@2018-11-21.yang @@ -0,0 +1,795 @@ +module openconfig-ospf-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/ospf-types"; + + prefix "oc-ospf-types"; + + // import some basic types + import ietf-yang-types { prefix "yang"; } + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Type definitions for OSPF"; + + oc-ext:openconfig-version "0.1.3"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedefs + typedef ospf-area-identifier { + type union { + type uint32; + type yang:dotted-quad; + } + description + "An identifier for an area with OSPF version 2 or 3. This value + is expressed as either a dotted-quad, or a unsigned 32-bit + number"; + } + + typedef ospf-metric { + type uint16; + description + "A common type that can be utilised to express an OSPF metric"; + } + + typedef sr-sid-type { + type enumeration { + enum LABEL { + description + "When the length of the SR/Label Sub-TLV is specified to be 3, then + the right-most 20-bits represent a label value within the SR/Label + Sub-TLV. When this leaf is set to a value of Label the first-entry + leaf should be interpreted to be an MPLS label."; + } + enum SID { + description + "When the length of the SR/Label Sub-TLV is specified to be 4, then + the value specified in the first-entry leaf should be specified to + be a segment identifier."; + } + } + description + "A common type used to express the type of segment identifier that is + used in LSDB entries relating to segment routing"; + } + + // identities + identity OSPF_LSA_TYPE { + description + "Base identity for an OSPF LSA type. This identity is intended + to be used across both OSPFv2 and OSPFv3. Identity values that + correspond to only one OSPF version are marked as such."; + } + + identity ROUTER_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 1 - ROUTER_LSA. An LSA originated by each router within + the area describing the state and cost of the router's links + in the area."; + reference "RFC2328"; + } + + identity NETWORK_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 2 - NETWORK_LSA. An LSA originated for each broadcast and + non-broadcast multiple access (NBMA) in the area. This LSA is + originated by the designated router."; + reference "RFC2328"; + } + + identity SUMMARY_IP_NETWORK_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 3 - SUMMARY_IP_NETWORK_LSA. An LSA originated by area + border routers describing inter-area destinations. This LSA type + is used when the destination is an IP network"; + reference "RFC2328"; + } + + identity SUMMARY_ASBR_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 4 - SUMMARY_ASBR_LSA. An LSA originated by an area border + router describing inter-area destinations. This LSA type is used + when the destination is an AS boundary router."; + reference "RFC2328"; + } + + identity AS_EXTERNAL_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 5 - AS_EXTERNAL_LSA. This LSA type is used to describe + destinations external to the autonomous system, and is + originated by an AS boundary router (ASBR)."; + reference "RFC2328"; + } + + identity NSSA_AS_EXTERNAL_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 7 - NSSA_AS_EXTERNAL_LSA. This LSA type is used by + systems within a not-so-stubby-area (NSSA) to inject external + prefixes into the LSDB. They are translated to Type 5 LSAs + at an ABR device."; + reference "RFC3101"; + } + + identity OSPFV2_LINK_SCOPE_OPAQUE_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 9 - OSPFV2_LINK_SCOPE_OPAQUE_LSA. This LSA type is used + in OSPFv2 to distribute arbitrary information via the OSPF + protocol. The contents is specific to the application defining + the Opaque Type specified within the LSDB. LSAs with Type 9 have + a scope of the link that they are being transmitted on (and the + associated network or subnetwork)."; + reference "RFC5250"; + } + + identity OSPFV2_AREA_SCOPE_OPAQUE_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 10 - OSPFV2_AREA_SCOPE_OPAQUE_LSA. This LSA type is used + in OSPFv2 to distribute arbitrary information via the OSPF + protocol. The contents is specific to the application defining + the Opaque Type specified within the LSDB. LSAs with Type 10 have + a scope of the area that they are transmitted within."; + reference "RFC5250"; + } + + identity OSPFV2_AS_SCOPE_OPAQUE_LSA { + base "OSPF_LSA_TYPE"; + description + "Type 11 - OSPFV2_AS_SCOPE_OPAQUE_LSA. This LSA type is used + in OSPFv2 to distribute arbitrary information via the OSPF + protocol. The contents is specific to the application defining + the Opaque Type specified within the LSDB. LSAs with Type 11 + have a scope of the autonomous system that they are transmitted + within."; + reference "RFC5250"; + } + + identity ROUTER_LSA_TYPES { + description + "Sub-types of the router LSA"; + } + + identity ROUTER_LSA_P2P { + base "ROUTER_LSA_TYPES"; + description + "The LSA represents a point-to-point connection to another + router"; + } + + identity ROUTER_LSA_TRANSIT_NETWORK { + base "ROUTER_LSA_TYPES"; + description + "The LSA represents a connection to a transit network"; + } + + identity ROUTER_LSA_STUB_NETWORK { + base "ROUTER_LSA_TYPES"; + description + "The LSA represents a connection to a stub network"; + } + + identity ROUTER_LSA_VIRTUAL_LINK { + base "ROUTER_LSA_TYPES"; + description + "The LSA represents a virtual link connection"; + } + + identity OSPF_NEIGHBOR_STATE { + description + "The state of an adjacency between the local system and a remote + device"; + } + + identity DOWN { + base "OSPF_NEIGHBOR_STATE"; + description + "The initial state of a neighbor, indicating that no recent + information has been received from the neighbor."; + reference "RFC2328"; + } + + identity ATTEMPT { + base "OSPF_NEIGHBOR_STATE"; + description + "Utilised for neighbors that are attached to NBMA networks, it + indicates that no information has been recently received from + the neighbor but that Hello packets should be directly sent + to that neighbor."; + reference "RFC2328"; + } + + identity INIT { + base "OSPF_NEIGHBOR_STATE"; + description + "Indicates that a Hello packet has been received from the + neighbor but bi-directional communication has not yet been + established. That is to say that the local Router ID does + not appear in the list of neighbors in the remote system's + Hello packet."; + reference "RFC2328"; + } + + identity TWO_WAY { + base "OSPF_NEIGHBOR_STATE"; + description + "Communication between the local and remote system is + bi-directional such that the local system's Router ID is listed + in the received remote system's Hello packet."; + reference "RFC2328"; + } + + identity EXSTART { + base "OSPF_NEIGHBOR_STATE"; + description + "An adjacency with the remote system is being formed. The local + system is currently transmitting empty database description + packets in order to establish the master/slave relationship for + the adjacency."; + reference "RFC2328"; + } + + identity EXCHANGE { + base "OSPF_NEIGHBOR_STATE"; + description + "The local and remote systems are currently exchanging database + description packets in order to determine which elements of + their local LSDBs are out of date."; + reference "RFC2328"; + } + + identity LOADING { + base "OSPF_NEIGHBOR_STATE"; + description + "The local system is sending Link State Request packets to the + remote system in order to receive the more recently LSAs that + were discovered during the Exchange phase of the procedure + establishing the adjacency."; + reference "RFC2328"; + } + + identity FULL { + base "OSPF_NEIGHBOR_STATE"; + description + "The neighboring routers are fully adjacent such that both + LSDBs are synchronized. The adjacency will appear in Router and + Network LSAs"; + reference "RFC2328"; + } + + identity OSPF_NETWORK_TYPE { + description + "Types of network that OSPF should consider attached to an + interface"; + } + + identity POINT_TO_POINT_NETWORK { + base "OSPF_NETWORK_TYPE"; + description + "A interface that connects two routers."; + reference "RFC2328"; + } + + identity BROADCAST_NETWORK { + base "OSPF_NETWORK_TYPE"; + description + "An interface that supports >2 attached routers which has the + ability to address all connected systems via a single + (broadcast) address."; + } + + identity NON_BROADCAST_NETWORK { + base "OSPF_NETWORK_TYPE"; + description + "An interface that supports >2 attached rotuers which does not + have the ability to address all connected systems with a + broadcast address."; + } + + // rjs TODO: Maybe need p2mp here. + + + identity OSPF_OPAQUE_LSA_TYPE { + description + "This identity is the base used for opaque LSA types. The values + that extend this base are those that are described in the IANA + OSPF Opaque Link-State Advertisements (LSA) Option Types registry"; + } + + identity TRAFFIC_ENGINEERING { + base "OSPF_OPAQUE_LSA_TYPE"; + description + "The Traffic Engineering LSA. This type is used only with area-scope + Opaque LSAs - and is used to describe routers, point-to-point links + and connections to multi-access networks for traffic engineering + purposes."; + reference "RFC3630"; + } + + identity GRACE_LSA { + base "OSPF_OPAQUE_LSA_TYPE"; + description + "Grace LSAs are announced by a system undergoing graceful-restart. + A system that is attempting an OSPF graceful restart announces + Grace-LSAs with a specified grace period, indicating the intention + to have completed an restart within the specified period."; + reference "RFC3623"; + } + + identity ROUTER_INFORMATION { + base "OSPF_OPAQUE_LSA_TYPE"; + description + "The Router Information LSA is used by an OSPFv2 system to announce + optional capabilities of the local system, over and above those that + are included within the OSPF hello message field. The flooding scope + of the LSA can be link-, area-, or AS-wide (i.e., the LSA type can + be 9, 10 or 11)."; + reference "RFC7770"; + } + + identity OSPFV2_EXTENDED_PREFIX { + base "OSPF_OPAQUE_LSA_TYPE"; + description + "The Extended Prefix LSA is used in OSPFv2 to carry a set of attributes + that are to be associated with a prefix that is advertised in OSPF. The + attributes are carried as one or more TLV tuples. The flooding scope + of the LSA can be link-, area-, or AS-wide as specified by the + advertising system. The flooding scope of the LSA may exceed the scope + of the corresponding prefix."; + reference "RFC7684"; + } + + identity OSPFV2_EXTENDED_LINK { + base "OSPF_OPAQUE_LSA_TYPE"; + description + "The Extended Link LSA is used in OSPFv2 to carry a set of attributes + that are to be associated with a link that is advertised in OSPF. The + link attributes are carried as one or more TLV tuples. The flooding + scope of the link LSA is area-local - i.e., it is carried in a Type 10 + opaque LSA."; + reference "RFC7684"; + } + + identity OSPF_TE_LSA_TLV_TYPE { + description + "This identity is the base used for the type field of TLVs that are + included within the Traffic Engineering Opaque LSA."; + } + + identity TE_ROUTER_ADDRESS { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "A stable IP address of the advertising router that is always reachable + if the node has connectivity."; + } + + identity TE_LINK { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "A single link within a traffic engineering topology. A set of sub-TLVs + are carried within this attribute to indicate traffic engineering + characteristics of the link."; + } + + identity TE_ROUTER_IPV6_ADDRESS { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "A stable IPv6 address of the advertising router that is always + reachable if the node has connectivity. This TLV is used only with + OSPFv3"; + reference "RFC5329"; + } + + identity TE_LINK_LOCAL { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "Attributes associated with the local link by the system."; + reference "RFC4203"; + } + + identity TE_NODE_ATTRIBUTE { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "Attributes associted with the local system"; + reference "RFC5786"; + } + + identity TE_OPTICAL_NODE_PROPERTY { + base "OSPF_TE_LSA_TLV_TYPE"; + description + "Attributes associated with the local optical node. A set of sub-TLVs + are carried within this TLV which are used within the GMPLS control + plane when using OSPF"; + } + + identity OSPF_TE_LINK_TLV_TYPE { + description + "This identity is the based used for the type field for sub-TLVs of the + Link TLV of the OSPF Traffic Engineering Opaque LSA"; + } + + identity TE_LINK_TYPE { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Link Type sub-TLV appears exactly once per OSPF-TE Link + and describes the type of the link"; + } + + identity TE_LINK_ID { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Link ID sub-TLV appears exactly once per OSPF-TE link and + identifies the remote end of the link."; + } + + identity TE_LINK_LOCAL_IP { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Local IP specifies a list of the interface addresses of the + local system corresponding to the traffic engineering link."; + } + + identity TE_LINK_REMOTE_IP { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Remote IP specifies a list of IP addresses of the remote + neighbors associated with the traffic engineering link."; + } + + identity TE_LINK_METRIC { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Metric specifies the link metric for traffic engineering + purposes"; + } + + identity TE_LINK_MAXIMUM_BANDWIDTH { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Maximum Bandwidth specifies the maximum bandwidth of the + link that it is associated with."; + } + + identity TE_LINK_MAXIMUM_RESERVABLE_BANDWIDTH { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE Maximum Reservable Bandwidth specifies the maximum + bandwidth that may be reserved on the link in bytes per second"; + } + + identity TE_LINK_UNRESERVED_BANDWIDTH { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE unreserved bandwidth indicates the amount of bandwidth + at each priority level that is currently not reserved"; + } + + identity TE_LINK_ADMIN_GROUP { + base "OSPF_TE_LINK_TLV_TYPE"; + description + "The OSPF-TE administrative group indicates the administrative group + that the is assigned to the interface"; + } + + identity TE_NODE_ATTRIBUTE_TLV_TYPE { + description + "This identity forms the base for sub-TLVs of the Node Attribute TLV + of the Traffic Engineering LSA"; + } + + identity NODE_IPV4_LOCAL_ADDRESS { + base "TE_NODE_ATTRIBUTE_TLV_TYPE"; + description + "The Node Attribute Sub-TLV contains a list of the IPv4 addresses of + the local system"; + } + + identity NODE_IPV6_LOCAL_ADDRESS { + base "TE_NODE_ATTRIBUTE_TLV_TYPE"; + description + "The Node Attribute Sub-TLV contains a list of the IPv6 addresses of + the local system"; + } + + identity GRACE_LSA_TLV_TYPES { + description + "This identity is used as the base for TLVs within the Grace LSA"; + } + + identity GRACE_PERIOD { + base "GRACE_LSA_TLV_TYPES"; + description + "This sub-TLV describes the period for which adjacencies should be + maintained with the restarting system"; + } + + identity GRACE_RESTART_REASON { + base "GRACE_LSA_TLV_TYPES"; + description + "This sub-TLV describes the reason for the OSPF restart of the system + that is restarting"; + } + + identity GRACE_IP_INTERFACE_ADDRESS { + base "GRACE_LSA_TLV_TYPES"; + description + "This sub-TLV specifies the restarting system's IP address on the + interface via which it is advertising the Grace LSA"; + } + + identity RI_LSA_TLV_TYPES { + description + "This identity is used as the base for the TLVs within the Router + Information LSA"; + reference "RFC7770"; + } + + identity RI_INFORMATIONAL_CAPABILITIES { + base "RI_LSA_TLV_TYPES"; + description + "Informational capabilities of the advertising system"; + reference "RFC7770"; + } + + identity RI_FUNCTIONAL_CAPABILITIES { + base "RI_LSA_TLV_TYPES"; + description + "Functional capabilities of the advertising system"; + reference "RFC7770"; + } + + identity RI_NODE_ADMIN_TAG { + base "RI_LSA_TLV_TYPES"; + description + "Operator-defined administrative tags associated with the advertising + system"; + reference "RFC7777"; + } + + identity RI_SR_SID_LABEL_RANGE { + base "RI_LSA_TLV_TYPES"; + description + "SID or Label ranges for use with segment routing when forwarding to + the advertising system"; + reference "draft-ietf-ospf-segment-routing-extensions"; + } + + identity RI_SR_ALGORITHM { + base "RI_LSA_TLV_TYPES"; + description + "The algorithms that are supported for segment routing by the + advertising system"; + reference "draft-ietf-ospf-segment-routing-extensions"; + } + + // will be shared with IS-IS + identity SR_ALGORITHM { + description + "This identity is used as a base for the algorithms that can be + supported for segment routing and are advertised by a system in the RI + LSA"; + } + + identity SPF { + base "SR_ALGORITHM"; + description + "The standard shortest path algorithm based on link metric, + as used by the OSPF protocol"; + } + + identity STRICT_SPF { + base "SR_ALGORITHM"; + description + "The standard shortest path algorithm based on link metric, with the + requirement that all nodes along the path honor the SPF decision. That + is to say that the SPF decision cannot be altered by local policy at + the node"; + } + + identity OSPF_RI_SR_SID_LABEL_TLV_TYPES { + description + "This identity is used as a base for the sub-TLVs of the Segment + Routing SID/Label Range TLV"; + } + + identity SR_SID_LABEL_TLV { + base "OSPF_RI_SR_SID_LABEL_TLV_TYPES"; + description + "A range of SID/Label values used by the local system"; + reference "draft-ietf-ospf-segment-routing-extensions"; + } + + identity OSPFV2_ROUTER_LINK_TYPE { + description + "OSPFv2 Router Link Types as per the IANA registry defined in + RFC2740"; + } + + identity POINT_TO_POINT_LINK { + base "OSPFV2_ROUTER_LINK_TYPE"; + description + "The link is a point-to-point connection to another router"; + } + + identity TRANSIT_NETWORK_LINK { + base "OSPFV2_ROUTER_LINK_TYPE"; + description + "The link is a connection to a transit network"; + } + + identity STUB_NETWORK_LINK { + base "OSPFV2_ROUTER_LINK_TYPE"; + description + "The link is a connection to a stub network"; + } + + identity VIRTUAL_LINK { + base "OSPFV2_ROUTER_LINK_TYPE"; + description + "The link is a virtual connection to another router"; + } + + identity OSPFV2_EXTENDED_PREFIX_SUBTLV_TYPE { + description + "Sub-TLVs of the OSPFv2 Extended Prefix LSA as defined by + RFC7684"; + } + + identity EXTENDED_PREFIX_RANGE { + base "OSPFV2_EXTENDED_PREFIX_SUBTLV_TYPE"; + description + "The attributes being described relate to a range of prefixes"; + } + + identity PREFIX_SID { + base "OSPFV2_EXTENDED_PREFIX_SUBTLV_TYPE"; + description + "The TLV describes a Segment Routing Prefix Segment Identifier + associated with a prefix"; + } + + identity SID_LABEL_BINDING { + base "OSPFV2_EXTENDED_PREFIX_SUBTLV_TYPE"; + description + "The TLV describes a binding of a SID to a path to the prefix, + which may have associated path characteristics"; + } + + identity OSPFV2_EXTENDED_PREFIX_SID_LABEL_BINDING_SUBTLV_TYPE { + description + "Sub-TLV types carried in the SID/Label Binding Sub-TLV of + the Extended Prefix Sub-TLV"; + } + + identity SID_MPLS_LABEL_BINDING { + base "OSPFV2_EXTENDED_PREFIX_SID_LABEL_BINDING_SUBTLV_TYPE"; + description + "This sub-TLV indicates a binding between an SR SID and an + MPLS label and must be present in the sub-TLV"; + } + + identity ERO_METRIC { + base "OSPFV2_EXTENDED_PREFIX_SID_LABEL_BINDING_SUBTLV_TYPE"; + description + "This sub-TLV indicates the cost of the ERO path being + advertised in the SID/Label TLV"; + } + + identity ERO_PATH { + base "OSPFV2_EXTENDED_PREFIX_SID_LABEL_BINDING_SUBTLV_TYPE"; + description + "This sub-TLV indicates the path associated with an ERO + being advertised in the SID/Label TLV"; + } + + identity OSPFV2_EXTPREFIX_BINDING_ERO_PATH_SEGMENT_TYPE { + description + "The types of segment included within an ERO Path described + within the SID/Label binding sub-TLV"; + } + + identity IPV4_SEGMENT { + base "OSPFV2_EXTPREFIX_BINDING_ERO_PATH_SEGMENT_TYPE"; + description + "The segment is specified as an IPv4 address"; + } + + identity UNNUMBERED_INTERFACE_SEGMENT { + base "OSPFV2_EXTPREFIX_BINDING_ERO_PATH_SEGMENT_TYPE"; + description + "The segment is specified as an unnumbered interface of + a remote system"; + } + + identity OSPFV2_EXTENDED_LINK_SUBTLV_TYPE { + description + "Sub-TLVs of the Extended Link TLV for OSPFv2"; + } + + identity ADJACENCY_SID { + base "OSPFV2_EXTENDED_LINK_SUBTLV_TYPE"; + description + "The extended link sub-TLV indicates an Adjacency SID"; + } + + identity MAX_METRIC_TRIGGER { + description + "Triggers which cause the maximum metric to be set for + entities advertised in OSPF"; + } + + identity MAX_METRIC_ON_SYSTEM_BOOT { + base "MAX_METRIC_TRIGGER"; + description + "Set the maximum metric when the system boots."; + } + + identity MAX_METRIC_INCLUDE { + description + "Entities that may optionally be included when advertising + the maximum metric."; + } + + identity MAX_METRIC_INCLUDE_STUB { + base "MAX_METRIC_INCLUDE"; + description + "Include stub networks when advertising the maximum metric."; + } + + identity MAX_METRIC_INCLUDE_TYPE2_EXTERNAL { + base "MAX_METRIC_INCLUDE"; + description + "Include OSPF Type 2 external routes when advertising + the maximum metric."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2-area-interface@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2-area-interface@2019-11-28.yang new file mode 100644 index 0000000..c72025b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2-area-interface@2019-11-28.yang @@ -0,0 +1,490 @@ +submodule openconfig-ospfv2-area-interface { + + belongs-to openconfig-ospfv2 { + prefix "oc-ospfv2"; + } + + import ietf-yang-types { prefix "yang"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-interfaces { prefix "oc-if"; } + import openconfig-ospf-types { prefix "oc-ospf-types"; } + + // include common submodule + include openconfig-ospfv2-common; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule provides OSPFv2 configuration and operational + state parameters that are specific to the area context"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping ospfv2-area-interface-config { + description + "Configuration parameters for an OSPF interface"; + + leaf id { + type string; + description + "An operator-specified string utilised to uniquely + reference this interface"; + } + + leaf network-type { + type identityref { + base "oc-ospf-types:OSPF_NETWORK_TYPE"; + } + description + "The type of network that OSPFv2 should use for the specified + interface."; + } + + leaf priority { + type uint8; + description + "The local system's priority to become the designated + router"; + } + + leaf multi-area-adjacency-primary { + type boolean; + default true; + description + "When the specified interface is included in more than one + area's configuration, this leaf marks whether the area should + be considered the primary (when the value is true). In the + case that this value is false, the area is considered a + secondary area."; + } + + leaf authentication-type { + type string; + // rjs TODO: discuss with bogdanov@ what the approach for auth + // links should be. + description + "The type of authentication that should be used on this + interface"; + } + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "The metric for the interface"; + } + + leaf passive { + type boolean; + description + "When this leaf is set to true, the interface should be + advertised within the OSPF area but OSPF adjacencies should + not be established over the interface"; + } + + leaf hide-network { + type boolean; + description + "When this leaf is set to true, the network connected to + the interface should be hidden from OSPFv2 advertisements + per the procedure described in RFC6860."; + reference + "RFC6860 - Hiding Transit-Only Networks in OSFF"; + } + } + + grouping ospfv2-area-interface-timers-config { + description + "Configuration parameters relating to per-interface OSPFv2 + timers"; + + leaf dead-interval { + type uint32; + units seconds; + description + "The number of seconds that the local system should let + elapse before declaring a silent router down"; + reference "RFC2328"; + } + + leaf hello-interval { + type uint32; + units seconds; + description + "The number of seconds the local system waits between the + transmission of subsequent Hello packets"; + } + + leaf retransmission-interval { + type uint32; + units seconds; + description + "The number of seconds that the local system waits before + retransmitting an unacknowledged LSA."; + } + } + + grouping ospfv2-area-interface-mpls-config { + description + "Configuration parameters relating to MPLS extensions for OSPF"; + + leaf traffic-engineering-metric { + type uint32; + description + "A link metric that should only be considered for traffic + engineering purposes."; + reference "RFC3630, section 2.5.5"; + } + } + + grouping ospfv2-area-interface-neighbor-config { + description + "Configuration parameters relating to an individual neighbor + system on an interface within an OSPF area"; + + leaf router-id { + type yang:dotted-quad; + description + "The router ID of the remote system."; + } + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "The metric that should be considered to the remote neighbor + over this interface. This configuration is only applicable + for multiple-access networks"; + } + } + + grouping ospfv2-area-interface-neighbor-state { + description + "Operational state parameters relating an individual neighbor + system on an interface within an OSPF area"; + + leaf priority { + type uint8; + description + "The remote system's priority to become the designated + router"; + } + + leaf dead-time { + type oc-types:timeticks64; + description + "The time at which this neighbor's adjacency will be + considered dead. The value is expressed relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf designated-router { + type yang:dotted-quad; + description + "The designated router for the adjacency. This device + advertises the Network LSA for broadcast and NBMA networks."; + } + + leaf backup-designated-router { + type yang:dotted-quad; + description + "The backup designated router for the adjacency."; + } + + leaf optional-capabilities { + // rjs TODO: should this be anything more than the hex-string + // this is currently what is shown in IOS/JUNOS + type yang:hex-string; + description + "The optional capabilities field received in the Hello + message from the neighbor"; + } + + leaf last-established-time { + type oc-types:timeticks64; + // rjs TODO: check implementations - is FULL considered 'up' + // since the adjacency is probably up since ExStart + description + "The time at which the adjacency was last established with + the neighbor. That is to say the time at which the + adjacency last transitioned into the FULL state. The + value is expressed relative to the Unix Epoch (Jan 1 1970 + 00:00:00 UTC)."; + } + + leaf adjacency-state { + type identityref { + base "oc-ospf-types:OSPF_NEIGHBOR_STATE"; + } + description + "The state of the adjacency with the neighbor."; + } + + leaf state-changes { + type uint32; + description + "The number of transitions out of the FULL state that this + neighbor has been through"; + } + + leaf retranmission-queue-length { + type uint32; + description + "The number of LSAs that are currently in the queue to be + retransmitted to the neighbor"; + } + } + + grouping ospfv2-area-interface-lsa-filter-config { + description + "Configuration options relating to filtering LSAs + on an interface."; + + leaf all { + type boolean; + description + "When this leaf is set to true, all LSAs should be + filtered to the neighbours with whom adjacencies are + formed on the interface."; + } + + // NB: this container can be augmented to add additional + // filtering options which exist in some implementations. + } + + grouping ospfv2-area-interface-mpls-igp-ldp-sync-state { + description + "Operational state parameters relating to MPLS LDP/IGP + synchronization on a per-neighbor basis"; + + leaf synchronized { + type boolean; + description + "When the value of this leaf is set to true, the + LDP neighbors reachable via this interface are considered + to be synchronized, and hence the link is considered + usable by the IGP."; + } + } + + grouping ospfv2-area-interfaces-structure { + description + "Structural grouping for configuration and operational state + parameters that relate to an interface"; + + container interfaces { + description + "Enclosing container for a list of interfaces enabled within + this area"; + + list interface { + key "id"; + + description + "List of interfaces which are enabled within this area"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "A pointer to the identifier for the interface."; + } + + container config { + description + "Configuration parameters for the interface on which + OSPFv2 is enabled"; + + uses ospfv2-area-interface-config; + } + + container state { + config false; + description + "Operational state parameters for the interface on which + OSPFv2 is enabled"; + uses ospfv2-area-interface-config; + } + + uses oc-if:interface-ref; + + container timers { + description + "Timers relating to OSPFv2 on the interface"; + + container config { + description + "Configuration parameters for OSPFv2 timers on the + interface"; + uses ospfv2-area-interface-timers-config; + } + + container state { + config false; + description + "Operational state parameters for OSPFv2 timers on + the interface"; + + uses ospfv2-area-interface-timers-config; + } + } + + container mpls { + description + "Configuration and operational state parameters for + OSPFv2 extensions related to MPLS on the interface."; + + container config { + description + "Configuration parameters for OSPFv2 extensions relating + to MPLS for the interface"; + uses ospfv2-area-interface-mpls-config; + } + + container state { + config false; + description + "Operational state for OSPFv2 extensions relating to + MPLS for the interface"; + uses ospfv2-area-interface-mpls-config; + } + + container igp-ldp-sync { + description + "OSPFv2 parameters relating to LDP/IGP synchronization"; + + container config { + description + "Configuration parameters relating to LDP/IG + synchronization."; + uses ospfv2-common-mpls-igp-ldp-sync-config; + } + + container state { + config false; + description + "Operational state variables relating to LDP/IGP + synchronization"; + uses ospfv2-common-mpls-igp-ldp-sync-config; + uses ospfv2-area-interface-mpls-igp-ldp-sync-state; + } + } + } + + container lsa-filter { + description + "OSPFv2 parameters relating to filtering of LSAs to + neighbors the specified interface."; + + container config { + description + "Configuration parameters relating to filtering LSAs + on the specified interface."; + uses ospfv2-area-interface-lsa-filter-config; + } + + container state { + config false; + description + "Operational state parameters relating to filtering + LSAs on the specified interface"; + uses ospfv2-area-interface-lsa-filter-config; + } + } + + container neighbors { + description + "Enclosing container for the list of neighbors that + an adjacency has been established with on the interface"; + + list neighbor { + key "router-id"; + + description + "A neighbor with which an OSPFv2 adjacency has been + established within this area"; + + leaf router-id { + type leafref { + path "../config/router-id"; + } + description + "Reference to the router ID of the adjacent system"; + } + + container config { + description + "Configuration parameters relating to the adjacent + system"; + uses ospfv2-area-interface-neighbor-config; + } + + container state { + config false; + description + "Operational state parameters relating to the adjacent + system"; + uses ospfv2-area-interface-neighbor-config; + uses ospfv2-area-interface-neighbor-state; + } + } + } + + } + } + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2-area@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2-area@2019-11-28.yang new file mode 100644 index 0000000..241cfd1 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2-area@2019-11-28.yang @@ -0,0 +1,193 @@ +submodule openconfig-ospfv2-area { + + belongs-to openconfig-ospfv2 { + prefix "oc-ospfv2"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-ospf-types { prefix "oc-ospf-types"; } + import ietf-inet-types { prefix "inet"; } + + // include other required submodules + include openconfig-ospfv2-area-interface; + include openconfig-ospfv2-lsdb; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule provides OSPFv2 configuration and operational + state parameters that are specific to the area context"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping ospfv2-area-config { + description + "Configuration parameters relating to an OSPF area"; + + leaf identifier { + type oc-ospf-types:ospf-area-identifier; + description + "An identifier for the OSPFv2 area - described as either a + 32-bit unsigned integer, or a dotted-quad"; + } + } + + grouping ospfv2-area-mpls-config { + description + "Configuration parameters relating to OSPFv2 extensions for + MPLS"; + + leaf traffic-engineering-enabled { + type boolean; + description + "Specifies whether traffic engineering extensions should be + advertised within the area"; + } + } + + grouping ospfv2-area-virtual-link-config { + description + "Configuration parameters relating to a virtual-link within + the OSPF area"; + + leaf remote-router-id { + type inet:ipv4-address-no-zone; + description + "The router ID of the device which terminates the remote end + of the virtual link"; + } + } + + grouping ospfv2-area-structure { + description + "Structural grouping for configuration and operational state + parameters that relate to an individual area"; + + container config { + description + "Configuration parameters relating to an OSPFv2 area"; + + uses ospfv2-area-config; + } + + container state { + config false; + description + "Operational state parameters relating to an OSPFv2 area"; + uses ospfv2-area-config; + } + + container mpls { + description + "Configuration and operational state parameters for OSPFv2 + extensions relating to MPLS"; + + container config { + description + "Configuration parameters relating to MPLS extensions for + OSPFv2"; + uses ospfv2-area-mpls-config; + } + + container state { + config false; + description + "Operational state parameters relating to MPLS extensions + for OSPFv2"; + uses ospfv2-area-mpls-config; + } + } + + uses ospfv2-lsdb-structure; + uses ospfv2-area-interfaces-structure; + + container virtual-links { + description + "Configuration and state parameters relating to virtual + links from the source area to a remote router"; + + list virtual-link { + key "remote-router-id"; + + description + "Configuration and state parameters relating to a + virtual link"; + + leaf remote-router-id { + type leafref { + path "../config/remote-router-id"; + } + description + "Reference to the remote router ID"; + } + + container config { + description + "Configuration parameters relating to the OSPF virtual link"; + uses ospfv2-area-virtual-link-config; + } + + container state { + config false; + description + "State parameters relating to the OSPF virtual link"; + uses ospfv2-area-virtual-link-config; + uses ospfv2-area-interface-neighbor-state; + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2-common@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2-common@2019-11-28.yang new file mode 100644 index 0000000..e9a1e7e --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2-common@2019-11-28.yang @@ -0,0 +1,115 @@ +submodule openconfig-ospfv2-common { + + belongs-to openconfig-ospfv2 { + prefix "oc-ospfv2"; + } + + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule provides OSPFv2 configuration and operational + state parameters that are shared across multiple contexts"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping ospfv2-common-mpls-igp-ldp-sync-config { + description + "Configuration parameters used for OSPFv2 MPLS/IGP + synchronization"; + + leaf enabled { + type boolean; + description + "When this leaf is set to true, do not utilise this link for + forwarding via the IGP until such time as LDP adjacencies to + the neighbor(s) over the link are established."; + } + + leaf post-session-up-delay { + type uint32; + units milliseconds; + description + "This leaf specifies a delay, expressed in units of milliseconds, + between the LDP session to the IGP neighbor being established, and + it being considered synchronized by the IGP."; + } + } + + grouping ospfv2-common-timers { + description + "Common definition of the type of timers that the OSPFv2 implementation + uses"; + + leaf timer-type { + type enumeration { + enum LINEAR_BACKOFF { + description + "The backoff used by the OSPFv2 implementation is linear, such that + a common delay is added following each event."; + } + enum EXPONENTIAL_BACKOFF { + description + "The backoff used by the OSPFv2 implementation is exponential, such + that the delay added following each event increases."; + } + } + description + "The timer mode that is utilised by the implementation."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2-global@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2-global@2019-11-28.yang new file mode 100644 index 0000000..660f4a3 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2-global@2019-11-28.yang @@ -0,0 +1,533 @@ +submodule openconfig-ospfv2-global { + + belongs-to openconfig-ospfv2 { + prefix "oc-ospfv2"; + } + + import ietf-yang-types { prefix "yang"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-routing-policy { prefix "oc-rpol"; } + import openconfig-ospf-types { prefix "oc-ospft"; } + + // Include common submodule + include openconfig-ospfv2-common; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule provides OSPFv2 configuration and operational + state parameters that are global to a particular OSPF instance"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping ospfv2-global-config { + description + "Global configuration for OSPFv2"; + + leaf router-id { + type yang:dotted-quad; + description + "A 32-bit number represented as a dotted quad assigned to + each router running the OSPFv2 protocol. This number should + be unique within the autonomous system"; + reference "rfc2828"; + } + + leaf summary-route-cost-mode { + type enumeration { + enum RFC1583_COMPATIBLE { + description + "Specify that summary routes should assume the cost of + the lowest-cost more-specific route as per the behaviour + specified in RFC1583"; + } + enum RFC2328_COMPATIBLE { + description + "Specify that summary routes should assume the cost of the + highest-cost more-specific route as per the revised + behaviour specified in RFC2328"; + } + } + default "RFC2328_COMPATIBLE"; + description + "Specify how costs for the summary routes should be specified + as per the behaviour in the original OSPF specification + RFC1583, or alternatively whether the revised behaviour + described in RFC2328 should be utilised"; + } + + leaf igp-shortcuts { + type boolean; + description + "When this leaf is set to true, OSPFv2 will route traffic to + a remote system via any LSP to the system that is marked as + shortcut eligible."; + } + + leaf log-adjacency-changes { + type boolean; + description + "When this leaf is set to true, a log message will be + generated when the state of an OSPFv2 neighbour changes."; + } + + leaf hide-transit-only-networks { + type boolean; + description + "When this leaf is set to true, do not advertise prefixes + into OSPFv2 that correspond to transit interfaces, as per + the behaviour discussed in RFC6860."; + reference + "RFC6860 - Hiding Transit-Only Networks in OSPF"; + } + } + + grouping ospfv2-global-spf-timers-config { + description + "Configuration parameters relating to global SPF timer + parameters for OSPFv2"; + + leaf initial-delay { + // rjs TODO: IS-IS model has this as decimal64 - should it be + // that or uint32 msec? + type uint32; + units msec; + description + "The value of this leaf specifies the time between a change + in topology being detected and the first run of the SPF + algorithm."; + } + + leaf maximum-delay { + // rjs TODO: same question as above + type uint32; + units msec; + description + "The value of this leaf specifies the maximum delay between + a topology change being detected and the SPF algorithm + running. This value is used for implementations that support + increasing the wait time between SPF runs."; + } + + // rjs TODO: some questions here around what we should specify: + // JUNOS has rapid-runs and holddown + // Cisco has maximum time between runs, and then a doubling of + // the wait interval up to that maximum. + // ALU has first-wait, second-wait, max-wait + } + + grouping ospfv2-global-lsa-generation-timers-config { + description + "Configuration parameters relating to global LSA generation + parameters for OSPFv2"; + + leaf initial-delay { + type uint32; + units msec; + description + "The value of this leaf specifies the time between the first + time an LSA is generated and advertised and the subsequent + generation of that LSA."; + } + + leaf maximum-delay { + type uint32; + units msec; + description + "The value of this leaf specifies the maximum time between the + generation of an LSA and the subsequent re-generation of that + LSA. This value is used in implementations that support + increasing delay between generation of an LSA"; + } + } + + grouping ospfv2-global-spf-timers-state { + description + "Operational state parameters relating to OSPFv2 global + timers"; + + uses ospfv2-common-timers; + } + + grouping ospfv2-global-lsa-generation-timers-state { + description + "Operational state parameters relating to OSPFv2 global + timers"; + + uses ospfv2-common-timers; + } + + grouping ospfv2-global-graceful-restart-config { + description + "Configuration parameters relating to graceful restart for + OSPFv2"; + + leaf enabled { + type boolean; + description + "When the value of this leaf is set to true, graceful restart + is enabled on the local system. In this case, the system will + use Grace-LSAs to signal that it is restarting to its + neighbors."; + } + + leaf helper-only { + type boolean; + description + "Operate graceful-restart only in helper mode. When this leaf + is set to true, the local system does not use Grace-LSAs to + indicate that it is restarting, but will accept Grace-LSAs + from remote systems, and suppress withdrawl of adjacencies + of the system for the grace period specified"; + } + } + + grouping ospfv2-global-mpls-config { + description + "Configuration parameters for OSPFv2 options which + relate to MPLS"; + + leaf traffic-engineering-extensions { + type boolean; + description + "When this leaf is set to true, use traffic engineering + extensions for OSPF to advertise TE parameters via type 10 + Opaque LSAs"; + } + } + + grouping ospfv2-global-inter-areapp-config { + description + "Configuration parameters for OSPFv2 policies which propagate + prefixes between areas"; + + leaf src-area { + type leafref { + // we are at ospf/global/inter-area-propagation-policies/... + // inter-area-propagation-policy/config/src-area + path "../../../../../areas/area/identifier"; + } + description + "The area from which prefixes are to be exported."; + } + + leaf dst-area { + type leafref { + // we are at ospf/global/inter-area-propagation-policies/... + // inter-area-propagation-policy/config/src-area + path "../../../../../areas/area/identifier"; + } + description + "The destination area to which prefixes are to be imported"; + } + + uses oc-rpol:apply-policy-import-config; + } + + grouping ospfv2-global-max-metric-config { + description + "Configuration paramters relating to setting the OSPFv2 + maximum metric."; + + leaf set { + type boolean; + description + "When this leaf is set to true, all non-stub interfaces of + the local system are advertised with the maximum metric, + such that the router does not act as a transit system, + (similarly to the IS-IS overload functionality)."; + reference + "RFC3137 - OSPF Stub Router Advertisement"; + } + + leaf timeout { + type uint64; + units "seconds"; + description + "The delay, in seconds, after which the advertisement of + entities with the maximum metric should be cleared, and + the system reverts to the default, or configured, metrics."; + } + + leaf-list include { + type identityref { + base "oc-ospft:MAX_METRIC_INCLUDE"; + } + description + "By default, the maximum metric is advertised for all + non-stub interfaces of a device. When identities are + specified within this leaf-list, additional entities + are also advertised with the maximum metric according + to the values within the list."; + } + + leaf-list trigger { + type identityref { + base "oc-ospft:MAX_METRIC_TRIGGER"; + } + description + "By default, the maximum metric is only advertised + when the max-metric/set leaf is specified as true. + In the case that identities are specified within this + list, they provide additional triggers (e.g., system + boot) that may cause the max-metric to be set. In this + case, the system should still honour the timeout specified + by the max-metric/timeout leaf, and clear the max-metric + advertisements after the expiration of this timer."; + } + } + + grouping ospfv2-global-structural { + description + "Top level structural grouping for OSPFv2 global parameters"; + + container global { + description + "Configuration and operational state parameters for settings + that are global to the OSPFv2 instance"; + + container config { + description + "Global configuration parameters for OSPFv2"; + uses ospfv2-global-config; + } + + container state { + config false; + description + "Operational state parameters for OSPFv2"; + uses ospfv2-global-config; + } + + container timers { + description + "Configuration and operational state parameters for OSPFv2 + timers"; + + container spf { + description + "Configuration and operational state parameters relating + to timers governing the operation of SPF runs"; + + container config { + description + "Configuration parameters relating to global OSPFv2 + SPF timers"; + uses ospfv2-global-spf-timers-config; + } + + container state { + config false; + description + "Operational state parameters relating to the global + OSPFv2 SPF timers"; + uses ospfv2-global-spf-timers-config; + uses ospfv2-global-spf-timers-state; + } + } + + container max-metric { + description + "Configuration and operational state parameters relating + to setting the OSPFv2 maximum metric."; + + container config { + description + "Configuration parameters relating to setting the OSPFv2 + maximum metric for a set of advertised entities."; + uses ospfv2-global-max-metric-config; + } + + container state { + config false; + description + "Operational state parameters relating to setting the + OSPFv2 maximum metric for a set of advertised entities."; + uses ospfv2-global-max-metric-config; + } + } + + container lsa-generation { + description + "Configuration and operational state parameters relating + to timers governing the generation of LSAs by the local + system"; + + container config { + description + "Configuration parameters relating to the generation of + LSAs by the local system"; + uses ospfv2-global-lsa-generation-timers-config; + } + + container state { + config false; + description + "Operational state parameters relating to the generation + of LSAs by the local system"; + uses ospfv2-global-lsa-generation-timers-config; + uses ospfv2-global-lsa-generation-timers-state; + } + } + } + + container graceful-restart { + description + "Configuration and operational state parameters for OSPFv2 + graceful restart"; + + container config { + description + "Configuration parameters relating to OSPFv2 graceful + restart"; + uses ospfv2-global-graceful-restart-config; + } + + container state { + config false; + description + "Operational state parameters relating to OSPFv2 graceful + restart"; + uses ospfv2-global-graceful-restart-config; + } + } + + container mpls { + description + "OSPFv2 parameters relating to MPLS"; + + container config { + description + "Configuration parameters relating to MPLS for OSPFv2"; + uses ospfv2-global-mpls-config; + } + + container state { + config false; + description + "Operational state parameters relating to MPLS for + OSPFv2"; + uses ospfv2-global-mpls-config; + } + + container igp-ldp-sync { + description + "OSPFv2 parameters relating to LDP/IGP synchronization"; + + container config { + description + "Configuration parameters relating to LDP/IG + synchronization."; + uses ospfv2-common-mpls-igp-ldp-sync-config; + } + + container state { + config false; + description + "Operational state variables relating to LDP/IGP + synchronization"; + uses ospfv2-common-mpls-igp-ldp-sync-config; + } + } + } + + container inter-area-propagation-policies { + description + "Policies defining how inter-area propagation should be performed + by the OSPF instance"; + + list inter-area-propagation-policy { + key "src-area dst-area"; + description + "A list of connections between pairs of areas - routes are + propagated from the source (src) area to the destination (dst) + area according to the policy specified"; + + leaf src-area { + type leafref { + path "../config/src-area"; + } + description + "Reference to the source area"; + } + + leaf dst-area { + type leafref { + path "../config/dst-area"; + } + description + "Reference to the destination area"; + } + + container config { + description + "Configuration parameters relating to the inter-area + propagation policy"; + uses ospfv2-global-inter-areapp-config; + } + + container state { + config false; + description + "Operational state parameters relating to the inter-area + propagation policy"; + uses ospfv2-global-inter-areapp-config; + } + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2-lsdb@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2-lsdb@2019-11-28.yang new file mode 100644 index 0000000..c51de06 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2-lsdb@2019-11-28.yang @@ -0,0 +1,2379 @@ +submodule openconfig-ospfv2-lsdb { + + belongs-to openconfig-ospfv2 { + prefix "oc-ospfv2"; + } + + // import some basic types + import ietf-yang-types { prefix "yang"; } + import ietf-inet-types { prefix "inet"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-ospf-types { prefix "oc-ospf-types"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "An OpenConfig model for the Open Shortest Path First (OSPF) + version 2 link-state database (LSDB)"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping ospfv2-lsdb-common-prefix-properties { + description + "Common properties used in the LSDB that relate to IPv4 prefixes"; + + leaf prefix-length { + type uint8 { + range "0..32"; + } + description + "The length of the IPv4 prefix contained in the Extended Prefix LSA"; + } + + leaf address-family { + // TODO: should this be an identity? + type enumeration { + enum IPV4_UNICAST { + value 0; + description + "The prefix contained within the Extended Prefix LSA is an IPv4 + unicast prefix"; + } + } + description + "The address family of the prefix contained in the Extended Prefix + LSA"; + } + } + + grouping ospfv2-lsdb-common-link-specification { + description + "Generic attributes used to identify links within OSPFv2"; + + leaf link-id { + type yang:dotted-quad; + description + "The identifier for the link specified. The value of the link + identifier is dependent upon the type of the LSA. The value is + specified to be, per sub-type: + 1) Neighbouring router's router ID. + 2) IP address of DR. + 3) IP network address. + 4) Neighbouring router router's ID."; + } + + leaf link-data { + type union { + type yang:dotted-quad; + type uint32; + } + description + "The data associated with the link type. The value is + dependent upon the subtype of the LSA. When the connection is + to a stub network it represents the mask; for p2p connections + that are unnumbered it represents the ifIndex value of the + router's interface; for all other connections it represents + the local system's IP address"; + } + + } + + grouping ospfv2-lsdb-common-unknown-tlv { + description + "A generic specification of a TLV to be used when the + value cannot be decoded by the local system"; + + leaf type { + type uint16; + description + "The type value of the unknown TLV"; + } + + leaf length { + type uint16; + description + "The length value of the unknown TLV"; + } + + leaf value { + type binary; + description + "The value portion of the unknwon TLV"; + } + } + + grouping ospfv2-lsdb-common-unknown-tlv-structure { + description + "A generic specification of an unknown TLV"; + + container unknown-tlv { + description + "An unknown TLV within the context. Unknown TLVs are + defined to be the set of TLVs that are not modelled + within the OpenConfig model, or are unknown to the + local system such that it cannot decode their value."; + + container state { + description + "Contents of an unknown TLV within the LSA"; + uses ospfv2-lsdb-common-unknown-tlv; + } + } + } + + grouping ospfv2-lsdb-common-unknown-subtlv-structure { + description + "A generic specification of an unknown TLV"; + + container unknown-subtlv { + description + "An unknown SubTLV within the context. Unknown Sub-TLV + are defined to be the set of SubTLVs that are not modelled + by the OpenConfig schema, or are unknown to the local system + such that it cannot decode their value."; + + container state { + description + "Contents of an unknown TLV within the LSA"; + uses ospfv2-lsdb-common-unknown-tlv; + } + } + } + + grouping ospfv2-lsdb-common-tos-metric { + description + "Common LSDB LSA parameters for type of service and metric"; + + leaf tos { + type uint8; + description + "OSPF encoding of the type of service referred to by this + LSA. Encoding for OSPF TOS are described in RFC2328."; + } + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "The metric value to be used for the TOS specified. This value + represents the cost of use of the link for the specific type + of service."; + } + } + + grouping ospfv2-lsdb-common-sr-sid-spec { + description + "Re-usable specification of a segment routing SID"; + + leaf sid-type { + type oc-ospf-types:sr-sid-type; + description + "The type of the value contained within the sub-TLV"; + } + + leaf sid-value { + type uint32; + description + "The value of the binding included within the sub-TLV. The type of + this binding is indicated by the type leaf."; + } + } + + grouping ospfv2-lsdb-area-state { + description + "Per-area operational state parameters for an OSPFv2 area"; + + leaf identifier { + type oc-ospf-types:ospf-area-identifier; + description + "An identifier for the area, expressed as a dotted quad or + an unsigned 32-bit integer"; + } + } + + grouping ospfv2-lsdb-area-lsa-type-state { + description + "Per-LSA type operational state parameters for an OSPFv2 area"; + + leaf type { + type identityref { + base "oc-ospf-types:OSPF_LSA_TYPE"; + } + description + "The type of LSA being described. The type of the LSA is + expressed as a canonical name."; + } + } + + grouping ospfv2-lsdb-area-lsa-state { + description + "Generic parameters of an OSPFv2 LSA"; + + leaf link-state-id { + type yang:dotted-quad; + description + "The Link State ID for the specified LSA type. The exact + defined value of the Link State ID is dependent on the LSA + type."; + } + + leaf advertising-router { + type yang:dotted-quad; + description + "The router ID of the router that originated the LSA"; + } + + leaf sequence-number { + type int32; + description + "A signed 32-bit integer used to detect old and duplicate + LSAs. The greater the sequence number the more recent the + LSA."; + } + + leaf checksum { + type uint16; + description + "The checksum of the complete contents of the LSA excluding + the age field."; + } + + leaf age { + type uint16; + units seconds; + description + "The time since the LSA's generation in seconds"; + } + } + + grouping ospfv2-lsdb-router-lsa-structure { + description + "Structural grouping for Router LSA contents within the LSDB"; + + container router-lsa { + description + "Contents of the router LSA"; + + container state { + description + "State parameters of the router LSA"; + uses ospfv2-lsdb-router-lsa-state; + } + + uses ospfv2-lsdb-generic-lsa-tos-metric-structure; + } + } + + grouping ospfv2-lsdb-generic-lsa-tos-metric-structure { + description + "Grouping including a generic TOS/metric structure for an + LSA"; + + container types-of-service { + description + "Breakdown of LSA contents specifying multiple + TOS values"; + + list type-of-service { + key "tos"; + description + "Per-type of service parameters for the LSA"; + + leaf tos { + type leafref { + path "../state/tos"; + } + description + "Reference to the type of service identifier which is + specified in the LSA"; + } + + container state { + description + "Per-TOS parameters for the LSA"; + + uses ospfv2-lsdb-generic-lsa-tos-metric-state; + } + } + } + } + + grouping ospfv2-lsdb-network-lsa-structure { + description + "Structural grouping for Network LSA contents within the LSDB"; + + container network-lsa { + description + "Contents of the network LSA"; + + container state { + description + "State parameters of the network LSA"; + uses ospfv2-lsdb-network-lsa-state; + } + } + } + + grouping ospfv2-lsdb-summary-lsa-structure { + description + "Structural grouping for the Summary LSA contents within the + LSDB"; + + container summary-lsa { + description + "Contents of the summary LSA"; + + container state { + description + "State parameters of the summary LSA"; + uses ospfv2-lsdb-summary-lsa-state; + } + + uses ospfv2-lsdb-generic-lsa-tos-metric-structure; + } + } + + grouping ospfv2-lsdb-asexternal-lsa-structure { + description + "Structural grouping for the AS External LSA contents within + the LSDB"; + + container as-external-lsa { + description + "Contents of the AS External LSA"; + + container state { + description + "State parameters for the AS external LSA"; + uses ospfv2-lsdb-asexternal-lsa-state; + } + + container types-of-service { + description + "Breakdown of External LSA contents specifying multiple + TOS values"; + + list type-of-service { + key "tos"; + description + "Per-type of service parameters for the AS External LSA"; + + leaf tos { + type leafref { + path "../state/tos"; + } + description + "Reference to the type of service identifier which is + specified in the AS External LSA"; + } + + container state { + description + "Per-TOS parameters for the LSA"; + + uses ospfv2-lsdb-asexternal-tos-state; + } + } + } + + } + } + + grouping ospfv2-lsdb-nssa-external-lsa-structure { + description + "Structural grouping for the NSSA External LSA contents within + the LSDB"; + + container nssa-external-lsa { + description + "Contents of the NSSA External LSA"; + + container state { + description + "State parameters for the AS external LSA"; + // Type 7 LSAs are are a super-set of Type 5 LSAs so we simply + // include the Type 5 + uses ospfv2-lsdb-asexternal-lsa-state; + uses ospfv2-lsdb-nssa-external-lsa-state; + } + + container types-of-service { + description + "Breakdown of the NSSA External LSA contents specifying multiple + TOS values"; + + list type-of-service { + key "tos"; + description + "Per-type of service parameters for the NSSA external LSA"; + + leaf tos { + type leafref { + path "../state/tos"; + } + description + "Reference to the type of services identifier which is specified + in the NSSA External LSA"; + } + + container state { + description + "Per-TOS parameters for the LSA"; + uses ospfv2-lsdb-asexternal-tos-state; + } + } + } + } + } + + grouping ospfv2-lsdb-opaque-lsa-structure { + description + "Structural grouping for Opaque LSA contents within the LSDB"; + + container opaque-lsa { + description + "Contents of the opaque LSA"; + + container state { + description + "State parameters for the opaque LSA"; + uses ospfv2-lsdb-opaque-lsa-state; + } + + container traffic-engineering { + when "../state/type = 'TRAFFIC_ENGINEERING'" { + description + "Include the traffic-engineering information when + the Opaque LSA being described is a Traffic Engineering + LSA"; + } + description + "Contents of the Traffic Engineering Opaque LSA"; + + container tlvs { + description + "The TLVs contained in the TE Opaque LSA"; + list tlv { + // this is an unkeyed list + description + "The Type-Length-Value tuples included in the TE LSA"; + + container state { + description + "The contents of the TLV tuple within the TE LSA"; + uses ospfv2-lsdb-opaque-lsa-te-tlv-state; + } + + uses ospfv2-lsdb-common-unknown-tlv-structure; + + container router-address { + when "../state/type = 'TE_ROUTER_ADDRESS'" { + description + "Include the router address container only when the type + of the TLV is Router Address"; + } + + description + "Parameters included in the Router Address TLV"; + + container state { + description + "State parameters of the router address TLV"; + uses ospfv2-lsdb-opaque-te-router-address-state; + } + } + + container link { + when "../state/type = 'TE_ROUTER_LINK'" { + description + "Include the link container only when the type of the + TLV describes a traffic engineering link"; + } + + description + "Parameters included in the Link TLV"; + container sub-tlvs { + description + "Sub-TLVs included in the Link TLV"; + + list sub-tlv { + // unkeyed list + description + "The Sub-TLVs included within the Traffic Engineering + LSA's sub-TLV"; + + container state { + description + "State parameters of the Link Sub-TLV"; + + uses ospfv2-lsdb-opaque-te-link-state; + } + + uses ospfv2-lsdb-common-unknown-subtlv-structure; + + container unreserved-bandwidths { + description + "The unreserved link bandwidths for the Traffic + Engineering LSA - utilised when the sub-TLV type + indicates that the sub-TLV describes unreserved + bandwidth"; + + list unreserved-bandwidth { + key "priority"; + + description + "The unreserved bandwidth at each priority level"; + + leaf priority { + type leafref { + path "../state/priority"; + } + description + "A reference to the priority level being described"; + } + + container state { + description + "State parameters relating to the unreserved + bandwidth of the link being described"; + uses ospfv2-lsdb-opaque-te-link-unreserved-bw-state; + } + } + } + + container administrative-groups { + description + "The administrative groups that are set for the + Traffic Engineering LSA - utilised when the sub-TLV type + indicates that the sub-TLV describes administrative + groups"; + + list admin-group { + key "bit-index"; + + description + "The administrative group described within the + sub-TLV"; + + leaf bit-index { + type leafref { + path "../state/bit-index"; + } + description + "A reference to the bit index being described"; + } + + container state { + description + "State parameters relating to the administrative + groups being described for the link"; + uses ospfv2-lsdb-opaque-te-link-admin-group-state; + } + } + } + } + } + } + + container node-attribute { + when "../state/type = 'TE_NODE_ATTRIBUTE'" { + description + "Include the node-attribute container only when the type of + the TLV describes a node attribute"; + } + + description + "Parameters included in the Node Attribute TLV"; + + container sub-tlvs { + description + "Sub-TLVs of the Node Attribute TLV of the Traffic + Engineering LSA"; + + list sub-tlv { + // unkeyed list + description + "List of the Sub-TLVs contained within the Node Attribute + TLV"; + + container state { + description + "State parameters of the Node Attribute TLV sub-TLV"; + uses ospfv2-lsdb-opaque-te-node-attribute-state; + } + + uses ospfv2-lsdb-common-unknown-subtlv-structure; + } + } + } + + // A set of TLVs are omitted here - based on operational + // requirements, these are: + // * link-local + // * ipv6-address (OSPFv3 only) + // * optical-node-property + } + } + } // traffic-engineering + + container grace-lsa { + when "../state/type = 'GRACE_LSA'" { + description + "Include the grace-lsa container when the opaque LSA is specified + to be of that type."; + } + + description + "The Grace LSA is utilised when a remote system is undergoing + graceful restart"; + + container tlvs { + description + "TLVs of the Grace LSA"; + + list tlv { + description + "TLV entry in the Grace LSA, advertised by a system undergoing + graceful restart"; + + // unkeyed list + container state { + description + "Per-TLV state parameters of the Grace LSA"; + uses ospfv2-lsdb-opaque-grace-state; + } + uses ospfv2-lsdb-common-unknown-tlv-structure; + } + } + } // grace LSA + + container router-information { + when "../state/type = 'ROUTER_INFORMATION_LSA'" { + description + "Include the router-information container when the opaque LSA + type is specified to be an RI LSA"; + } + + description + "The router information LSA is utilised to advertise capabilities + of a system to other systems who receive the LSA"; + + container tlvs { + description + "The TLVs included within the Router Information LSA."; + + list tlv { + description + "TLV entry in the Router Information LSA"; + + // unkeyed list + container state { + description + "Per-TLV state parameters of the RI LSA"; + uses ospfv2-lsdb-opaque-ri-state; + } + + uses ospfv2-lsdb-common-unknown-tlv-structure; + + container informational-capabilities { + when "../state/type = 'RI_INFORMATIONAL_CAPABILITIES'" { + description + "Include the informational capabilities specification when + the TLV of the RI LSA is specified to be of this type"; + } + + description + "Information related to the capabilities of the advertising + router within the scope that the opaque RI LSA is being + advertised"; + + container state { + description + "State parameters of the informational capabilitis of the + RI LSA"; + uses ospfv2-lsdb-opaque-ri-informational-state; + } + } + + container node-administrative-tags { + when "../state/type = 'RI_NODE_ADMIN_TAG'" { + description + "Include the node administrative tags specification when + the TLV of the RI LSA is specified to be of this type"; + } + + description + "Per-node administrative tags associated with the local system + specified by the operator"; + + container state { + description + "State parameters of the node administrative tags advertised + in the RI LSA"; + uses ospfv2-lsdb-opaque-ri-admintag-state; + } + } + + container segment-routing-algorithm { + when "../state/type = 'RI_SR_ALGORITHM'" { + description + "Include the segment routing algorithm specific parameters when + the TLV of the RI LSA is specified to be of this type"; + } + + description + "The algorithms supported for Segment Routing by the local system"; + + container state { + description + "State parameters of the Segment Routing algorithm advertised in + the RI LSA"; + uses ospfv2-lsdb-opaque-ri-sralgo-state; + } + } + + container segment-routing-sid-label-range { + when "../state/type = 'RI_SR_SID_LABEL_RANGE'" { + description + "Include the segment routing SID/Label range TLV specific state when + the TLV of the RI LSA is specified to be of this type"; + } + + description + "The Segment Identifier (SID) or label ranges that are supported by + the local system for Segment Routing"; + + container tlvs { + description + "Sub-TLVs of the SID/Label range TLV of the RI LSA"; + + list tlv { + // unkeyed list + description + "Sub-TLVs of the SID/Label range TLV"; + + uses ospfv2-lsdb-common-unknown-tlv-structure; + + container state { + description + "State parameters of the sub-TLVs of the SR/Label range TLV"; + uses ospfv2-lsdb-opaque-ri-srrange-tlv-state; + } + + container sid-label { + description + "Sub-TLV used to advertise the SID or label associated with the + subset of the SRGB being advertised"; + + container state { + description + "State parameters of the SID/Label sub-TLV of the SR/Label + range TLV of the RI LSA"; + uses ospfv2-lsdb-opaque-ri-srrange-sid-label-tlv-state; + } + } + } + } + } + } + } + } // router-information + + container extended-prefix { + when "../state/type = 'OSPFV2_EXTENDED_PREFIX'" { + description + "Include the extended-prefix container when the opaque LSA + type is specified to be an extended prefix LSA"; + } + + description + "An OSPFv2 Extended Prefix Opaque LSA, used to encapsulate + TLV attributes associated with a prefix advertised in OSPF."; + + reference "RFC7684 - OSPFv2 Prefix/Link Attribute Advertisement"; + + container state { + description + "State parameters of the Extended Prefix LSA"; + uses ospfv2-lsdb-extended-prefix-state; + } + + container tlvs { + description + "TLVs contained within the Extended Prefix LSA"; + + list tlv { + // unkeyed list + description + "A TLV contained within the extended prefix LSA"; + + container state { + description + "State parameters relating to the sub-TLV of the extended + prefix LSA"; + uses ospfv2-lsdb-extended-prefix-tlv-state; + } + + container extended-prefix-range { + when "../state/type = 'EXTENDED_PREFIX_RANGE'" { + description + "Include the prefix range sub-TLV when the type of the + sub-TLV is specified as such"; + } + + description + "State parameters relating to the extended prefix range + sub-TLV of the extended prefix LSA"; + + container state { + description + "State parameters relating to the Extended Prefix Range + sub-TLV of the Extended Prefix LSA"; + uses ospfv2-lsdb-extended-prefix-range-state; + } + } + + container prefix-sid { + when "../state/type = 'PREFIX_SID'" { + description + "Include parameters relating to the Prefix SID when the type + of the sub-TLV is indicated as such"; + } + + description + "State parameters relating to the Prefix SID sub-TLV of the + extended prefix LSA"; + + container state { + description + "State parameters relating to the Prefix SID sub-TLV of the + extended prefix LSA"; + uses ospfv2-lsdb-extended-prefix-prefix-sid-state; + } + } // prefix-sid + + container sid-label-binding { + when "../state/type = 'SID_LABEL_BINDING'" { + description + "Include parameters relating to the SID/Label binding sub-TLV + only when the type is indicated as such"; + } + + description + "State parameters relating to the SID/Label binding sub-TLV + of the extended prefix LSA"; + + container state { + description + "State parameters relating to the SID/Label binding sub-TLV + of the extended prefix LSA"; + uses ospfv2-lsdb-extended-prefix-sid-label-binding-state; + } + + container tlvs { + description + "TLVs contained within the SID/Label Binding sub-TLV of the + SID/Label Binding TLV"; + + list tlv { + description + "A TLV contained within the SID/Label Binding sub-TLV"; + + container state { + description + "State parameters relating to the SID/Label Binding + sub-TLV"; + uses ospfv2-lsdb-extended-prefix-sid-label-binding-tlv-state; + } + + container sid-label-binding { + when "../state/type = 'SID_LABEL_BINDING'" { + description + "Include the SID/Label Binding sub-TLV parameters only + when the type is indicated as such"; + } + + description + "Parameters for the SID/Label Binding sub-TLV of the + SID/Label binding TLV"; + + container state { + description + "State parameteres relating to the SID/Label Binding + sub-TLV"; + uses ospfv2-lsdb-extprefix-sid-label-binding-state; + } + } // sid-label-binding + + container ero-metric { + when "../state/type = 'ERO_METRIC'" { + description + "Include the ERO Metric sub-TLV parameters only when + the type is indicated as such"; + } + + description + "Parameters for the ERO Metric Sub-TLV of the SID/Label + binding TLV"; + + container state { + description + "State parameters relating to the ERO Metric Sub-TLV of + the SID/Label binding TLV"; + uses ospfv2-lsdb-extprefix-sid-label-ero-metric-state; + } + } // ero-metric + + container ero-path { + when "../state/type = 'ERO_PATH'" { + description + "Include the ERO Path sub-TLV parameters only when the + type is indicated as such"; + } + + description + "Parameters for the ERO Path Sub-TLV of the SID/Label + binding TLV"; + + container segments { + description + "Segments of the path described within the SID/Label + Binding sub-TLV"; + + list segment { + description + "A segment of the path described within the sub-TLV"; + + container state { + description + "State parameters relating to the path segment + contained within the sub-TLV"; + uses ospfv2-lsdb-extprefix-sid-lbl-ero-path-seg-state; + } + + container ipv4-segment { + when "../state/type = 'IPV4_SEGMENT'" { + description + "Include the IPv4 segment only when the type is + indicated as such"; + } + + description + "Details of the IPv4 segment interface of the ERO"; + + container state { + description + "State parameters of the IPv4 segment of the ERO"; + uses ospfv2-lsdb-extprefix-sid-lbl-ero-ipv4-state; + } + } // ipv4-segment + + container unnumbered-hop { + when "../state/type = 'UNNUMBERED_INTERFACE_SEGMENT'" { + description + "Include the unnumbered segment only when the + type is indicated as such"; + } + + description + "Details of the unnumbered interface segment of the + ERO"; + + container state { + description + "State parameters of the unnumbered interface + segment of the ERO"; + uses ospfv2-lsdb-extprefix-sid-lbl-ero-unnum-state; + } + } // unnumbered-hop + } // tlv + } // tlvs + } + } + } + } // sid-label-binding + + uses ospfv2-lsdb-common-unknown-tlv-structure; + } + } + } // extended-prefix + + container extended-link { + description + "The OSPFv2 Extended Link Opaque LSA, used to encapsulate TLV + attributes associated with a link advertised in OSPF."; + + reference "RFC7684 - OSPFv2 Prefix/Link Attribute Advertisement"; + + container state { + description + "State parameters of the Extended Link LSA"; + uses ospfv2-lsdb-extended-link-state; + } + + container tlvs { + description + "TLVs contained within the Extended Link LSA"; + + list tlv { + description + "List of TLVs within the Extended Link LSA"; + + container state { + description + "State parameters relating to the sub-TLV of the extended link + LSA"; + uses ospfv2-lsdb-extended-link-tlv-state; + } + + uses ospfv2-lsdb-common-unknown-tlv-structure; + + container adjacency-sid { + when "../state/type = 'ADJACENCY_SID'" { + description + "Include the Adjacency SID parameters only when the type of + the sub-TLV is indicated as such"; + } + + description + "Parameters relating to an Adjacency SID sub-TLV of the + extended link LSA"; + + container state { + description + "State parameters relating to an Adjacency SID"; + + uses ospfv2-lsdb-extended-link-adj-sid-state; + } + } + } + } + + } // extended-link + + uses ospfv2-lsdb-common-unknown-tlv-structure; + } + } + + grouping ospfv2-lsdb-generic-lsa-tos-metric-state { + description + "Per-TOS state parameters for the Router LSA"; + + uses ospfv2-lsdb-common-tos-metric; + } + + grouping ospfv2-lsdb-router-lsa-state { + description + "Parameters of the router LSA"; + + leaf type { + type identityref { + base "oc-ospf-types:ROUTER_LSA_TYPES"; + } + description + "The sub-type of the Router LSA."; + } + + uses ospfv2-lsdb-common-link-specification; + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "The cost of utilising the link specified independent of TOS"; + } + + leaf number-links { + type uint16; + description + "The number of links that are described within the LSA"; + } + + leaf number-tos-metrics { + type uint16; + description + "The number of different TOS metrics given for this link, not + including the link metric (which is referred to as TOS 0)."; + } + } + + grouping ospfv2-lsdb-network-lsa-state { + description + "Parameters of the Network LSA"; + + leaf network-mask { + type uint8 { + range "0..32"; + } + description + "The mask of the network described by the Network LSA + represented as a CIDR mask."; + } + + leaf-list attached-router { + type yang:dotted-quad; + description + "A list of the router ID of the routers that are attached to + the network described by the Network LSA"; + } + } + + grouping ospfv2-lsdb-summary-lsa-state { + description + "Parameters of the Summary LSA"; + + leaf network-mask { + type uint8 { + range "0..32"; + } + description + "The mask of the network described by the Summary LSA + represented as a CIDR mask."; + } + } + + grouping ospfv2-lsdb-asexternal-lsa-common-parameters { + description + "Common parameters that are used for OSPFv2 AS External LSAs"; + + leaf forwarding-address { + type inet:ipv4-address-no-zone; + description + "The destination to which traffic for the external prefix + should be advertised. When this value is set to 0.0.0.0 then + traffic should be forwarded to the LSA's originator"; + } + + leaf external-route-tag { + type uint32; + description + "An opaque tag that set by the LSA originator to carry + information relating to the external route"; + } + } + + grouping ospfv2-lsdb-asexternal-lsa-state { + description + "Parameters for the AS External LSA"; + + leaf mask { + type uint8 { + range "0..32"; + } + description + "The subnet mask for the advertised destination"; + } + + leaf metric-type { + type enumeration { + enum "TYPE_1" { + description + "When the metric of a prefix is specified as Type 1 + then it is considered to be expressed in the same units as + the link-state metrics carried in OSPF. That is to say + that the metric advertised is directly compared to the + internal cost"; + } + enum "TYPE_2" { + description + "When the metric of a prefix is specified as Type 2 then + it is considered to be expressed as a cost in addition to + that of the link-state metric to the advertising router. + That is to say that the metric is considered to be the + cost to the advertising router plus the advertised metric + for the external entity"; + } + } + description + "The type of metric included within the AS External LSA."; + } + + leaf metric { + type oc-ospf-types:ospf-metric; + description + "The cost to reach the external network specified. The exact + interpretation of this cost is dependent on the type of + metric specified"; + } + + uses ospfv2-lsdb-asexternal-lsa-common-parameters; + } + + grouping ospfv2-lsdb-asexternal-tos-state { + description + "Per-TOS parameters for the AS External LSA"; + + uses ospfv2-lsdb-asexternal-lsa-common-parameters; + uses ospfv2-lsdb-common-tos-metric; + } + + grouping ospfv2-lsdb-nssa-external-lsa-state { + description + "Operational state parameters specific to the NSSA External + LSA"; + + leaf propagate { + type boolean; + description + "When this bit is set to true, an NSSA border router will + translate a Type 7 LSA (NSSA External) to a Type 5 LSA + (AS External)."; + reference "RFC3101, Section 2.3"; + } + } + + grouping ospfv2-lsdb-opaque-lsa-state { + description + "Operational state parameters specific to an Opaque LSA"; + + leaf scope { + type enumeration { + enum LINK { + description + "The scope of the LSA is the current link. The LSA + is not flooded beyond the local network. This + enumeration denotes a Type 9 LSA."; + } + enum AREA { + description + "The scope of the LSA is the local area. The LSA + is not flooded beyond the area of origin. This + enumeration denotes a Type 10 LSA."; + } + enum AS { + description + "The scope of the LSA is the local autonomous + system (AS). The flooding domain is the same + as a Type 5 LSA - it is not flooded into + stub areas or NSSAs. This enumeration denotes a + Type 11 LSA."; + } + } + description + "The scope of the opaque LSA. The type of the LSA + indicates its scope - the value of this leaf + determines both the flooding domain, and the type + of the LSA."; + } + + leaf type { + type identityref { + base "oc-ospf-types:OSPF_OPAQUE_LSA_TYPE"; + } + description + "The Opaque Type of the LSA. This value is used to + indicate the type of data carried by the opaque LSA"; + } + } + + grouping ospfv2-lsdb-opaque-lsa-te-tlv-state { + description + "The contents of the Traffic Engineering LSA"; + + leaf type { + type identityref { + base "oc-ospf-types:OSPF_TE_LSA_TLV_TYPE"; + } + description + "The type of TLV within the Traffic Engineering LSA"; + } + } + + grouping ospfv2-lsdb-opaque-te-unknown-state { + description + "The contents of the unknown TLV within the Traffic Engineering LSA"; + + uses ospfv2-lsdb-common-unknown-tlv; + } + + grouping ospfv2-lsdb-opaque-te-link-state { + description + "The contents of the sub-TLVs of a Traffic Engineering LSA Link TLV"; + + leaf type { + type union { + type identityref { + base "oc-ospf-types:OSPF_TE_LINK_TLV_TYPE"; + } + type enumeration { + enum UNKNOWN { + description + "The sub-TLV received in the LSA is unknown to the local + system"; + } + } + } + description + "The sub-TLV type specified in the Link TLV. When the value is + known by the local system, a canonical name of the sub-TLV is utilised + - the special UNKNOWN value indicates that the system did not + support the sub-TLV type received in the LSA."; + } + + leaf unknown-type { + when "../type = 'UNKNOWN'" { + description + "Include the unknown type field only when the sub-TLV was not + known to the local system"; + } + + type uint16; + description + "The value of the type field of an unknown sub-TLV"; + } + + leaf unknown-value { + when "../type = 'UNKNOWN'" { + description + "Include the unknown value field only when the sub-TLV was not + known to the local system"; + } + + type binary; + description + "The binary contents of the unknown TLV"; + } + + leaf link-type { + when "../type = 'TE_LINK_TYPE'" { + description + "Include the link-type field only when the sub-TLV type was a TE + link type"; + } + + type enumeration { + enum POINT_TO_POINT { + description + "The link being described by the TE LSA Link sub-TLV is a + point-to-point link to exactly one other system"; + } + enum MULTI_ACCESS { + description + "The link being described by the TE LSA Link sub-TLV is a + multi-access link that supports connectivity to multiple remote + systems"; + } + enum UNKNOWN { + description + "The link type received was unknown to the local system"; + } + } + description + "The type of the link that is being described by the TE LSA Link + sub-TLV"; + } + + leaf link-id { + when "../type = 'TE_LINK_ID'" { + description + "Include the link ID field only when the sub-TLV type was a TE + Link identifier"; + } + + type yang:dotted-quad; + description + "The ID of the remote system. For point-to-point links, this is the + router ID of the neighbor. For multi-access links it is the address + of the designated router."; + } + + leaf-list local-ip-address { + when "../type = 'TE_LINK_LOCAL_IP'" { + description + "Include the local IP address field only when the sub-TLV type was + a local IP address"; + } + + type inet:ipv4-address-no-zone; + description + "The IP address(es) of the local system that correspond to the + specified TE link"; + } + + leaf-list remote-ip-address { + when "../type = 'TE_LINK_REMOTE_IP'" { + description + "Include the remote IP address field only when the sub-TLV type was + a remote IP address"; + } + + type inet:ipv4-address-no-zone; + description + "The IP address(es) of the remote systems that are attached to the + specified TE link"; + } + + leaf metric { + when "../type = 'TE_LINK_METRIC'" { + description + "Include the traffic engineering metric only when the sub-TLV type + is a TE metric"; + } + + type uint32; + description + "The metric of the link that should be used for traffic engineering + purposes. This link may be different than the standard OSPF link + metric."; + } + + leaf maximum-bandwidth { + when "../type = 'TE_LINK_MAXIMUM_BANDWIDTH'" { + description + "Include the traffic engineering metric only when the sub-TLV type + is the maximum bandwidth"; + } + + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The maximum bandwidth of the link. This value reflects the actual + bandwidth of the link expressed asn IEEE 32-bit floating point + number"; + } + + leaf maximum-reservable-bandwidth { + when "../type = 'TE_LINK_MAXIUMUM_RESERVABLE_BANDWIDTH'" { + description + "Include the maximum reservable bandwidth field only when the + sub-TLV type is the maximum reservable bandwidth"; + } + + type oc-types:ieeefloat32; + units "bytes per second"; + description + "The maximum reservable bandwidth for the link. This value represents + the total bandwidth which may be used for traffic engineering + purposes. The value may exceed the maximum-bandwidth value + in cases where the link is oversubscribed. The value is reflected as + a 32-bit IEEE floating-point number"; + } + } + + grouping ospfv2-lsdb-opaque-te-link-unreserved-bw-state { + description + "The per-priority unreserved bandwidth described within the unreserved + bandwidth sub-TLV of the Link TLV of the Traffic Engineering LSA"; + + leaf priority { + type uint8 { + range "0..7"; + } + description + "The priority level being described"; + } + + leaf unreserved-bandwidth { + type oc-types:ieeefloat32; + description + "The unreserved bandwidth for at priority level P, where P is + equal to the priority of the current list entry. The reservable + bandwidth at priority P is equal to the sum of the reservable + bandwidth at all levels 0..P."; + } + } + + grouping ospfv2-lsdb-opaque-te-link-admin-group-state { + description + "Per bit administrative group status"; + + leaf bit-index { + type uint8 { + range "0..31"; + } + description + "The index of the bit within the 32-bit administrative group field + of the Administrative Group sub-TLV of the Traffic Engineering LSA"; + } + + leaf set { + type boolean; + default false; + description + "Whether the bit is set within the administrative group field"; + } + } + + grouping ospfv2-lsdb-opaque-te-node-attribute-state { + description + "State parameters relating to the Traffic Engineering Node Attribute + TLV of the Traffic Engineering LSA"; + + leaf type { + type union { + type identityref { + base "oc-ospf-types:TE_NODE_ATTRIBUTE_TLV_TYPE"; + } + type enumeration { + enum UNKNOWN { + description + "The sub-TLV type received within the TE LSA Node Attribute TLV + was unknown the the local system"; + } + } + } + description + "The type of the sub-TLV of the Node Attribute TLV contained within + the TE LSA. If the local system can interpret the value received the + canonical name of the type is utilised, otherwise the special UNKNOWN + value is used"; + } + + leaf-list local-ipv4-addresses { + when "../type = 'NODE_IPV4_LOCAL_ADDRESS'" { + description + "Include the local IPv4 addresses when the type of the sub-TLV + indicates that this is the contained data"; + } + + type inet:ipv4-prefix; + description + "The local IPv4 addresses of the node expressed in CIDR notation"; + } + + leaf-list local-ipv6-addresses { + when "../type = 'NODE_LOCAL_IPV6_ADDRESS'" { + description + "Include the local IPv6 addresses when the type of the sub-TLV + indicfates that this is the contained data"; + } + + type inet:ipv6-prefix; + description + "The local IPv6 addreses of the node"; + } + } + + grouping ospfv2-lsdb-opaque-te-router-address-state { + description + "The contents of the value field of the Router Address TLV of the + Traffic Engineering LSA."; + + leaf address { + type inet:ipv4-address-no-zone; + description + "A stable IP address of the advertising router, that is always + reachable when the router is connected to the network. Typically this + is a loopback address."; + } + } + + grouping ospfv2-lsdb-opaque-grace-state { + description + "State parameters on a per-TLV basis of the Grace LSA"; + + leaf type { + type identityref { + base "oc-ospf-types:GRACE_LSA_TLV_TYPES"; + } + description + "The type of the sub-TLV received within the Grace LSA"; + } + + leaf period { + when "../type = 'GRACE_PERIOD'" { + description + "Include the period specification when the sub-TLV type is indicated + to be of this type"; + } + + type uint32; + units seconds; + description + "The number of seconds that the router's neighbors should advertise + the local system as fully adjacent regardless of database + synchronization state"; + reference "RFC3623"; + } + + leaf reason { + when "../type = 'GRACE_RESTART_REASON'" { + description + "Include the restart reason when the sub-TLV type specifies this + is included"; + } + + type enumeration { + enum UNKNOWN { + value 0; + description + "The reason for the graceful restart is unknown"; + } + enum SOFTWARE_RESTART { + value 1; + description + "The local system is restarting due to a software component + restart"; + } + enum SOFTWARE_RELOAD_UPGRADE { + value 2; + description + "The local system is restarting due to a software reload or + upgrade"; + } + enum CONTROL_PROCESSOR_SWITCH { + value 3; + description + "The local system is restarting due to a switch to a redundant + control plane element"; + } + } + description + "The reason for the graceful restart event occurring, as advertised + by the restarting system"; + reference "RFC3623"; + } + + leaf ip-interface-address { + when "../type = 'GRACE_IP_INTERFACE_ADDRESS'" { + description + "Include the interface address when the sub-TLV type specifies that + it is included"; + } + + type inet:ipv4-address-no-zone; + description + "The restarting system's IP address on the interface via which the + Grace LSA is being advertised."; + } + } + + grouping ospfv2-lsdb-opaque-ri-state { + description + "State parameters of the Router Information Opaque LSA"; + + leaf type { + type union { + type identityref { + base "oc-ospf-types:RI_LSA_TLV_TYPES"; + } + type enumeration { + enum UNKNOWN { + description + "The TLV received within the RI LSA is unknown"; + } + } + } + description + "The type of sub-TLV of the Router Information opaque LSA"; + } + } + + grouping ospfv2-lsdb-opaque-ri-informational-state { + description + "State parmaeters of the Router Information Informational Capabilities + sub-TLV"; + + leaf graceful-restart-capable { + type boolean; + default false; + description + "When this leaf is set to true, the advertising system is capable of + OSPF graceful restart."; + } + + leaf graceful-restart-helper { + type boolean; + default false; + description + "When this leaf is set to true, the advertising system is capable of + being a helper for OSPF graceful restart"; + } + + leaf stub-router { + type boolean; + default false; + description + "When this leaf is set to true, the advertising system is able to + advertise its status as a stub router"; + reference "RFC6987"; + } + + leaf traffic-engineering { + type boolean; + default false; + description + "When this leaf is set to true, the advertising system supports OSPFv2 + traffic engineering capabilities"; + } + + leaf point-to-point-over-lan { + type boolean; + default false; + description + "When this leaf is set to true, the advertising system supports treating + LAN adjacencies as though they were point to point"; + reference "RFC5309"; + } + + leaf experimental-te { + type boolean; + default false; + description + "When this leaf is set to ture, the advertising system supports the + experimental extensions to OSPF for TE described in RFC4973"; + reference "RFC4973"; + } + } + + grouping ospfv2-lsdb-opaque-ri-admintag-state { + description + "State parameters relating to the administrative tags specified for + a node within the RI LSA"; + + leaf-list administrative-tags { + type uint32; + description + "The set of administrative tags assigned to the local system by + the network operator. The meaning of these tags is opaque to OSPF + - and their interpretation is per-domain specific"; + reference "RFC7777"; + } + } + + grouping ospfv2-lsdb-opaque-ri-unknown-state { + description + "State parameters relating to an unknown TLV within the RI LSA"; + uses ospfv2-lsdb-common-unknown-tlv; + } + + grouping ospfv2-lsdb-opaque-ri-sralgo-state { + description + "State parameters relating to the SR Algorithms TLV of the RI LSA"; + + leaf-list supported-algorithms { + type identityref { + base "oc-ospf-types:SR_ALGORITHM"; + } + description + "A list of the algorithms that are supported for segment routing + by the advertising system"; + } + } + + grouping ospfv2-lsdb-opaque-ri-srrange-tlv-state { + description + "State parameters relating to the SR SID/Label range TLV of the + RI LSA"; + + leaf type { + type union { + type identityref { + base "oc-ospf-types:OSPF_RI_SR_SID_LABEL_TLV_TYPES"; + } + type enumeration { + enum UNKNOWN { + description + "The type of the sub-TLV advertised with the SID/Label range + TLV of the RI LSA is unknown to the receiving system"; + } + } + } + description + "The type of the sub-TLV received by the local system within the + SR SID/Label Range TLV of the RI LSA"; + } + + leaf range-size { + type uint32 { + range "0..16777216"; + } + description + "The number of entries within the range being described within the + SID/Label range TLV"; + } + } + + grouping ospfv2-lsdb-opaque-ri-srrange-sid-label-tlv-state { + description + "State parameters relating to the SR SID/Label sub-TLV of the SR SID/Label + range TLV of the RI LSA"; + + leaf entry-type { + type oc-ospf-types:sr-sid-type; + description + "The type of entry that is contained within the sub-TLV. The range may + be represented as either a range of MPLS labels, or numeric segment + identifiers"; + } + + leaf first-value { + type uint32; + description + "The first value within the SRGB range being specified. The type of the + entry is determined based on the value of the entry type as this value + may represent either a segment identifier or an MPLS label."; + } + } + + grouping ospfv2-lsdb-extended-prefix-state { + description + "State parameters relating to an Extended Prefix LSA"; + + leaf route-type { + type enumeration { + enum UNSPECIFIED { + value 0; + description + "The prefix described in the extended prefix LSA is of an + unspecified type"; + } + enum INTRA_AREA { + value 1; + description + "The prefix described in the extended prefix LSA is an intra-area + prefix for the advertising system"; + } + enum INTER_AREA { + value 3; + description + "The prefix described in the extended prefix LSA is an inter-area + prefix for the advertising system"; + } + enum AS_EXTERNAL { + value 5; + description + "The prefix described in the extended prefix LSA is external to the + autonomous system of the advertising system"; + } + enum NSSA_EXTERNAL { + value 7; + description + "The prefix described in the extended prefix LSA externally + advertised from an NSSA area visibile to the advertising system"; + } + } + description + "The type of prefix that is contained within the Extended Prefix LSA. + The information contained in sub-TLVs of the attribute is applicable + regardless of this value."; + } + + uses ospfv2-lsdb-common-prefix-properties; + + leaf attached { + type boolean; + default false; + description + "If this value is set to true, the prefix being advertised was + generated by an ABR for an inter-area prefix. The value corresponds + to the A-flag of the flags field of the Extended Prefix LSA"; + } + + leaf node { + type boolean; + default false; + description + "If this value is set to true, the prefix being advertised represents + the advertising router. Typically, the prefix within the LSA is + expected to be globally-reachable prefix associated with a loopback + interface"; + } + + leaf prefix { + type inet:ipv4-address-no-zone; + description + "The IPv4 prefix contained within the extended prefix LSA"; + } + } + + grouping ospfv2-lsdb-extended-link-state { + description + "State parameters related to an extended link LSA"; + + leaf link-type { + type identityref { + base "oc-ospf-types:OSPFV2_ROUTER_LINK_TYPE"; + } + description + "The type of link with which extended attributes are associated"; + } + + uses ospfv2-lsdb-common-link-specification; + + } + + grouping ospfv2-lsdb-extended-link-tlv-state { + description + "State parameters relating to a sub-TLV of the extended link LSA"; + + leaf type { + type identityref { + base "oc-ospf-types:OSPFV2_EXTENDED_LINK_SUBTLV_TYPE"; + } + description + "The type of the sub-TLV contained within the extended link TLV"; + } + } + + grouping ospfv2-lsdb-extended-prefix-tlv-state { + description + "State parameters related to a sub-TLV of an Extended Prefix LSA"; + + leaf type { + type identityref { + base "oc-ospf-types:OSPFV2_EXTENDED_PREFIX_SUBTLV_TYPE"; + } + description + "The type of sub-TLV as indicated by the Extended Prefix LSA"; + } + } + + grouping ospfv2-lsdb-extended-prefix-range-state { + description + "Parameters of the Extended Prefix Range SubTLV"; + + uses ospfv2-lsdb-common-prefix-properties; + + leaf range-size { + type uint16; + description + "The number of prefixes that are covered by the advertisement."; + } + + leaf inter-area { + type boolean; + default false; + description + "When this leaf is set to true, then the prefix range is inter-area - + the flag is set by the ABR that advertises the Extended Prefix Range + TLV"; + } + + leaf prefix { + type inet:ipv4-prefix; + description + "The first prefix in the range of prefixes being described by the + extended prefix range sub-TLV"; + } + } + + grouping ospfv2-lsdb-extended-prefix-prefix-sid-state { + description + "Parameters of the Prefix-SID sub-TLV"; + + leaf no-php { + type boolean; + default false; + description + "If this leaf is set the advertising system has indicated that the + prefix SID must not be popped before delivering packets to it"; + } + + leaf mapping-server { + type boolean; + default false; + description + "If this leaf is set the SID was advertised by a Segment Routing + mapping server"; + } + + leaf explicit-null { + type boolean; + default false; + description + "If this leaf is set, the advertising system has requested that the + prefix SID value should be replaced with the explicit null label + value"; + } + + leaf sid-value-type { + type enumeration { + enum ABSOLUTE { + description + "The SID contained in the Prefix-SID sub-TLV is an absolute + value"; + } + enum INDEX { + description + "The SID contained in the Prefix-SID sub-TLV is an index to the + SRGB"; + } + } + description + "Specifies the type of the value specified within the Prefix SID + sub-TLV - in particular, whether the value is an index or an + absolute value. This value corresponds with the V-flag of the Prefix + SID sub-TLV"; + } + + leaf sid-scope { + type enumeration { + enum LOCAL { + description + "The value of the SID is + significant only to the advertising system"; + } + enum GLOBAL { + description + "The value of the SID is globally significant"; + } + } + description + "Specifies the scope of the SID advertisement within the Prefix SID + sub-TLV. The scope of the SID is independent of whether the SID + contained is an index, or an absolute value"; + } + + leaf multi-topology-identifier { + type uint8; + description + "The identifier for the topology to which the Prefix SID relates. The + value of this leaf is a MT-ID as defined in RFC4915"; + } + + leaf algorithm { + type uint8; + description + "The algorithm that computes the path associated with the Prefix SID"; + } + + leaf sid-value { + type uint32; + description + "The value of the Prefix SID. The meaning of this value is dependent + upon the type of SID, and its scope. The value contained is either a + 32-bit value indicating the index of the SID, or a 24-bit label where + the 20 right-most bits are used for encoding the label value"; + } + } + + grouping ospfv2-lsdb-extended-prefix-sid-label-binding-state { + description + "State parameters relating to the extended prefix SID SID/Label binding + sub-TLV"; + + leaf mirroring { + type boolean; + default false; + description + "When set to true, this indicates that the SID/Label Binding sub-TLV + entries contained within this TLV are indicative of a mirroring + context"; + } + + leaf multi-topology-identifier { + type uint8; + description + "The identifier for the topology to which the SID/Label Binding + sub-TLV is associated. The value of this leaf is a MT-ID as defined + in RFC4915"; + } + + leaf weight { + type uint8; + description + "The weight of the advertised binding when used for load-balancing + purposes"; + } + } + + grouping ospfv2-lsdb-extended-prefix-sid-label-binding-tlv-state { + description + "State parameters directly relating to the SID/Label Binding TLV"; + + leaf type { + type identityref { + base + "oc-ospf-types:OSPFV2_EXTENDED_PREFIX_SID_LABEL_BINDING_SUBTLV_TYPE"; + } + description + "The type of sub-TLV that is being contained within the SID/Label + sub-TLV"; + } + } + + grouping ospfv2-lsdb-extprefix-sid-label-binding-state { + description + "State parameters relating to the SID/Label binding sub-TLV of the + SID/Label/Binding TLV"; + + uses ospfv2-lsdb-common-sr-sid-spec; + } + + grouping ospfv2-lsdb-extprefix-sid-label-ero-metric-state { + description + "State parameters relating to the ERO Metric Sub-TLV of the SID/Label + Binding TLV"; + + leaf metric { + type uint32; + description + "The metric representing the aggregate IGP or TE path cost for the + binding included within the SID/Label Binding TLV"; + } + } + + grouping ospfv2-lsdb-extprefix-sid-lbl-ero-path-seg-state { + description + "State parameters relating to the a segment included within the + ERO Path Sub-TLV of the SID/Label Binding TLV"; + + leaf type { + type identityref { + base "oc-ospf-types:OSPFV2_EXTPREFIX_BINDING_ERO_PATH_SEGMENT_TYPE"; + } + description + "The type of the segment being specified as part of the ERO"; + } + + leaf loose { + type boolean; + default false; + description + "If this leaf is set the segment is identifier as a loose path + segment, otherwise the path strictly follows the path specified"; + } + } + + grouping ospfv2-lsdb-extprefix-sid-lbl-ero-ipv4-state { + description + "State parameters relating to an IPv4 address segment included within + the ERO path"; + + leaf address { + type inet:ipv4-address-no-zone; + description + "The IPv4 address of the hop within the ERO"; + } + } + + grouping ospfv2-lsdb-extprefix-sid-lbl-ero-unnum-state { + description + "State parameters relating to an unnumbered hop within the ERO path"; + + leaf router-id { + type inet:ipv4-address-no-zone; + description + "The IPv4 router identtifier of the remote system"; + } + + leaf interface-id { + type uint32; + description + "The identifier assigned to the link by the remote system"; + } + } + + grouping ospfv2-lsdb-extended-link-adj-sid-state { + description + "State parameters relating to the Adjacency SID sub-TLV of the + Extended Link LSA"; + + leaf backup { + type boolean; + default false; + description + "When this flag is set, it indicates that the adjacency SID refers to + an adjacency which is eligible for protection"; + } + + leaf group { + type boolean; + default false; + description + "When this flag is set it indicates that the adjacency SID refers to + a group of adjacencies that have a common value"; + } + + uses ospfv2-lsdb-common-sr-sid-spec; + + leaf weight { + type uint8; + description + "The weight of the Adjacency SID when used for load-balancing"; + } + + leaf multi-topology-identifier { + type uint8; + description + "The multi-topology identifier with which the adjacency SID is + associated"; + } + } + + grouping ospfv2-lsdb-structure { + description + "Structural grouping for per-area LSDB contents"; + + container lsdb { + // Top-level RO, if this were ever to become writeable then + // the state containers lower down need config false added + config false; + description + "The link-state database for the OSPFv2 area"; + + container state { + description + "Operational state parameters relating to the OSPFv2 + area"; + + uses ospfv2-lsdb-area-state; + } + + container lsa-types { + description + "Enclosing container for a list of LSA types that are + in the LSDB for the specified area"; + + list lsa-type { + key "type"; + + description + "List of LSA types in the LSDB for the specified + area"; + + leaf type { + type leafref { + path "../state/type"; + } + description + "A reference for the LSA type being described within + the LSDB"; + } + + container state { + description + "Top-level operational state parameters relating to + an LSA within the area"; + uses ospfv2-lsdb-area-lsa-type-state; + } + + container lsas { + description + "Enclosing container for a list of the LSAs of + the specified type received by the system"; + + list lsa { + key "link-state-id"; + + description + "List of the LSAs of a specified type in the + LSDB for the specified area"; + + leaf link-state-id { + type leafref { + path "../state/link-state-id"; + } + description + "Reference to the Link State ID of the LSA"; + } + + container state { + description + "Operational state parameters relating to all + LSA types"; + uses ospfv2-lsdb-area-lsa-state; + } + + uses ospfv2-lsdb-router-lsa-structure { + when "../../state/type = 'ROUTER_LSA'" { + description + "Include the router LSA hierarchy solely when + that LSA type is being described"; + } + } + + uses ospfv2-lsdb-network-lsa-structure { + when "../../state/type = 'NETWORK_LSA'" { + description + "Include the network LSA hierarchy solely when + that LSA type is being described"; + } + } + + uses ospfv2-lsdb-summary-lsa-structure { + // rjs TODO: check this syntax + when "../../state/type = " + + "'SUMMARY_IP_NETWORK_LSA' or " + + "../../state/type = 'SUMMARY_ASBR_LSA'" { + description + "Include the summary LSA hierarchy solely when + that LSA type is being described"; + } + } + + uses ospfv2-lsdb-asexternal-lsa-structure { + when "../../state/type = 'AS_EXTERNAL_LSA'" { + description + "Include the AS external LSA hierarchy solely when + that LSA type is being described"; + } + } + + uses ospfv2-lsdb-nssa-external-lsa-structure { + when "../../state/type = 'NSSA_AS_EXTERNAL_LSA'" { + description + "Include the NSSA External LSA hierarchy solely + when that LSA type is being described"; + } + } + + uses ospfv2-lsdb-opaque-lsa-structure { + when "../../state/type = 'OSPFV2_LINK_SCOPE_OPAQUE_LSA' + or ../../state/type = 'OSPFV2_AREA_SCOPE_OPAQUE_LSA' + or ../../state/type = 'OSPFV2_AS_SCOPE_OPAQUE_LSA'" { + description + "Include the Opaque LSA structure when type of entry + being described in an opaque LSA"; + } + } + } + } + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-ospfv2@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-ospfv2@2019-11-28.yang new file mode 100644 index 0000000..b9bac25 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-ospfv2@2019-11-28.yang @@ -0,0 +1,127 @@ +module openconfig-ospfv2 { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/ospfv2"; + + prefix "oc-ospfv2"; + + // import some basic types + //import ietf-inet-types { prefix inet; } + import openconfig-extensions { prefix "oc-ext"; } + + // Include submodules + // Global: All global context groupings; + include openconfig-ospfv2-global; + // Area: Config/opstate for an area + include openconfig-ospfv2-area; + // Area Interface: Config/opstate for an Interface + include openconfig-ospfv2-area-interface; + // LSDB: Operational state model covering the LSDB + include openconfig-ospfv2-lsdb; + // Common: Content included in >1 context + include openconfig-ospfv2-common; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "An OpenConfig model for Open Shortest Path First (OSPF) + version 2"; + + oc-ext:openconfig-version "0.2.2"; + + revision "2019-11-28" { + description + "Revert path changes in when statements in LSDB model"; + reference "0.2.2"; + } + + revision "2019-11-05" { + description + "Fix paths in when statements in LSDB model"; + reference "0.2.1"; + } + + revision "2019-07-09" { + description + "Normalise all timeticks64 to be expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.3"; + } + + revision "2018-06-05" { + description + "Bug fixes in when statements in lsdb"; + reference "0.1.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes."; + reference "0.1.1"; + } + + revision "2017-02-28"{ + description + "Initial public release of OSPFv2"; + reference "0.1.0"; + } + + revision "2016-06-24" { + description + "Initial revision"; + reference "0.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping ospfv2-top { + description + "Top-level OSPF configuration and operational state"; + + container ospfv2 { + description + "Top-level configuration and operational state for + Open Shortest Path First (OSPF) v2"; + + uses ospfv2-global-structural; + + container areas { + description + "Configuration and operational state relating to an + OSPFv2 area."; + + list area { + key "identifier"; + + description + "The OSPFv2 areas within which the local system exists"; + + leaf identifier { + type leafref { + path "../config/identifier"; + } + description + "A reference to the identifier for the area."; + } + + uses ospfv2-area-structure; + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-packet-match-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-packet-match-types@2018-11-21.yang new file mode 100644 index 0000000..1b93d52 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-packet-match-types@2018-11-21.yang @@ -0,0 +1,309 @@ +module openconfig-packet-match-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/packet-match-types"; + + prefix "oc-pkt-match-types"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines common types for use in models requiring + data definitions related to packet matches."; + + oc-ext:openconfig-version "1.0.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.0.2"; + } + + revision "2018-04-15" { + description + "Corrected description and range for ethertype typedef"; + reference "1.0.1"; + } + + revision "2017-05-26" { + description + "Separated IP matches into AFs"; + reference "1.0.0"; + } + + revision "2016-08-08" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + revision "2016-04-27" { + description + "Initial revision"; + reference "TBD"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + + // extension statements + + // feature statements + + // identity statements + + + //TODO: should replace this with an official IEEE module + // when available. Only a select number of types are + // defined in this identity. + identity ETHERTYPE { + description + "Base identity for commonly used Ethertype values used + in packet header matches on Ethernet frames. The Ethertype + indicates which protocol is encapsulated in the Ethernet + payload."; + reference + "IEEE 802.3"; + } + + identity ETHERTYPE_IPV4 { + base ETHERTYPE; + description + "IPv4 protocol (0x0800)"; + } + + identity ETHERTYPE_ARP { + base ETHERTYPE; + description + "Address resolution protocol (0x0806)"; + } + + identity ETHERTYPE_VLAN { + base ETHERTYPE; + description + "VLAN-tagged frame (as defined by IEEE 802.1q) (0x8100). Note + that this value is also used to represent Shortest Path + Bridging (IEEE 801.1aq) frames."; + } + + identity ETHERTYPE_IPV6 { + base ETHERTYPE; + description + "IPv6 protocol (0x86DD)"; + } + + identity ETHERTYPE_MPLS { + base ETHERTYPE; + description + "MPLS unicast (0x8847)"; + } + + identity ETHERTYPE_LLDP { + base ETHERTYPE; + description + "Link Layer Discovery Protocol (0x88CC)"; + } + + identity ETHERTYPE_ROCE { + base ETHERTYPE; + description + "RDMA over Converged Ethernet (0x8915)"; + } + + + //TODO: should replace this with an official IANA module when + //available. Only a select set of protocols are defined with + //this identity. + identity IP_PROTOCOL { + description + "Base identity for commonly used IP protocols used in + packet header matches"; + reference + "IANA Assigned Internet Protocol Numbers"; + } + + identity IP_TCP { + base IP_PROTOCOL; + description + "Transmission Control Protocol (6)"; + } + + identity IP_UDP { + base IP_PROTOCOL; + description + "User Datagram Protocol (17)"; + } + + identity IP_ICMP { + base IP_PROTOCOL; + description + "Internet Control Message Protocol (1)"; + } + + identity IP_IGMP { + base IP_PROTOCOL; + description + "Internet Group Membership Protocol (2)"; + } + + identity IP_PIM { + base IP_PROTOCOL; + description + "Protocol Independent Multicast (103)"; + } + + identity IP_RSVP { + base IP_PROTOCOL; + description + "Resource Reservation Protocol (46)"; + } + + identity IP_GRE { + base IP_PROTOCOL; + description + "Generic Routing Encapsulation (47)"; + } + + identity IP_AUTH { + base IP_PROTOCOL; + description + "Authentication header, e.g., for IPSEC (51)"; + } + + identity IP_L2TP { + base IP_PROTOCOL; + description + "Layer Two Tunneling Protocol v.3 (115)"; + } + + + + identity TCP_FLAGS { + description + "Common TCP flags used in packet header matches"; + reference + "IETF RFC 793 - Transmission Control Protocol + IETF RFC 3168 - The Addition of Explicit Congestion + Notification (ECN) to IP"; + } + + identity TCP_SYN { + base TCP_FLAGS; + description + "TCP SYN flag"; + } + + identity TCP_FIN { + base TCP_FLAGS; + description + "TCP FIN flag"; + } + + identity TCP_RST { + base TCP_FLAGS; + description + "TCP RST flag"; + } + + identity TCP_PSH { + base TCP_FLAGS; + description + "TCP push flag"; + } + + identity TCP_ACK { + base TCP_FLAGS; + description + "TCP ACK flag"; + } + + identity TCP_URG { + base TCP_FLAGS; + description + "TCP urgent flag"; + } + + identity TCP_ECE { + base TCP_FLAGS; + description + "TCP ECN-Echo flag. If the SYN flag is set, indicates that + the TCP peer is ECN-capable, otherwise indicates that a + packet with Congestion Experienced flag in the IP header + is set"; + } + + identity TCP_CWR { + base TCP_FLAGS; + description + "TCP Congestion Window Reduced flag"; + } + + // typedef statements + + typedef port-num-range { + type union { + type string { + pattern '^(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?[0-9]?' + + '[0-9]?)\.\.(6[0-5][0-5][0-3][0-5]|[0-5]?[0-9]?[0-9]?' + + '[0-9]?[0-9]?)$'; + } + type oc-inet:port-number; + type enumeration { + enum ANY { + description + "Indicates any valid port number (e.g., wildcard)"; + } + } + } + description + "Port numbers may be represented as a single value, + an inclusive range as .., or as ANY to + indicate a wildcard."; + } + + typedef ip-protocol-type { + type union { + type uint8 { + range 0..254; + } + type identityref { + base IP_PROTOCOL; + } + } + description + "The IP protocol number may be expressed as a valid protocol + number (integer) or using a protocol type defined by the + IP_PROTOCOL identity"; + } + + typedef ethertype-type { + type union { + type uint16 { + range 1536..65535; + } + type identityref { + base ETHERTYPE; + } + } + description + "The Ethertype value may be expressed as a 16-bit number in + decimal notation, or using a type defined by the + ETHERTYPE identity"; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-packet-match@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-packet-match@2018-11-21.yang new file mode 100644 index 0000000..510bc57 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-packet-match@2018-11-21.yang @@ -0,0 +1,371 @@ +module openconfig-packet-match { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/header-fields"; + + prefix "oc-pkt-match"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-packet-match-types { prefix oc-pkt-match-types; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data related to packet header fields + used in matching operations, for example in ACLs. When a + field is omitted from a match expression, the effect is a + wildcard ('any') for that field."; + + oc-ext:openconfig-version "1.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.1.1"; + } + + revision "2017-12-15" { + description + "Add MPLS packet field matches"; + reference "1.1.0"; + } + + revision "2017-05-26" { + description + "Separated IP matches into AFs"; + reference "1.0.0"; + } + + revision "2016-08-08" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + revision "2016-04-27" { + description + "Initial revision"; + reference "TBD"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + + // Physical Layer fields + // ethernet-header + grouping ethernet-header-config { + description + "Configuration data of fields in Ethernet header."; + + leaf source-mac { + type oc-yang:mac-address; + description + "Source IEEE 802 MAC address."; + } + + leaf source-mac-mask { + type oc-yang:mac-address; + description + "Source IEEE 802 MAC address mask."; + } + + leaf destination-mac { + type oc-yang:mac-address; + description + "Destination IEEE 802 MAC address."; + } + + leaf destination-mac-mask { + type oc-yang:mac-address; + description + "Destination IEEE 802 MAC address mask."; + } + + leaf ethertype { + type oc-pkt-match-types:ethertype-type; + description + "Ethertype field to match in Ethernet packets"; + } + } + + grouping ethernet-header-state { + description + "State information of fields in Ethernet header."; + } + + grouping ethernet-header-top { + description + "Top level container for fields in Ethernet header."; + + container l2 { + description + "Ethernet header fields"; + + container config { + description + "Configuration data"; + uses ethernet-header-config; + } + + container state { + config false; + description + "State Information."; + uses ethernet-header-config; + uses ethernet-header-state; + } + } + } + + grouping mpls-header-top { + description + "Top-level container for fields in an MPLS header."; + + container mpls { + description + "MPLS header fields"; + + container config { + description + "Configuration parameters relating to fields within + the MPLS header."; + uses mpls-header-config; + } + + container state { + config false; + description + "Operational state parameters relating to fields + within the MPLS header"; + uses mpls-header-config; + } + } + } + + grouping mpls-header-config { + description + "Configuration parameters relating to matches within + MPLS header fields."; + + leaf traffic-class { + type uint8 { + range "0..7"; + } + description + "The value of the MPLS traffic class (TC) bits, + formerly known as the EXP bits."; + } + } + + grouping ip-protocol-fields-common-config { + description + "IP protocol fields common to IPv4 and IPv6"; + + leaf dscp { + type oc-inet:dscp; + description + "Value of diffserv codepoint."; + } + + leaf protocol { + type oc-pkt-match-types:ip-protocol-type; + description + "The protocol carried in the IP packet, expressed either + as its IP protocol number, or by a defined identity."; + } + + leaf hop-limit { + type uint8 { + range 0..255; + } + description + "The IP packet's hop limit -- known as TTL (in hops) in + IPv4 packets, and hop limit in IPv6"; + } + } + + // IP Layer + // ip-protocol-fields + grouping ipv4-protocol-fields-config { + description + "Configuration data of IP protocol fields + for IPv4"; + + leaf source-address { + type oc-inet:ipv4-prefix; + description + "Source IPv4 address prefix."; + } + + leaf destination-address { + type oc-inet:ipv4-prefix; + description + "Destination IPv4 address prefix."; + } + + uses ip-protocol-fields-common-config; + + } + + grouping ipv4-protocol-fields-state { + description + "State information of IP header fields for IPv4"; + } + + grouping ipv4-protocol-fields-top { + description + "IP header fields for IPv4"; + + container ipv4 { + description + "Top level container for IPv4 match field data"; + + container config { + description + "Configuration data for IPv4 match fields"; + uses ipv4-protocol-fields-config; + } + + container state { + config false; + description + "State information for IPv4 match fields"; + uses ipv4-protocol-fields-config; + uses ipv4-protocol-fields-state; + } + } + } + + grouping ipv6-protocol-fields-config { + description + "Configuration data for IPv6 match fields"; + + leaf source-address { + type oc-inet:ipv6-prefix; + description + "Source IPv6 address prefix."; + } + + leaf source-flow-label { + type oc-inet:ipv6-flow-label; + description + "Source IPv6 Flow label."; + } + + leaf destination-address { + type oc-inet:ipv6-prefix; + description + "Destination IPv6 address prefix."; + } + + leaf destination-flow-label { + type oc-inet:ipv6-flow-label; + description + "Destination IPv6 Flow label."; + } + + uses ip-protocol-fields-common-config; + } + + grouping ipv6-protocol-fields-state { + description + "Operational state data for IPv6 match fields"; + } + + grouping ipv6-protocol-fields-top { + description + "Top-level grouping for IPv6 match fields"; + + container ipv6 { + description + "Top-level container for IPv6 match field data"; + + container config { + description + "Configuration data for IPv6 match fields"; + + uses ipv6-protocol-fields-config; + } + + container state { + + config false; + + description + "Operational state data for IPv6 match fields"; + + uses ipv6-protocol-fields-config; + uses ipv6-protocol-fields-state; + } + } + } + + // Transport fields + grouping transport-fields-config { + description + "Configuration data of transport-layer packet fields"; + + leaf source-port { + type oc-pkt-match-types:port-num-range; + description + "Source port or range"; + } + + leaf destination-port { + type oc-pkt-match-types:port-num-range; + description + "Destination port or range"; + } + + leaf-list tcp-flags { + type identityref { + base oc-pkt-match-types:TCP_FLAGS; + } + description + "List of TCP flags to match"; + } + } + + grouping transport-fields-state { + description + "State data of transport-fields"; + } + + grouping transport-fields-top { + description + "Destination transport-fields top level grouping"; + + container transport { + description + "Transport fields container"; + + container config { + description + "Configuration data"; + uses transport-fields-config; + } + + container state { + config false; + description + "State data"; + uses transport-fields-config; + uses transport-fields-state; + } + } + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-pf-forwarding-policies@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-pf-forwarding-policies@2018-11-21.yang new file mode 100644 index 0000000..602174b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pf-forwarding-policies@2018-11-21.yang @@ -0,0 +1,391 @@ +submodule openconfig-pf-forwarding-policies { + belongs-to openconfig-policy-forwarding { + prefix "oc-pf"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-packet-match { prefix "oc-pmatch"; } + import openconfig-yang-types { prefix "oc-yang"; } + import openconfig-inet-types { prefix "oc-inet"; } + + include openconfig-pf-path-groups; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains configuration and operational state + relating to the definition of policy-forwarding policies."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2017-06-21" { + description + "Amend policy forwarding model based on ACL changes."; + reference "0.2.0"; + } + + revision "2017-02-28" { + description + "Initial public release of policy forwarding."; + reference "0.1.0"; + } + + revision "2016-11-08" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping pf-forwarding-policy-structural { + description + "Structural grouping defining forwarding policies under the + policy- forwarding module."; + + container policies { + description + "Forwarding policies defined to enact policy-based forwarding + on the local system."; + + list policy { + key "policy-id"; + + description + "A forwarding policy is defined to have a set of match + criteria, allowing particular fields of a packet's header to + be matched, and a set of forwarding actions which determines + how the local system should forward the packet."; + + leaf policy-id { + type leafref { + path "../config/policy-id"; + } + description + "Reference to the identifier for the forwarding-policy."; + } + + container config { + description + "Configuration options relating to the forwarding + policy."; + uses pf-forwarding-policy-config; + } + + container state { + config false; + description + "Operational state parameters relating to the forwarding + policy."; + uses pf-forwarding-policy-config; + } + + container rules { + description + "The criteria that should be matched for a packet to be + forwarded according to the policy action."; + + list rule { + key "sequence-id"; + + description + "A match rule for the policy. In the case that multiple + criteria are specified within a single rule, all criteria + must be met for the rule to be applied to a packet."; + + leaf sequence-id { + type leafref { + path "../config/sequence-id"; + } + description + "A unique sequence identifier for the match rule."; + } + + container config { + description + "Configuration parameters relating to the match + rule."; + uses pf-forwarding-policy-rule-config; + } + + container state { + config false; + description + "Operational state parameters relating to the match + rule."; + uses pf-forwarding-policy-rule-config; + uses pf-forwarding-policy-rule-state; + } + + uses oc-pmatch:ethernet-header-top; + uses oc-pmatch:ipv4-protocol-fields-top; + uses oc-pmatch:ipv6-protocol-fields-top; + uses oc-pmatch:transport-fields-top; + + container action { + description + "The forwarding policy action to be applied for + packets matching the rule."; + + container config { + description + "Configuration parameters relating to the forwarding + rule's action."; + uses pf-forwarding-policy-action-config; + } + + container state { + config false; + description + "Operational state parameters relating to the + forwarding rule's action."; + uses pf-forwarding-policy-action-config; + } + + uses pf-forwarding-policy-action-encapsulate-gre; + } + } + } + } + } + } + + grouping pf-forwarding-policy-config { + description + "Configuration parameters relating to the forwarding policy."; + + leaf policy-id { + type string; + description + "A unique name identifying the forwarding policy. This name is + used when applying the policy to a particular interface."; + } + } + + grouping pf-forwarding-policy-rule-config { + description + "Configuration parameters relating to a policy rule."; + + leaf sequence-id { + type uint32; + description + "Unique sequence number for the policy rule."; + } + } + + grouping pf-forwarding-policy-rule-state { + description + "Operational state parameters relating to a policy rule."; + + leaf matched-pkts { + type oc-yang:counter64; + description + "Number of packets matched by the rule."; + } + + leaf matched-octets { + type oc-yang:counter64; + description + "Bytes matched by the rule."; + } + } + + grouping pf-forwarding-policy-action-config { + description + "Forwarding policy action configuration parameters."; + + leaf discard { + type boolean; + default false; + description + "When this leaf is set to true, the local system should drop + packets that match the rule."; + } + + leaf decapsulate-gre { + type boolean; + default false; + description + "When this leaf is set to true, the local system should remove + the GRE header from the packet matching the rule. Following + the decapsulation it should subsequently forward the + encapsulated packet according to the relevant lookup (e.g., if + the encapsulated packet is IP, the packet should be routed + according to the IP destination)."; + } + + leaf network-instance { + type leafref { + + // We are at: + // $NIROOT/policy-forwarding/policies/ + // policy/rules/rule/action/config/ + // network-instance + path "../../../../../../../../config/name"; + } + description + "When this leaf is set, packets matching the match criteria + for the forwarding rule should be looked up in the + network-instance that is referenced rather than the + network-instance with which the interface is associated. + Such configuration allows policy-routing into multiple + sub-topologies from a single ingress access interface, or + different send and receive contexts for a particular + interface (sometimes referred to as half-duplex VRF)."; + } + + leaf path-selection-group { + type leafref { + // We are at: + // $NIROOT/policy-forwarding/policies/ + // policy/rules/rule/action/config/to-path-group + path "../../../../../../../path-selection-groups/" + + "path-selection-group/config/group-id"; + } + description + "When path-selection-group is set, packets matching the + match criteria for the forwarding rule should be forwarded + only via one of the paths that is specified within the + referenced path-selection-group. The next-hop of the packet + within the routing context should be used to determine between + multiple paths that are specified within the group."; + } + + leaf next-hop { + type oc-inet:ip-address; + description + "When an IP next-hop is specified in the next-hop field, + packets matching the match criteria for the forwarding rule + should be forwarded to the next-hop IP address, bypassing any + lookup on the local system."; + } + } + + grouping pf-forwarding-policy-action-encapsulate-gre { + description + "Structural grouping covering the encapsulate-gre action of the + policy forwarding rule."; + + container encapsulate-gre { + description + "Packets matching the policy rule should be GRE encapsulated + towards the set of targets defined within the target list. Where + more than one target is specified, or the target subnet expands + to more than one endpoint, packets should be load-balanced across + the destination addresses within the subnets."; + + container config { + description + "Configuration parameters for the GRE encapsulation rules action."; + uses pf-forwarding-policy-action-gre-config; + } + + container state { + description + "Operational state parameters for the GRE encapsulation rule + action."; + config false; + uses pf-forwarding-policy-action-gre-config; + } + + container targets { + description + "Surrounding container for the list of GRE tunnel targets that + should be encapsulated towards."; + + list target { + key "id"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to the unique identifier for the target."; + } + + description + "Each target specified within this list should be treated as a + endpoint to which packets should be GRE encapsulated. Where the + set of destinations described within a single entry expands to + more than one destination IP address, packets should be load + shared across the destination using the local system's ECMP hashing + mechanisms."; + + container config { + description + "Configuration parameters for the GRE target."; + uses pf-forwarding-policy-action-gre-target-config; + } + + container state { + description + "Operational state parameters for the GRE target."; + config false; + uses pf-forwarding-policy-action-gre-target-config; + } + } + } + } + } + + grouping pf-forwarding-policy-action-gre-config { + description + "Configuration parameters for the encapsulate-gre forwarding + policy action."; + + leaf identifying-prefix { + type oc-inet:ip-prefix; + description + "An IP prefix that can be used to identify the group of + GRE endpoints that are being encapsulated towards. Systems + that require an IP identifier for the tunnel set + should use this prefix as the next-hop identifier."; + } + } + + grouping pf-forwarding-policy-action-gre-target-config { + description + "Configuration parameters for each target of a GRE Encapsulation + rule"; + + leaf id { + type string; + description + "A unique identifier for the target."; + } + + leaf source { + type oc-inet:ip-address; + description + "The source IP address that should be used when encapsulating + packets from the local system."; + } + + leaf destination { + type oc-inet:ip-prefix; + description + "The set of destination addresses that should be encapsulated towards. + Where a subnet is specified, each address within the subnet should be + treated as an independent destination for encapsulated traffic. Packets + should be distributed with ECMP across the set of tunnel destination + addresses."; + } + + leaf ip-ttl { + type uint8; + description + "The TTL that should be specified in the IP header of the GRE packet + encapsulating the packet matching the rule."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-pf-interfaces@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-pf-interfaces@2018-11-21.yang new file mode 100644 index 0000000..2037553 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pf-interfaces@2018-11-21.yang @@ -0,0 +1,127 @@ +submodule openconfig-pf-interfaces { + belongs-to openconfig-policy-forwarding { + prefix "oc-pf"; + } + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-interfaces { prefix "oc-if"; } + + include openconfig-pf-forwarding-policies; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains groupings related to the association + between interfaces and policy forwarding rules."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2017-06-21" { + description + "Amend policy forwarding model based on ACL changes."; + reference "0.2.0"; + } + + revision "2017-02-28" { + description + "Initial public release of policy forwarding."; + reference "0.1.0"; + } + + revision "2016-11-08" { + description + "Initial revision"; + reference "0.0.1"; + } + + + grouping pf-interfaces-structural { + description + "Structural grouping for interface to forwarding policy bindings + within the policy-forwarding model."; + + container interfaces { + description + "Configuration and operational state relating policy + forwarding on interfaces."; + + list interface { + key "interface-id"; + + description + "Configuration and operationals state relating to the + relationship between interfaces and policy-based forwarding + rules."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "A reference to the unique identifier for the interface + being referenced by the policy."; + } + + container config { + description + "Configuration parameters relating to an interface to + policy forwarding rule binding."; + + uses pf-interface-config; + } + + container state { + config false; + description + "Operational state parameters relating to an interface to + policy forwarding rule binding."; + + uses pf-interface-config; + } + + uses oc-if:interface-ref; + } + } + } + + grouping pf-interface-config { + description + "Configuration parameters relating to an interface to policy + forwarding rule binding."; + + leaf interface-id { + type oc-if:interface-id; + description + "A unique identifier for the interface."; + } + + leaf apply-forwarding-policy { + type leafref { + // We are at /network-instances/network-instance/ + // policy-forwarding/interfaces/interface/config/ + // apply-forwarding-policy + path "../../../../policies/policy/" + + "config/policy-id"; + } + description + "The policy to be applied on the interface. Packets ingress on + the referenced interface should be compared to the match + criteria within the specified policy, and in the case that + these criteria are met, the forwarding actions specified + applied. These policies should be applied following quality of + service classification, and ACL actions if such entities are + referenced by the corresponding interface."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-pf-path-groups@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-pf-path-groups@2018-11-21.yang new file mode 100644 index 0000000..c9dd8a1 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pf-path-groups@2018-11-21.yang @@ -0,0 +1,131 @@ +submodule openconfig-pf-path-groups { + belongs-to openconfig-policy-forwarding { + prefix "oc-pf"; + } + + import openconfig-extensions { prefix "oc-ext"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains configuration and operational state + relating to path-selection-groups which are used to group + forwarding entities together to be used as policy forwarding + targets."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2017-06-21" { + description + "Amend policy forwarding model based on ACL changes."; + reference "0.2.0"; + } + + revision "2017-02-28" { + description + "Initial public release of policy forwarding."; + reference "0.1.0"; + } + + revision "2016-11-08" { + description + "Initial revision"; + reference "0.0.1"; + } + + grouping pf-path-groups-structural { + description + "Structural grouping containing the definition of path groups + within the context of policy-based forwarding."; + + container path-selection-groups { + description + "Surrounding container for the path selection groups defined + within the policy forwarding model."; + + list path-selection-group { + key "group-id"; + + leaf group-id { + type leafref { + path "../config/group-id"; + } + description + "Reference to a unique identifier for the path selection + group"; + + } + + description + "A path selection group is a set of forwarding resources, + which are grouped as eligible paths for a particular + policy-based forwarding rule. A policy rule may select a + path-selection-group as the egress for a particular type of + traffic (e.g., DSCP value). The system then utilises its + standard forwarding lookup mechanism to select from the + paths that are specified within the group - for IP packets, + the destination IP address is used such that the packet is + routed to the entity within the path-selection-group that + corresponds to the next-hop for the destination IP address + of the packet; for L2 packets, the selection is based on the + destination MAC address. If multiple paths within the + selection group are eligible to be used for forwarding, + the packets are load-balanced between them according to + the system's usual load balancing logic."; + + container config { + description + "Configuration parameters relating to the path selection + group."; + uses pf-path-selection-group-config; + } + + container state { + config false; + description + "Operational state parameters relating to the path + selection group."; + uses pf-path-selection-group-config; + } + } + } + } + + grouping pf-path-selection-group-config { + description + "Configuration parameters relating to a path selection group."; + + leaf group-id { + type string; + description + "A unique name for the path-selection-group"; + } + + leaf-list mpls-lsp { + type leafref { + // We are at /network-instances/network-instance/ + // policy-forwarding/path-selection-groups/ + // path-selection-group/config/mpls-lsp + path "../../../../../mpls/lsps/constrained-path/tunnels/" + + "tunnel/config/name"; + } + description + "A set of MPLS constrained-path LSPs which should be + considered for the policy forwarding next-hop. In order to + select between the LSPs within the path-selection-group, the + system should determine which LSP provides the best path to + the next-hop for the routed packet."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-pf-srte@2019-10-15.yang b/exp/yangcli/h3c-yang/openconfig-pf-srte@2019-10-15.yang new file mode 100644 index 0000000..7809e82 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pf-srte@2019-10-15.yang @@ -0,0 +1,297 @@ +module openconfig-pf-srte { + yang-version "1"; + namespace "http://openconfig.net/yang/policy-forwarding/sr-te"; + prefix "oc-pf-srte"; + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-network-instance { prefix "oc-ni"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + import openconfig-inet-types { prefix "oc-inet"; } + import openconfig-segment-routing-types { prefix "oc-srt"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig Working group + www.openconfig.net"; + + description + "This module defines extensions to the OpenConfig policy forwarding + module to support static segment routing traffic engineering policy + definitions. Extensions are provided to match: + + - Ingress binding SIDs, such that traffic can be mapped based on + an ingress label. + - A colour community and endpoint combination, such that the + routes can be resolved according to the policy forwarding + entries that are to be installed. + + In addition, policy forwarding actions associated with next-hops are + added to the model. The next-hop set to be forwarded to is augmented + to cover a set of lists of segments. The most common application of + such segment lists is to express stacks of MPLS labels which are used + as SR segments. In addition, they may be used to expressed segments + in the form of IPv6 addresses."; + + oc-ext:openconfig-version "0.2.0"; + + revision "2019-10-15" { + description + "Change imported segment-routing module."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision 2017-10-01 { + description + "Initial revision of the SR-TE policy SAFI model."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping oc-pf-srte-match-top { + description + "Top-level grouping used for SR-TE policy match criteria within + a policy forwarding rule."; + + container srte { + description + "Match criteria associated with Segment Routing Traffic Engineering + policies."; + + container config { + description + "Configuration parameters associated with SR-TE policies."; + uses oc-pf-srte-match-config; + } + + container state { + config false; + description + "Operational state parameters associated with SR-TE policies."; + uses oc-pf-srte-match-config; + } + } + } + + grouping oc-pf-srte-match-config { + description + "Configuration parameters specific to Segment Routing traffic + Engineering."; + + leaf mpls-bsid { + type oc-mplst:mpls-label; + description + "The Binding SID (BSID) to be matched expressed as an MPLS label. Packets + that are ingress to the system with the top-most label matching + the SID value specified in this leaf should be forwarded according + to the policy. The top-most label (the specified Binding SID) + must be popped from the label stack by the system."; + } + + leaf srte-endpoint { + type oc-inet:ip-address; + description + "When the policy forwarding rule is used for RIB resolution + to a Segment Routing Traffic Engineering path, the policy is used + when the required endpoint (which may be the protocol next-hop) + matches the endpoint address specified in this + leaf. When the leaf is set to all zeros (0.0.0.0 or ::), the endpoint + acts as a wildcard in the policy resolution."; + } + + leaf srte-color { + type uint32; + description + "When the policy forwarding rule is used for RIB resolution to a + specific Segment Routing Traffic Engineering path, the policy is + used when the colour required in the policy (which may be specified + based on the value of a BGP extended colour community) matches the + value of this leaf. The colour being set to 0 indicates that the + colour is a wildcard in the policy resolution."; + } + + leaf srte-preference { + type uint32; + description + "When there are multiple policy forwarding rules specified for + a particular SR-TE endpoint. The preference is used to resolve + between them. These rules may be learnt from a dynamic routing + protocol, or interface to the device, or from other static + entries configured on the system."; + } + } + + grouping oc-pf-srte-segment-list-top { + description + "Top-level grouping for specifying segment lists under a policy + forwarding action."; + + container segment-lists { + description + "A list of SR-TE segment lists that should be applied as an + action within this policy. Where a system selects the SR-TE + policy to be used, the list of segment lists that is specified + should be used as forwarding next-hops."; + + list segment-list { + key "index"; + description + "An individual segment list within the list of segment + lists used for SR-TE policies."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index leaf which act as a key to the + segment-list list."; + } + + container config { + description + "Configuration parameters for the SR-TE segment list."; + uses oc-pf-srte-segment-list-config; + } + + container state { + config false; + description + "Operational state parameters relating to the SR-TE + segment list."; + uses oc-pf-srte-segment-list-config; + } + + container sids { + description + "Surrounding container for the list of SIDs that makes up the + segment list."; + + list sid { + key "index"; + + description + "List of SIDs that make up the segment list. The segment list + is formed by ordering the set of SIDs that are specified by + their index in ascending numerical order."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the SID's index within the segment list which + acts as the key of the list."; + } + + container config { + description + "Configuration parameters relating to the SID within the + segment list."; + uses oc-pf-srte-segment-list-sid-config; + } + + container state { + config false; + description + "Operational state parameters relating to the SID within + the segment list."; + uses oc-pf-srte-segment-list-sid-config; + } + } + } + } + } + } + + grouping oc-pf-srte-segment-list-config { + description + "Configuration parameters relating to a segment list."; + + leaf index { + type uint64; + description + "Unique integer identifying the segment list within the set + of segment lists used for the SR-TE policy action."; + } + + leaf weight { + type uint32; + description + "The weight of the segment list within the set of segment lists + specified for the policy. The traffic that is forwarded according + to the policy is distributed across the set of paths such that + each list receives weight/(sum of all weights) traffic."; + } + } + + grouping oc-pf-srte-segment-list-sid-config { + description + "Configuration parameters relating to a SID within an SR-TE segment + list"; + + leaf index { + type uint64; + description + "The index of the SID within the segment list. The segment list is + applied by ordering the SID entries in ascending numerical order + beginning at 0."; + } + + leaf value { + type oc-srt:sr-sid-type; + description + "The value of the SID that is to be used. Specified as an MPLS + label or IPv6 address."; + } + + leaf mpls-ttl { + type uint8; + default 0; + description + "The TTL to be set if the type of the SID is an MPLS label. If the + value of the TTL is set to be 0, the value is picked by the local + implementation."; + } + + leaf mpls-tc { + type uint8 { + range "0..7"; + } + default 0; + description + "The value of the MPLS Traffic Class (TC) bits to be used if the + value of the SID is an MPLS label. In the case that the value is + set to 0, then the local implementation should choose the value."; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:policy-forwarding/" + + "oc-ni:policies/oc-ni:policy/oc-ni:rules/oc-ni:rule" { + description + "Add the SR-TE specific policy forwarding match criteria to the + policy forwarding model."; + + uses oc-pf-srte-match-top; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:policy-forwarding/" + + "oc-ni:policies/oc-ni:policy/oc-ni:rules/oc-ni:rule/oc-ni:action" { + description + "Add the SR-TE specific policy forwarding actions to the + policy forwarding model."; + + uses oc-pf-srte-segment-list-top; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-pim-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-pim-types@2018-11-21.yang new file mode 100644 index 0000000..a1fc515 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pim-types@2018-11-21.yang @@ -0,0 +1,85 @@ +module openconfig-pim-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/pim/types"; + + prefix "oc-pim-types"; + + // import some basic types + import openconfig-extensions { prefix "oc-ext"; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines types related to the PIM protocol model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-02-19" { + description + "Initial revision."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity PIM_MODE { + description + "Base identity for the operating modes of Protocol-Independent + Multicast."; + } + + identity PIM_MODE_SPARSE { + base PIM_MODE; + description + "PIM sparse mode (PIM-SM)."; + reference "RFC7761"; + } + + identity PIM_MODE_DENSE { + base PIM_MODE; + description + "PIM dense mode (PIM-DM)."; + reference "RFC3973"; + } + + // typedef statements + + typedef dr-priority-type { + type uint32; + description + "The port's designated router priority. Larger always preferred. + DR Priority is a 32-bit unsigned number, ranges 0-4294967295."; + reference "RFC7761 4.3.1 page 33"; + } + + typedef pim-interval-type { + type uint8 { + range 1..255; + } + units "seconds"; + description + "Interval at which the router sends the PIM message toward the + upstream RPF neighbor."; + reference "RFC7761 4.5 page 44, 4.3.1 page 29"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-pim@2019-07-09.yang b/exp/yangcli/h3c-yang/openconfig-pim@2019-07-09.yang new file mode 100644 index 0000000..f5faffe --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-pim@2019-07-09.yang @@ -0,0 +1,481 @@ +module openconfig-pim { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/pim"; + + prefix "oc-pim"; + + // import some basic types/interfaces + import openconfig-pim-types { prefix oc-pim-types; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-acl { prefix oc-acl; } + import openconfig-types { prefix "oc-types"; } + import openconfig-extensions { prefix "oc-ext"; } + import ietf-inet-types { prefix "inet"; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "An OpenConfig model for Protocol Independent Multicast (PIM)."; + + oc-ext:openconfig-version "0.2.0"; + + revision "2019-07-09" { + description + "Reindent to two spaces. + Ensure that timeticks64 is consistently expressed in nanoseconds."; + reference "0.2.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-02-09" { + description + "Initial revision."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping admin-config { + description + "Re-usable grouping to enable or disable a particular feature."; + + leaf enabled { + type boolean; + default false; + description + "When set to true, the functionality within which this + leaf is defined is enabled, when set to false it is + explicitly disabled."; + } + } + + grouping pim-counters-state { + description + "Counters related to PIM messages."; + + leaf hello-messages { + type uint32; + description + "Number of hello messages received."; + reference "RFC7761 4.9.2 page 108"; + } + + leaf join-prune-messages { + type uint32; + description + "Number of join/prune messages received."; + reference "RFC7761 4.5 page 44"; + } + + leaf bootstrap-messages { + type uint32; + description + "Number of bootstrap router messages received."; + reference "RFC7761 3.7 page 12"; + } + } + + grouping pim-interface-config { + description + "Configuration data for PIM on each interface."; + + uses admin-config; + + leaf interface-id { + type oc-if:interface-id; + description + "Reference to an interface on which PIM is enabled."; + } + + leaf mode { + type identityref { + base oc-pim-types:PIM_MODE; + } + description + "PIM mode to use when delivering multicast traffic via this + interface."; + } + + leaf bsr-border { + type boolean; + default false; + description + "When set to true the device will not send bootstrap router + messages over this interface. By default these are transmitted + over all PIM sparse mode (PIM-SM) enabled interfaces."; + } + + leaf border-router { + type boolean; + default false; + description + "When set to true the interface is set as MBR (multicast border + router) and allows multicast traffic from sources that are + outside of the PIM domain."; + } + + + leaf dr-priority { + type oc-pim-types:dr-priority-type; + description + "The designated router priority of this interface. Larger always + preferred."; + } + + leaf join-prune-interval { + type oc-pim-types:pim-interval-type; + description + "Interval at which the router sends the PIM join/prune messages + toward the upstream RPF neighbor."; + } + + leaf hello-interval { + type oc-pim-types:pim-interval-type; + description + "Interval at which the router sends the PIM hello messages."; + } + + leaf dead-timer { + type uint16 { + range 1..65535; + } + description + "Number of missed hello messages after which a neighbor is + expired."; + } + } + + grouping pim-neighbor-state { + description + "PIM neighbor state."; + + leaf neighbor-address { + type inet:ipv4-address; + description + "IPv4 address of neighbor router."; + } + + leaf dr-address { + type inet:ipv4-address; + description + "IPv4 address of designated router."; + } + + leaf neighbor-established { + type oc-types:timeticks64; + description + "This timestamp indicates the time that the + PIM neighbor adjacency established. It is expressed + relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC). + + The PIM session uptime can be computed by clients + as the difference between this value and the + current time in UTC."; + } + + leaf neighbor-expires { + type oc-types:timeticks64; + description + "This timestamp indicates the time that the + PIM neighbor adjacency will expire should hello + messages fail to arrive from the neighbor. The value + is expressed relative to the Unix Epoch (Jan 1, 1970 + 00:00:00 UTC)."; + } + + leaf mode { + type identityref { + base oc-pim-types:PIM_MODE; + } + description + "PIM mode in use when delivering multicast traffic + via this neighbor."; + } + } + + grouping pim-neighbors-top { + description + "Details about PIM neighbors."; + + container neighbors { + config false; + description + "Details about PIM neighbors."; + + list neighbor { + key "neighbor-address"; + description + "Details about a specific PIM neighbor."; + + leaf neighbor-address { + type leafref { + path "../state/neighbor-address"; + } + description + "IPv4 address of neighbor router."; + } + + container state { + config false; + description + "Details about a specific PIM neighbor."; + + uses pim-neighbor-state; + } + } + } + } + + grouping pim-interfaces-top { + description + "Configuration and state data for PIM on each interface."; + + container interfaces { + description + "Configuration and state data for PIM on each interface."; + + list interface { + key "interface-id"; + description + "This container defines interface PIM configuration and + state information."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to an interface on which PIM is enabled."; + } + + container config { + description + "PIM interface configuration."; + + uses pim-interface-config; + } + + container state { + config false; + description + "State information for PIM interfaces."; + + uses pim-interface-config; + container counters { + description + "PIM counters for each interface."; + + uses pim-counters-state; + } + } + + uses pim-neighbors-top; + uses oc-if:interface-ref; + } + } + } + + grouping pim-global-state { + description + "State and session data for PIM on each interface."; + + leaf neighbor-count { + type uint8; + description + "Number of adjacent PIM neighbors."; + } + + container counters { + description + "Global PIM counters."; + + uses pim-counters-state; + } + } + + grouping pim-sources-joined-top { + description + "List of multicast sources joined."; + + container sources-joined { + config false; + description + "List of multicast sources joined."; + + list source { + key "address"; + description + "A multicast source that has been joined."; + + leaf address { + type leafref { + path "../state/address"; + } + description + "Source address of multicast."; + } + + container state { + config false; + description + "State for a multicast source that has been joined."; + + leaf address { + type inet:ipv4-address; + description + "Source address of multicast."; + } + + leaf group { + type inet:ipv4-address; + description + "Multicast address."; + } + + leaf upstream-interface-id { + type oc-if:interface-id; + description + "The upstream interface for this multicast source."; + } + } + } + } + } + + grouping pim-global-ssm-config { + description + "Source specific multicast (SSM) configuration."; + + leaf ssm-ranges { + type leafref { + path "/oc-acl:acl/oc-acl:acl-sets/oc-acl:acl-set/" + + "oc-acl:config/oc-acl:name"; + } + description + "List of accepted source specific multicast (SSM) address + ranges."; + } + } + + grouping pim-global-rp-addresses-config { + description + "Defines rendezvous points for sparse mode multicast."; + + leaf address { + type inet:ipv4-address; + description + "IPv4 address of rendezvous point."; + } + + leaf multicast-groups { + type string; + // TODO should this be an ACL or prefix-list reference or prefix list? + // Cisco it's an ACL, Juniper it's an inline prefix list + description + "List of multicast groups (multicast IP address ranges) for which + this entry will be used as a rendezvous point. When not + present the default is equivalent to all valid IP multicast + addresses."; + } + } + + grouping pim-global-top { + description + "Top level grouping for global PIM configuration."; + + container ssm { + description + "Source specific multicast (SSM)."; + + container config { + description + "Configuration for source specific multicast (SSM)."; + uses pim-global-ssm-config; + } + container state { + config false; + description + "State for source specific multicast (SSM)."; + uses pim-global-ssm-config; + } + } + + container rendezvous-points { + description + "Defines rendezvous points for sparse mode multicast."; + + list rendezvous-point { + key "address"; + description + "Defines a rendezvous point (RP) for sparse mode multicast."; + + leaf address { + type leafref { + path "../config/address"; + } + description + "IPv4 address of rendezvous point."; + } + + container config { + description + "Rendezvous point configuration."; + uses pim-global-rp-addresses-config; + } + container state { + config false; + description + "Rendezvous point state."; + uses pim-global-rp-addresses-config; + } + } + } + + container state { + config false; + description + "Global PIM state."; + uses pim-global-state; + } + + uses pim-sources-joined-top; + } + + grouping pim-top { + description + "Top-level grouping for PIM."; + + container pim { + description + "Top-level PIM configuration and operational state."; + + container global { + description + "This container defines global PIM configuration and state + information."; + uses pim-global-top; + } + + uses pim-interfaces-top; + } + } + + // data definition statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-platform-cpu@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-platform-cpu@2018-11-21.yang new file mode 100644 index 0000000..4182c77 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-cpu@2018-11-21.yang @@ -0,0 +1,72 @@ +module openconfig-platform-cpu { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/cpu"; + + prefix "oc-cpu"; + + import openconfig-platform { prefix oc-platform; } + import openconfig-types { prefix oc-types; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data related to FAN components in the + OpenConfig platform model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-01-30" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping component-cpu-utilization { + description + "Per-component CPU statistics"; + + container utilization { + description + "Statistics representing CPU utilization of the + component."; + + container state { + config false; + description + "Operational state variables relating to the utilization + of the CPU."; + + uses oc-types:avg-min-max-instant-stats-pct; + } + } + } + + augment "/oc-platform:components/oc-platform:component/" + + "oc-platform:cpu" { + description + "Adding CPU utilization data to component model"; + + uses component-cpu-utilization; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-platform-fan@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-platform-fan@2018-11-21.yang new file mode 100644 index 0000000..cd4a381 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-fan@2018-11-21.yang @@ -0,0 +1,76 @@ +module openconfig-platform-fan { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/fan"; + + prefix "oc-fan"; + + import openconfig-platform { prefix oc-platform; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data related to FAN components in the + OpenConfig platform model."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2018-01-18" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + // typedef statements + + // grouping statements + + grouping fan-state { + description + "Operational state data for fan components"; + + leaf speed { + type uint32; + units rpm; + description + "Current (instantaneous) fan speed"; + } + } + + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component/" + + "oc-platform:fan/oc-platform:state" { + description + "Adding fan data to component model"; + + uses fan-state; + } + +} + diff --git a/exp/yangcli/h3c-yang/openconfig-platform-linecard@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-platform-linecard@2018-11-21.yang new file mode 100644 index 0000000..e9ee046 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-linecard@2018-11-21.yang @@ -0,0 +1,129 @@ +module openconfig-platform-linecard { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/linecard"; + + prefix "oc-linecard"; + + import openconfig-platform { prefix oc-platform; } + import openconfig-platform-types { prefix oc-platform-types; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data related to LINECARD components in + the openconfig-platform model"; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2017-08-03" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + // grouping statements + + grouping linecard-config { + description + "Configuration data for linecard components"; + + leaf power-admin-state { + type oc-platform-types:component-power-type; + default POWER_ENABLED; + description + "Enable or disable power to the linecard"; + } + } + + grouping linecard-state { + description + "Operational state data for linecard components"; + + leaf slot-id { + type string; + description + "Identifier for the slot or chassis position in which the + linecard is installed"; + } + } + + grouping linecard-top { + description + "Top-level grouping for linecard data"; + + container linecard { + description + "Top-level container for linecard data"; + + container config { + description + "Configuration data for linecards"; + + uses linecard-config; + } + + container state { + + config false; + + description + "Operational state data for linecards"; + + uses linecard-config; + uses linecard-state; + } + } + } + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component" { + description + "Adding linecard data to physical inventory"; + + uses linecard-top { + when "current()/oc-platform:state/" + + "oc-platform:type = 'LINECARD'" { + description + "Augment is active when component is of type LINECARD"; + } + } + } + + // rpc statements + + // notification statements + +} + diff --git a/exp/yangcli/h3c-yang/openconfig-platform-port@2021-10-01.yang b/exp/yangcli/h3c-yang/openconfig-platform-port@2021-10-01.yang new file mode 100644 index 0000000..8e4a0d7 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-port@2021-10-01.yang @@ -0,0 +1,237 @@ +module openconfig-platform-port { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/port"; + + prefix "oc-port"; + + // import some basic types + import openconfig-platform { prefix oc-platform; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-if-ethernet { prefix oc-eth; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data related to PORT components in the + openconfig-platform model"; + + oc-ext:openconfig-version "0.4.2"; + + revision "2021-10-01" { + description + "Fix indentation for 'list group'"; + reference "0.4.2"; + } + + revision "2021-06-16" { + description + "Remove trailing whitespace"; + reference "0.4.1"; + } + + revision "2021-04-22" { + description + "Adding support for flexible port breakout."; + reference "0.4.0"; + } + + revision "2020-05-06" { + description + "Ensure that when statements in read-write contexts + reference only read-write leaves."; + reference "0.3.3"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.2"; + } + + revision "2018-11-07" { + description + "Fixed error in when statement path"; + reference "0.3.1"; + } + + revision "2018-01-20" { + description + "Added augmentation for interface-to-port reference"; + reference "0.3.0"; + } + + revision "2017-11-17" { + description + "Corrected augmentation path for port data"; + reference "0.2.0"; + } + + revision "2016-10-24" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // extension statements + + // feature statements + + // identity statements + + // typedef statements + + // grouping statements + + grouping group-config { + description + "Configuration data for the breakout group."; + + leaf index { + type uint8; + description + "Each index specifies breakouts that are identical in + terms of speed and the number of physical channels."; + } + + leaf num-breakouts { + type uint8; + description + "Sets the number of interfaces using this breakout group."; + } + + leaf breakout-speed { + type identityref { + base oc-eth:ETHERNET_SPEED; + } + description + "Speed of interfaces in this breakout group, supported + values are defined by the ETHERNET_SPEED identity."; + } + + leaf num-physical-channels { + type uint8; + description + "Sets the number of lanes or physical channels assigned + to the interfaces in this breakout group. This leaf need + not be set if there is only one breakout group where all + the interfaces are of equal speed and have equal number + of physical channels"; + } + } + + grouping group-state { + description + "Operational state data for the port breakout group."; + } + + grouping port-breakout-top { + description + "Top-level grouping for port breakout data."; + + container breakout-mode { + description + "Top-level container for port breakout-mode data."; + + container groups { + description + "Top level container for breakout groups data. + When a device has the capability to break a port into + interfaces of different speeds and different number of + physical channels, it can breakout a 400G OSFP port with + 8 physical channels (with support for 25G NRZ, 50G PAM4 + and 100G PAM4) in the following configuration: + 100G + 100G + 200G -> 1 interface with 2 physical channels + and 1 interface with 4 physical channels and 1 interface with + 2 physical channels. With this configuration the interface in + 1st breakout group would use 50G PAM4 modulation, interface + in 2nd breakout group would use 25G NRZ modulation and the + interface in 3rd breakout group would use 100G PAM4 modulation + This configuration would result in 3 entries in the breakout + groups list. + When a device does not have the capability to break a port + into interfaces of different speeds and different number of + physical channels, it would breakout a 400G OSFP port with + 8 physical channels in the following configuration: + 50G -> 8 interfaces with 1 physical channel each, this would + result in 1 entry in the breakout groups list."; + + list group { + key "index"; + description + "List of breakout groups."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Index of the breakout group entry in the breakout groups list."; + } + + container config { + description + "Configuration data for breakout group."; + uses group-config; + } + + container state { + config false; + description + "Operational state data for breakout group."; + + uses group-config; + uses group-state; + } + } + } + } + } + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component/" + + "oc-platform:port" { + description + "Adding port breakout data to physical platform data. This subtree + is only valid when the type of the component is PORT."; + + uses port-breakout-top; + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:state" { + description + "Adds a reference from the base interface to the corresponding + port component in the device inventory."; + + leaf hardware-port { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "For non-channelized interfaces, references the hardware port + corresponding to the base interface."; + } + } + + // rpc statements + + // notification statements + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-platform-psu@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-platform-psu@2018-11-21.yang new file mode 100644 index 0000000..02d6e96 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-psu@2018-11-21.yang @@ -0,0 +1,146 @@ +module openconfig-platform-psu { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/psu"; + + prefix "oc-platform-psu"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-types { prefix oc-types; } + import openconfig-platform { prefix oc-platform; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines a schema for power supply components in + the OpenConfig platform model."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2018-01-16" { + description + "Changed admin state leaf name"; + reference "0.2.0"; + } + + revision "2017-12-21" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + // typedef statements + + // grouping statements + + grouping psu-config { + description + "Configuration data for power supply components"; + + leaf enabled { + type boolean; + default true; + description + "Adminsitrative control on the on/off state of the power + supply unit."; + } + } + + grouping psu-state { + description + "Operational state data for power supply components"; + + + // TODO(aashaikh): May need to convert some of these to + // interval statistics once decided on which leaves to include. + leaf capacity { + type oc-types:ieeefloat32; + units watts; + description + "Maximum power capacity of the power supply."; + } + + leaf input-current { + type oc-types:ieeefloat32; + units amps; + description + "The input current draw of the power supply."; + } + + leaf input-voltage { + type oc-types:ieeefloat32; + units volts; + description + "Input voltage to the power supply."; + } + + leaf output-current { + type oc-types:ieeefloat32; + units amps; + description + "The output current supplied by the power supply."; + } + + leaf output-voltage { + type oc-types:ieeefloat32; + units volts; + description + "Output voltage supplied by the power supply."; + } + + leaf output-power { + type oc-types:ieeefloat32; + units watts; + description + "Output power supplied by the power supply."; + } + } + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component/" + + "oc-platform:power-supply/oc-platform:config" { + description + "Adds power supply data to component operational state."; + + uses psu-config; + } + + augment "/oc-platform:components/oc-platform:component/" + + "oc-platform:power-supply/oc-platform:state" { + description + "Adds power supply data to component operational state."; + + uses psu-config; + uses psu-state; + } + + + // rpc statements + + // notification statements +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-platform-transceiver@2021-07-29.yang b/exp/yangcli/h3c-yang/openconfig-platform-transceiver@2021-07-29.yang new file mode 100644 index 0000000..913454c --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-transceiver@2021-07-29.yang @@ -0,0 +1,789 @@ +/* + * This file is subject to the Apache License Version 2.0 (the "License"). + * You may not use the software except in compliance with the License. + * + * This file in this distribution may have been modified by Tencent ("Tencent Modifications"). + * All Tencent Modifications are Copyright (c) 2019 Shenzhen tencent computer systems + * company limited and are made available subject to the Tencent end user agreement or + * other applicable agreement between you and Tencent. + */ + +module openconfig-platform-transceiver { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/transceiver"; + + prefix "oc-transceiver"; + + // import some basic types + import ietf-yang-types { prefix yang; } + import openconfig-platform { prefix oc-platform; } + import openconfig-platform-types { prefix oc-platform-types; } + import openconfig-platform-port { prefix oc-port; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-transport-types { prefix oc-opt-types; } + import openconfig-types { prefix oc-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + for transceivers (i.e., pluggable optics). The module should be + used in conjunction with the platform model where other + physical entity data are represented. + + In the platform model, a component of type=TRANSCEIVER is + expected to be a subcomponent of a PORT component. This + module defines a concrete schema for the associated data for + components with type=TRANSCEIVER. + + A transceiver will always contain physical-channel(s), however + when a line side optical-channel is present (i.e. ZR+ optics) + the physical-channel will reference its optical-channel. + In this case, the optical-channels components must be + subcomponents of the transceiver. The relationship between the + physical-channel and the optical-channel allows for multiple + optical-channels to be associated with a transceiver in addition + to ensuring certain leaves (i.e. output-power) are not duplicated + in multiple components. + + If a transceiver contains a digital signal processor (DSP), such + as with ZR+ optics, the modeling will utilize hierarchical + components as follows: + PORT --> TRANSCEIVER --> OPTICAL_CHANNEL(s) + The signal will then traverse through a series of + terminal-device/logical-channels as required. The first + logical-channel connected to the OPTICAL_CHANNEL will utilize the + assignment/optical-channel leaf to create the relationship. At the + conclusion of the series of logical-channels, the logical-channel + will be associated to its host / client side based on: + * If the TRANSCEIVER is directly within a router or switch, then + it will use the logical-channel ingress leaf to specify the + interface it is associated with. + * If the TRANSCEIVER is within a dedicated terminal (Layer 1) + device, then it will use the logical-channel ingress leaf to + specify a physical-channel within a TRANSCEIVER component + (i.e. gray optic) that it is associated with."; + + oc-ext:openconfig-version "0.9.0"; + + revision "2021-07-29" { + description + "Add several media-lane-based VDM defined by CMIS to physical channel"; + reference "0.9.0"; + } + + revision "2021-02-23" { + description + "Add leafref to an optical channel from a physical channel."; + reference "0.8.0"; + } + + revision "2020-05-06" { + description + "Ensure that when statements in read-write contexts reference + only read-write leaves."; + reference "0.7.1"; + } + + revision "2018-11-25" { + description + "Add augment for leafref to transceiver component; + Correct paths in physical channels leafref."; + reference "0.7.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.6.1"; + } + + revision "2018-11-16" { + description + "Added transceiver FEC configuration and state"; + reference "0.6.0"; + } + + revision "2018-05-15" { + description + "Remove internal-temp state leaf, since we prefer + the generic /components/component/state/temperature + container for temperature information."; + reference "0.5.0"; + } + + revision "2018-01-22" { + description + "Fixed physical-channel path reference"; + reference "0.4.1"; + } + + revision "2017-09-18" { + description + "Use openconfig-yang-types module"; + reference "0.4.0"; + } + + revision "2017-07-08" { + description + "Adds clarification on aggregate power measurement data"; + reference "0.3.0"; + } + + revision "2016-12-22" { + description + "Adds preconfiguration data and clarified units"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + // typedef statements + + // grouping statements + + grouping optical-power-state { + description + "Reusable leaves related to optical power state -- these + are read-only state values. If avg/min/max statistics are + not supported, the target is expected to just supply the + instant value"; + + container output-power { + description + "The output optical power of a physical channel in units + of 0.01dBm, which may be associated with individual + physical channels, or an aggregate of multiple physical + channels (i.e., for the overall transceiver). For an + aggregate, this may be a measurement from a photodetector + or a a calculation performed on the device by summing up + all of the related individual physical channels. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dBm; + } + + container input-power { + description + "The input optical power of a physical channel in units + of 0.01dBm, which may be associated with individual + physical channels, or an aggregate of multiple physical + channels (i.e., for the overall transceiver). For an + aggregate, this may be a measurement from a photodetector + or a a calculation performed on the device by summing up + all of the related individual physical channels. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dBm; + } + + container laser-bias-current { + description + "The current applied by the system to the transmit laser to + achieve the output power. The current is expressed in mA + with up to two decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-mA; + } + + container voltage { + description + "Values include the + instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value. This container is defined by Tencnet"; + + uses oc-types:avg-min-max-instant-stats-precision2-V; + } + } + + grouping output-optical-frequency { + description + "Reusable leaves related to optical output power -- this is + typically configurable on line side and read-only on the + client-side"; + + leaf output-frequency { + type oc-opt-types:frequency-type; + description + "The frequency in MHz of the individual physical channel + (e.g. ITU C50 - 195.0THz and would be reported as + 195,000,000 MHz in this model). This attribute is not + configurable on most client ports."; + } + } + + + grouping physical-channel-config { + description + "Configuration data for physical client channels"; + + leaf index { + type uint16 { + range 0..max; + } + description + "Index of the physical channnel or lane within a physical + client port"; + } + + leaf associated-optical-channel { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "A physical channel may reference an optical channel + component. If the physical channel does make this optional + reference, then a limited set of leaves will apply within + the physical channel to avoid duplication within the optical + channel."; + } + + leaf description { + type string; + description + "Text description for the client physical channel"; + } + + leaf tx-laser { + type boolean; + description + "Enable (true) or disable (false) the transmit label for the + channel"; + } + + uses physical-channel-config-extended { + when "../../../config/module-functional-type = 'oc-opt-types:TYPE_STANDARD_OPTIC'" { + description + "When the physical channel is of TYPE_STANDARD_OPTIC, the + extended config will be used"; + } + } + } + + grouping physical-channel-config-extended { + description + "Extended configuration data for physical client channels + for applications where the full physical channel config and + state are used. In some cases, such as when the physical + channel has a leafref to an optical channel component and the + module-functional-type is TYPE_DIGITAL_COHERENT_OPTIC this + grouping will NOT be used."; + + leaf target-output-power { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "Target output optical power level of the optical channel, + expressed in increments of 0.01 dBm (decibel-milliwats)"; + } + } + + grouping physical-channel-state { + description + "Operational state data for client channels. In some cases, + such as when the physical channel has a leafref to an optical + channel component and the module-functional-type is + TYPE_DIGITAL_COHERENT_OPTIC this grouping will NOT be used."; + + container laser-temperature { + description + "Laser temperature for the cooled laser in degrees Celsius with 1 + decimal precision. This term is defined by Common Management + Interface Specification (CMIS). Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply the + instant value."; + + uses oc-platform-types:avg-min-max-instant-stats-precision1-celsius; + } + + container target-frequency-deviation { + description + "The difference in MHz with 1 decimal precision between the target + center frequency and the actual current center frequency . This term + is defined by Common Management Interface Specification (CMIS) and + referred to as laser frequency error or laser ferquency deviation. + Values include the instantaneous, average, minimum, and maximum + statistics. If avg/min/max statistics are not supported, the target + is expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision1-mhz; + } + + container tec-current { + description + "The amount of current flowing to the TC of a cooled laser in percentage + with 2 decimal precision. This term is defined by Common Management + Interface Specification (CMIS). Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply the instant + value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + leaf laser-age { + type oc-types:percentage; + description + "Laser age (0% at BOL, 100% EOL) in integer percentage. This term is + defined by Common Management Interface Specification (CMIS)."; + } + + uses physical-channel-state-extended { + when "../../../state/module-functional-type = 'oc-opt-types:TYPE_STANDARD_OPTIC'" { + description + "When the physical channel is of TYPE_STANDARD_OPTIC, the + extended state will be used"; + } + } + } + + grouping physical-channel-state-extended { + description + "Extended operational state data for physical client channels + for applications where the full physical channel config and + state are used. In some cases, such as when the physical + channel has a leafref to an optical channel component and the + module-functional-type is TYPE_DIGITAL_COHERENT_OPTIC this + grouping will NOT be used."; + + uses output-optical-frequency; + uses optical-power-state; + } + + grouping physical-channel-top { + description + "Top-level grouping for physical client channels"; + + container physical-channels { + description + "Enclosing container for client channels"; + + list channel { + key "index"; + description + "List of client channels, keyed by index within a physical + client port. A physical port with a single channel would + have a single zero-indexed element"; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index number of the channel"; + } + + container config { + description + "Configuration data for physical channels"; + + uses physical-channel-config; + } + + container state { + + config false; + + description + "Operational state data for channels"; + + uses physical-channel-config; + uses physical-channel-state; + } + } + } + } + + + grouping port-transceiver-config { + description + "Configuration data for client port transceivers"; + + leaf enabled { + type boolean; + description + "Turns power on / off to the transceiver -- provides a means + to power on/off the transceiver (in the case of SFP, SFP+, + QSFP,...) or enable high-power mode (in the case of CFP, + CFP2, CFP4) and is optionally supported (device can choose to + always enable). True = power on / high power, False = + powered off"; + } + + leaf form-factor-preconf { + type identityref { + base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE; + } + description + "Indicates the type of optical transceiver used on this + port. If the client port is built into the device and not + pluggable, then non-pluggable is the corresponding state. If + a device port supports multiple form factors (e.g. QSFP28 + and QSFP+, then the value of the transceiver installed shall + be reported. If no transceiver is present, then the value of + the highest rate form factor shall be reported + (QSFP28, for example). + + The form factor is included in configuration data to allow + pre-configuring a device with the expected type of + transceiver ahead of deployment. The corresponding state + leaf should reflect the actual transceiver type plugged into + the system."; + } + + leaf ethernet-pmd-preconf { + type identityref { + base oc-opt-types:ETHERNET_PMD_TYPE; + } + description + "The Ethernet PMD is a property of the optical transceiver + used on the port, indicating the type of physical connection. + It is included in configuration data to allow pre-configuring + a port/transceiver with the expected PMD. The actual PMD is + indicated by the ethernet-pmd state leaf."; + } + + leaf fec-mode { + type identityref { + base oc-platform-types:FEC_MODE_TYPE; + } + description + "The FEC mode indicates the mode of operation for the + transceiver's FEC. This defines typical operational modes + and does not aim to specify more granular FEC capabilities."; + } + + leaf module-functional-type { + type identityref { + base oc-opt-types:TRANSCEIVER_MODULE_FUNCTIONAL_TYPE; + } + description + "Indicates the module functional type which represents the + functional capability of the transceiver. For example, this + would specify the module is a digital coherent optic or a + standard grey optic that performs on-off keying."; + } + } + + grouping port-transceiver-state { + description + "Operational state data for client port transceivers"; + + leaf present { + type enumeration { + enum PRESENT { + description + "Transceiver is present on the port"; + } + enum NOT_PRESENT { + description + "Transceiver is not present on the port"; + } + } + description + "Indicates whether a transceiver is present in + the specified client port."; + } + + leaf form-factor { + type identityref { + base oc-opt-types:TRANSCEIVER_FORM_FACTOR_TYPE; + } + description + "Indicates the type of optical transceiver used on this + port. If the client port is built into the device and not + pluggable, then non-pluggable is the corresponding state. If + a device port supports multiple form factors (e.g. QSFP28 + and QSFP+, then the value of the transceiver installed shall + be reported. If no transceiver is present, then the value of + the highest rate form factor shall be reported + (QSFP28, for example)."; + } + + leaf connector-type { + type identityref { + base oc-opt-types:FIBER_CONNECTOR_TYPE; + } + description + "Connector type used on this port"; + } + + leaf vendor { + type string { + length 1..16; + } + description + "Full name of transceiver vendor. 16-octet field that + contains ASCII characters, left-aligned and padded on the + right with ASCII spaces (20h)"; + } + + leaf vendor-part { + type string { + length 1..16; + } + description + "Transceiver vendor's part number. 16-octet field that + contains ASCII characters, left-aligned and padded on the + right with ASCII spaces (20h). If part number is undefined, + all 16 octets = 0h"; + } + + leaf vendor-rev { + type string { + length 0..255; + } + description + "Transceiver vendor's revision number. 255-octet field that + contains ASCII characters, left-aligned and padded on the + right with ASCII spaces (20h)"; + } + + //TODO: these compliance code leaves should be active based on + //the type of port + leaf ethernet-pmd { + type identityref { + base oc-opt-types:ETHERNET_PMD_TYPE; + } + description + "Ethernet PMD (physical medium dependent sublayer) that the + transceiver supports. The SFF/QSFP MSAs have registers for + this and CFP MSA has similar."; + } + + leaf sonet-sdh-compliance-code { + type identityref { + base oc-opt-types:SONET_APPLICATION_CODE; + } + description + "SONET/SDH application code supported by the port"; + } + + leaf otn-compliance-code { + type identityref { + base oc-opt-types:OTN_APPLICATION_CODE; + } + description + "OTN application code supported by the port"; + } + + leaf serial-no { + type string { + length 0..64; + } + description + "Transceiver serial number. 64-octet field that contains + ASCII characters, left-aligned and padded on the right with + ASCII spaces (20h). If part serial number is undefined, all + 64 octets = 0h"; + } + + leaf date-code { + type oc-yang:date-and-time; + description + "Representation of the transceiver date code, typically + stored as YYMMDD. The time portion of the value is + undefined and not intended to be read."; + } + + leaf fault-condition { + type boolean; + description + "Indicates if a fault condition exists in the transceiver"; + } + + leaf fec-status { + type identityref { + base oc-platform-types:FEC_STATUS_TYPE; + } + description + "Operational status of FEC"; + } + + leaf fec-uncorrectable-blocks { + type yang:counter64; + description + "The number of blocks that were uncorrectable by the FEC"; + } + + leaf fec-uncorrectable-words { + type yang:counter64; + description + "The number of words that were uncorrectable by the FEC"; + } + + leaf fec-corrected-bytes { + type yang:counter64; + description + "The number of bytes that were corrected by the FEC"; + } + + leaf fec-corrected-bits { + type yang:counter64; + description + "The number of bits that were corrected by the FEC"; + } + + container pre-fec-ber { + description + "Bit error rate before forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container post-fec-ber { + description + "Bit error rate after forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container supply-voltage { + description + "Supply voltage to the transceiver in volts with 2 decimal + precision. Values include the instantaneous, average, minimum, + and maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the instant + value."; + + uses oc-platform-types:avg-min-max-instant-stats-precision2-volts; + } + + uses optical-power-state; + } + + grouping port-transceiver-top { + description + "Top-level grouping for client port transceiver data"; + + container transceiver { + description + "Top-level container for client port transceiver data"; + + container config { + description + "Configuration data for client port transceivers"; + + uses port-transceiver-config; + } + + container state { + + config false; + + description + "Operational state data for client port transceivers"; + + uses port-transceiver-config; + uses port-transceiver-state; + } + // physical channels are associated with a transceiver + // component + uses physical-channel-top; + } + } + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component" { + description + "Adding transceiver data to physical inventory. This subtree is + only valid when the type of the component is TRANSCEIVER."; + + uses port-transceiver-top; + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:state" { + description + "Adds a reference from an interface to the corresponding + transceiver component."; + + leaf transceiver { + type leafref { + path "/oc-platform:components/" + + "oc-platform:component[oc-platform:name=current()/../oc-port:hardware-port]/" + + "oc-platform:subcomponents/oc-platform:subcomponent/" + + "oc-platform:name"; + } + description + "Provides a reference to the transceiver subcomponent that + corresponds to the physical port component for this interface. + The device must only populate this leaf with a reference to + a component of type TRANSCEIVER."; + } + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:state" { + description + "Adds a reference from the base interface to its corresponding + physical channels."; + + leaf-list physical-channel { + type leafref { + path "/oc-platform:components/" + + "oc-platform:component[oc-platform:name=current()/../oc-transceiver:transceiver]/" + + "oc-transceiver:transceiver/" + + "oc-transceiver:physical-channels/oc-transceiver:channel/" + + "oc-transceiver:index"; + } + description + "For a channelized interface, list of references to the + physical channels (lanes) corresponding to the interface. + The physical channels are elements of a transceiver component + in the platform model."; + } + } + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-platform-types@2021-07-29.yang b/exp/yangcli/h3c-yang/openconfig-platform-types@2021-07-29.yang new file mode 100644 index 0000000..d847989 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform-types@2021-07-29.yang @@ -0,0 +1,433 @@ +module openconfig-platform-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform-types"; + + prefix "oc-platform-types"; + + import openconfig-types { prefix oc-types; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines data types (e.g., YANG identities) + to support the OpenConfig component inventory model."; + + oc-ext:openconfig-version "1.2.0"; + + revision "2021-07-29" { + description + "Add several avg-min-max-instant-stats groupings"; + reference "1.2.0"; + } + + revision "2021-01-18" { + description + "Add identity for software modules"; + reference "1.1.0"; + } + + revision "2019-06-03" { + description + "Add OpenConfig component operating system patch type."; + reference "1.0.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.10.1"; + } + + revision "2018-11-16" { + description + "Added FEC_MODE_TYPE and FEC_STATUS_TYPE"; + reference "0.10.0"; + } + + revision "2018-05-05" { + description + "Added min-max-time to + avg-min-max-instant-stats-precision1-celsius, + added new CONTROLLER_CARD identity"; + reference "0.9.0"; + } + + revision "2018-01-16" { + description + "Added new per-component common data; add temp alarm"; + reference "0.8.0"; + } + + revision "2017-12-14" { + description + "Added anchor containers for component data, added new + component types"; + reference "0.7.0"; + } + + revision "2017-08-16" { + description + "Added power state enumerated type"; + reference "0.6.0"; + } + + revision "2016-12-22" { + description + "Added temperature state variable to component"; + reference "0.5.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + grouping avg-min-max-instant-stats-precision1-celsius { + description + "Common grouping for recording temperature values in + Celsius with 1 decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics"; + + leaf instant { + type decimal64 { + fraction-digits 1; + } + units celsius; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 1; + } + units celsius; + description + "The arithmetic mean value of the statistic over the + sampling period."; + } + + leaf min { + type decimal64 { + fraction-digits 1; + } + units celsius; + description + "The minimum value of the statistic over the sampling + period"; + } + + leaf max { + type decimal64 { + fraction-digits 1; + } + units celsius; + description + "The maximum value of the statistic over the sampling + period"; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-volts { + description + "Common grouping for recording voltage values in + volts with 2 decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + If supported by the device, the time interval over which + the statistics are computed, and the times at which the + minimum and maximum values occurred, are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units volts; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units volts; + description + "The arithmetic mean value of the statistic over the + sampling period."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units volts; + description + "The minimum value of the statistic over the sampling + period"; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units volts; + description + "The maximum value of the statistic over the sampling + period"; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + // identity statements + + identity OPENCONFIG_HARDWARE_COMPONENT { + description + "Base identity for hardware related components in a managed + device. Derived identities are partially based on contents + of the IANA Entity MIB."; + reference + "IANA Entity MIB and RFC 6933"; + } + + + identity OPENCONFIG_SOFTWARE_COMPONENT { + description + "Base identity for software-related components in a managed + device"; + } + + // hardware types + + identity CHASSIS { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Chassis component, typically with multiple slots / shelves"; + } + + identity BACKPLANE { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Backplane component for aggregating traffic, typically + contained in a chassis component"; + } + + identity FABRIC { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Interconnect between ingress and egress ports on the + device (e.g., a crossbar switch)."; + } + + identity POWER_SUPPLY { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Component that is supplying power to the device"; + } + + identity FAN { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Cooling fan, or could be some other heat-reduction component"; + } + + identity SENSOR { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Physical sensor, e.g., a temperature sensor in a chassis"; + } + + identity FRU { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Replaceable hardware component that does not have a more + specific defined schema."; + } + + identity LINECARD { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Linecard component, typically inserted into a chassis slot"; + } + + identity CONTROLLER_CARD { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "A type of linecard whose primary role is management or control + rather than data forwarding."; + } + + identity PORT { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Physical port, e.g., for attaching pluggables and networking + cables"; + } + + identity TRANSCEIVER { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Pluggable module present in a port"; + } + + identity CPU { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "Processing unit, e.g., a management processor"; + } + + identity STORAGE { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "A storage subsystem on the device (disk, SSD, etc.)"; + } + + identity INTEGRATED_CIRCUIT { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "A special purpose processing unit, typically for traffic + switching/forwarding (e.g., switching ASIC, NPU, forwarding + chip, etc.)"; + } + + identity CHIP { + base OPENCONFIG_HARDWARE_COMPONENT; + description + "A special purpose processing unit, typically for traffic + switching/forwarding (e.g., switching ASIC, NPU, forwarding + chip, etc.)"; + } + identity OPERATING_SYSTEM { + base OPENCONFIG_SOFTWARE_COMPONENT; + description + "Operating system running on a component"; + } + + identity OPERATING_SYSTEM_UPDATE { + base OPENCONFIG_SOFTWARE_COMPONENT; + description + "An operating system update - which should be a subcomponent + of the `OPERATING_SYSTEM` running on a component. An update is + defined to be a set of software changes that are atomically + installed (and uninstalled) together. Multiple updates may be + present for the Operating System. A system should not list all + installed software packages using this type -- but rather + updates that are bundled together as a single installable + item"; + } + + identity BOOT_LOADER { + base OPENCONFIG_SOFTWARE_COMPONENT; + description + "Software layer responsible for loading and booting the + device OS or network OS."; + } + + identity SOFTWARE_MODULE { + base OPENCONFIG_SOFTWARE_COMPONENT; + description + "A base identity for software modules installed and/or + running on the device. Modules include user-space programs + and kernel modules that provide specific functionality. + A component with type SOFTWARE_MODULE should also have a + module type that indicates the specific type of software module"; + } + + identity COMPONENT_OPER_STATUS { + description + "Current operational status of a platform component"; + } + + identity ACTIVE { + base COMPONENT_OPER_STATUS; + description + "Component is enabled and active (i.e., up)"; + } + + identity INACTIVE { + base COMPONENT_OPER_STATUS; + description + "Component is enabled but inactive (i.e., down)"; + } + + identity DISABLED { + base COMPONENT_OPER_STATUS; + description + "Component is administratively disabled."; + } + + identity FEC_MODE_TYPE { + description + "Base identity for FEC operational modes."; + } + + identity FEC_ENABLED { + base FEC_MODE_TYPE; + description + "FEC is administratively enabled."; + } + + identity FEC_DISABLED { + base FEC_MODE_TYPE; + description + "FEC is administratively disabled."; + } + + identity FEC_AUTO { + base FEC_MODE_TYPE; + description + "System will determine whether to enable or disable + FEC on a transceiver."; + } + + identity FEC_STATUS_TYPE { + description + "Base identity for FEC operational statuses."; + } + + identity FEC_STATUS_LOCKED { + base FEC_STATUS_TYPE; + description + "FEC is operationally locked."; + } + + identity FEC_STATUS_UNLOCKED { + base FEC_STATUS_TYPE; + description + "FEC is operationally unlocked."; + } + + // typedef statements + + typedef component-power-type { + type enumeration { + enum POWER_ENABLED { + description + "Enable power on the component"; + } + enum POWER_DISABLED { + description + "Disable power on the component"; + } + } + description + "A generic type reflecting whether a hardware component + is powered on or off"; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-platform@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-platform@2018-11-21.yang new file mode 100644 index 0000000..a3921de --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-platform@2018-11-21.yang @@ -0,0 +1,790 @@ +/* + * This file is subject to the Apache License Version 2.0 (the "License"). + * You may not use the software except in compliance with the License. + * + * This file in this distribution may have been modified by Tencent ("Tencent Modifications"). + * All Tencent Modifications are Copyright (c) 2019 Shenzhen tencent computer systems + * company limited and are made available subject to the Tencent end user agreement or + * other applicable agreement between you and Tencent. + */ + +module openconfig-platform { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform"; + + prefix "oc-platform"; + + import openconfig-platform-types { prefix oc-platform-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-alarm-types { prefix oc-alarm-types; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines a data model for representing a system + component inventory, which can include hardware or software + elements arranged in an arbitrary structure. The primary + relationship supported by the model is containment, e.g., + components containing subcomponents. + + It is expected that this model reflects every field replacable + unit on the device at a minimum (i.e., additional information + may be supplied about non-replacable components). + + Every element in the inventory is termed a 'component' with each + component expected to have a unique name and type, and optionally + a unique system-assigned identifier and FRU number. The + uniqueness is guaranteed by the system within the device. + + Components may have properties defined by the system that are + modeled as a list of key-value pairs. These may or may not be + user-configurable. The model provides a flag for the system + to optionally indicate which properties are user configurable. + + Each component also has a list of 'subcomponents' which are + references to other components. Appearance in a list of + subcomponents indicates a containment relationship as described + above. For example, a linecard component may have a list of + references to port components that reside on the linecard. + + This schema is generic to allow devices to express their own + platform-specific structure. It may be augmented by additional + component type-specific schemas that provide a common structure + for well-known component types. In these cases, the system is + expected to populate the common component schema, and may + optionally also represent the component and its properties in the + generic structure. + + The properties for each component may include dynamic values, + e.g., in the 'state' part of the schema. For example, a CPU + component may report its utilization, temperature, or other + physical properties. The intent is to capture all platform- + specific physical data in one location, including inventory + (presence or absence of a component) and state (physical + attributes or status)."; + + oc-ext:openconfig-version "0.12.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.12.1"; + } + + revision "2018-06-29" { + description + "Added location description for components"; + reference "0.12.0"; + } + + revision "2018-06-03" { + description + "Added parent reference, empty flag and preconfiguration + for components"; + reference "0.11.0"; + } + + revision "2018-04-20" { + description + "Added new per-component state data: mfg-date and removable"; + reference "0.10.0"; + } + + revision "2018-01-30" { + description + "Amended approach for modelling CPU - rather than having + a local CPU utilisation state variable, a component with + a CPU should create a subcomponent of type CPU to report + statistics."; + reference "0.9.0"; + } + + revision "2018-01-16" { + description + "Added new per-component common data; add temp alarm; + moved hardware-port reference to port model"; + reference "0.8.0"; + } + + revision "2017-12-14" { + description + "Added anchor containers for component data, added new + component types"; + reference "0.7.0"; + } + + revision "2017-08-16" { + description + "Added power state enumerated type"; + reference "0.6.0"; + } + + revision "2016-12-22" { + description + "Added temperature state variable to component"; + reference "0.5.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + + grouping platform-component-properties-config { + description + "System-defined configuration data for component properties"; + + leaf name { + type string; + description + "System-supplied name of the property -- this is typically + non-configurable"; + } + + leaf value { + type union { + type string; + type boolean; + type int64; + type uint64; + type decimal64 { + fraction-digits 2; + } + } + description + "Property values can take on a variety of types. Signed and + unsigned integer types may be provided in smaller sizes, + e.g., int8, uint16, etc."; + } + } + + grouping platform-component-properties-state { + description + "Operational state data for component properties"; + + leaf configurable { + type boolean; + description + "Indication whether the property is user-configurable"; + } + } + + grouping platform-component-properties-top { + description + "Top-level grouping "; + + container properties { + description + "Enclosing container "; + + list property { + key "name"; + description + "List of system properties for the component"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the property name."; + } + + container config { + description + "Configuration data for each property"; + + uses platform-component-properties-config; + } + + container state { + + config false; + + description + "Operational state data for each property"; + + uses platform-component-properties-config; + uses platform-component-properties-state; + } + } + } + } + + grouping platform-subcomponent-ref-config { + description + "Configuration data for subcomponent references"; + + leaf name { + type leafref { + path "../../../../../component/config/name"; + } + description + "Reference to the name of the subcomponent"; + } + } + + grouping platform-subcomponent-ref-state { + description + "Operational state data for subcomponent references"; + + } + + grouping platform-subcomponent-ref-top { + description + "Top-level grouping for list of subcomponent references"; + + container subcomponents { + description + "Enclosing container for subcomponent references"; + + list subcomponent { + key "name"; + description + "List of subcomponent references"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name list key"; + } + + container config { + description + "Configuration data for the subcomponent"; + + uses platform-subcomponent-ref-config; + } + + container state { + + config false; + + description + "Operational state data for the subcomponent"; + + uses platform-subcomponent-ref-config; + uses platform-subcomponent-ref-state; + } + } + } + } + + grouping platform-component-config { + description + "Configuration data for components"; + + leaf name { + type string; + description + "Device name for the component -- this may not be a + configurable parameter on many implementations. Where + component preconfiguration is supported, for example, + the component name may be configurable."; + } + } + + grouping platform-component-state { + description + "Operational state data for device components."; + + leaf type { + type union { + type identityref { + base oc-platform-types:OPENCONFIG_HARDWARE_COMPONENT; + } + type identityref { + base oc-platform-types:OPENCONFIG_SOFTWARE_COMPONENT; + } + } + description + "Type of component as identified by the system"; + } + + leaf id { + type string; + description + "Unique identifier assigned by the system for the + component"; + } + + leaf location { + type string; + description + "System-supplied description of the location of the + component within the system. This could be a bay position, + slot number, socket location, etc. For component types that + have an explicit slot-id attribute, such as linecards, the + system should populate the more specific slot-id."; + } + + leaf description { + type string; + description + "System-supplied description of the component"; + } + + leaf mfg-name { + type string; + description + "System-supplied identifier for the manufacturer of the + component. This data is particularly useful when a + component manufacturer is different than the overall + device vendor."; + } + + leaf mfg-date { + type oc-yang:date; + description + "System-supplied representation of the component's + manufacturing date."; + } + + leaf hardware-version { + type string; + description + "For hardware components, this is the hardware revision of + the component."; + } + + leaf firmware-version { + type string; + description + "For hardware components, this is the version of associated + firmware that is running on the component, if applicable."; + } + + leaf software-version { + type string; + description + "For software components such as operating system or other + software module, this is the version of the currently + running software."; + } + + leaf serial-no { + type string; + description + "System-assigned serial number of the component."; + } + + leaf part-no { + type string; + description + "System-assigned part number for the component. This should + be present in particular if the component is also an FRU + (field replaceable unit)"; + } + + leaf removable { + type boolean; + description + "If true, this component is removable or is a field + replaceable unit"; + } + + leaf oper-status { + type identityref { + base oc-platform-types:COMPONENT_OPER_STATUS; + } + description + "If applicable, this reports the current operational status + of the component."; + } + + leaf empty { + type boolean; + default false; + description + "The empty leaf may be used by the device to indicate that a + component position exists but is not populated. Using this + flag, it is possible for the management system to learn how + many positions are available (e.g., occupied vs. empty + linecard slots in a chassis)."; + } + + leaf parent { + type leafref { + path "../../config/name"; + } + description + "Reference to the name of the parent component. Note that + this reference must be kept synchronized with the + corresponding subcomponent reference from the parent + component."; + } + } + + grouping platform-component-temp-alarm-state { + description + "Temperature alarm data for platform components"; + + // TODO(aashaikh): consider if these leaves could be in a + // reusable grouping (not temperature-specific); threshold + // may always need to be units specific. + + leaf alarm-status { + type boolean; + description + "A value of true indicates the alarm has been raised or + asserted. The value should be false when the alarm is + cleared."; + } + + leaf alarm-threshold { + type uint32; + description + "The threshold value that was crossed for this alarm."; + } + + leaf alarm-severity { + type identityref { + base oc-alarm-types:OPENCONFIG_ALARM_SEVERITY; + } + description + "The severity of the current alarm."; + } + } + + grouping platform-component-power-state { + description + "Power-related operational state for device components."; + + leaf allocated-power { + type uint32; + units watts; + description + "Power allocated by the system for the component."; + } + + leaf used-power { + type uint32; + units watts; + description + "Actual power used by the component."; + } + + leaf boot-loader-software-version { + type string; + description + "For the software started in the next boot. This leaf is defined by Tencent"; + } + + } + + grouping platform-component-temp-state { + description + "Temperature state data for device components"; + + container temperature { + description + "Temperature in degrees Celsius of the component. Values include + the instantaneous, average, minimum, and maximum statistics. If + avg/min/max statistics are not supported, the target is expected + to just supply the instant value"; + + uses oc-platform-types:avg-min-max-instant-stats-precision1-celsius; + uses platform-component-temp-alarm-state; + } + } + + grouping platform-component-memory-state { + description + "Per-component memory statistics"; + + container memory { + description + "For components that have associated memory, these values + report information about available and utilized memory."; + + leaf available { + type uint64; + units bytes; + description + "The available memory physically installed, or logically + allocated to the component."; + } + + // TODO(aashaikh): consider if this needs to be a + // min/max/avg statistic + leaf utilized { + type uint64; + units bytes; + description + "The memory currently in use by processes running on + the component, not considering reserved memory that is + not available for use."; + } + } + } + + grouping platform-anchors-top { + description + "This grouping is used to add containers for components that + are common across systems, but do not have a defined schema + within the openconfig-platform module. Containers should be + added to this grouping for components that are expected to + exist in multiple systems, with corresponding modules + augmenting the config/state containers directly."; + + container chassis { + description + "Data for chassis components"; + + container config { + description + "Configuration data for chassis components"; + } + + container state { + config false; + description + "Operational state data for chassis components"; + } + } + +// TODO(aashaikh): linecard container is already defined in +// openconfig-platform-linecard; will move to this module +// in future. + /* + container linecard { + description + "Data for linecard components"; + + container config { + description + "Configuration data for linecard components"; + } + + container state { + config false; + description + "Operational state data for linecard components"; + } + } + */ + + container port { + description + "Data for physical port components"; + + container config { + description + "Configuration data for physical port components"; + } + + container state { + config false; + description + "Operational state data for physical port components"; + } + } + +// TODO(aashaikh): transceiver container is already defined in +// openconfig-platform-transceiver; will move to this module +// in future. + /* + container transceiver { + description + "Data for transceiver components"; + + container config { + description + "Configuration data for transceiver components"; + } + + container state { + config false; + description + "Operational state data for transceiver components"; + } + } + */ + + container power-supply { + description + "Data for power supply components"; + + container config { + description + "Configuration data for power supply components"; + } + + container state { + config false; + description + "Operational state data for power supply components"; + } + } + + container fan { + description + "Data for fan components"; + + container config { + description + "Configuration data for fan components"; + } + + container state { + config false; + description + "Operational state data for fan components"; + } + } + + container fabric { + description + "Data for fabric components"; + + container config { + description + "Configuration data for fabric components"; + } + + container state { + config false; + description + "Operational state data for fabric components"; + } + } + + container storage { + description + "Data for storage components"; + + container config { + description + "Configuration data for storage components"; + } + + container state { + config false; + description + "Operational state data for storage components"; + } + } + + container cpu { + description + "Data for cpu components"; + + container config { + description + "Configuration data for cpu components"; + } + + container state { + config false; + description + "Operational state data for cpu components"; + } + } + + container integrated-circuit { + description + "Data for chip components, such as ASIC, NPUs, etc."; + + container config { + description + "Configuration data for chip components"; + } + + container state { + config false; + description + "Operational state data for chip components"; + } + } + + container backplane { + description + "Data for backplane components"; + + container config { + description + "Configuration data for backplane components"; + } + + container state { + config false; + description + "Operational state data for backplane components"; + } + } + } + + grouping platform-component-top { + description + "Top-level grouping for components in the device inventory"; + + container components { + description + "Enclosing container for the components in the system."; + + list component { + key "name"; + description + "List of components, keyed by component name."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "References the component name"; + } + + container config { + description + "Configuration data for each component"; + + uses platform-component-config; + } + + container state { + + config false; + + description + "Operational state data for each component"; + + uses platform-component-config; + uses platform-component-state; + uses platform-component-temp-state; + uses platform-component-memory-state; + uses platform-component-power-state; + } + + uses platform-component-properties-top; + uses platform-subcomponent-ref-top; + uses platform-anchors-top; + } + } + } + + + // data definition statements + + uses platform-component-top; + + + // augments + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-policy-forwarding@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-policy-forwarding@2018-11-21.yang new file mode 100644 index 0000000..e759724 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-policy-forwarding@2018-11-21.yang @@ -0,0 +1,129 @@ +module openconfig-policy-forwarding { + yang-version "1"; + + namespace "http://openconfig.net/yang/policy-forwarding"; + + prefix "oc-pf"; + + import openconfig-extensions { prefix "oc-ext"; } + + // Include submodules. + include openconfig-pf-forwarding-policies; + include openconfig-pf-path-groups; + include openconfig-pf-interfaces; + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + relating to policy-based forwarding. Policy-based forwarding is + utilised when a system chooses how to forward packets (including + applying data-plane operations such as encapsulation or + decapsulation) based on policies other than destination L2 or L3 + header. Typically, systems may implement: + + - IP policy-based routing, where routing may be done based on the + source plus destination of an IP packet; information within the + L4 header; or some combination of both. + - Encapsulation or decapsulation based on certain policy + information - for example, matching particular IP destinations + and decapsulating GRE headers. + - Class-based selection of egress routes - such as class-based + selection of an egress MPLS path. + + The policies that are defined in this model are applied to a + particular ingress context of a network element (e.g., interface) + and are defined to apply following other interface policy such as + QoS classification and access control lists. + + This module defines: + + - policy-forwarding + | + |--- policies + | |-- policy + | |-- [match criteria] How packets are defined to + | | match policy. + | |-- [forwarding-action] How packets matching should + | be forwarded. + |--- interfaces + | |-- interfaces + | | -- apply-forwarding-policy Forwarding policy to + | used on the interface. + |--- path-selection-groups + |-- path-selection-group A group of forwarding resources + that are grouped for purposes + of next-hop selection. + + A forwarding-policy specifies the match criteria that it intends + to use to determine the packets that it reroutes - this may + consist of a number of criteria, such as DSCP. The action of the + policy results in a forwarding action being applied to matching + packets. For example, decapsulating the packet from a GRE header. + In order to enact the policy based on particular interfaces - the + forwarding-policy is applied to an interface via referencing it + within an 'apply-forwarding-policy' statement associated with an + interface. + + In some cases (e.g., Class-Based Tunnel Selection) the forwarding + action does not resolve to a single egress action, and rather + normal forwarding rules are to be applied but considering a subset + of forwarding resources. In these cases, a path-selection-group + can be created, referencing the subset of forwarding paths that + should be used for the egress selection. In the case that a subset + of MPLS LSPs are eligible for, say, DSCP 46 marked packets, a + path-selection-group is created, referencing the subset of LSPs. + The forwarding action of the corresponding policy is set to + PATH_GROUP and references the configured group of LSPs."; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2017-06-21" { + description + "Amend policy forwarding model based on ACL changes."; + reference "0.2.0"; + } + + revision "2017-02-28" { + description + "Initial public release of policy forwarding."; + reference "0.1.0"; + } + + revision "2016-11-08" { + description + "Initial revision."; + reference "0.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping policy-forwarding-top { + description + "Top-level grouping for Policy Forwarding"; + + container policy-forwarding { + description + "Configuration and operational state relating to policy-forwarding within + a network instance."; + + uses pf-forwarding-policy-structural; + uses pf-interfaces-structural; + uses pf-path-groups-structural; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-policy-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-policy-types@2018-11-21.yang new file mode 100644 index 0000000..46efef7 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-policy-types@2018-11-21.yang @@ -0,0 +1,231 @@ +module openconfig-policy-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/policy-types"; + + prefix "oc-pol-types"; + + // import some basic types + import ietf-yang-types { prefix yang; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module contains general data definitions for use in routing + policy. It can be imported by modules that contain protocol- + specific policy conditions and actions."; + + oc-ext:openconfig-version "3.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.1.1"; + } + + revision "2018-06-05" { + description + "Add PIM, IGMP to INSTALL_PROTOCOL_TYPES identity"; + reference "3.1.0"; + } + + revision "2017-07-14" { + description + "Replace policy choice node/type with policy-result + enumeration;simplified defined set naming;removed generic + IGP actions; migrate to OpenConfig types; added mode for + prefix sets"; + reference "3.0.0"; + } + + revision "2016-05-12" { + description + "OpenConfig public release"; + reference "2.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity ATTRIBUTE_COMPARISON { + description + "base type for supported comparison operators on route + attributes"; + } + + identity ATTRIBUTE_EQ { + base ATTRIBUTE_COMPARISON; + description "== comparison"; + } + + identity ATTRIBUTE_GE { + base ATTRIBUTE_COMPARISON; + description ">= comparison"; + } + + identity ATTRIBUTE_LE { + base ATTRIBUTE_COMPARISON; + description "<= comparison"; + } + + typedef match-set-options-type { + type enumeration { + enum ANY { + description "match is true if given value matches any member + of the defined set"; + } + enum ALL { + description "match is true if given value matches all + members of the defined set"; + } + enum INVERT { + description "match is true if given value does not match any + member of the defined set"; + } + } + default ANY; + description + "Options that govern the behavior of a match statement. The + default behavior is ANY, i.e., the given value matches any + of the members of the defined set"; + } + + typedef match-set-options-restricted-type { + type enumeration { + enum ANY { + description "match is true if given value matches any member + of the defined set"; + } + enum INVERT { + description "match is true if given value does not match any + member of the defined set"; + } + } + default ANY; + description + "Options that govern the behavior of a match statement. The + default behavior is ANY, i.e., the given value matches any + of the members of the defined set. Note this type is a + restricted version of the match-set-options-type."; + //TODO: restriction on enumerated types is only allowed in + //YANG 1.1. Until then, we will require this additional type + } + + grouping attribute-compare-operators { + description "common definitions for comparison operations in + condition statements"; + + leaf operator { + type identityref { + base ATTRIBUTE_COMPARISON; + } + description + "type of comparison to be performed"; + } + + leaf value { + type uint32; + description + "value to compare with the community count"; + } + } + + typedef tag-type { + type union { + type uint32; + type yang:hex-string; + } + description "type for expressing route tags on a local system, + including IS-IS and OSPF; may be expressed as either decimal or + hexidecimal integer"; + reference + "RFC 2178 OSPF Version 2 + RFC 5130 A Policy Control Mechanism in IS-IS Using + Administrative Tags"; + } + + identity INSTALL_PROTOCOL_TYPE { + description + "Base type for routing protocols, including those which may + install prefixes into the RIB"; + } + + identity BGP { + base INSTALL_PROTOCOL_TYPE; + description + "BGP"; + reference + "RFC 4271"; + } + + identity ISIS { + base INSTALL_PROTOCOL_TYPE; + description + "IS-IS"; + reference + "ISO/IEC 10589"; + } + + identity OSPF { + base INSTALL_PROTOCOL_TYPE; + description + "OSPFv2"; + reference + "RFC 2328"; + } + + identity OSPF3 { + base INSTALL_PROTOCOL_TYPE; + description + "OSPFv3"; + reference + "RFC 5340"; + } + + identity STATIC { + base INSTALL_PROTOCOL_TYPE; + description + "Locally-installed static route"; + } + + identity DIRECTLY_CONNECTED { + base INSTALL_PROTOCOL_TYPE; + description + "A directly connected route"; + } + + identity LOCAL_AGGREGATE { + base INSTALL_PROTOCOL_TYPE; + description + "Locally defined aggregate route"; + } + + identity PIM { + base INSTALL_PROTOCOL_TYPE; + description + "Protocol Independent Multicast"; + reference + "RFC 7761"; + } + + identity IGMP { + base INSTALL_PROTOCOL_TYPE; + description + "Internet Group Management Protocol"; + reference + "RFC 3376"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-procmon@2019-03-15.yang b/exp/yangcli/h3c-yang/openconfig-procmon@2019-03-15.yang new file mode 100644 index 0000000..10c0551 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-procmon@2019-03-15.yang @@ -0,0 +1,180 @@ +module openconfig-procmon { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/system/procmon"; + + prefix "oc-proc"; + + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-types { prefix oc-types; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module provides data definitions for process health + monitoring of one or more processes running on the system."; + + oc-ext:openconfig-version "0.4.0"; + + revision "2019-03-15" { + description + "Update process start time to be an absolute timestamp, + ensure that the units for CPU time are expressed correctly. + Update cpu-usage leaves to commonly use counter64 for consumed + CPU time."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + grouping procmon-processes-top { + description + "Top level grouping for attributes for processes."; + + container processes { + description + "Parameters related to all monitored processes"; + + list process { + key "pid"; + config false; + description + "List of monitored processes"; + + leaf pid { + type leafref { + path "../state/pid"; + } + description + "Reference to the process pid key"; + } + + container state { + config false; + description + "State parameters related to monitored processes"; + + uses procmon-process-attributes-state; + } + } + } + } + + grouping procmon-process-attributes-state { + description + "Attributes state definitions for a process"; + + leaf pid { + type uint64; + description + "The process pid"; + } + + leaf name { + type string; + description + "The process name"; + } + + leaf-list args { + type string; + description + "Current process command line arguments. Arguments with + a parameter (e.g., --option 10 or -option=10) should be + represented as a single element of the list with the + argument name and parameter together. Flag arguments, i.e., + those without a parameter should also be in their own list + element."; + } + + leaf start-time { + type oc-types:timeticks64; + description + "The time at which this process started, + relative to the UNIX epoch. The system must be + synchronized such that the start-time can be + reported accurately, otherwise it should not be reported."; + } + + leaf cpu-usage-user { + type oc-yang:counter64; + units "nanoseconds"; + description + "CPU time consumed by this process in user mode in + nanoseconds."; + } + + leaf cpu-usage-system { + type oc-yang:counter64; + units "nanoseconds"; + description + "CPU time consumed by this process in kernel mode."; + } + + leaf cpu-utilization { + type oc-types:percentage; + description + "The percentage of CPU that is being used by the process."; + } + + leaf memory-usage { + type uint64; + units "bytes"; + description + "Bytes allocated and still in use by the process"; + } + + leaf memory-utilization { + type oc-types:percentage; + description + "The percentage of RAM that is being used by the process."; + } + } + + // augment statements + + // rpc statements + + // notification statements +} diff --git a/exp/yangcli/h3c-yang/openconfig-qos-elements@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-qos-elements@2019-11-28.yang new file mode 100644 index 0000000..85a7c62 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-qos-elements@2019-11-28.yang @@ -0,0 +1,1318 @@ +submodule openconfig-qos-elements { + + belongs-to openconfig-qos { + prefix "oc-qos"; + } + + import openconfig-extensions { prefix oc-ext; } + import openconfig-qos-types { prefix oc-qos-types; } + import openconfig-packet-match { prefix oc-pkt-match; } + import openconfig-platform { prefix oc-platform; } + import openconfig-types { prefix oc-types; } + + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This submodule defines configuration and operational state + data associated with QoS elements. The primary elements of + the model include: + classifiers: match packets with a specific characteristic + forwarding groups: logical class of packets that receive + common forwarding treatment + queues: collection of packets to be scheduled, including + a queue management scheme + schedulers: sequence of one more elements that schedule + packets for transmission, including policer and shaper + functions"; + + oc-ext:openconfig-version "0.2.3"; + + revision "2019-11-28" { + description + "Fix xpaths in when statements"; + reference "0.2.3"; + } + + revision "2019-08-20" { + description + "Fix typo in classifiers container name"; + reference "0.2.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2016-12-16" { + description + "Fix incorrect interface-ref placement"; + reference "0.2.0"; + } + + revision "2016-06-03" { + description + "Initial revision"; + reference "0.1.0"; + } + + grouping qos-classifier-term-config { + description + "Configuration data for list of match criteria in a QoS + classifier"; + + leaf id { + type string; + description + "Identifier for the match term"; + } + } + + grouping qos-classifier-term-state { + description + "Operational state data for list of match criteria in a QoS + classifier"; + } + + grouping qos-classifier-term-action-config { + description + "Configuration parameters for actions for a classifier term."; + + leaf target-group { + type leafref { + // Current location: + // /qos/classifiers/classifier/terms/term/actions/config/target-group + path "../../../../../../../forwarding-groups/forwarding-group/" + + "config/name"; + } + description + "References the forwarding group or class to which the + matched packets should be assigned"; + } + } + + grouping qos-classifier-terms-top { + description + "Top-level grouping for list of match criteria in a QoS + classifier"; + + container terms { + description + "Enclosing container for ths list of terms"; + + list term { + key "id"; + description + "List of match terms used in the classifier"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to id list key."; + } + + container config { + description + "Configuration data for list of match criteria in a QoS + classifier"; + + uses qos-classifier-term-config; + } + + container state { + config false; + description + "Operational state data for list of match criteria in a + QoS classifier"; + + uses qos-classifier-term-config; + uses qos-classifier-term-state; + } + + container conditions { + description + "Conditions for the classifier term. Packets must match all of + the criteria specified within the match condition to be considered + matching the term."; + + // TODO(robjs): Consider whether we should have classifiers + // that can match >1 different value of a field, or whether + // this should require different match terms within the + // classifier. + uses oc-pkt-match:ethernet-header-top; + uses oc-pkt-match:ipv4-protocol-fields-top; + uses oc-pkt-match:ipv6-protocol-fields-top; + uses oc-pkt-match:transport-fields-top; + uses oc-pkt-match:mpls-header-top; + } + + container actions { + description + "Actions to be applied for packets matching the specified + classification rules."; + + container config { + description + "Actions to be applied to packets that match the classifier + term."; + + uses qos-classifier-term-action-config; + } + + container state { + config false; + description + "Operational state parameters associated with classifier term + actions"; + + uses qos-classifier-term-action-config; + } + + container remark { + description + "Remark actions to be associated with packets that match the + classifier term. Where a packet matches these criteria, the + specified rewrite actions should be performed."; + + uses qos-common-remark-actions; + } + } + } + } + } + + grouping qos-classifier-config { + description + "Configuration data for classifiers"; + + leaf name { + type string; + description + "User-assigned name of the classifier"; + } + + leaf type { + type enumeration { + enum IPV4 { + description + "Classifier matches and operates + on packets with IPv4 headers."; + } + enum IPV6 { + description + "Classifier matches and operates + on packets with IPv6 headers."; + } + enum MPLS { + description + "Classifier matches and operates + on packets with MPLS headers."; + } + enum ETHERNET { + description + "Classifier matches and operates + on fields within the L2 ETHERNET + headers."; + } + } + description + "Type of classifier."; + } + } + + grouping qos-classifier-state { + description + "Operational state data for classifiers"; + + } + + grouping qos-classifier-top { + description + "Top-level grouping for classifier data"; + + container classifiers { + description + "Enclosing container for QoS classifiers"; + + list classifier { + key "name"; + description + "List of classifier elements"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to list key name"; + } + + container config { + description + "Configuration data for classifers"; + + uses qos-classifier-config; + } + + container state { + config false; + description + "Operational state data for classifiers"; + + uses qos-classifier-config; + uses qos-classifier-state; + } + + uses qos-classifier-terms-top; + } + } + } + + grouping qos-fabric-trace-config { + description + "Configuration data for fabric trace data"; + + leaf source { + type leafref { + path "/oc-platform:components/oc-platform:component" + + "/oc-platform:config/oc-platform:name"; + } + description + "Source component for fabric trace data"; + } + + leaf dest { + type leafref { + path "/oc-platform:components/oc-platform:component" + + "/oc-platform:config/oc-platform:name"; + } + description + "Destination component for fabric trace data"; + } + } + + grouping qos-forwarding-group-config { + description + "Configuration data for forwarding groups"; + + leaf name { + type string; + description + "Name of the forwarding group"; + } + + // TODO(robjs, Simon G): Discuss optionally moving + // this to a high/low priority indicator, if this + // is common across implementations. + leaf fabric-priority { + type uint8; + description + "Set the priority for the forwarding group for + local transmission through the device, e.g., + across a switching fabric. Higher priorities + are considered to be better, such that traffic + with fabric priority 128 is considered to be + higher priority than that with fabric priority + 0."; + } + + leaf output-queue { + type leafref { + path "../../../../queues/queue/config/name"; + } + description + "Queue for packets in this forwarding group."; + } + } + + grouping qos-forwarding-group-state { + description + "Operational state data for forwarding groups"; + } + + grouping qos-forwarding-group-top { + description + "Top-level grouping for forwarding group data"; + + container forwarding-groups { + description + "Enclosing container for list of forwarding groups"; + + list forwarding-group { + key "name"; + description + "List of forwarding groups. Forwarding groups are + logical groups of traffic that will receive common + forwarding treatment."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to name list key"; + } + + container config { + description + "Configuration data for forwarding groups"; + + uses qos-forwarding-group-config; + } + + container state { + config false; + description + "Operational state data for forwarding groups"; + + uses qos-forwarding-group-config; + uses qos-forwarding-group-state; + } + } + } + } + + grouping qos-queue-red-common-config { + description + "Common configuration parameters applicable to RED and + its variants"; + + leaf enable-ecn { + type boolean; + default false; + description + "When set to true, the device should mark packets that are + ECN-capable rather than dropping them. The receiver is + expected to echo the congestion signal back to the sender + so that it may adjust its transmission rate accordingly. + When this leaf is false, the device drops packets according + to the RED/WRED probability, or all packets if the + average queue length is above the max threshold."; + } + } + + grouping qos-queue-red-common-state { + description + "Common operational state data applicable to RED and + its variants"; + + } + + grouping qos-queue-wred-config { + description + "Configuration data for WRED-managed queues"; + + // TODO(robjs, aashaikh): Add configuration for weighted RED + // within this grouping. + } + + grouping qos-queue-wred-state { + description + "Operational state data for WRED-managed queues"; + } + + grouping qos-queue-wred-top { + description + "Top-level grouping for WRED-managed queues"; + + container wred { + description + "Top-level container for WRED data"; + + container config { + description + "Configuration data for WRED"; + + uses qos-queue-wred-config; + } + + container state { + config false; + description + "Operational state data for WRED"; + + uses qos-queue-wred-config; + uses qos-queue-wred-state; + } + } + } + + grouping qos-queue-red-config { + description + "Configuration data for queues managed with RED"; + + leaf minth { + type uint64; + units bytes; + description + "The mininum threshold parameter for a RED-managed queue. + When the average queue length is less than minth, all + packets are admitted to the queue."; + } + + leaf maxth { + type uint64; + units bytes; + description + "The maximum threshold parameter for a RED-managed queue. + When the average queue length exceeds the maxth value, all + packets are dropped (or marked if ECN is enabled)."; + } + } + + grouping qos-queue-red-state { + description + "Operational state data for queues managed with RED"; + } + + grouping qos-queue-red-top { + description + "Top-level grouping for RED queues"; + + container red { + description + "Top-level container for data related to RED-managed + queues"; + + container config { + description + "Configuration data for RED queues"; + + uses qos-queue-red-config; + } + + container state { + config false; + description + "Operational state data for RED queues"; + + uses qos-queue-red-config; + uses qos-queue-red-state; + } + } + } + + + grouping qos-queue-config { + description + "Configuration data for QoS egress queues"; + + leaf name { + type string; + description + "User-defined name of the queue"; + } + + leaf queue-type { + type identityref { + base oc-qos-types:QOS_QUEUE_TYPE; + } + description + "Sets the type of the queue"; + } + } + + grouping qos-queue-state { + description + "Operational state data for egress queues"; + } + + grouping qos-queue-top { + description + "Top-level grouping for queue elements"; + + container queues { + description + "Enclosing container for the list of queues"; + + list queue { + key "name"; + description + "List of defined queues"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the queue name list key."; + } + + container config { + description + "Configuration data for queues"; + + uses qos-queue-config; + } + + container state { + config false; + description + "Operational state data for queues"; + + uses qos-queue-config; + uses qos-queue-state; + } + + uses qos-queue-red-top { + when "./config/queue-type = 'oc-qos-types:RED'" { + description + "RED configuration is valid when the queue-type + is set accordingly."; + } + } + uses qos-queue-wred-top { + when "./config/queue-type = 'oc-qos-types:WRED'" { + description + "WRED configuration is valid when the queue-type + is set accordingly."; + } + } + } + } + } + + grouping qos-scheduler-output-config { + description + "Configuration data for scheduler output operations"; + + leaf output-type { + type enumeration { + enum SCHEDULER { + description + "Scheduler output is a child scheduler, e.g. to + implement hierarchical schedulers."; + } + enum FWD_GROUP { + description + "Scheduler output is a forwarding group, e.g., when + performing ingress scheduling before packets traverse + a fabric to be processed by an egress forwarding + complex."; + } + enum INTERFACE { + description + "Scheduler output is an interface for forwarding."; + } + } + description + "Describes the type of output sink for the scheduler."; + } + + leaf child-scheduler { + // TODO: consider whether both child (output) and parent + // (input) references are needed; consider whether child + // reference should separate in-profile and out-of-profile + type leafref { + // current loc: + // /qos/scheduler-policies/scheduler-policy/schedulers/scheduler/ + // output/config/child-scheduler + path "../../../../../../../scheduler-policies/scheduler-policy/" + + "config/name"; + } + when "../output-type = 'SCHEDULER'" { + description + "The child-scheduler leaf is valid only when + the output type of the scheduler is a child scheduler"; + } + description + "When the scheduler output type is a child scheduler, + this leaf provides a reference to the downstream + scheduler."; + } + + leaf output-fwd-group { + type leafref { + path "../../../../../../../forwarding-groups/forwarding-group" + + "/config/name"; + } + when "../output-type = 'FWD_GROUP'" { + description + "The output-fwd-group leaf is valid only when + the output type of the scheduler is a forwarding group"; + } + description + "When the scheduler output type is a forwarding group, + this leaf provides a reference to the forwarding group."; + } + } + + grouping qos-scheduler-output-state { + description + "Operational state data for scheduler output"; + } + + grouping qos-scheduler-output-top { + description + "Top-level grouping for data related to scheduler output"; + + container output { + description + "Top-level container for scheduler output data"; + + container config { + description + "Configuration data for scheduler output"; + + uses qos-scheduler-output-config; + } + + container state { + config false; + description + "Operational state data for scheduler output"; + + uses qos-scheduler-output-config; + uses qos-scheduler-output-state; + } + } + } + + grouping qos-scheduler-inputs-config { + description + "Configuration data for scheduler input sources"; + + leaf id { + type string; + description + "User-defined identifier for the scheduler input"; + } + + leaf input-type { + type enumeration { + enum QUEUE { + description + "Input is a defined queue."; + } + enum IN_PROFILE { + description + "Input is in-profile traffic from a parent scheduler/ + shaper"; + } + enum OUT_PROFILE { + description + "Input is out-of-profile traffic from a parent + scheduler/shaper"; + } + } + description + "Describes the type of input source for the scheduler"; + } + + leaf queue { + type leafref { + // current loc: /qos/scheduler-policies/scheduler-policy/schedulers/ + // scheduler/inputs/input/config/queue + path "../../../../../../../../queues/queue/name"; + } + when "../input-type = 'QUEUE'" { + description + "The queue leaf is valid only when + the input type of the scheduler is a queue"; + } + description + "Reference to a queue that is an input source for the + scheduler"; + } + + leaf weight { + type uint64; + description + "For priority schedulers, this indicates the priority of + the corresponding input. Higher values indicate higher + priority. For weighted round-robin schedulers, this leaf + indicates the weight of the corresponding input."; + } + } + + grouping qos-scheduler-inputs-state { + description + "Operational state data for scheduler input sources"; + } + + grouping qos-scheduler-inputs-top { + description + "Top-level grouping for defining inputs to a scheduler."; + + container inputs { + description + "Enclosing container "; + + list input { + key "id"; + description + "List of input sources for the scheduler."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to list key"; + } + + container config { + description + "Configuration data for scheduler input sources"; + + uses qos-scheduler-inputs-config; + } + + container state { + config false; + description + "Operational state data for scheduler input sources"; + + uses qos-scheduler-inputs-config; + uses qos-scheduler-inputs-state; + } + } + } + } + + grouping qos-scheduler-1r2c-config { + description + "Configuration data for 1 rate, 2 color scheduler."; + + leaf cir { + type uint64; + units bps; + description + "Committed information rate for the single-rate token + bucket scheduler. This value represents the rate at which + tokens are added to the bucket."; + } + + leaf cir-pct { + type oc-types:percentage; + description + "Committed information rate for the single-rate token + bucket scheduler. This value represents the rate at which + tokens are added to the bucket. It is expressed as a + percentage of the total bandwidth allocated to the + context in which the scheduler is referenced."; + } + + leaf cir-pct-remaining { + type oc-types:percentage; + description + "Committed information rate for the single-rate token + bucket scheduler. This value represents the rate at which + tokens are added to the bucket. It is expressed as a + percentage of the unallocated bandwidth available in the + context in which the scheduled is referenced."; + } + + leaf bc { + type uint32; + units bytes; + description + "Committed burst size for the single-rate token bucket + scheduler. This value represents the depth of the token + bucket."; + } + + leaf queuing-behavior { + type oc-qos-types:queue-behavior; + description + "The type of scheduler that is being configured."; + } + + // TODO(robjs): Add when statements to these parameters when the + // types of scheduler are agreed through review. + leaf max-queue-depth-bytes { + type uint32; + units bytes; + description + "When the scheduler is specified to be a shaper - the + maximum depth of the queue in bytes is the value + specified by this leaf."; + } + + leaf max-queue-depth-packets { + type uint32; + units packets; + description + "When the scheduler is specified to be a shaper - the + maximum depth of the queue in packets is the value + specified by this leaf."; + } + + leaf max-queue-depth-percent { + type oc-types:percentage; + description + "The queue depth specified as a percentage of the total + available buffer that is avaialble."; + } + } + + grouping qos-scheduler-1r2c-top { + description + "Top-level grouping for 1 rate, 2 color shapers"; + + container one-rate-two-color { + description + "Top-level container for data related to a 1 rate, 2 color + shaper."; + + container config { + description + "Configuration data for 1 rate, 2 color shapers"; + + uses qos-scheduler-1r2c-config; + } + + container state { + config false; + description + "Operational state data for 1 rate, 2 color shapers"; + + uses qos-scheduler-1r2c-config; + } + + container conform-action { + description + "Action to be applied to packets that are scheduled within the + CIR of the one-rate, two-colour scheduler. Packets that receive + a token from the in-CIR bucket are said to be conforming and + have all of the specified actions applied."; + + container config { + description + "Configuration parameters relating to conforming packets for the + 1r2c scheduler."; + + uses qos-common-remark-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to conforming packets + for the 1r2c scheduler."; + + uses qos-common-remark-actions-config; + } + } + + container exceed-action { + description + "Action to be applied to packets that are scheduled above the CIR + of the one-rate, two-colour shaper. Packets that do not receive a + token from the in-CIR bucket are said to be exceeding, and have + all of the specified actions applied."; + + container config { + description + "Configuration parameters relating to exceeding packets for + the 1r2c scheduler."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to exceeding + packets for the 1r2c scheduler."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + } + } + } + + grouping qos-scheduler-2r3c-config { + description + "Configuration data for 2 rate, 3 color policer"; + + leaf cir { + type uint64; + units bps; + description + "Committed information rate for the dual-rate token + bucket policer. This value represents the rate at which + tokens are added to the primary bucket."; + } + + leaf cir-pct { + type oc-types:percentage; + description + "Committed information rate for the dual-rate token bucket + policer. This value represents the rate at which tokens + are added to the primary bucket. It is expressed as a + percentage of the total bandwidth available within the + context the scheduler is instantiated."; + } + + leaf cir-pct-remaining { + type oc-types:percentage; + description + "Committed information rate for the dual-rate token + bucket policer. This value represents the rate at which + tokens are added to the primary bucket. It is expressed + as a percentage of the remaining bandwidth within the + context the scheduler is instantiated."; + } + + leaf pir { + type uint64; + units bps; + description + "Peak information rate for the dual-rate token bucket + policer. This value represents the rate at which tokens + are added to the secondary bucket."; + } + + leaf pir-pct { + type oc-types:percentage; + description + "Peak information rate for the dual-rate token bucket + policer. This value represents the rate at which tokens + are added to the secondary bucket. The value is expressed + as a percentage of the total bandwidth available in the + context in which the scheduler is instantiated."; + } + + leaf pir-pct-remaining { + type oc-types:percentage; + description + "Peak information rate for the dual-rate token + bucket policer. This value represents the rate at which + tokens are added to the secondary bucket. It is expressed + as a percentage of the remaining bandwidth within the + context the scheduler is instantiated."; + } + + leaf bc { + type uint32; + units bytes; + description + "Committed burst size for the dual-rate token bucket + policer. This value represents the depth of the token + bucket."; + } + + leaf be { + type uint32; + units bytes; + description + "Excess burst size for the dual-rate token bucket policer. + This value represents the depth of the secondary bucket."; + } + } + + grouping qos-scheduler-2r3c-top { + description + "Top-level grouping for 2 rate, 3 color policers.."; + + container two-rate-three-color { + description + "Top-level container for data for a 2 rate, 3 color policer."; + + container config { + description + "Configuration data for 2 rate, 3 color policers."; + + uses qos-scheduler-2r3c-config; + } + + container state { + config false; + description + "Operational state data for 2 rate, 3 color policers."; + + uses qos-scheduler-2r3c-config; + } + + container conform-action { + description + "Action to be applied to the packets that are scheduled + within the CIR of the policer. All packets that receive + a token from this bucket have all actions specified + applied to them"; + + container config { + description + "Configuration parameters for the conform action of a + 2r3c policer."; + uses qos-common-remark-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to the conform + action of a 2r3c policer."; + uses qos-common-remark-actions-config; + } + } + + container exceed-action { + description + "Action to be applied to the packets that are scheduled + within the PIR of the policer. Packets that receive a + token from within the PIR allocation have all the + specified actions applied to them"; + + container config { + description + "Configuration parameters relating to the action + applied to exceeding packets."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to the action + applied to exceeding packets."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + } + + container violate-action { + description + "Action to be applied to the packets that are scheduled + above the PIR of the policer. Packets that do not receive + a token from either bucket have all specified actions + applied to them."; + + container config { + description + "Configuration parameters relating to the action + applied to violating packets."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to the action + applied to violating packets."; + + uses qos-common-remark-actions-config; + uses qos-common-scheduler-actions-config; + } + } + } + } + + grouping qos-scheduler-config { + description + "Configuration data for QoS schedulers"; + + leaf sequence { + type uint32; + description + "Sequence number for the scheduler within the scheduler + policy. Schedulers are processed from lowest sequence + to highest."; + } + + leaf type { + type identityref { + base oc-qos-types:QOS_SCHEDULER_TYPE; + } + description + "Sets the type of scheduler, i.e. the scheduling algorithm + used to serve inputs."; + } + + leaf priority { + type enumeration { + enum STRICT { + description + "This scheduler term is considered as a strict priority + term - such that packets that arrive in the queue are + immediately serviced."; + } + } + description + "Priority of the scheduler within the scheduler policy."; + } + } + + grouping qos-scheduler-state { + description + "Operational state data for QoS schedulers"; + } + + grouping qos-scheduler-policy-config { + description + "Configuration parameters relating to a scheduler policy"; + + leaf name { + type string; + description + "Name for the scheduler policy."; + } + } + + grouping qos-scheduler-top { + description + "Top-level grouping for the set of defined QoS schedulers"; + + container scheduler-policies { + description + "Enclosing container for the list of configured scheduler policies."; + + list scheduler-policy { + key "name"; + + description + "List of scheduler policies. A scheduler policy is a set of schedulers + that are to be applied together. Each scheduler within a scheduler + policy takes an input, and outputs it according to a scheduling + discipline that is specified within it. The schedulers consume + resources according to the specification that is provided - which + may be absolute resource limits, or relative."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name of the scheduler policy"; + } + + container config { + description + "Configuration parameters relating to a scheduler policy."; + uses qos-scheduler-policy-config; + } + + container state { + config false; + description + "Operational state parameters relating to a scheduler policy."; + uses qos-scheduler-policy-config; + } + + container schedulers { + description + "Schedulers within the scheduler policy."; + + list scheduler { + key "sequence"; + description + "List of defined QoS traffic schedulers."; + + leaf sequence { + type leafref { + path "../config/sequence"; + } + description + "Reference to the list key"; + } + + container config { + description + "Configuration data for QoS schedulers"; + + uses qos-scheduler-config; + } + + container state { + config false; + + description + "Operational state data for QoS schedulers"; + + uses qos-scheduler-config; + uses qos-scheduler-state; + } + + uses qos-scheduler-inputs-top; + uses qos-scheduler-output-top; + uses qos-scheduler-1r2c-top; + uses qos-scheduler-2r3c-top; + } + } + } + } + } + + grouping qos-common-remark-actions { + description + "Common grouping specifying actions related to re-marking + packets"; + + container config { + description + "Configuration parameters relating to remarking packets."; + uses qos-common-remark-actions-config; + } + + container state { + config false; + description + "Operational state parameters relating to remarking packets."; + uses qos-common-remark-actions-config; + } + } + + grouping qos-common-scheduler-actions-config { + description + "Configuration data for common actions of a QoS scheduler."; + + leaf drop { + type boolean; + description + "If set to true, packets within this context are dropped."; + } + } + + grouping qos-common-remark-actions-config { + description + "Configuration data for QoS re-marking actions"; + + leaf set-dscp { + type uint8; + description + "Sets the 6-bit DSCP (differentiated services code point) + value in the IP packet header."; + reference + "RFC 2474 - Definition of the Differentiated Services Field + (DS Field) in the IPv4 and IPv6 Headers"; + } + + leaf set-dot1p { + type uint8; + description + "Sets the 3-bit class-of-service value in the + Ethernet packet header for 802.1Q VLAN-tagged packets, + also known as PCP (priority code point)."; + reference + "IEEE 802.1Q-2014 - IEEE Standard for Local and metropolitan + area networks--Bridges and Bridged Networks"; + } + + leaf set-mpls-tc { + type uint8; + description + "Sets the 3-bit traffic class value (also referred to as EXP + or CoS) in MPLS packets."; + reference + "RFC 3270 - Multi-Protocol Label Switching (MPLS) Support of + Differentiated Services"; + } + } +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-qos-interfaces@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-qos-interfaces@2019-11-28.yang new file mode 100644 index 0000000..afad233 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-qos-interfaces@2019-11-28.yang @@ -0,0 +1,678 @@ +submodule openconfig-qos-interfaces { + + belongs-to openconfig-qos { + prefix "oc-qos"; + } + + // import openconfig-qos-elements { prefix oc-qos; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-yang-types { prefix oc-yang; } + + include openconfig-qos-elements; + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This submodule defines data related to quality-of-service + configuration and operational state associated with + interfaces."; + + oc-ext:openconfig-version "0.2.3"; + + revision "2019-11-28" { + description + "Fix xpaths in when statements"; + reference "0.2.3"; + } + + revision "2019-08-20" { + description + "Fix typo in classifiers container name"; + reference "0.2.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2016-12-16" { + description + "Fix incorrect interface-ref placement"; + reference "0.2.0"; + } + + revision "2016-06-03" { + description + "Initial revision"; + reference "0.1.0"; + } + + grouping qos-interface-classifier-match-config { + description + "Configuration data for match terms in the classifier + associated with an interface"; + + leaf id { + type leafref { + // Current location: + // /qos/interfaces/interface/input/classifiers/classifier/ + // terms/term/config/id + path "../../../../../../../../../classifiers/" + + "classifier[name=current()/../../../../config/name]/" + + "terms/term/config/id"; + + } + description + "Reference to match terms in the classifier"; + } + } + + grouping qos-interface-classifier-match-state { + description + "Operational state data for match terms in the classifier + associated with an interface"; + + leaf matched-packets { + type oc-yang:counter64; + description + "Count of the number of packets matching this classifier + match term on the interface."; + } + + leaf matched-octets { + type oc-yang:counter64; + description + "Count of the number of octets (bytes) matching this + classifier match term on the interface."; + } + + } + + grouping qos-interface-classifier-match-top { + description + "Top-level grouping for match terms in the classifier + associated with an interface"; + + container terms { + description + "Enclosing container for the list of match terms in the + classifier"; + + list term { + key "id"; + description + "List of match terms in the classifier associated with the + interface"; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to match term id list key"; + } + + container config { + description + "Configuration data for match terms in the classifier + associated with an interface"; + + uses qos-interface-classifier-match-config; + } + + container state { + config false; + description + "Operational state data for match terms in the classifier + associated with an interface"; + + uses qos-interface-classifier-match-config; + uses qos-interface-classifier-match-state; + } + } + } + } + + grouping qos-interface-classifier-top { + description + "Top-level grouping for a QoS classifier associated with an + interface"; + + container classifiers { + description + "Classifiers to be applied to the interface."; + + list classifier { + key "type"; + + description + "A list of classifiers that should be applied to the interface"; + + leaf type { + type leafref { + path "../config/type"; + } + description + "Reference to the classifier name."; + } + + container config { + description + "Configuration parameters for the list of classifiers."; + uses qos-interface-classifiers-config; + } + + container state { + config false; + description + "Operational state parameters for the list of classifiers."; + uses qos-interface-classifiers-config; + } + + uses qos-interface-classifier-match-top; + } + } + } + + grouping qos-interface-classifiers-config { + description + "Configuration parameters for the list of classifiers"; + + leaf name { + type leafref { + // current loc: /qos/interfaces/interface/input/classifiers/ + // classifier/config/name + path "../../../../../../../classifiers/classifier/config/name"; + } + description + "Reference to the classifier to be applied to ingress traffic on + the interface"; + } + + leaf type { + type enumeration { + enum IPV4 { + description + "Classifier matches IPv4 packets."; + value 4; + } + enum IPV6 { + description + "Classifier matches IPv6 packets."; + value 6; + } + enum MPLS { + description + "Classifier matches MPLS packets."; + } + } + description + "Type of packets matched by the classifier."; + } + } + + grouping qos-interface-queue-config { + description + "Configuration data for the queue associated with the + interface"; + + leaf name { + // TODO(robjs): Previously we proposed that the queue name here is + // only a queue that has been configured. However, in some cases we + // may want to have queues that have not been configured exist. + //type leafref { + // path "../../../../../../queues/queue/config/name"; + //} + type string; + description + "Reference to the queue associated with this interface. + A queue may be explicitly configured, or implicitly created + by the system based on default queues that are instantiated + by a hardware component, or are assumed to be default on + the system."; + } + } + + grouping qos-interface-queue-state { + description + "Operational state data for the queue associated with the + interface"; + + leaf max-queue-len { + type oc-yang:counter64; + units bytes; + description + "Maximum observed queue length"; + } + + leaf avg-queue-len { + type oc-yang:counter64; + units bytes; + description + "Average observed queue length"; + + } + + leaf transmit-pkts { + type oc-yang:counter64; + description + "Number of packets transmitted by this queue"; + } + + leaf transmit-octets { + type oc-yang:counter64; + description + "Number of octets trasmitted by this queue"; + } + + leaf dropped-pkts { + type oc-yang:counter64; + description + "Number of packets dropped by the queue due to overrun"; + } + } + + grouping qos-interface-queue-top { + description + "Top-level grouping for the queue associated with the + interface"; + + container queues { + description + "Surrounding container for a list of queues that are + instantiated on an interface."; + + list queue { + key "name"; + + description + "Top-level container for the queue associated with this + interface"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name of the queue + instantiated on the interface."; + } + + container config { + description + "Configuration data for the queue associated with the + interface"; + + uses qos-interface-queue-config; + } + + container state { + config false; + description + "Operational state data for the queue associated with the + interface"; + + uses qos-interface-queue-config; + uses qos-interface-queue-state; + } + } + } + } + + grouping qos-interface-voqs-top { + description + "Structural grouping of virtual-output-queue operational state + for an interface."; + + container virtual-output-queues { + description + "Surrounding container for the list of egress interfaces + for which virtual output queues are instantiated on this + interface."; + + list voq-interface { + key "name"; + + description + "List of egress interfaces for which a virtual output + queue is instantiated at this interface."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Name used to refer to the egress interface."; + } + + container config { + description + "Configuration parameters relating to the interface + for which the VOQs are instantiated."; + uses qos-voqs-config; + } + + container state { + config false; + description + "Operational state parameters relating to the interface + for which the VOQs are instantiated."; + uses qos-voqs-config; + } + + uses qos-interface-queue-top; + } + } + } + + grouping qos-voqs-config { + description + "Configuration parameters relating to an egress interface for which + VOQs are established on an interface."; + + leaf name { + type string; + description + "Name used to refer to the egress interface."; + } + } + + grouping qos-interface-scheduler-policy-config { + description + "Configuration data for schedulers associated with + the interface"; + + leaf name { + type leafref { + // current loc: + // /qos/interfaces/interface/input/schedulers/scheduler/config/name + path "../../../../../../scheduler-policies/scheduler-policy/" + + "config/name"; + } + description + "The scheduler policy to be applied to traffic on this interface."; + } + } + + grouping qos-interface-scheduler-state { + description + "Operational state data for a scheduler within + a scheduler group applied to an interface."; + + leaf sequence { + type leafref { + // current loc: /qos/interfaces/interface/input/scheduler-policy/ + // schedulers/scheduler/state/sequence + path "../../../../../../../../scheduler-policies/" + + "scheduler-policy[name=current()/../../../../config/name]" + + "/schedulers/scheduler/config/sequence"; + } + description + "Reference to the sequence ID of the scheduler within + the current scheduler policy."; + } + + uses qos-scheduler-common-state; + } + + grouping qos-scheduler-common-state { + description + "Common definitions of counters used in schedulers."; + + leaf conforming-pkts { + type oc-yang:counter64; + description + "The number of packets that were considered conforming by + the scheduler."; + } + + leaf conforming-octets { + type oc-yang:counter64; + description + "The number of octets in packets that were considered + conforming by the scheduler."; + } + + leaf exceeding-pkts { + type oc-yang:counter64; + description + "The number of packets that were considered exceeding by + the scheduler."; + } + + leaf exceeding-octets { + type oc-yang:counter64; + description + "The number of octets in packets that were considered + exceeding by the scheduler."; + } + + leaf violating-pkts { + type oc-yang:counter64; + description + "The number of packets that were considered violating by + the policer."; + } + + leaf violating-octets { + type oc-yang:counter64; + description + "The number of octets in packets that were considered + violating by the policer."; + } + } + + grouping qos-interface-scheduler-top { + description + "Top-level grouping "; + + container scheduler-policy { + description + "Scheduler policy associated with the interface."; + + container config { + description + "Configuration parameters relating to a scheduler policy on + an interface."; + uses qos-interface-scheduler-policy-config; + } + + container state { + config false; + description + "Operational state parameters relating to a scheduler policy + on an interface."; + uses qos-interface-scheduler-policy-config; + } + + container schedulers { + config false; + description + "Schedulers within the applied scheduler-policy."; + + list scheduler { + key "sequence"; + description + "List of the schedulers that are part of the scheduler-policy + specified."; + + leaf sequence { + type leafref { + path "../state/sequence"; + } + description + "Reference to the sequence ID for the scheduler."; + } + + container state { + description + "Operational state parameters relating to the scheduler + policy."; + + uses qos-interface-scheduler-state; + } + } + } + } + } + + grouping qos-interfaces-config { + description + "Configuration data for interfaces referenced in the QoS + model"; + + leaf interface-id { + type string; + description + "Identifier for the interface."; + } + } + + grouping qos-interfaces-state { + description + "Operational state data for interfaces referenced in the QoS + model"; + + // definitions per-interface counters for QoS + } + + grouping qos-interface-input-config { + description + "Configuration data for QoS on ingress interface"; + } + + grouping qos-interface-input-state { + description + "Operational state data for QoS on ingress interface"; + } + + grouping qos-interface-input-top { + description + "Top-level grouping for QoS on ingress interface"; + + container input { + description + "Top-level container for QoS data for the ingress + interface"; + + container config { + description + "Configuration data for QoS on ingress interface"; + + uses qos-interface-input-config; + } + + container state { + config false; + description + "Operational state data for QoS on ingress interface"; + + uses qos-interface-input-config; + uses qos-interface-input-state; + } + + uses qos-interface-classifier-top; + uses qos-interface-queue-top; + uses qos-interface-scheduler-top; + uses qos-interface-voqs-top; + } + } + + grouping qos-interface-output-config { + description + "Configuration data for QoS on the egress interface"; + } + + grouping qos-interface-output-state { + description + "Operational state data for QoS on the egress interface"; + } + + grouping qos-interface-output-top { + description + "Top-level grouping for QoS on the egress interface"; + + container output { + description + "Top-level container for QoS data related to the egress + interface"; + + container config { + description + "Configuration data for QoS on the egress interface"; + + uses qos-interface-output-config; + } + + container state { + config false; + description + "Operational state data for QoS on the egress interface"; + + uses qos-interface-output-config; + uses qos-interface-output-state; + } + + uses oc-if:interface-ref; + uses qos-interface-classifier-top; + uses qos-interface-queue-top; + uses qos-interface-scheduler-top; + } + } + + grouping qos-interfaces-top { + description + "Top-level grouping for interfaces referenced in the QoS + model"; + + container interfaces { + description + "Enclosing container for the list of interface references"; + + list interface { + key "interface-id"; + description + "List of interfaces referenced by QoS entities."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to the interface-id list key"; + } + + container config { + description + "Configuration data "; + + uses qos-interfaces-config; + } + + container state { + config false; + description + "Operational state data "; + + uses qos-interfaces-config; + uses qos-interfaces-state; + } + + uses oc-if:interface-ref; + uses qos-interface-input-top; + uses qos-interface-output-top; + + } + } + } + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-qos-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-qos-types@2018-11-21.yang new file mode 100644 index 0000000..c178af8 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-qos-types@2018-11-21.yang @@ -0,0 +1,159 @@ +module openconfig-qos-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/qos-types"; + + prefix "oc-qos-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines types and identities used in OpenConfig + models related to quality-of-service (QoS)"; + + oc-ext:openconfig-version "0.2.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2016-12-16" { + description + "Fix incorrect interface-ref placement"; + reference "0.2.0"; + } + + revision "2016-08-08" { + description + "Initial revision"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // extension statements + + // feature statements + + // identity statements + + identity QOS_QUEUE_TYPE { + description + "Base identity for supported queue types, primarily + defined by their drop behavior / strategy"; + } + + identity DROP_TAIL { + base QOS_QUEUE_TYPE; + description + "When the queue is filled to capacity, newly arriving packets + are discarded until there is room in the queue to accept new + traffic. Packets are not differentiated, i.e., all packets + are treated identically."; + } + + identity RED { + base QOS_QUEUE_TYPE; + description + "Queue management based on Random Early Detection (RED). RED + drops packets based on a drop probability that is based on the + average queue length, and settings of mininum and maximum + queue thresholds. On ECN-capable devices, packets may be + marked instead of dropped to signal congestion to the + sender."; + reference + "IETF RFC 2309 - Recommendations on Queue Management and + Congestion Avoidance in the Internet + IETF RFC 7567 - IETF Recommendations Regarding Active Queue + Management"; + } + + identity WRED { + base QOS_QUEUE_TYPE; + description + "Queue management based on a variant of RED in which the packet + drop probability is based on its traffic class."; + } + + identity QOS_SCHEDULER_TYPE { + description + "Base identity to describe supported QoS scheduler types."; + } + + identity ONE_RATE_TWO_COLOR { + base QOS_SCHEDULER_TYPE; + description + "Token bucket scheduler with a single rate (committed information + rate) and two colors (conforming and exceeding). The scheduler + behavior is governed by two parameters, the CIR which + determines the rate of token fill (bps) and the committed + burst size (depth of the token bucket in bytes)."; + } + + identity TWO_RATE_THREE_COLOR { + base QOS_SCHEDULER_TYPE; + description + "Token bucket scheduler with two buckets, one filled at the + committed information rate (CIR) in bps, and the second filled + at the peak information rate (PIR) in bps when the first + bucket is full. The first bucket depth is + the committed burst size (bytes), and the second is the + excess burst size (bytes). Traffic is categorized in three + colors as follows: traffic that falls within the + the CIR is conforming, traffic that is greater than the CIR + but less than the PIR is exceeding, and traffic that is + greater than PIR is violating."; + } + + // typedef statements + + typedef queue-behavior { + type enumeration { + enum SHAPE { + description + "Packets that exceed the CIR should be queued into a + buffer. The depth of the buffer is specified to be + max-queue-depth-bytes or max-queue-depth-packets. + Packets are subsequently scheduled from this queue + to the specified output. Only packets that overflow + the buffer have the exceed action applied to them."; + } + enum POLICE { + description + "Packets that exceed the CIR should be immediately + treated as exceeding the defined rate of the scheduler + and have the exceed action applied to them."; + } + } + description + "Type definition for different queueing behaviours that + are available to a scheduler."; + } + + // grouping statements + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-qos@2019-11-28.yang b/exp/yangcli/h3c-yang/openconfig-qos@2019-11-28.yang new file mode 100644 index 0000000..3ce828f --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-qos@2019-11-28.yang @@ -0,0 +1,113 @@ +module openconfig-qos { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/qos"; + + prefix "oc-qos"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + // include submodules + include openconfig-qos-interfaces; + include openconfig-qos-elements; + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + related to network quality-of-service."; + + oc-ext:openconfig-version "0.2.3"; + + revision "2019-11-28" { + description + "Fix xpaths in when statements"; + reference "0.2.3"; + } + + revision "2019-08-20" { + description + "Fix typo in classifiers container name"; + reference "0.2.2"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision "2016-12-16" { + description + "Fix incorrect interface-ref placement"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + grouping qos-config { + description + "Configuration data for global QoS"; + } + + grouping qos-state { + description + "Operational state data for global QoS"; + } + + grouping qos-top { + description + "Top-level grouping for QoS model"; + + container qos { + description + "Top-level container for QoS data"; + + container config { + description + "Configuration data for global QoS"; + + uses qos-config; + } + + container state { + config false; + description + "Operational state data for global QoS"; + + uses qos-config; + uses qos-state; + } + + uses qos-interfaces-top; + uses qos-classifier-top; + uses qos-forwarding-group-top; + uses qos-queue-top; + uses qos-scheduler-top; + } + } + + // data definition statements + + uses qos-top; + + // augment statements + + // rpc statements + + // notification statements + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-relay-agent@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-relay-agent@2018-11-21.yang new file mode 100644 index 0000000..f2f6181 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-relay-agent@2018-11-21.yang @@ -0,0 +1,825 @@ +module openconfig-relay-agent { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/relay-agent"; + + prefix "oc-relay"; + + // import some basic types + import ietf-inet-types { prefix inet; } + import ietf-yang-types { prefix yang; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module describes a model for configuration and operational + state related to relay agents typically used for DHCP and BOOTP + packets. The supports both DHCP and DHCPv6 and device-wide and + per-interface settings."; + + oc-ext:openconfig-version "0.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.1.1"; + } + + revision "2016-05-16" { + description + "Initial public release"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // grouping statements + + grouping agent-information-ipv4-common-config { + description + "Common configuration data for DHCP relay option"; + + leaf enable { + type boolean; + default false; + description + "Enable sending the DHCP option for Relay Agent information + -- option 82."; + reference + "RFC 3046 - DHCP Relay Agent Information Option"; + } + } + + grouping agent-information-ipv4-common-state { + description + "Common operational state data for DHCP relay option"; + + } + + grouping agent-information-ipv4-global-top { + description + "Top-level grouping for agent information data at global level"; + + container agent-information-option { + description + "Top-level container for relay agent information option + data"; + + container config { + description + "Configuration data for the relay agent information + option"; + + uses agent-information-ipv4-common-config; + } + + container state { + + config false; + + description + "Operational state data for agent information at global + level"; + + uses agent-information-ipv4-common-config; + uses agent-information-ipv4-common-state; + } + } + } + + grouping agent-information-ipv4-interface-config { + description + "Configuration data for DCHP relay option on interfaces"; + + leaf circuit-id { + type string; + description + "Encodes an agent-local identifier of the circuit from which + a DHCP client-to-server packet was received. It is intended + for use by agents in relaying DHCP responses back to the + proper circuit. The circuit id is an opaque value"; + reference + "RFC 3046 - DHCP Relay Agent Information Option"; + } + + leaf remote-id { + type string; + description + "Provides a mechanism to identify the remote host end of + the circuit. The remote-id should be thought of as an + opaque value, but must be globally unique."; + reference + "RFC 3046 - DHCP Relay Agent Information Option"; + } + } + + grouping agent-information-ipv4-interface-state { + description + "Operational state data for DHCP relay option on interfaces"; + + leaf sent-circuit-id { + type string; + description + "Reports the circuit-id sent by the system to the DHCP + server."; + } + + leaf sent-remote-id { + type string; + description + "Reports the remote-id value sent by the system to the DHCP + server"; + } + } + + grouping agent-information-ipv4-interface-top { + description + "Top-level grouping for relay agent information option data"; + + container agent-information-option { + description + "Top-level container for relay agent information option + data"; + + container config { + description + "Configuration data for the relay agent information + option"; + + uses agent-information-ipv4-common-config; + uses agent-information-ipv4-interface-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses agent-information-ipv4-common-config; + uses agent-information-ipv4-interface-config; + uses agent-information-ipv4-common-state; + uses agent-information-ipv4-interface-state; + } + } + } + + grouping agent-options-ipv6-common-config { + description + "Configuration data for DHCPv6 options"; + + leaf enable-interface-id { + type boolean; + default false; + description + "Enables DHCPv6 OPTION_INTERFACE_ID (18) to identify the + interface on which the client message was received."; + reference + "IETF RFC 3315 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6)"; + } + + leaf enable-remote-id { + type boolean; + default false; + description + "Sets DHCPv6 OPTION_REMOTE_ID (37). This option is the + DHCPv6 equivalent for the IPv4 (DHCPv4) Relay Agent Option's + Remote-ID suboption as specified in RFC 3046. The remote-id + field may be used to encode a user name, remote IP address, + interface/port identifier, etc."; + reference + "IETF RFC 4649 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6) Relay Agent Remote-ID Option"; + } + } + + grouping agent-options-ipv6-common-state { + description + "Operational state data for DHCPv6 options"; + } + + grouping agent-options-ipv6-interface-config { + description + "Configuration data for DHCPv6 options"; + + leaf interface-id { + type string; + description + "Sets DHCPv6 OPTION_INTERFACE_ID (18) to identify the + interface on which the client message was received."; + reference + "IETF RFC 3315 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6)"; + } + + leaf remote-id { + type string; + description + "Sets DHCPv6 OPTION_REMOTE_ID (37). This option is the + DHCPv6 equivalent for the IPv4 (DHCPv4) Relay Agent Option's + Remote-ID suboption as specified in RFC 3046. The remote-id + field may be used to encode a user name, remote IP address, + interface/port identifier, etc."; + reference + "IETF RFC 4649 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6) Relay Agent Remote-ID Option"; + } + } + + grouping agent-options-ipv6-interface-state { + description + "Operational state data for DHCPv6 options"; + + leaf sent-interface-id { + type string; + description + "Reflects the DHCPv6 OPTION_INTERFACE_ID (18) sent to the + server by the system."; + reference + "IETF RFC 3315 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6)"; + } + + leaf sent-remote-id { + type string; + description + "Reflects the DHCPv6 OPTION_REMOTE_ID (37) sent to the + server by the system."; + reference + "IETF RFC 4649 - Dynamic Host Configuration Protocol for + IPv6 (DHCPv6) Relay Agent Remote-ID Option"; + } + } + + grouping agent-options-ipv6-global-top { + description + "Top-level grouping for DHCPv6 options on interfaces"; + + container options { + description + "Top-level container for DHCPv6 agent options on interfaces"; + + container config { + description + "Configuration data "; + + uses agent-options-ipv6-common-config; + } + + container state { + + config false; + + description + "Operational state data for DHCPv6 agent option on an + interface"; + + uses agent-options-ipv6-common-config; + uses agent-options-ipv6-common-state; + } + } + } + + grouping agent-options-ipv6-interface-top { + description + "Top-level grouping for DHCPv6 options on interfaces"; + + container options { + description + "Top-level container for DHCPv6 agent options on interfaces"; + + container config { + description + "Configuration data "; + + uses agent-options-ipv6-common-config; + uses agent-options-ipv6-interface-config; + } + + container state { + + config false; + + description + "Operational state data for DHCPv6 agent option on an + interface"; + + uses agent-options-ipv6-common-config; + uses agent-options-ipv6-interface-config; + uses agent-options-ipv6-common-state; + uses agent-options-ipv6-interface-state; + } + } + } + + grouping relay-agent-common-config { + description + "Configuration data for global level relay agent options, + common across address families"; + + leaf enable-relay-agent { + type boolean; + default false; + description + "Enables DHCP/BOOTP relay agent on all interfaces"; + } + } + + grouping relay-agent-common-state { + description + "Operational state data for global level relay agent, common + across address families"; + } + + grouping relay-agent-ipv4-config { + description + "Configuration data for DHCPv4 relay agents"; + + uses relay-agent-common-config; + } + + grouping relay-agent-ipv4-state { + description + "Configuration data for DHCPv4 relay agents"; + + uses relay-agent-common-state; + } + + + grouping relay-agent-ipv4-top { + description + "Top-level grouping for global relay agent data"; + + container dhcp { + description + "Top-level container for global relay agent data"; + + container config { + description + "Configuration data for global DHCPv4"; + + uses relay-agent-ipv4-config; + } + + container state { + + config false; + + description + "Operational state data global DHCPv4"; + + uses relay-agent-ipv4-config; + uses relay-agent-ipv4-state; + } + + uses agent-information-ipv4-global-top; + uses relay-agent-ipv4-interfaces-top; + } + } + + grouping relay-agent-ipv6-config { + description + "Configuration data for DHCPv6 relay agents"; + + uses relay-agent-common-config; + } + + grouping relay-agent-ipv6-state { + description + "Configuration data for DHCPv6 relay agents"; + + uses relay-agent-common-state; + } + + grouping relay-agent-ipv6-top { + description + "Top-level grouping for global relay agent data"; + + container dhcpv6 { + description + "Top-level container for global relay agent data"; + + container config { + description + "Configuration data for global DHCPv6"; + + uses relay-agent-ipv6-config; + } + + container state { + + config false; + + description + "Operational state data global DHCPv6"; + + uses relay-agent-ipv6-config; + uses relay-agent-ipv6-state; + } + + uses agent-options-ipv6-global-top; + uses relay-agent-ipv6-interfaces-top; + } + } + + + grouping relay-agent-common-stats { + description + "Common DHCP / BOOTP message statistics for + DHCPv4 and DHCPv6"; + + + leaf total-dropped { + type yang:counter64; + description + "Total number of DHCP packets dropped by the relay agent"; + } + + leaf invalid-opcode { + type yang:counter64; + description + "Number of DHCP packets dropped due to an invalid opcode"; + } + + leaf invalid-options { + type yang:counter64; + description + "Number of DHCP packets dropped due to an invalid option"; + } + } + + grouping relay-agent-ipv4-stats { + description + "DHCPv4 relay agent message statistics"; + + leaf bootrequest-received { + type yang:counter64; + description + "BOOTREQUEST messages received by the relay agent"; + } + + leaf dhcp-decline-received { + type yang:counter64; + description + "DHCP DECLINE messages received by the relay agent"; + } + + leaf dhcp-discover-received { + type yang:counter64; + description + "DHCP DISCOVER messages received by the relay agent"; + } + + leaf dhcp-inform-received { + type yang:counter64; + description + "DHCP INFORM messages received by the relay agent"; + } + + leaf dhcp-release-received { + type yang:counter64; + description + "DHCP RELEASE messages received by the relay agent"; + } + + leaf dhcp-request-received { + type yang:counter64; + description + "DHCP REQUEST messages received by the relay agent"; + } + + leaf bootrequest-sent { + type yang:counter64; + description + "BOOTREQUEST messages forwarded by the relay agent"; + } + + leaf bootreply-sent { + type yang:counter64; + description + "BOOTREPLY messages forwarded by the relay agent"; + } + + leaf dhcp-offer-sent { + type yang:counter64; + description + "DHCP OFFER messages sent by the relay agent"; + } + + leaf dhcp-ack-sent { + type yang:counter64; + description + "DHCP ACK messages sent by the relay agent"; + } + + leaf dhcp-nack-sent { + type yang:counter64; + description + "DHCP NACK messages sent by the relay agent"; + } + } + + grouping relay-agent-ipv6-stats { + description + "DHCPv4 relay agent message statistics"; + + leaf dhcpv6-solicit-received { + type yang:counter64; + description + "Number of DHCPv6 SOLICIT messages received from clients + by the relay agent"; + } + + leaf dhcpv6-decline-received { + type yang:counter64; + description + "Number of DHCPv6 DECLINE messages received from + clients by the relay agent"; + } + + leaf dhcpv6-request-received { + type yang:counter64; + description + "Number of DHCPv6 request messages received from clients + by the relay agent"; + } + + leaf dhcpv6-release-received { + type yang:counter64; + description + "Number of DHCPv6 release messages received from clients + by the relay agent"; + } + + leaf dhcpv6-confirm-received { + type yang:counter64; + description + "Number of DHCPv6 confirm messages received from clients + by the relay agent"; + } + + leaf dhcpv6-rebind-received { + type yang:counter64; + description + "Number of DHCPv6 rebind messages received from clients + by the relay agent"; + } + + leaf dhcpv6-info-request-received { + type yang:counter64; + description + "Number of DHCPv6 information requests messages received from + clients by the relay agent"; + } + + leaf dhcpv6-relay-reply-received { + type yang:counter64; + description + "Number of DHCPv6 relay reply messages received from servers + by the relay agent"; + } + + leaf dhcpv6-adverstise-sent { + type yang:counter64; + description + "Number of DHCPv6 adverstise messages sent to clients by + the relay agent"; + } + + leaf dhcpv6-reply-sent { + type yang:counter64; + description + "Number of DHCPv6 reply messages sent to clients by + the relay agent"; + } + + leaf dhcpv6-reconfigure-sent { + type yang:counter64; + description + "Number of DHCPv6 reconfigure messages sent to clients by + the relay agent"; + } + + leaf dhcpv6-relay-forw-sent { + type yang:counter64; + description + "Number of DHCPv6 relay-forward messages sent to servers + by the relay agent"; + } + + } + + grouping relay-agent-ipv4-interfaces-config { + description + "Configuration data for interfaces enabled for relaying"; + + leaf id { + type oc-if:interface-id; + description + "Name of the interface on which relay agent is active"; + } + + leaf enable { + type boolean; + description + "Enables the relay agent on the referenced interface. + At least one helper address should also be configured + for forwarding requested."; + } + + leaf-list helper-address { + type inet:ip-address; + description + "List of IPv4 or IPv6 addresses of DHCP servers to which the + relay agent should forward DHCPv4 requests. The relay agent is + expected to forward DHCPv4/BOOTP requests to all listed + server addresses when DHCPv4 relaying is enabled globally, or + on the interface."; + } + } + + grouping relay-agent-ipv4-interfaces-state { + description + "Operational state data for interfaces enabled for relaying"; + + container counters { + description + "Counters and statistics for relay agent operation."; + + uses relay-agent-common-stats; + uses relay-agent-ipv4-stats; + } + } + + grouping relay-agent-ipv4-interfaces-top { + description + "Top-level grouping for DHCPv4 relays on interfaces"; + + container interfaces { + description + "Enclosing container for the list of interface references."; + + list interface { + key "id"; + description + "List of interfaces on which the relay agent is + configured."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to the interface list key"; + } + + container config { + description + "Configuration data for relay agent interfaces."; + + uses relay-agent-ipv4-interfaces-config; + } + + container state { + + config false; + + description + "Operational state data for relay agent interfaces."; + + uses relay-agent-ipv4-interfaces-config; + uses relay-agent-ipv4-interfaces-state; + } + + uses oc-if:interface-ref; + uses agent-information-ipv4-interface-top; + } + } + } + + grouping relay-agent-ipv6-interfaces-config { + description + "Configuration data for interfaces enabled for relaying"; + + leaf id { + type oc-if:interface-id; + description + "Name of the interface on which relay agent is active"; + } + + leaf enable { + type boolean; + description + "Enables the relay agent on the referenced interface. + At least one helper address should also be configured + for forwarding requested."; + } + + leaf-list helper-address { + type inet:ipv6-address; + description + "List of IPv6 addresses of DHCP servers to which the + relay agent should forward DHCPv6 requests. The relay agent + is expected to forward DHCPv4/BOOTP requests to all listed + server addresses when DHCPv6 relaying is enabled globally, or + on the interface."; + } + } + + grouping relay-agent-ipv6-interfaces-state { + description + "Operational state data for interfaces enabled for relaying"; + + container counters { + description + "Counters and statistics for relay agent operation."; + + uses relay-agent-common-stats; + uses relay-agent-ipv6-stats; + } + } + + grouping relay-agent-ipv6-interfaces-top { + description + "Top-level grouping for DHCPv4 relays on interfaces"; + + container interfaces { + description + "Enclosing container for the list of interface references."; + + list interface { + key "id"; + description + "List of interfaces on which the relay agent is + configured."; + + leaf id { + type leafref { + path "../config/id"; + } + description + "Reference to the interface list key"; + } + + container config { + description + "Configuration data for relay agent interfaces."; + + uses relay-agent-ipv6-interfaces-config; + } + + container state { + + config false; + + description + "Operational state data for relay agent interfaces."; + + uses relay-agent-ipv6-interfaces-config; + uses relay-agent-ipv6-interfaces-state; + } + + uses oc-if:interface-ref; + uses agent-options-ipv6-interface-top; + } + } + } + + grouping relay-agent-top { + description + "Top-level container for relay agent configuration and opstate + data."; + + container relay-agent { + description + "Top level container for relay-agent configuration and + operational state data"; + + uses relay-agent-ipv4-top; + uses relay-agent-ipv6-top; + } + } + + // data definition statements + + uses relay-agent-top; + + // augment statements + + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-attributes@2019-10-15.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-attributes@2019-10-15.yang new file mode 100644 index 0000000..e0be6cf --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-attributes@2019-10-15.yang @@ -0,0 +1,939 @@ +submodule openconfig-rib-bgp-attributes { + + belongs-to openconfig-rib-bgp { + prefix "oc-rib-bgp"; + } + + + // import some basic types + import openconfig-bgp-types { prefix oc-bgpt; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-rib-bgp-types { prefix oc-bgprt; } + import openconfig-segment-routing-types { prefix oc-srt; } + import openconfig-inet-types { prefix oc-inet; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains common data definitions for BGP + attributes for use in BGP RIB tables."; + + + oc-ext:openconfig-version "0.7.0"; + + revision "2019-10-15" { + description + "Change imported segment-routing module."; + reference "0.7.0"; + } + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + grouping bgp-as-path-attr-state { + description + "Data for representing BGP AS-PATH attribute"; + + leaf type { + type oc-bgpt:as-path-segment-type; + description + "The type of AS-PATH segment"; + } + + leaf-list member { + type oc-inet:as-number; + description + "List of the AS numbers in the AS-PATH segment"; + } + } + + grouping bgp-as-path-attr-top { + description + "Top-level grouping for AS-PATH attribute data"; + + container as-path { + description + "Enclosing container for the list of AS path segments. + + In the Adj-RIB-In or Adj-RIB-Out, this list should show + the received or sent AS_PATH, respectively. For + example, if the local router is not 4-byte capable, this + value should consist of 2-octet ASNs or the AS_TRANS + (AS 23456) values received or sent in route updates. + + In the Loc-RIB, this list should reflect the effective + AS path for the route, e.g., a 4-octet value if the + local router is 4-octet capable."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4) + RFC 6793 - BGP Support for Four-octet AS Number Space + RFC 5065 - Autonomous System Confederations for BGP"; + + list as-segment { + description + "Unkeyed list of AS PATH segments"; + + container state { + config false; + description + "Opstate data for AS-PATH segments"; + + uses bgp-as-path-attr-state; + } + } + } + } + + grouping bgp-as4-path-attr-top { + description + "Top-level grouping for AS4-PATH attribute data"; + + container as4-path { + description + "This is the path encoded with 4-octet + AS numbers in the optional transitive AS4_PATH attribute. + This value is populated with the received or sent attribute + in Adj-RIB-In or Adj-RIB-Out, respectively. It should not + be populated in Loc-RIB since the Loc-RIB is expected to + store the effective AS-Path in the as-path leaf regardless + of being 4-octet or 2-octet."; + reference + "RFC 6793 - BGP Support for Four-octet AS Number Space"; + + list as4-segment { + description + "Unkeyed list of AS PATH segments"; + + container state { + config false; + description + "Opstate data for AS-PATH segments"; + + uses bgp-as-path-attr-state; + } + } + } + } + + grouping bgp-community-attr-state { + description + "Common definition of BGP community attributes"; + + leaf-list community { + type union { + type oc-bgpt:bgp-well-known-community-type; + type oc-bgpt:bgp-std-community-type; + } + description + "List of standard or well-known BGP community + attributes."; + } + } + + grouping bgp-extended-community-attr-state { + description + "Common definition of BGP extended community attribute"; + + leaf-list ext-community { + type oc-bgpt:bgp-ext-community-recv-type; + description + "List of BGP extended community attributes. The received + extended community may be an explicitly modeled + type or unknown, represented by an 8-octet value + formatted according to RFC 4360."; + reference + "RFC 4360 - BGP Extended Communities Attribute"; + } + + } + + grouping bgp-aggregator-attr-state { + description + "Operational state data for the BGP aggregator + attribute"; + + leaf as { + type oc-inet:as-number; + description + "AS number of the autnonomous system that performed the + aggregation."; + } + + leaf as4 { + type oc-inet:as-number; + description + "AS number of the autnonomous system that performed the + aggregation (4-octet representation). This value is + populated if an upstream router is not 4-octet capable. + Its semantics are similar to the AS4_PATH optional + transitive attribute"; + reference + "RFC 6793 - BGP Support for Four-octet AS Number Space"; + } + + leaf address { + type oc-inet:ipv4-address; + description + "IP address of the router that performed the + aggregation."; + } + } + + + grouping bgp-aggregator-attr-top { + description + "Common definition of the BGP aggregator attribute"; + + container aggregator { + description + "BGP attribute indicating the prefix has been aggregated by + the specified AS and router."; + + container state { + config false; + description + "Operational state data for BGP aggregator attribute"; + + uses bgp-aggregator-attr-state; + } + } + } + + grouping bgp-shared-common-attr-state { + description + "Route attributes shared across route table entries, + common to both LOC-Rib and Adj-RIB"; + + + leaf origin { + type oc-bgpt:bgp-origin-attr-type; + description + "BGP attribute defining the origin of the path information."; + } + + leaf atomic-aggregate { + type boolean; + description + "BGP attribute indicating that the prefix is an atomic + aggregate, i.e., the peer selected a less specific + route without selecting a more specific route that is + included in it."; + } + + leaf next-hop { + type oc-inet:ip-address; + description + "BGP next hop attribute defining the IP address of the router + that should be used as the next hop to the destination"; + } + + leaf med { + type uint32; + description + "BGP multi-exit discriminator attribute used in BGP route + selection process"; + } + + leaf local-pref { + type uint32; + description + "BGP local preference attribute sent to internal peers to + indicate the degree of preference for externally learned + routes. The route with the highest local preference value + is preferred."; + } + + leaf originator-id { + type oc-inet:ipv4-address; + description + "BGP attribute that provides the id as an IPv4 address + of the originator of the announcement."; + reference + "RFC 4456 - BGP Route Reflection: An Alternative to Full + Mesh Internal BGP (IBGP)"; + } + + leaf-list cluster-list { + type oc-inet:ipv4-address; + description + "Represents the reflection path that the route has passed."; + reference + "RFC 4456 - BGP Route Reflection: An Alternative to Full + Mesh Internal BGP (IBGP)"; + } + + leaf aigp { + type uint64; + description + "BGP path attribute representing the accumulated IGP metric + for the path"; + reference + "RFC 7311 - The Accumulated IGP Metric Attribute for BGP"; + } + } + + grouping bgp-unknown-attr-flags-state { + description + "Operational state data for path attribute flags"; + + leaf optional { + type boolean; + description + "Defines whether the attribute is optional (if + set to true) or well-known (if set to false). + Set in the high-order bit of the BGP attribute + flags octet."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + leaf transitive { + type boolean; + description + "Defines whether an optional attribute is transitive + (if set to true) or non-transitive (if set to false). For + well-known attributes, the transitive flag MUST be set to + true. Set in the second high-order bit of the BGP attribute + flags octet."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + leaf partial { + type boolean; + description + "Defines whether the information contained in the optional + transitive attribute is partial (if set to true) or complete + (if set to false). For well-known attributes and for + optional non-transitive attributes, the partial flag + must be set to false. Set in the third high-order bit of + the BGP attribute flags octet."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + leaf extended { + type boolean; + description + "Defines whether the attribute length is one octet + (if set to false) or two octets (if set to true). Set in + the fourth high-order bit of the BGP attribute flags + octet."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + } + + grouping bgp-unknown-attr-state { + description + "Operational state data for path attributes not shared + across route entries, common to LOC-RIB and Adj-RIB"; + + leaf attr-type { + type uint8; + description + "1-octet value encoding the attribute type code"; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + leaf attr-len { + type uint16; + description + "One or two octet attribute length field indicating the + length of the attribute data in octets. If the Extended + Length attribute flag is set, the length field is 2 octets, + otherwise it is 1 octet"; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + + leaf attr-value { + type binary { + length 1..65535; + } + description + "Raw attribute value, not including the attribute + flags, type, or length. The maximum length + of the attribute value data is 2^16-1 per the max value + of the attr-len field (2 octets)."; + reference + "RFC 4271 - A Border Gateway Protocol 4 (BGP-4)"; + } + } + + grouping bgp-unknown-attr-top { + description + "Unknown path attributes that are not expected to be shared + across route entries, common to LOC-RIB and Adj-RIB"; + + container unknown-attributes { + description + "Unknown path attributes that were received in the UPDATE + message which contained the prefix."; + + list unknown-attribute { + key "attr-type"; + description + "This list contains received attributes that are unrecognized + or unsupported by the local router. The list may be empty."; + + leaf attr-type { + type leafref { + path "../state/attr-type"; + } + description + "Reference to the list key"; + } + + container state { + description + "Operational state for unknown route attributes"; + + uses bgp-unknown-attr-flags-state; + uses bgp-unknown-attr-state; + } + } + } + } + + grouping bgp-loc-rib-attr-state { + description + "Path attributes that are not expected to be shared across + route entries, specific to LOC-RIB"; + + } + + grouping bgp-adj-rib-attr-state { + description + "Path attributes that are not expected to be shared across + route entries, specific to Adj-RIB"; + + leaf path-id { + type uint32; + description + "When the BGP speaker supports advertisement of multiple + paths for a prefix, the path identifier is used to + uniquely identify a route based on the combination of the + prefix and path id. In the Adj-RIB-In, the path-id value is + the value received in the update message. In the Loc-RIB, + if used, it should represent a locally generated path-id + value for the corresponding route. In Adj-RIB-Out, it + should be the value sent to a neighbor when add-paths is + used, i.e., the capability has been negotiated."; + reference + "draft-ietf-idr-add-paths - Advertisement of Multiple Paths + in BGP"; + } + } + + grouping bgp-tunnel-encapsulation-attr-top { + description + "Top-level definition of the BGP Tunnel encapsulation + attribute."; + + container tunnel-encapsulation { + config false; + description + "The Tunnel Encapsulation attribute specifies a set of + tunnels to a remote destination. The attribute is TLV + based and allows description of a tunnel type, and the + relevant information to create the tunnel to the remote + destination."; + + reference "RFC5512, draft-ietf-idr-tunnel-encaps"; + + container tunnels { + description + "Surrounding container for the set of tunnels included + within the tunnel encapsulation attribute."; + + list tunnel { + key "type"; + description + "List of the tunnels that are specified within the + attribute. Keyed on the type of tunnel that the + TLV describes."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the tunnel type specified within the + TLV's type field."; + } + + container state { + config false; + description + "State parameters of the tunnel attribute"; + + uses bgp-tunnel-encapsulation-attr-tunnel-state; + } + + container subtlvs { + description + "Surrounding container for the list of sub-TLVs within + the tunnel encapsulation attribute."; + + list subtlv { + key "type"; + description + "List of the subTLVs that are specified within the + TLV instance inside the tunnel encapsulation attribute."; + + leaf type { + type leafref { + path "../state/type"; + } + description + "Reference to the sub-TLV type that is included within + the subTLV."; + } + + container state { + config false; + description + "State parameters of the subTLV of the tunnel attribute"; + + uses bgp-tunnel-encapsulation-attr-tunnel-subtlv-state; + } + + container remote-endpoints { + when "../state/type = 'oc-bgprt:TUNNEL_REMOTE_ENDPOINT'" { + description + "Only allow the remote endpoint to be specified when the + subTLV is specified to describe remote endpoints."; + } + + description + "The remote endpoints associated with the tunnel + described by the attribute."; + + list remote-endpoint { + key "endpoint"; + description + "List of the remote endpoints described within the TLV."; + + leaf endpoint { + type leafref { + path "../state/endpoint"; + } + description + "Reference to the IP address of the endpoint."; + } + + container state { + config false; + description + "State parameters of the remote endpoints described + by the attribute."; + + uses bgp-tunnel-encapsulation-attr-tunnel-subtlv-endpoint-state; + } + } + } + + container segment-lists { + when "../state/type = 'oc-bgprt:SRTE_SEGMENT_LIST'" { + description + "Only allow the segment lists to be specified when the sub-TLV + is of the relevant type."; + } + + description + "Surrounding container for the list of segment lists that are + associated with a SR-TE Policy tunnel."; + + list segment-list { + key "instance-id"; + + description + "List of segment lists that are specified within the + tunnel encapsulation attribute."; + + leaf instance-id { + type leafref { + path "../state/instance-id"; + } + description + "Reference to the instance identifier of the Segment List + that is included within the tunnel encapsulation + attribute."; + } + + container state { + config false; + description + "State parameters relating to the Segment List within the + Tunnel Encapsulation attribute."; + + uses bgp-tunnel-encapsulation-attr-tunnel-subtlv-segment-list-state; + } + + container segments { + description + "Surrounding container for the list of segments within the + SR-TE segment list."; + + list segment { + key "index"; + + description + "List of segments within the SR-TE segment list."; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the index of the segment within the + segment list."; + } + + container state { + config false; + description + "State parameters relating to the segment within + the segment list."; + + uses bgp-tunnel-encapsulation-attr-tunnel-subtlv-segment-state; + } + } + } + } + } + } + } + } + } + } + } + + grouping bgp-tunnel-encapsulation-attr-tunnel-state { + description + "State parameters of the tunnel encapsulation attribute"; + + leaf type { + type identityref { + base "oc-bgprt:TUNNEL_ENCAPSULATION_TYPE"; + } + description + "Type of the tunnel described within the tunnel encapsulation + attribute."; + } + } + + grouping bgp-tunnel-encapsulation-attr-tunnel-subtlv-state { + description + "State parameters relating to subTLVs of the tunnel encapsulation + attribute."; + + leaf type { + type identityref { + base "oc-bgprt:TUNNEL_ENCAPSULATION_SUBTLV_TYPE"; + } + description + "Type of the sub-TLV within the tunnel encapsulation attribute"; + } + + leaf-list colors { + when "../type = 'oc-bgprt:TUNNEL_COLOR'" { + description + "Only allow list of colours to be specified when the sub-TLV + specifies colours associated with the tunnel encapsulation + attribute."; + } + type uint32; + description + "The colours associated with the tunnel encapsulation attribute, + as described by RFC5512."; + } + + leaf preference { + when "../type = 'oc-bgprt:SRTE_PREFERENCE'" { + description + "Only allow the preference to be specified when the sub-TLV + specifies the preference associated with the tunnel encapsulation + attribute."; + } + type uint32; + default 100; + description + "The preference of the SR-TE policy described by the tunnel + encapsulation attribute. If unspecified, the preference + defaults to 100."; + } + + leaf binding-sid { + when "../type = 'oc-bgprt:SRTE_BINDING_SID'" { + description + "Only allow the binding SID to be specified when the sub-TLV + is specified to be the of the relevant type."; + } + type oc-srt:sr-sid-type; + description + "Binding SID associated with the SR-TE policy"; + } + } + + grouping bgp-tunnel-encapsulation-attr-tunnel-subtlv-endpoint-state { + description + "State parameters relating to the remote endpoint described by a + tunnel encapsulation attribute."; + + leaf as { + type oc-inet:as-number; + description + "The remote AS to which the IP address of the remote endpoint + belongs."; + } + + leaf endpoint { + type oc-inet:ip-address; + description + "IP address of the remote endpoint."; + } + } + + grouping bgp-tunnel-encapsulation-attr-tunnel-subtlv-segment-list-state { + description + "State parameters relating to an entry within a segment list within + a SR-TE policy segment list."; + + leaf instance-id { + type uint64; + description + "Instance of the segment list within the sub-TLV"; + } + + leaf weight { + type uint32; + description + "The weight given to the path within the set of segment + lists that are included in the tunnel attribute sub-TLV."; + } + } + + grouping bgp-tunnel-encapsulation-attr-tunnel-subtlv-segment-state { + description + "State parameters relating to a segment within the segment list."; + + leaf index { + type uint64; + description + "Index of the segment within the segment list. The segments are + ordered in ascending order, beginning at 0."; + } + + leaf type { + type enumeration { + enum MPLS_SID { + description + "The segment is specified as an MPLS label."; + value 1; + } + enum IPV6_SID { + description + "The segment is specified as an IPv6 address."; + value 2; + } + enum IPV4_NODE_ADDRESS { + description + "The segment is specified as an IPv4 node address with + optional SID."; + value 3; + } + enum IPV6_NODE_ADDRESS { + description + "The segment is specified as an IPv6 node address with + optional SID."; + value 4; + } + enum IPV4_LOCAL_INTF_ID { + description + "The segment is specified as an IPv4 address with a + local interface identifier along with an ."; + value 5; + } + enum IPV4_LOCAL_REMOTE_ADDR { + description + "The segment is specified as an IPv4 local and remote + address with an optional SID."; + value 6; + } + enum IPV6_LOCAL_INTF_ID { + description + "The segment is specified as an IPv6 address with an + index, along with an optional SID."; + value 7; + } + enum IPV6_LOCAL_REMOTE_ADDR { + description + "The segmetn is specified as an IPv6 local and remote + address with an optional SID."; + value 8; + } + } + description + "The type of segment specified within the segment entry."; + } + + leaf sid { + type oc-srt:sr-sid-type; + description + "SID value for the segment entry, specified as an MPLS label + or IPv6 address."; + } + + leaf mpls-tc { + when "../type = 'MPLS_SID'" { + description + "The MPLS TC bits can only be specified when the segment + time is an MPLS label."; + } + type uint8 { + range "0..7"; + } + description + "The MPLS TC bits used when the SID is specified as an MPLS + label. If set to zero, the receiving system specifies the + value of the TC bits."; + } + + leaf mpls-bos { + when "../type = 'MPLS_SID'" { + description + "The MPLS BoS bit can only be specified when the segment + type is an MPLS label."; + } + type boolean; + description + "When this leaf is set to true the MPLS bottom-of-stack + (BoS) bit is set in the MPLS segment. The BoS bit should + always be set to zero by the sender."; + } + + leaf mpls-ttl { + when "../type = 'MPLS_SID'" { + description + "The MPLS TTL can only be set when the segment type is + an MPLS label."; + } + type uint8; + description + "The MPLS time to live (TTL) to be set for the MPLS + segment. If set to 255, the receiver specifies the + TTL value that is used for packets sent with this + segment in the stack."; + } + + leaf remote-ipv4-address { + when "../type = 'IPV4_NODE_ADDRESS' or ../type='../IPV4_ADDRESS_INDEX'" + + "or ../type='IPV4_LOCAL_INTF_ID' or " + + "../type='IPV4_LOCAL_REMOTE_ADDR'" { + description + "An IPv4 address can only be associated with the segment entry + when the type of the SID is a node address, or an IPv6 address + with an index."; + } + type oc-inet:ipv4-address; + description + "An IPv4 address specified as the remote node address. When the type + of the segment specifies only the remote address, no other addresses + are specified. When the type of the segment requires a local address, + this leaf specifies the remote IPv4 address."; + } + + leaf local-ipv4-address { + when "../type = 'IPV4_LOCAL_REMOTE_ADDR'" { + description + "A local IPv4 address can only be specified when the segment is + specified by the local and remote IPv4 interface addresses."; + } + type oc-inet:ipv4-address; + description + "An IPv4 address of a local adjacency that is used to identify + the segment."; + } + + leaf remote-ipv6-address { + when "../type = 'IPV6_NODE_ADDRESS' or ../type='IPV6_ADDRESS_INDEX'" + + "or ../type='IPV6_LOCAL_INTF_ID' or " + + "../type='IPV6_LOCAL_REMOTE_ADDR'" { + description + "An IPv6 address can only be specified with a segment entry + when the type of the SID is a node address, or an IPv6 address + with an index."; + } + type oc-inet:ipv6-address; + description + "An IPv6 address specified as the remote node address. When the type + of the segment specifies only the remote address, no other addresses + are specified. When the type of the segment requires a local address, + this leaf specifies the remote IPv6 address."; + } + + leaf local-ipv6-address { + when "../type = 'IPV6_LOCAL_REMOTE_ADDR'" { + description + "A local IPv6 address can only be speciifed when the segment + is specified by the local and remote IPv6 interface addresses."; + } + type oc-inet:ipv6-address; + description + "An IPv6 address of a local adjacency that is used to identify the + segment."; + } + + leaf local-interface-id { + when "../type = 'IPV4_LOCAL_INTF_ID' or ../type='IPV6_LOCAL_INTF_ID'" { + description + "A local interface identifier can only be specified when the + type of the segment is an IPv4 address with local interface ID, + or IPv6 address with local interface ID."; + } + type uint32; + description + "The local interface identifier to be utilised for the segment."; + reference + "draft-ietf-pce-segment-routing"; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-ext@2019-04-25.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-ext@2019-04-25.yang new file mode 100644 index 0000000..d6613ce --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-ext@2019-04-25.yang @@ -0,0 +1,218 @@ +module openconfig-rib-bgp-ext { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/rib/bgp-ext"; + + prefix "oc-bgprib-ext"; + + import openconfig-extensions { prefix oc-ext; } + import openconfig-rib-bgp-types { prefix oc-bgpribt; } + import openconfig-network-instance { prefix oc-ni; } + + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Defines additional data nodes for the OpenConfig BGP RIB model. + These items reflect extensions that are desirable features but + are not currently supported in a majority of BGP + implementations."; + + oc-ext:openconfig-version "0.6.0"; + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + revision "2016-04-11" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping rib-ext-route-annotations { + description + "Extended annotations for routes in the routing tables"; + + leaf reject-reason { + type union { + type identityref { + base oc-bgpribt:BGP_NOT_SELECTED_BESTPATH; + } + type identityref { + base oc-bgpribt:BGP_NOT_SELECTED_POLICY; + } + } + description + "Indicates the reason the route is not used, either due to + policy filtering or bestpath selection"; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol/" + + "oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv4-unicast/oc-ni:loc-rib/" + + "oc-ni:routes/oc-ni:route/oc-ni:state" { + description + "Add extended annotations to the Loc-RIB for IPv4"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv6-unicast/oc-ni:loc-rib/" + + "oc-ni:routes/oc-ni:route/oc-ni:state" { + description + "Add extended annotations to the Loc-RIB for IPv6"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv4-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-in-pre/oc-ni:routes/oc-ni:route" + + "/oc-ni:state" { + description + "Add extended annotations to Adj-RIB for IPv4"; + + uses rib-ext-route-annotations; + } + + augment + "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv4-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-in-post/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv4"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv4-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-out-pre/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv4"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv4-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-out-post/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv4"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv6-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-in-pre/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv6"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv6-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-in-post/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv6"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv6-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-out-pre/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv6"; + + uses rib-ext-route-annotations; + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:protocols/oc-ni:protocol" + + "/oc-ni:bgp/oc-ni:rib/oc-ni:afi-safis/" + + "oc-ni:afi-safi/oc-ni:ipv6-unicast/" + + "oc-ni:neighbors/oc-ni:neighbor/" + + "oc-ni:adj-rib-out-post/oc-ni:routes/oc-ni:route" + + "/oc-ni:state"{ + description + "Add extended annotations to Adj-RIB for IPv6"; + + uses rib-ext-route-annotations; + } + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-shared-attributes@2019-10-15.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-shared-attributes@2019-10-15.yang new file mode 100644 index 0000000..27df103 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-shared-attributes@2019-10-15.yang @@ -0,0 +1,203 @@ +submodule openconfig-rib-bgp-shared-attributes { + + belongs-to openconfig-rib-bgp { + prefix "oc-rib-bgp"; + } + + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + include openconfig-rib-bgp-attributes; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains structural data definitions for + attribute sets shared across routes."; + + oc-ext:openconfig-version "0.7.0"; + + revision "2019-10-15" { + description + "Change imported segment-routing module."; + reference "0.7.0"; + } + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + + grouping attribute-sets-top { + description + "Top level grouping for list of common attribute sets"; + + container attr-sets { + description + "Enclosing container for the list of path attribute sets"; + + list attr-set { + key "index"; + + description + "List of path attributes that may be in use by multiple + routes in the table"; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to list key"; + } + + container state { + config false; + description + "Operational state for common path attributes"; + + leaf index { + type uint64; + description + "System generated index for each attribute set. The + index is used to reference an attribute set from a + specific path. Multiple paths may reference the same + attribute set."; + } + + uses bgp-shared-common-attr-state; + } + uses bgp-aggregator-attr-top; + uses bgp-as-path-attr-top; + uses bgp-as4-path-attr-top; + uses bgp-tunnel-encapsulation-attr-top; + } + } + } + + grouping community-sets-top { + description + "Top level grouping for list of shared community attribute + sets"; + + container communities { + description + "Enclosing container for the list of community attribute + sets"; + + list community { + key "index"; + + description + "List of path attributes that may be in use by multiple + routes in the table"; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the list key"; + } + + container state { + config false; + description + "Operational state for shared BGP community attribute"; + + leaf index { + type uint64; + description + "System generated index for each attribute set. The + index is used to reference an attribute set from a + specific path. Multiple paths may reference the same + attribute set."; + } + + uses bgp-community-attr-state; + } + } + } + } + + grouping ext-community-sets-top { + description + "Top level grouping for list of extended community attribute + sets"; + + container ext-communities { + description + "Enclosing container for the list of extended community + attribute sets"; + + list ext-community { + key "index"; + + description + "List of path attributes that may be in use by multiple + routes in the table"; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the list key"; + } + + container state { + config false; + description + "Operational state for shared BGP extended community + attribute"; + + leaf index { + type uint64; + description + "System generated index for each attribute set. The + index is used to reference an attribute set from a + specific path. Multiple paths may reference the same + attribute set."; + } + + uses bgp-extended-community-attr-state; + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-table-attributes@2019-04-25.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-table-attributes@2019-04-25.yang new file mode 100644 index 0000000..ec1c738 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-table-attributes@2019-04-25.yang @@ -0,0 +1,137 @@ +submodule openconfig-rib-bgp-table-attributes { + + belongs-to openconfig-rib-bgp { + prefix "oc-rib-bgp"; + } + + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-types { prefix oc-types; } + import openconfig-rib-bgp-types { prefix oc-bgpribt; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains common data definitions for data + related to a RIB entry, or RIB table."; + + oc-ext:openconfig-version "0.6.0"; + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + grouping bgp-common-route-annotations-state { + description + "Data definitions for flags and other information attached + to routes in both LOC-RIB and Adj-RIB"; + + leaf last-modified { + type oc-types:timeticks64; + description + "Timestamp when this path was last modified. + + The value is the timestamp relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf valid-route { + type boolean; + description + "Indicates that the route is considered valid by the + local router"; + } + + leaf invalid-reason { + type identityref { + base oc-bgpribt:INVALID_ROUTE_REASON; + } + description + "If the route is rejected as invalid, this indicates the + reason."; + } + + } + + grouping bgp-loc-rib-route-annotations-state { + description + "Data definitions for information attached to routes in the + LOC-RIB"; + + // placeholder for route metadata specific to the LOC-RIB + + } + + grouping bgp-adj-rib-in-post-route-annotations-state { + description + "Data definitions for information attached to routes in the + Adj-RIB-in post-policy table"; + + leaf best-path { + type boolean; + description + "Current path was selected as the best path."; + } + } + + grouping bgp-common-table-attrs-state { + description + "Common attributes attached to all routing tables"; + + // placeholder for metadata associated with all tables + } + + grouping bgp-common-table-attrs-top { + description + "Operational state data for common attributes attached to + all routing tables"; + // no enclosing container as this data will fit under an + // existing LOC-RIB container + + container state { + config false; + description + "Operational state data for data related to the entire + LOC-RIB"; + + uses bgp-common-table-attrs-state; + } + } + + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-tables@2019-10-15.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-tables@2019-10-15.yang new file mode 100644 index 0000000..4d9875b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-tables@2019-10-15.yang @@ -0,0 +1,916 @@ +submodule openconfig-rib-bgp-tables { + + belongs-to openconfig-rib-bgp { + prefix "oc-rib-bgp"; + } + + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-policy-types { prefix oc-pol-types; } + + include openconfig-rib-bgp-attributes; + include openconfig-rib-bgp-shared-attributes; + include openconfig-rib-bgp-table-attributes; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This submodule contains structural data definitions for + BGP routing tables."; + + oc-ext:openconfig-version "0.7.0"; + + revision "2019-10-15" { + description + "Change imported segment-routing module."; + reference "0.7.0"; + } + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + + grouping bgp-adj-rib-common-attr-refs { + description + "Definitions of common references to attribute sets for + multiple AFI-SAFIs for Adj-RIB tables"; + + leaf attr-index { + type leafref { + path "../../../../../../../../../../attr-sets/attr-set/" + + "state/index"; + } + description + "Reference to the common attribute group for the + route"; + } + + leaf community-index { + type leafref { + path "../../../../../../../../../../communities/community/" + + "state/index"; + } + description + "Reference to the community attribute for the route"; + } + + leaf ext-community-index { + type leafref { + path "../../../../../../../../../../ext-communities/" + + "ext-community/state/index"; + } + description + "Reference to the extended community attribute for the + route"; + } + } + + grouping bgp-loc-rib-common-attr-refs { + description + "Definitions of common references to attribute sets for + multiple AFI-SAFIs for LOC-RIB tables"; + + leaf attr-index { + type leafref { + path "../../../../../../../../attr-sets/attr-set/" + + "state/index"; + } + description + "Reference to the common attribute group for the + route"; + } + + leaf community-index { + type leafref { + path "../../../../../../../../communities/community/" + + "state/index"; + } + description + "Reference to the community attribute for the route"; + } + + leaf ext-community-index { + type leafref { + path "../../../../../../../../ext-communities/" + + "ext-community/state/index"; + } + description + "Reference to the extended community attribute for the + route"; + } + } + + grouping bgp-loc-rib-common-keys { + description + "Common references used in keys for IPv4 and IPv6 + LOC-RIB entries"; + + leaf origin { + type union { + type oc-inet:ip-address; + type identityref { + base oc-pol-types:INSTALL_PROTOCOL_TYPE; + } + } + description + "Indicates the origin of the route. If the route is learned + from a neighbor, this value is the neighbor address. If + the route was injected or redistributed from another + protocol, the origin indicates the source protocol for the + route."; + } + + leaf path-id { + type uint32; + default 0; + description + "If the route is learned from a neighbor, the path-id + corresponds to the path-id for the route in the + corresponding adj-rib-in-post table. If the route is + injected from another protocol, or the neighbor does not + support BGP add-paths, the path-id should be set + to zero, also the default value."; + } + } + + grouping bgp-loc-rib-key-refs { + description + "Key references to support operational state structure for + the BGP LOC-RIB table"; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the prefix list key"; + } + + leaf origin { + type leafref { + path "../state/origin"; + } + description + "Reference to the origin list key"; + } + + leaf path-id { + type leafref { + path "../state/path-id"; + } + description + "Reference to the path-id list key"; + } + } + + grouping ipv4-loc-rib-top { + description + "Top-level grouping for IPv4 routing tables"; + + container loc-rib { + config false; + description + "Container for the IPv4 BGP LOC-RIB data"; + + uses bgp-common-table-attrs-top; + + container routes { + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix origin path-id"; + + description + "List of routes in the table, keyed by the route + prefix, the route origin, and path-id. The route + origin can be either the neighbor address from which + the route was learned, or the source protocol that + injected the route. The path-id distinguishes routes + for the same prefix received from a neighbor (e.g., + if add-paths is eanbled)."; + + uses bgp-loc-rib-key-refs; + + container state { + description + "Operational state data for route entries in the + BGP LOC-RIB"; + + leaf prefix { + type oc-inet:ipv4-prefix; + description + "The IPv4 prefix corresponding to the route"; + } + + uses bgp-loc-rib-common-keys; + uses bgp-loc-rib-common-attr-refs; + uses bgp-loc-rib-attr-state; + uses bgp-common-route-annotations-state; + uses bgp-loc-rib-route-annotations-state; + + } + + uses bgp-unknown-attr-top; + + } + } + } + } + + grouping ipv6-loc-rib-top { + description + "Top-level grouping for IPv6 routing tables"; + + container loc-rib { + config false; + description + "Container for the IPv6 BGP LOC-RIB data"; + + uses bgp-common-table-attrs-top; + + container routes { + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix origin path-id"; + + description + "List of routes in the table, keyed by the route + prefix, the route origin, and path-id. The route + origin can be either the neighbor address from which + the route was learned, or the source protocol that + injected the route. The path-id distinguishes routes + for the same prefix received from a neighbor (e.g., + if add-paths is eanbled)."; + + uses bgp-loc-rib-key-refs; + + container state { + description + "Operational state data for route entries in the + BGP LOC-RIB"; + + leaf prefix { + type oc-inet:ipv6-prefix; + description + "The IPv6 prefix corresponding to the route"; + } + + uses bgp-loc-rib-common-keys; + uses bgp-loc-rib-common-attr-refs; + uses bgp-loc-rib-attr-state; + uses bgp-common-route-annotations-state; + uses bgp-loc-rib-route-annotations-state; + + } + + uses bgp-unknown-attr-top; + } + } + } + } + + grouping bgp-adj-rib-key-refs { + description + "Key references to support operational state structure for + the BGP Adj-RIB tables"; + + leaf prefix { + type leafref { + path "../state/prefix"; + } + description + "Reference to the prefix list key"; + } + + leaf path-id { + type leafref { + path "../state/path-id"; + } + description + "Reference to the path-id list key"; + } + } + + grouping ipv4-adj-rib-common { + description + "Common structural grouping for each IPv4 adj-RIB table"; + + uses bgp-common-table-attrs-top; + + container routes { + config false; + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix path-id"; + + description + "List of routes in the table, keyed by a combination of + the route prefix and path-id to distinguish multiple + routes received from a neighbor for the same prefix, + e.g., when BGP add-paths is enabled."; + + uses bgp-adj-rib-key-refs; + + container state { + description + "Operational state data for BGP Adj-RIB entries"; + + leaf prefix { + type oc-inet:ipv4-prefix; + description + "Prefix for the route"; + } + + uses bgp-adj-rib-attr-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + } + + uses bgp-unknown-attr-top; + + } + } + } + + grouping ipv4-adj-rib-in-post { + description + "Common structural grouping for the IPv4 adj-rib-in + post-policy table"; + + uses bgp-common-table-attrs-top; + + container routes { + config false; + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix path-id"; + + description + "List of routes in the table, keyed by a combination of + the route prefix and path-id to distinguish multiple + routes received from a neighbor for the same prefix, + e.g., when BGP add-paths is enabled."; + + uses bgp-adj-rib-key-refs; + + container state { + description + "Operational state data for BGP Adj-RIB entries"; + + leaf prefix { + type oc-inet:ipv4-prefix; + description + "Prefix for the route"; + } + + uses bgp-adj-rib-attr-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + uses bgp-adj-rib-in-post-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + + + grouping ipv4-adj-rib-top { + description + "Top-level grouping for Adj-RIB table"; + + container neighbors { + config false; + description + "Enclosing container for neighbor list"; + + list neighbor { + key "neighbor-address"; + description + "List of neighbors (peers) of the local BGP speaker"; + + leaf neighbor-address { + type leafref { + path "../state/neighbor-address"; + } + description + "Reference to the list key"; + } + + container state { + description + "Operational state for each neighbor BGP Adj-RIB"; + + leaf neighbor-address { + type oc-inet:ip-address; + description + "IP address of the BGP neighbor or peer"; + } + } + + container adj-rib-in-pre { + description + "Per-neighbor table containing the NLRI updates + received from the neighbor before any local input + policy rules or filters have been applied. This can + be considered the 'raw' updates from the neighbor."; + + uses ipv4-adj-rib-common; + + } + + container adj-rib-in-post { + description + "Per-neighbor table containing the paths received from + the neighbor that are eligible for best-path selection + after local input policy rules have been applied."; + + uses ipv4-adj-rib-in-post; + } + + container adj-rib-out-pre { + description + "Per-neighbor table containing paths eligble for + sending (advertising) to the neighbor before output + policy rules have been applied"; + + uses ipv4-adj-rib-common; + + } + + container adj-rib-out-post { + description + "Per-neighbor table containing paths eligble for + sending (advertising) to the neighbor after output + policy rules have been applied"; + + uses ipv4-adj-rib-common; + + } + } + } + } + + grouping ipv6-adj-rib-common { + description + "Common structural grouping for each IPv6 adj-RIB table"; + + uses bgp-common-table-attrs-state; + + container routes { + config false; + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix path-id"; + + description + "List of routes in the table"; + + uses bgp-adj-rib-key-refs; + + container state { + description + "Operational state data for BGP Adj-RIB entries"; + + leaf prefix { + type oc-inet:ipv6-prefix; + description + "Prefix for the route"; + } + + uses bgp-adj-rib-attr-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + + grouping ipv6-adj-rib-in-post { + description + "Common structural grouping for the IPv6 adj-rib-in + post-policy table"; + + uses bgp-common-table-attrs-state; + + container routes { + config false; + description + "Enclosing container for list of routes in the routing + table."; + + list route { + key "prefix path-id"; + + description + "List of routes in the table"; + + uses bgp-adj-rib-key-refs; + + container state { + description + "Operational state data for BGP Adj-RIB entries"; + + leaf prefix { + type oc-inet:ipv6-prefix; + description + "Prefix for the route"; + } + + uses bgp-adj-rib-attr-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + uses bgp-adj-rib-in-post-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + + grouping ipv6-adj-rib-top { + description + "Top-level grouping for Adj-RIB table"; + + container neighbors { + config false; + description + "Enclosing container for neighbor list"; + + list neighbor { + key "neighbor-address"; + description + "List of neighbors (peers) of the local BGP speaker"; + + leaf neighbor-address { + type leafref { + path "../state/neighbor-address"; + } + description + "Reference to the list key"; + } + + container state { + description + "Operational state for each neighbor BGP Adj-RIB"; + + leaf neighbor-address { + type oc-inet:ip-address; + description + "IP address of the BGP neighbor or peer"; + } + } + + container adj-rib-in-pre { + description + "Per-neighbor table containing the NLRI updates + received from the neighbor before any local input + policy rules or filters have been applied. This can + be considered the 'raw' updates from the neighbor."; + + uses ipv6-adj-rib-common; + + } + + container adj-rib-in-post { + description + "Per-neighbor table containing the paths received from + the neighbor that are eligible for best-path selection + after local input policy rules have been applied."; + + uses ipv6-adj-rib-in-post; + } + + container adj-rib-out-pre { + description + "Per-neighbor table containing paths eligble for + sending (advertising) to the neighbor before output + policy rules have been applied"; + + uses ipv6-adj-rib-common; + + } + + container adj-rib-out-post { + description + "Per-neighbor table containing paths eligble for + sending (advertising) to the neighbor after output + policy rules have been applied"; + + uses ipv6-adj-rib-common; + + } + } + } + } + + grouping ipvX-srte-policy-adjrib-top { + description + "Top-level grouping for the IPv4 and IPv6 AFI, SR-TE Policy SAFI + Adj-RIBs."; + + container neighbors { + description + "Surrounding container for the list of neighbours that are + enabled for the IPv4 and IPv6 AFI, SR-TE Policy SAFI address + family."; + + list neighbor { + key "neighbor-address"; + + description + "An individual neighbour that is enabled for the SR-TE + Policy SAFI."; + + leaf neighbor-address { + type leafref { + path "../state/neighbor-address"; + } + description + "Reference to the address of the neighbour for which the + Adj-RIBs specified are maintained."; + } + + container state { + description + "Operational state parameters of the BGP neighbour for + which the SR-TE Policy SAFI is enabled."; + uses ipvX-srte-policy-adjrib-neighbor-state; + } + + container adj-rib-in-pre { + description + "The Adj-RIB-In for the SR-TE Policy SAFI for the neighbour, + prior to any inbound policy constraints or modifications + having been applied."; + uses ipvX-srte-policy-adjrib-common; + } + + container adj-rib-in-post { + description + "The Adj-RIB-In for the SR-TE Policy SAFI for the neighbour, + following any inbound policy constraints or modifications + being made."; + uses ipvX-srte-policy-adjrib-in-post; + } + + container adj-rib-out-pre { + description + "The Adj-RIB-Out for the SR-TE Policy SAFI for the neighbour, + prior to any outgoing policy modifications or constraints + having been applied."; + uses ipvX-srte-policy-adjrib-common; + } + + container adj-rib-out-post { + description + "The Adj-RIB-Out for the SR-TE Policy SAFI for the neighbour, + follow any outbound policy constraints or modifications being + made."; + uses ipvX-srte-policy-adjrib-common; + } + } + } + } + + grouping ipvX-srte-policy-adjrib-neighbor-state { + description + "Common attributes for each neighbour for which the SR-TE + Policy SAFI RIBs are being maintained."; + + leaf neighbor-address { + description + "The address of the neighbour for which the SR-TE policy + SAFI has been negotiated."; + type oc-inet:ip-address; + } + } + + grouping ipvX-srte-policy-adjrib-common { + description + "Common structure containing the routes that are learnt via + the IPv4 or IPv6 SR-TE Policy SAFI."; + + container routes { + description + "Surrounding container for the list of routes within the + SR-TE Policy SAFI."; + + list route { + key "path-id endpoint color"; + + description + "The routes within the SR-TE Policy SAFI Adj-RIB. The + routes are keyed on the path-id - set to a non-zero + value only if ADD-PATHS is being used; the color; and + the endpoint. The colour and endpoint are extracted from + the NLRI."; + + uses ipvX-srte-policy-common-keys; + + container state { + description + "State parameters for entries within the Adj-RIB used + to store SR-TE Policy SAFI routes."; + + uses ipvX-srte-policy-common-route-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + + grouping ipvX-srte-policy-common-route-state { + description + "Common attributes used SR-TE Policy SAFI routes."; + + leaf path-id { + type uint32; + default 0; + description + "Identifier for the path when using BGP ADD-PATHS for the SR-TE + policy SAFI."; + } + + leaf endpoint { + type oc-inet:ip-address; + description + "A unique identifier for the remote set of nodes. When the address + family is IPv4, the value is a 4-octet IPv4 address. When the + address family is IPv6, the value is a 16-octet IPv6 address."; + } + + leaf color { + type uint32; + description + "A 4-octet value identifying the policy. Combined with the endpoint + the endpoint and colour represent the unique policy."; + } + } + + grouping ipvX-srte-policy-common-keys { + description + "Common grouping of the keys used for lists of SR-TE policy + SAFI routes."; + + leaf path-id { + type leafref { + path "../state/path-id"; + } + description + "Reference to the path identifier for the SR-TE Policy SAFI + route. The value is only non-zero if ADD-PATHS is not being + used."; + } + + leaf endpoint { + type leafref { + path "../state/endpoint"; + } + description + "Reference to the endpoint used for the SR-TE Policy SAFI + route within the NLRI."; + } + + leaf color { + type leafref { + path "../state/color"; + } + description + "Reference to the colour used for the SR-TE policy SAFI + route within the NLRI."; + } + } + + grouping ipvX-srte-policy-adjrib-in-post { + description + "Grouping for the post-policy Adj-RIB-In for SR-TE Policy SAFI routes"; + + container routes { + description + "The set of routes that are within the Adj-RIB-Out for the + neighbour."; + + list route { + key "path-id endpoint color"; + + description + "The routes that are in the Adj-RIB-In-Post for the specified + BGP neighbour within the SR-TE Policy SAFI for the specified + address family."; + + uses ipvX-srte-policy-common-keys; + + container state { + description + "Operational state attributes related to the route within + the SR-TE Policy SAFI Adj-RIB-In-Post for the specified + neighbour."; + + uses ipvX-srte-policy-common-route-state; + uses bgp-adj-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + uses bgp-adj-rib-in-post-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + + grouping ipvX-srte-policy-locrib-top { + description + "Top-level grouping for the Loc-RIB for IPv4 or IPv6 Adj-RIB + for SR-TE Policy SAFI."; + + container loc-rib { + description + "The Loc-RIB for the SR-TE Policy SAFI for IPv4 or IPv6 Unicast + AFIs."; + + container routes { + description + "List of routes within the SR-TE Policy SAFI, for the IPv4 or + IPv6 AFI."; + + list route { + key "path-id endpoint color"; + + description + "Route within the specified address family for the SR-TE + Policy SAFI."; + + uses ipvX-srte-policy-common-keys; + + container state { + description + "Operational state attributes for each route within the + IPv4 or IPv6 Unicast SR-TE Policy SAFI."; + + uses ipvX-srte-policy-common-route-state; + uses bgp-loc-rib-common-attr-refs; + uses bgp-common-route-annotations-state; + } + + uses bgp-unknown-attr-top; + } + } + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp-types@2019-03-14.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp-types@2019-03-14.yang new file mode 100644 index 0000000..e5031c7 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp-types@2019-03-14.yang @@ -0,0 +1,269 @@ +module openconfig-rib-bgp-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/rib/bgp-types"; + + prefix "oc-bgprib-types"; + + import openconfig-extensions { prefix oc-ext; } + + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Defines identity and type defintions associated with + the OpenConfig BGP RIB modules"; + + oc-ext:openconfig-version "0.5.0"; + + revision "2019-03-14" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + revision "2016-04-11" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + identity INVALID_ROUTE_REASON { + description + "Base identity for reason code for routes that are rejected as + invalid. Some derived entities are based on BMP v3"; + reference "BGP Monitoring Protocol (draft-ietf-grow-bmp-07)"; + } + + identity INVALID_CLUSTER_LOOP { + base INVALID_ROUTE_REASON; + description + "Route was invalid due to CLUSTER_LIST loop"; + } + + identity INVALID_AS_LOOP { + base INVALID_ROUTE_REASON; + description + "Route was invalid due to AS_PATH loop"; + } + + identity INVALID_ORIGINATOR { + base INVALID_ROUTE_REASON; + description + "Route was invalid due to ORIGINATOR_ID, e.g., update has + local router as originator"; + } + + identity INVALID_CONFED { + base INVALID_ROUTE_REASON; + description + "Route was invalid due to a loop in the AS_CONFED_SEQUENCE or + AS_CONFED_SET attributes"; + } + + identity BGP_NOT_SELECTED_BESTPATH { + description + "Base identity for indicating reason a route was was not + selected by BGP route selection algorithm"; + reference + "RFC 4271 - Section 9.1"; + } + + identity LOCAL_PREF_LOWER { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route has a lower localpref attribute than current best path"; + reference + "RFC 4271 - Section 9.1.2"; + } + + identity AS_PATH_LONGER { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route has a longer AS path attribute than current best path"; + reference + "RFC 4271 - Section 9.1.2.2 (a)"; + } + + identity ORIGIN_TYPE_HIGHER { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route has a higher origin type, i.e., IGP origin is preferred + over EGP or incomplete"; + reference + "RFC 4271 - Section 9.1.2.2 (b)"; + } + + identity MED_HIGHER { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route has a higher MED, or metric, attribute than the current + best path"; + reference + "RFC 4271 - Section 9.1.2.2 (c)"; + } + + identity PREFER_EXTERNAL { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route source is via IGP, rather than EGP."; + reference + "RFC 4271 - Section 9.1.2.2 (d)"; + } + + identity NEXTHOP_COST_HIGHER { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route has a higher interior cost to the next hop."; + reference + "RFC 4271 - Section 9.1.2.2 (e)"; + } + + identity HIGHER_ROUTER_ID { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route was sent by a peer with a higher BGP Identifier value, + or router id"; + reference + "RFC 4271 - Section 9.1.2.2 (f)"; + } + + identity HIGHER_PEER_ADDRESS { + base BGP_NOT_SELECTED_BESTPATH; + description + "Route was sent by a peer with a higher IP address"; + reference + "RFC 4271 - Section 9.1.2.2 (g)"; + } + + identity BGP_NOT_SELECTED_POLICY { + description + "Base identity for reason code for routes that are rejected + due to policy"; + } + + identity REJECTED_IMPORT_POLICY { + base BGP_NOT_SELECTED_POLICY; + description + "Route was rejected after apply import policies"; + } + + identity TUNNEL_ENCAPSULATION_TYPE { + description + "Types of tunnel encapsulation, as described by the Tunnel + Encapsulation attribute"; + reference + "RFC5512"; + } + + identity SRTE_POLICY_TUNNEL { + base TUNNEL_ENCAPSULATION_TYPE; + description + "Segment Routing Traffic Engineering Policy tunnel."; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity TUNNEL_ENCAPSULATION_SUBTLV_TYPE { + description + "SubTLVs of the Tunnel Encapsulation attribute"; + reference + "RFC5512"; + } + + identity TUNNEL_REMOTE_ENDPOINT { + base TUNNEL_ENCAPSULATION_SUBTLV_TYPE; + description + "Remote endpoint of the tunnel."; + reference + "RFC5512"; + } + + identity TUNNEL_COLOR { + base TUNNEL_ENCAPSULATION_SUBTLV_TYPE; + description + "Colour of the tunnel"; + reference + "RFC5512"; + } + + identity SRTE_PREFERENCE { + base TUNNEL_ENCAPSULATION_SUBTLV_TYPE; + description + "Preference of the SR-TE policy entry described by + the tunnel encapsulation attribute."; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity SRTE_BINDING_SID { + base TUNNEL_ENCAPSULATION_SUBTLV_TYPE; + description + "Binding SID to be used by the SR-TE policy described + by the tunnel encapsulation attribute."; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity SRTE_SEGMENT_LIST { + base TUNNEL_ENCAPSULATION_SUBTLV_TYPE; + description + "Segment lists to be used by the SR-TE policy described + by the tunnel encapsulation attribute."; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity SRTE_SEGMENT_LIST_SUBTLV { + description + "SubTLVs of the SR-TE Policy Segment List sub-TLV of the + Tunnel Encapsulation attribute."; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity SRTE_SEGMENT_LIST_WEIGHT { + base SRTE_SEGMENT_LIST_SUBTLV; + description + "Weight of the segment list within the SR-TE policy"; + reference + "draft-previdi-idr-segment-routing-te-policy"; + } + + identity SRTE_SEGMENT_LIST_SEGMENT { + base SRTE_SEGMENT_LIST_SUBTLV; + description + "An individual element within the SR-TE Policy Segment + List."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-rib-bgp@2019-10-15.yang b/exp/yangcli/h3c-yang/openconfig-rib-bgp@2019-10-15.yang new file mode 100644 index 0000000..8920fcf --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rib-bgp@2019-10-15.yang @@ -0,0 +1,239 @@ +module openconfig-rib-bgp { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/rib/bgp"; + + prefix "oc-rib-bgp"; + + // import some basic types + import openconfig-bgp-types { prefix oc-bgpt; } + import openconfig-extensions { prefix oc-ext; } + + // include RIB submodules + + // structure for LOC-RIB and Adj-RIB tables + include openconfig-rib-bgp-tables; + + // structure of shared attribute groups + include openconfig-rib-bgp-shared-attributes; + + // groupings of attributes in three categories: + // - shared across multiple routes + // - common to LOC-RIB and Adj-RIB, but not shared across routes + // - specific to LOC-RIB or Adj-RIB + include openconfig-rib-bgp-attributes; + + // groupings of annotations for each route or table + include openconfig-rib-bgp-table-attributes; + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Defines a data model for representing BGP routing table (RIB) + contents. The model supports 5 logical RIBs per address family: + + loc-rib: This is the main BGP routing table for the local routing + instance, containing best-path selections for each prefix. The + loc-rib table may contain multiple routes for a given prefix, + with an attribute to indicate which was selected as the best + path. Note that multiple paths may be used or advertised even if + only one path is marked as best, e.g., when using BGP + add-paths. An implementation may choose to mark multiple + paths in the RIB as best path by setting the flag to true for + multiple entries. + + adj-rib-in-pre: This is a per-neighbor table containing the NLRI + updates received from the neighbor before any local input policy + rules or filters have been applied. This can be considered the + 'raw' updates from a given neighbor. + + adj-rib-in-post: This is a per-neighbor table containing the + routes received from the neighbor that are eligible for + best-path selection after local input policy rules have been + applied. + + adj-rib-out-pre: This is a per-neighbor table containing routes + eligible for sending (advertising) to the neighbor before output + policy rules have been applied. + + adj-rib-out-post: This is a per-neighbor table containing routes + eligible for sending (advertising) to the neighbor after output + policy rules have been applied."; + + oc-ext:openconfig-version "0.7.0"; + + revision "2019-10-15" { + description + "Change imported segment-routing module."; + reference "0.7.0"; + } + + revision "2019-04-25" { + description + "Update last-modified timestamp to be expressed as nanoseconds + since the Unix epoch."; + reference "0.6.0"; + } + + revision "2019-04-16" { + description + "Rename the top-level BGP RIB container's name + to RIB."; + reference "0.5.0"; + } + + revision "2019-02-27" { + description + "Remove top-level BGP RIB container, and update list + names to be compatible with path compression."; + reference "0.4.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2016-10-17" { + description + "OpenConfig BGP RIB refactor"; + reference "0.3.0"; + } + + revision "2016-04-11" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + + + // grouping statements + + + + grouping bgp-rib-state { + description + "Operational state data for the top level BGP RIB"; + + leaf afi-safi-name { + type identityref { + base oc-bgpt:AFI_SAFI_TYPE; + } + description "AFI,SAFI"; + } + } + + grouping bgp-rib-top { + description + "Top-level grouping for the BGP RIB"; + + container rib { + config false; + description + "Top level container for BGP RIBs"; + + uses attribute-sets-top; + uses community-sets-top; + uses ext-community-sets-top; + + container afi-safis { + config false; + description + "Enclosing container for address family list"; + + list afi-safi { + key "afi-safi-name"; + description + "list of afi-safi types"; + + leaf afi-safi-name { + type leafref { + path "../state/afi-safi-name"; + } + description + "Reference to the list key"; + } + + container state { + config false; + description + "Operational state data for the BGP list"; + + uses bgp-rib-state; + } + + container ipv4-unicast { + when "../afi-safi-name = 'oc-bgpt:IPV4_UNICAST'" { + description + "Include this container for IPv4 unicast RIB"; + } + description + "Routing tables for IPv4 unicast -- active when the + afi-safi name is ipv4-unicast"; + + uses ipv4-loc-rib-top; + uses ipv4-adj-rib-top; + } + + container ipv6-unicast { + when "../afi-safi-name = 'oc-bgpt:IPV6_UNICAST'" { + description + "Include this container for IPv6 unicast RIB"; + } + description + "Routing tables for IPv6 unicast -- active when the + afi-safi name is ipv6-unicast"; + + uses ipv6-loc-rib-top; + uses ipv6-adj-rib-top; + } + + container ipv4-srte-policy { + when "../afi-safi-name = 'oc-bgpt:SRTE_POLICY_IPV4'" { + description + "Include this container only for the IPv4 AFI, SR-TE Policy + SAFI."; + } + description + "Routing tables for the IPv4 Unicast, SR-TE Policy SAFI."; + + uses ipvX-srte-policy-locrib-top; + uses ipvX-srte-policy-adjrib-top; + } + + container ipv6-srte-policy { + when "../afi-safi-name = 'oc-bgpt:SRTE_POLICY_IPV6'" { + description + "Include this container only for the IPv6 AFI, SR-TE Policy + SAFI."; + } + description + "Routing tables for the IPv6 Unicast, SR-TE Policy SAFI."; + + uses ipvX-srte-policy-locrib-top; + uses ipvX-srte-policy-adjrib-top; + } + } + } + } + } + + + // data definition statements + // augment statements + + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-routing-policy@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-routing-policy@2018-11-21.yang new file mode 100644 index 0000000..28643dc --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-routing-policy@2018-11-21.yang @@ -0,0 +1,1107 @@ +module openconfig-routing-policy { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/routing-policy"; + + prefix "oc-rpol"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-policy-types { prefix oc-pol-types; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module describes a YANG model for routing policy + configuration. It is a limited subset of all of the policy + configuration parameters available in the variety of vendor + implementations, but supports widely used constructs for managing + how routes are imported, exported, and modified across different + routing protocols. This module is intended to be used in + conjunction with routing protocol configuration models (e.g., + BGP) defined in other modules. + + Route policy expression: + + Policies are expressed as a set of top-level policy definitions, + each of which consists of a sequence of policy statements. Policy + statements consist of simple condition-action tuples. Conditions + may include mutiple match or comparison operations, and similarly + actions may be multitude of changes to route attributes or a + final disposition of accepting or rejecting the route. + + Route policy evaluation: + + Policy definitions are referenced in routing protocol + configurations using import and export configuration statements. + The arguments are members of an ordered list of named policy + definitions which comprise a policy chain, and optionally, an + explicit default policy action (i.e., reject or accept). + + Evaluation of each policy definition proceeds by evaluating its + corresponding individual policy statements in order. When a + condition statement in a policy statement is satisfied, the + corresponding action statement is executed. If the action + statement has either accept-route or reject-route actions, policy + evaluation of the current policy definition stops, and no further + policy definitions in the chain are evaluated. + + If the condition is not satisfied, then evaluation proceeds to + the next policy statement. If none of the policy statement + conditions are satisfied, then evaluation of the current policy + definition stops, and the next policy definition in the chain is + evaluated. When the end of the policy chain is reached, the + default route disposition action is performed (i.e., reject-route + unless an an alternate default action is specified for the + chain). + + Policy 'subroutines' (or nested policies) are supported by + allowing policy statement conditions to reference another policy + definition which applies conditions and actions from the + referenced policy before returning to the calling policy + statement and resuming evaluation. If the called policy + results in an accept-route (either explicit or by default), then + the subroutine returns an effective true value to the calling + policy. Similarly, a reject-route action returns false. If the + subroutine returns true, the calling policy continues to evaluate + the remaining conditions (using a modified route if the + subroutine performed any changes to the route)."; + + oc-ext:openconfig-version "3.1.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "3.1.1"; + } + + revision "2018-06-05" { + description + "Add PIM, IGMP to INSTALL_PROTOCOL_TYPES identity"; + reference "3.1.0"; + } + + revision "2017-07-14" { + description + "Replace policy choice node/type with policy-result + enumeration;simplified defined set naming;removed generic + IGP actions; migrate to OpenConfig types; added mode for + prefix sets"; + reference "3.0.0"; + } + + revision "2016-05-12" { + description + "OpenConfig public release"; + reference "2.0.1"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedef statements + + typedef default-policy-type { + // this typedef retained for name compatibiity with default + // import and export policy + type enumeration { + enum ACCEPT_ROUTE { + description + "Default policy to accept the route"; + } + enum REJECT_ROUTE { + description + "Default policy to reject the route"; + } + } + description + "Type used to specify route disposition in + a policy chain"; + } + + typedef policy-result-type { + type enumeration { + enum ACCEPT_ROUTE { + description "Policy accepts the route"; + } + enum REJECT_ROUTE { + description "Policy rejects the route"; + } + } + description + "Type used to specify route disposition in + a policy chain"; + } + + + // grouping statements + + grouping prefix-set-config { + description + "Configuration data for prefix sets used in policy + definitions."; + + leaf name { + type string; + description + "name / label of the prefix set -- this is used to + reference the set in match conditions"; + } + + leaf mode { + type enumeration { + enum IPV4 { + description + "Prefix set contains IPv4 prefixes only"; + } + enum IPV6 { + description + "Prefix set contains IPv6 prefixes only"; + } + enum MIXED { + description + "Prefix set contains mixed IPv4 and IPv6 prefixes"; + } + } + description + "Indicates the mode of the prefix set, in terms of which + address families (IPv4, IPv6, or both) are present. The + mode provides a hint, but the device must validate that all + prefixes are of the indicated type, and is expected to + reject the configuration if there is a discrepancy. The + MIXED mode may not be supported on devices that require + prefix sets to be of only one address family."; + } + + } + + grouping prefix-set-state { + description + "Operational state data for prefix sets"; + } + + grouping prefix-set-top { + description + "Top-level data definitions for a list of IPv4 or IPv6 + prefixes which are matched as part of a policy"; + + container prefix-sets { + description + "Enclosing container "; + + list prefix-set { + key "name"; + description + "List of the defined prefix sets"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to prefix name list key"; + } + + container config { + description + "Configuration data for prefix sets"; + + uses prefix-set-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses prefix-set-config; + uses prefix-set-state; + } + + uses prefix-top; + } + } + } + + grouping prefix-config { + description + "Configuration data for a prefix definition"; + + leaf ip-prefix { + type oc-inet:ip-prefix; + mandatory true; + description + "The prefix member in CIDR notation -- while the + prefix may be either IPv4 or IPv6, most + implementations require all members of the prefix set + to be the same address family. Mixing address types in + the same prefix set is likely to cause an error."; + } + + leaf masklength-range { + type string { + pattern '^([0-9]+\.\.[0-9]+)|exact$'; + } + description + "Defines a range for the masklength, or 'exact' if + the prefix has an exact length. + + Example: 10.3.192.0/21 through 10.3.192.0/24 would be + expressed as prefix: 10.3.192.0/21, + masklength-range: 21..24. + + Example: 10.3.192.0/21 would be expressed as + prefix: 10.3.192.0/21, + masklength-range: exact"; + } + } + + grouping prefix-state { + description + "Operational state data for prefix definitions"; + } + + grouping prefix-top { + description + "Top-level grouping for prefixes in a prefix list"; + + container prefixes { + description + "Enclosing container for the list of prefixes in a policy + prefix list"; + + list prefix { + key "ip-prefix masklength-range"; + description + "List of prefixes in the prefix set"; + + leaf ip-prefix { + type leafref { + path "../config/ip-prefix"; + } + description + "Reference to the ip-prefix list key."; + } + + leaf masklength-range { + type leafref { + path "../config/masklength-range"; + } + description + "Reference to the masklength-range list key"; + } + + container config { + description + "Configuration data for prefix definition"; + + uses prefix-config; + } + + container state { + + config false; + + description + "Operational state data for prefix definition"; + + uses prefix-config; + uses prefix-state; + } + } + } + } + + grouping neighbor-set-config { + description + "Configuration data for neighbor set definitions"; + + leaf name { + type string; + description + "name / label of the neighbor set -- this is used to + reference the set in match conditions"; + } + + leaf-list address { + type oc-inet:ip-address; + description + "List of IP addresses in the neighbor set"; + } + } + + grouping neighbor-set-state { + description + "Operational state data for neighbor set definitions"; + } + + grouping neighbor-set-top { + description + "Top-level data definition for a list of IPv4 or IPv6 + neighbors which can be matched in a routing policy"; + + container neighbor-sets { + description + "Enclosing container for the list of neighbor set + definitions"; + + list neighbor-set { + key "name"; + description + "List of defined neighbor sets for use in policies."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the neighbor set name list key."; + } + + container config { + description + "Configuration data for neighbor sets."; + + uses neighbor-set-config; + } + + container state { + + config false; + + description + "Operational state data for neighbor sets."; + + uses neighbor-set-config; + uses neighbor-set-state; + } + } + } + } + + grouping tag-set-config { + description + "Configuration data for tag set definitions."; + + leaf name { + type string; + description + "name / label of the tag set -- this is used to reference + the set in match conditions"; + } + + leaf-list tag-value { + type oc-pol-types:tag-type; + description + "Value of the tag set member"; + } + } + + grouping tag-set-state { + description + "Operational state data for tag set definitions."; + } + + grouping tag-set-top { + description + "Top-level data definitions for a list of tags which can + be matched in policies"; + + container tag-sets { + description + "Enclosing container for the list of tag sets."; + + list tag-set { + key "name"; + description + "List of tag set definitions."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the tag set name list key"; + } + + container config { + description + "Configuration data for tag sets"; + + uses tag-set-config; + } + + container state { + + config false; + + description + "Operational state data for tag sets"; + + uses tag-set-config; + uses tag-set-state; + } + } + } + } + + grouping generic-defined-sets { + description + "Data definitions for pre-defined sets of attributes used in + policy match conditions. These sets are generic and can + be used in matching conditions in different routing + protocols."; + + uses prefix-set-top; + uses neighbor-set-top; + uses tag-set-top; + } + + grouping match-set-options-group { + description + "Grouping containing options relating to how a particular set + should be matched"; + + leaf match-set-options { + type oc-pol-types:match-set-options-type; + description + "Optional parameter that governs the behaviour of the + match operation"; + } + } + + grouping match-set-options-restricted-group { + description + "Grouping for a restricted set of match operation modifiers"; + + leaf match-set-options { + type oc-pol-types:match-set-options-restricted-type; + description + "Optional parameter that governs the behaviour of the + match operation. This leaf only supports matching on ANY + member of the set or inverting the match. Matching on ALL is + not supported"; + } + } + + grouping match-interface-condition-config { + description + "Configuration data for interface match condition"; + + uses oc-if:interface-ref-common; + } + + grouping match-interface-condition-state { + description + "Operational state data for interface match condition"; + } + + grouping match-interface-condition-top { + description + "Top-level grouping for the interface match condition"; + + container match-interface { + description + "Top-level container for interface match conditions"; + + container config { + description + "Configuration data for interface match conditions"; + + uses match-interface-condition-config; + } + + container state { + + config false; + + description + "Operational state data for interface match conditions"; + + uses match-interface-condition-config; + uses match-interface-condition-state; + } + + } + } + + grouping prefix-set-condition-config { + description + "Configuration data for prefix-set conditions"; + + leaf prefix-set { + type leafref { + path "../../../../../../../../defined-sets/" + + "prefix-sets/prefix-set/config/name"; + } + description "References a defined prefix set"; + } + uses match-set-options-restricted-group; + } + + + grouping prefix-set-condition-state { + description + "Operational state data for prefix-set conditions"; + } + + grouping prefix-set-condition-top { + description + "Top-level grouping for prefix-set conditions"; + + container match-prefix-set { + description + "Match a referenced prefix-set according to the logic + defined in the match-set-options leaf"; + + container config { + description + "Configuration data for a prefix-set condition"; + + uses prefix-set-condition-config; + } + + container state { + + config false; + + description + "Operational state data for a prefix-set condition"; + + uses prefix-set-condition-config; + uses prefix-set-condition-state; + } + } + } + + grouping neighbor-set-condition-config { + description + "Configuration data for neighbor-set conditions"; + + leaf neighbor-set { + type leafref { + path "../../../../../../../../defined-sets/neighbor-sets/" + + "neighbor-set/name"; + //TODO: require-instance should be added when it's + //supported in YANG 1.1 + //require-instance true; + } + description "References a defined neighbor set"; + } + + uses match-set-options-restricted-group; + } + + grouping neighbor-set-condition-state { + description + "Operational state data for neighbor-set conditions"; + } + + grouping neighbor-set-condition-top { + description + "Top-level grouping for neighbor-set conditions"; + + container match-neighbor-set { + description + "Match a referenced neighbor set according to the logic + defined in the match-set-options-leaf"; + + container config { + description + "Configuration data "; + + uses neighbor-set-condition-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses neighbor-set-condition-config; + uses neighbor-set-condition-state; + } + } + } + + grouping tag-set-condition-config { + description + "Configuration data for tag-set condition statements"; + + leaf tag-set { + type leafref { + path "../../../../../../../../defined-sets/tag-sets/tag-set" + + "/name"; + //TODO: require-instance should be added when it's + //supported in YANG 1.1 + //require-instance true; + } + description "References a defined tag set"; + } + uses match-set-options-restricted-group; + } + + grouping tag-set-condition-state { + description + "Operational state data for tag-set condition statements"; + } + + grouping tag-set-condition-top { + description + "Top-level grouping for tag-set conditions"; + + container match-tag-set { + description + "Match a referenced tag set according to the logic defined + in the match-options-set leaf"; + + container config { + description + "Configuration data for tag-set conditions"; + + uses tag-set-condition-config; + } + + container state { + + config false; + + description + "Operational state data tag-set conditions"; + + uses tag-set-condition-config; + uses tag-set-condition-state; + } + } + } + + grouping generic-conditions { + description "Condition statement definitions for checking + membership in a generic defined set"; + + uses match-interface-condition-top; + uses prefix-set-condition-top; + uses neighbor-set-condition-top; + uses tag-set-condition-top; + + } + + grouping generic-actions { + description + "Definitions for common set of policy action statements that + manage the disposition or control flow of the policy"; + + leaf policy-result { + type policy-result-type; + description + "Select the final disposition for the route, either + accept or reject."; + } + } + + + grouping policy-conditions-config { + description + "Configuration data for general policy conditions, i.e., those + not related to match-sets"; + + leaf call-policy { + type leafref { + path "../../../../../../../" + + "oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:name"; + //TODO: require-instance should be added when + //it is supported in YANG 1.1 + //require-instance true; + } + description + "Applies the statements from the specified policy + definition and then returns control the current + policy statement. Note that the called policy may + itself call other policies (subject to + implementation limitations). This is intended to + provide a policy 'subroutine' capability. The + called policy should contain an explicit or a + default route disposition that returns an + effective true (accept-route) or false + (reject-route), otherwise the behavior may be + ambiguous and implementation dependent"; + } + + leaf install-protocol-eq { + type identityref { + base oc-pol-types:INSTALL_PROTOCOL_TYPE; + } + description + "Condition to check the protocol / method used to install + the route into the local routing table"; + } + } + + grouping policy-conditions-state { + description + "Operational state data for policy conditions"; + } + + grouping policy-conditions-top { + description + "Top-level grouping for policy conditions"; + + container conditions { + description + "Condition statements for the current policy statement"; + + container config { + description + "Configuration data for policy conditions"; + + uses policy-conditions-config; + } + + container state { + + config false; + + description + "Operational state data for policy conditions"; + + uses policy-conditions-config; + uses policy-conditions-state; + } + uses generic-conditions; + } + } + + grouping policy-statements-config { + description + "Configuration data for policy statements"; + + leaf name { + type string; + description + "name of the policy statement"; + } + } + + grouping policy-statements-state { + description + "Operational state data for policy statements"; + } + + + + grouping policy-actions-config { + description + "Configuration data for policy actions"; + + uses generic-actions; + } + + grouping policy-actions-state { + description + "Operational state data for policy actions"; + } + + grouping policy-actions-top { + description + "Top-level grouping for policy actions"; + + container actions { + description + "Top-level container for policy action statements"; + + container config { + description + "Configuration data for policy actions"; + + uses policy-actions-config; + } + + container state { + + config false; + + description + "Operational state data for policy actions"; + + uses policy-actions-config; + uses policy-actions-state; + } + } + } + + grouping policy-statements-top { + description + "Top-level grouping for the policy statements list"; + + container statements { + description + "Enclosing container for policy statements"; + + list statement { + key "name"; + // TODO: names of policy statements within a policy + // definition should probably be optional, however, YANG + // requires a unique id for lists + ordered-by user; + description + "Policy statements group conditions and actions + within a policy definition. They are evaluated in + the order specified (see the description of policy + evaluation at the top of this module."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to list key"; + } + + container config { + description + "Configuration data for policy statements"; + + uses policy-statements-config; + } + + container state { + + config false; + + description + "Operational state data for policy statements"; + + uses policy-statements-config; + uses policy-statements-state; + } + + uses policy-conditions-top; + uses policy-actions-top; + } + } + } + + grouping defined-sets-top { + description + "Top-level grouping for defined set definitions"; + + container defined-sets { + description + "Predefined sets of attributes used in policy match + statements"; + + uses generic-defined-sets; + } + } + + grouping policy-definitions-config { + description + "Configuration data for policy definitions"; + + leaf name { + type string; + description + "Name of the top-level policy definition -- this name + is used in references to the current policy"; + } + } + + grouping policy-definitions-state { + description + "Operational state data for policy definitions"; + } + + grouping policy-definitions-top { + description + "Top-level grouping for the policy definition list"; + + container policy-definitions { + description + "Enclosing container for the list of top-level policy + definitions"; + + list policy-definition { + key "name"; + description + "List of top-level policy definitions, keyed by unique + name. These policy definitions are expected to be + referenced (by name) in policy chains specified in import + or export configuration statements."; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the list key"; + } + + container config { + description + "Configuration data for policy defintions"; + + uses policy-definitions-config; + } + + container state { + + config false; + + description + "Operational state data for policy definitions"; + + uses policy-definitions-config; + uses policy-definitions-state; + } + + uses policy-statements-top; + } + } + } + + grouping routing-policy-top { + description + "Top level container for OpenConfig routing policy"; + + container routing-policy { + description + "Top-level container for all routing policy configuration"; + + + uses defined-sets-top; + + uses policy-definitions-top; + } + } + + grouping apply-policy-import-config { + description + "Configuration data for applying import policies"; + + leaf-list import-policy { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:name"; + //TODO: require-instance should be added when it's + //supported in YANG 1.1 + //require-instance true; + } + ordered-by user; + description + "list of policy names in sequence to be applied on + receiving a routing update in the current context, e.g., + for the current peer group, neighbor, address family, + etc."; + } + + leaf default-import-policy { + type default-policy-type; + default REJECT_ROUTE; + description + "explicitly set a default policy if no policy definition + in the import policy chain is satisfied."; + } + + } + + grouping apply-policy-export-config { + description + "Configuration data for applying export policies"; + + leaf-list export-policy { + type leafref { + path "/oc-rpol:routing-policy/oc-rpol:policy-definitions/" + + "oc-rpol:policy-definition/oc-rpol:name"; + //TODO: require-instance should be added when it's + //supported in YANG 1.1 + //require-instance true; + } + ordered-by user; + description + "list of policy names in sequence to be applied on + sending a routing update in the current context, e.g., + for the current peer group, neighbor, address family, + etc."; + } + + leaf default-export-policy { + type default-policy-type; + default REJECT_ROUTE; + description + "explicitly set a default policy if no policy definition + in the export policy chain is satisfied."; + } + } + + + grouping apply-policy-config { + description + "Configuration data for routing policies"; + + uses apply-policy-import-config; + uses apply-policy-export-config; + + } + + + + grouping apply-policy-state { + description + "Operational state associated with routing policy"; + + //TODO: identify additional state data beyond the intended + //policy configuration. + } + + grouping apply-policy-group { + description + "Top level container for routing policy applications. This + grouping is intended to be used in routing models where + needed."; + + container apply-policy { + description + "Anchor point for routing policies in the model. + Import and export policies are with respect to the local + routing table, i.e., export (send) and import (receive), + depending on the context."; + + container config { + description + "Policy configuration data."; + + uses apply-policy-config; + } + + container state { + + config false; + description + "Operational state for routing policy"; + + uses apply-policy-config; + uses apply-policy-state; + } + } + } + + uses routing-policy-top; + +} diff --git a/exp/yangcli/h3c-yang/openconfig-rsvp-sr-ext@2019-07-09.yang b/exp/yangcli/h3c-yang/openconfig-rsvp-sr-ext@2019-07-09.yang new file mode 100644 index 0000000..847906b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-rsvp-sr-ext@2019-07-09.yang @@ -0,0 +1,418 @@ +module openconfig-rsvp-sr-ext { + yang-version "1"; + + namespace "http://openconfig.net/yang/rsvp-sr-ext"; + prefix "oc-sr-rsvp-ext"; + + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-types { prefix "oc-types"; } + import openconfig-network-instance { prefix "oc-ni"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module adds extensions to the OpenConfig MPLS models to + provide extensions which allow the coexistence of RSVP-TE and + Segment Routing (SR) within the same network. It augments the + existing OpenConfig segment routing (SR) and RSVP-TE models + where required."; + + oc-ext:openconfig-version "0.3.0"; + + revision "2019-07-09" { + description + "Clarify the base for measurements using timeticks64."; + reference "0.3.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.2.1"; + } + + revision 2018-04-13 { + description + "Replace boolean with modes for measure-sr-traffic."; + reference "0.2.0"; + } + + revision 2017-03-06 { + description + "Initial revision."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping bandwidth-measurement-global-state { + description + "Operational state parameters for bandwidth measurement which + apply globally to the device."; + + leaf effective-adjustment-interval { + type uint32; + units "seconds"; + description + "The effective adjustment interval that is being used by + the system. In the case that the adjustment-interval leaf + is set to a non-integer multiple of the collection-interval, + and the system does not support this, the value of this leaf + should reflect the effective value of the adjustment interval + that it has selected. In the case where no rounding of the + adjustment interval has occurred, this value should have the + same value as the adjustment-inerval leaf."; + } + } + + grouping bandwidth-measurement-global-config { + description + "Configuration parameters for bandwidth measurement which apply + globally to the device."; + + leaf measure-sr-traffic { + type enumeration { + enum MEASURE_ONLY { + description + "Only measure the SR traffic being sent via an interface, + and do not flood it into the IGP."; + } + enum MEASURE_AND_FLOOD { + description + "Measure the SR traffic being sent via an interface and + flood it into the IGP."; + } + } + description + "Parameter enabling SR traffic measurement + and optional flooding into IGP."; + reference + "draft-sitaraman-sr-rsvp-coexistence-rec-01"; + } + + // TODO(robjs): For future extension, traffic accounting for + // non-SR, non-RSVP traffic could be added here. e.g., LDP, + // BGP-LU etc. + + leaf collection-interval { + type uint32; + units "seconds"; + description + "The interval at which the collection of interface + statistics relating to non-RSVP-TE traffic should be + performed"; + reference + "draft-sitaraman-sr-rsvp-coexistence-rec-01"; + } + + leaf adjustment-interval { + type uint32; + units "seconds"; + description + "The interval after which an adjustment to the utilised + bandwidth on the interface is made. This value must be + greater than, or equal to, the collection interval for + statistics. This value is referred to as N in + draft-sitaraman-sr-rsvp-coexistence-rec-01. + + After N seconds have expired, the + arithmetic mean of the samples is taken, and this is + considered as the non-RSVP-TE utilisation of the + interface. In the case that the adjustment interval is + an integer >1 multiple of the collection interval, this + serves to provide smoothing of the collected bandwidth + statistics."; + reference + "draft-sitaraman-sr-rsvp-coexistence-rec-01"; + } + + leaf bandwidth-multiplier { + type decimal64 { + fraction-digits 4; + } + default 1.0000; + description + "A multiplier applied to the sampled bandwidth which + determines the value that is propagated to the IGP TED. + By default this value is 1.0000, and hence the actual + sampled value is flooded."; + } + } + + grouping bandwidth-measurement-update-config { + description + "Configuration parameters related to when the bandwidth + measurement information is used to update the IGP TED."; + + leaf update-trigger { + type enumeration { + enum ADJUSTED_MAX_RESERVABLE_PCT { + description + "Update of a new maximum reservable bandwidth IGP + TLV is based on the value changing >= X% of + the currently flooded adjusted-absolute-subscription-bw. + The percentage of this value that is used is specified + by the adjusted-max-reservable-bw-pct leaf."; + } + enum SR_TRAFFIC_PCT { + description + "Update of the new maximum reservable bandwidth IGP + TLV is based on the value changing >= X% of the last + calculated segment routing traffic utilisation for the + interface. The percentage delta of this value is + specified by the sr-traffic-pct leaf."; + } + } + description + "The trigger that should be used to determine when the IGP + TED is updated with new information as to the effective + maximum reservable bandwidth + (adjusted-absolute-subscription-bw)"; + } + + leaf adjusted-max-reservable-bw-pct { + when "../update-trigger = 'ADJUSTED_MAX_RESERVABLE_PCT'" { + description + "Only allow the adjusted-max-reservable-bw update trigger + to be specified when the update-trigger mode is specified + to be a percentage of the currently flooded value."; + } + type oc-types:percentage; + description + "The delta in the adjusted-max-reservable-bandwidth that + should trigger an update in the value which is flooded + through the IGP TED. + The delta is measured as a percentage of the + current adjusted value of the maximum reservable bandwidth + of the interface, as specified by the + adjusted-absolute-subscription-bw RSVP-TE leaf."; + reference + "draft-sitaraman-sr-rsvp-coexistence-rec-01"; + } + + leaf sr-traffic-pct { + when "../update-trigger = 'SR_TRAFFIC_PCT'" { + description + "Only allow the SR traffic percentage trigger to be + specified when the update trigger is defined to be a + percentage of the last calculated SR traffic value."; + } + type oc-types:percentage; + description + "The change in the calculated SR traffic on the interface + that should trigger an update in the value of the + maximum reservable bandwidth flooded through the IGP TED. + The value is specified as a percentage of the + last-calculated-sr-traffic state leaf."; + } + } + + grouping bandwidth-measurement-global-structural { + description + "Structural grouping for the measurement of segment routing + traffic, and its advertisement into the IGP TED."; + + container bandwidth-measurement { + description + "Configuration and operational state parameters related to + how bandwidth utilisation is measured and flooded into the + IGP."; + + container config { + description + "Configuration parameters relating to bandwidth + measurement."; + + uses bandwidth-measurement-global-config; + } + + container state { + config false; + description + "Operational state parameters relating to bandwidth + measurement"; + + uses bandwidth-measurement-global-config; + uses bandwidth-measurement-global-state; + } + + container update-trigger { + description + "Configuration and operational state parameters related + to the update trigger for flooding new bandwidth + information into the IGP."; + + container config { + description + "Configuration parameters related to the bandwidth + measurement update trigger."; + + uses bandwidth-measurement-update-config; + } + + container state { + config false; + description + "Operational state parameters related to the bandwidth + measurement update trigger."; + + uses bandwidth-measurement-update-config; + } + } + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:mpls/oc-ni:te-global-attributes" { + description + "Add the bandwidth measurement parameters to MPLS global + traffic engineering hierarchy."; + + uses bandwidth-measurement-global-structural; + } + + grouping bandwidth-measurement-rsvp-te-adjusted-state { + description + "Logical grouping augmented into the RSVP-TE hierarchy to + provide an operational state value which reflects the + adjusted RSVP-TE available bandwidth."; + + leaf adjusted-absolute-subscription-bw { + type uint64; + units "kbps"; + description + "The adjusted absolute value (in kbps) of the + bandwidth which is reservable to RSVP-TE on the + local system. In the case that the bandwidth-measurement + configuration does not account for non-RSVP-TE traffic + then this value is equal to the + calculated-absolute-subscription-bw, in the case that + non-RSVP-TE traffic is being accounted for, it is lower + such that calculated-absolute-subscription-bw - + adjusted-absolute-subscription-bw = the current calculated + non-RSVP-TE traffic. + + This value reflects the last flooded value of the maximum + reservable bandwidth, or subscription."; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/" + + "oc-ni:mpls/oc-ni:signaling-protocols/oc-ni:rsvp-te/" + + "oc-ni:interface-attributes/oc-ni:interface/" + + "oc-ni:subscription/oc-ni:state" { + + description + "Augmentation to add the adjusted RSVP-TE available bandwidth + state to the RSVP-TE signaling protocol."; + + uses bandwidth-measurement-rsvp-te-adjusted-state; + } + + grouping bandwidth-measurement-intf-structural { + description + "Structural grouping containing interface bandwidth + measurement configuration and operational state + parameters."; + + container bandwidth-measurement { + description + "Configuration and operational state parameters relating to + per-interface bandwidth measurement. These parameters are + used in the case that RSVP-TE coexists with other MPLS + signaling protocols on an interface."; + + container state { + config false; + description + "Operational state parameters relating to the containing + interface's bandwidth measurement."; + + uses bandwidth-measurement-intf-state; + } + } + } + + grouping bandwidth-measurement-intf-state { + description + "Operational state parameters per-interface for the measured + bandwidth on an interface"; + + leaf last-sample-time { + type oc-types:timeticks64; + description + "The time at which the last sample of bandwidth utilisation + for both RSVP-TE and non-RSVP-TE traffic was taken. This value + is relative to the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf last-sample-measured-rsvp-util { + type uint64; + units "kbps"; + description + "The measured RSVP-TE bandwidth utilisation at the last sample + (whose time is indicated in last-sample-time). This value is + expressed as a 64-bit unsigned integer representing the number + of kilobits per second that RSVP-TE traffic is consuming on + the interface."; + } + + leaf last-sample-measured-sr-util { + type uint64; + units "kbps"; + description + "The measured Segment Routing bandwidth utilisation at the + last sample (whose time is indicated in last-sample-time). + This value is expressed as a 64-bit unsigned integer + representing the number of kilobits per second that Segment + Routing traffic is consuming on the interface."; + } + + leaf last-calculated-time { + type oc-types:timeticks64; + description + "The time at which the last calculated value for bandwidth + utilisation was performed. The value is expressed relative + to the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf last-calculated-sr-utilisation { + type uint64; + description + "The last calculated value of the Segment Routing utilisation + (taken post any averaging or adjustment that occurs). This + value is updated regardless of whether the value was flooded + or not."; + } + + leaf last-flooded-time { + type oc-types:timeticks64; + description + "The time, relative to the Unix Epoch (Jan 1 1970 00:00:00 UTC), + at which the bandwidth utilisation of non-RSVP-TE traffic resulted + in the value being flooded in the IGP. If the configuration of the + local system specifies a 0% change requires flooding, this leaf + will always reflect the value of the last-calculated-time. In + systems that have suppression due to a >0% delta being required + then it indicates the last time that the percentage threshold + was exceeded."; + } + } + + augment "/oc-ni:network-instances/oc-ni:network-instance/oc-ni:mpls" + + "/oc-ni:te-interface-attributes/oc-ni:interface" { + description + "Augment the per-interface bandwidth measurement parameters into the + MPLS hierarchy of network instance."; + + uses bandwidth-measurement-intf-structural; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-segment-routing-types@2020-02-04.yang b/exp/yangcli/h3c-yang/openconfig-segment-routing-types@2020-02-04.yang new file mode 100644 index 0000000..f092d54 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-segment-routing-types@2020-02-04.yang @@ -0,0 +1,158 @@ +module openconfig-segment-routing-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/segment-routing-types"; + + prefix "oc-srt"; + + // import some basic types + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-mpls-types { prefix "oc-mplst"; } + import openconfig-inet-types { prefix "oc-inet"; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "Types associated with a network instance"; + + oc-ext:openconfig-version "0.2.0"; + + revision "2020-02-04" { + description + "Consistent prefix for openconfig-mpls-types."; + reference "0.2.0"; + } + + revision "2019-09-24" { + description + "Initial revision of the SR types."; + reference "0.1.0"; + } + + typedef sr-dataplane-type { + type enumeration { + enum MPLS { + description + "The entity uses MPLS labels as Segment Identifiers."; + } + enum IPV6 { + description + "The entity uses IPv6 prefixes as Segment Identifiers."; + } + } + description + "Types of data plane that can be used to instantiate a Segment + Routing block of SIDs."; + } + + typedef sr-sid-type { + type union { + type oc-mplst:mpls-label; + type oc-inet:ipv6-address; + } + description + "The defined value of a segment identifier."; + } + + typedef srte-protocol-type { + type enumeration { + enum PCEP { + value 10; + description + "Path Computation Element Protocol."; + } + enum BGP { + value 20; + description + "BGP SR policy."; + } + enum CONFIG { + value 30; + description + "Local configuration."; + } + } + description + "The component or protocol that originates or signals the + candidate path."; + reference + "Section 2.3 of draft-ietf-spring-segment-routing-policy."; + } + + typedef srte-endpoint-type { + type oc-inet:ip-address; + description + "SR-TE endpoint is the policy destination which can be either an + IPv4 or IPv6 address."; + reference + "draft-ietf-spring-segment-routing-policy"; + } + + typedef srte-invalid-sl-reason { + type enumeration { + enum EMPTY_SL { + description + "Segment-list is empty."; + } + enum ZERO_WEIGHT { + description + "Segment-list weight is 0."; + } + enum FIRST_SID_UNRESOLVABLE { + description + "The headend is unable to perform path resolution for the + first SID into one or more outgoing interface(s) and + next-hop(s)."; + } + enum OTHER_SID_UNRESOLVABLE { + description + "The headend is unable to perform SID resolution for any + non-first SID of type 3-through-11 into an MPLS label or + an SRv6 SID."; + } + enum VERIFICATION_FAIL { + description + "The headend verification fails for any SID for which + verification has been explicitly requested."; + } + } + description + "The list of segment-list invalid reasons."; + reference "draft-ietf-spring-segment-routing-policy"; + } + + typedef enlp-type { + type enumeration { + enum PUSH_IPV4_EXPLICIT_NULL { + description + "Push an IPv4 Explicit NULL label on an unlabeled IPv4 + packet but not IPv6 one."; + } + enum PUSH_IPV6_EXPLICIT_NULL { + description + "Push an IPv6 Explicit NULL label on an unlabeled IPv4 + packet but not IPv4 one."; + } + enum PUSH_IPV46_EXPLICIT_NULL { + description + "Push an IPv4 Explicit NULL label on both unlabeled IPv4 + packet and IPv6 packet."; + } + enum NO_EXPLICIT_NULL { + description + "Do not push an Explicit NULL label."; + } + } + description + "The list of possible ENLP(Explicit NULL Label Policy) values."; + reference "draft-ietf-idr-segment-routing-te-policy"; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-spanning-tree-types@2016-10-03.yang b/exp/yangcli/h3c-yang/openconfig-spanning-tree-types@2016-10-03.yang new file mode 100644 index 0000000..64b6180 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-spanning-tree-types@2016-10-03.yang @@ -0,0 +1,217 @@ +module openconfig-spanning-tree-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/spanning-tree/types"; + + prefix "oc-stp-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines types related to the Spanning-tree protocol model."; + + oc-ext:openconfig-version "0.1.0"; + + revision "2016-10-03" { + description + "Initial public revision"; + reference "0.1.0"; + } + + // identity statements + + identity STP_PROTOCOL { + description + "base identity for support spanning tree protocol"; + } + + identity RSTP { + base STP_PROTOCOL; + description + "Rapid Spanning Tree Protocol"; + reference "IEEE 802.1D 17"; + } + + identity MSTP { + base STP_PROTOCOL; + description + "Multiple Spanning Tree Protocol"; + reference "IEEE 802.1Q 13"; + } + + identity RAPID_PVST { + base STP_PROTOCOL; + description + "Rapid Per Vlan Spanning Tree Protocol"; + } + + identity STP_PORT_STATE { + description + "base identity for the different Spanning Tree Protocol port + states"; + reference + "IEEE 802.1D 7.4 Port States and the active topology"; + } + + identity DISABLED { + base STP_PORT_STATE; + description + "A port that is manually isolated from the network"; + } + + identity LISTENING { + base STP_PORT_STATE; + description + "Processing BPDUs and building active toplogy"; + } + + identity LEARNING { + base STP_PORT_STATE; + description + "Building bridging tables; no forwarding of data"; + } + + identity BLOCKING { + base STP_PORT_STATE; + description + "A port that would cause a loop if it were sending data, + so it is only receiving BPDUs, untill a topology change + removes the possibliity of a loop"; + } + + identity FORWARDING { + base STP_PORT_STATE; + description + "Sending and receiving data, normal operation"; + } + + identity STP_EDGE_PORT { + description + "base identity for the different edge port modes"; + reference + "IEEE 802.1D 17.13.1"; + } + + identity EDGE_ENABLE { + base STP_EDGE_PORT; + description + "Enable edge port for the bridge port"; + } + + identity EDGE_DISABLE { + base STP_EDGE_PORT; + description + "Disable edge port for the bridge port"; + } + + identity EDGE_AUTO { + base STP_EDGE_PORT; + description + "Enable edge port autodetction for the bridge port"; + } + + identity STP_PORT_ROLE { + description + "Base identity for the different Spanning Tree Protocol port + roles"; + reference + "IEEE 802.1D 17.7 Port Role assignments"; + } + + identity ROOT { + base STP_PORT_ROLE; + description + "The port that receives the best BPDU on a bridge is the + root port"; + } + + identity DESIGNATED { + base STP_PORT_ROLE; + description + "A port is designated if it can send the best BPDU on the + segment to which it is connected."; + } + + identity ALTERNATE { + base STP_PORT_ROLE; + description + "An alternate port receives more useful BPDUs from another + bridge and is a port blocked"; + } + + identity BACKUP { + base STP_PORT_ROLE; + description + "A backup port receives more useful BPDUs from the same + bridge it is on and is a port blocked"; + } + + // typedef statements + + typedef stp-bridge-priority-type { + type uint32 { + range 1..611440; + } + description + "The manageable component of the Bridge Identifier"; + reference "IEEE 802.1D 17.13.7 Bridge Identifier Priority"; + } + + typedef stp-port-priority-type { + type uint8 { + range 1..240; + } + description + "The manageable component of the Port Identifier, + also known as the Port Priority"; + reference + "IEEE 802.1D 17.13.10 Port Identifier Priority"; + } + + typedef stp-guard-type { + type enumeration { + enum ROOT { + description + "Enable root guard"; + } + enum LOOP { + description + "Enable loop guard"; + } + enum NONE { + description + "disable guard"; + } + } + description + "Type definition for the different STP guard for the switch port"; + reference "IEEE 802.1D 17.2"; + } + + typedef stp-link-type { + type enumeration { + enum P2P { + description + "Point-to-Point link"; + } + enum SHARED { + description + "Shared link"; + } + } + description + "Type definition for the different link types"; + reference "IEEE 802.1D 17.2"; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-srte-policy@2020-05-01.yang b/exp/yangcli/h3c-yang/openconfig-srte-policy@2020-05-01.yang new file mode 100644 index 0000000..8e6e97b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-srte-policy@2020-05-01.yang @@ -0,0 +1,669 @@ +module openconfig-srte-policy { + yang-version "1"; + namespace "http://openconfig.net/yang/segment-routing/srte-policy"; + prefix "oc-srte"; + + import openconfig-types { prefix "oc-types"; } + import openconfig-extensions { prefix "oc-ext"; } + import openconfig-interfaces { prefix "oc-if"; } + import openconfig-inet-types { prefix "oc-inet"; } + import openconfig-yang-types { prefix "oc-yang"; } + import openconfig-aft { prefix "oc-aft"; } + import openconfig-segment-routing-types { prefix "oc-srt"; } + + organization + "OpenConfig working group"; + + contact + "OpenConfig Working group + www.openconfig.net"; + + description + "This module defines a collection of segment routing traffic + engineering policy operational states. + + Each policy, identified by a combination of color and endpoint, + has one or more candidate paths learned from one or more sources. + The best valid/usable path is marked as active and programmed in + forwarding plane. + + A candidate path, identified by protocol-origin, originator and + discriminator, can have one and more segment-list defining the + path traffic should take. Each segment-list is associated with a + weight for weighted load balancing. + + Traffic counters related to SR policies are also defined in this + module."; + + reference + "draft-ietf-spring-segment-routing-policy"; + + oc-ext:openconfig-version "0.2.1"; + + revision "2020-05-01" { + description + "Fix consistency of per-policy counters."; + reference "0.2.1"; + } + + revision "2020-03-31" { + description + "Updated traffic counters on policy and segment-list levels."; + reference "0.2.0"; + } + + revision "2019-09-24" { + description + "Initial revision of the SR-TE policy model."; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping oc-srte-policy-top { + description + "Top-level grouping used for SR-TE policy operational states."; + + container te-policies { + config false; + description + "A collection of SR-TE policies in the system."; + + list te-policy { + key "color endpoint"; + description + "An individual SR-TE policy is identified by a combination + of color and endpoint."; + + leaf color { + type leafref { + path "../state/color"; + } + description + "A reference to the srte color in the state."; + } + + leaf endpoint { + type leafref { + path "../state/endpoint"; + } + description + "A reference to the srte endpoint in the state."; + } + + container state { + config false; + description + "The operational state of parameters associated with + SR-TE policies."; + + uses oc-srte-policy-state; + + container counters { + description + "A collection of counters on the policy level. They + count the total traffic forwarded by the policy, + regardless of its installation source. The counters + should be persistent across policy state changes and + switches between active protocols."; + + uses oc-srte-policy-counters; + } + } + + uses oc-srte-candidate-path; + } + } + } + + grouping oc-srte-policy-keys { + description + "Keys to identify a SR-TE policy."; + + leaf color { + type uint32; + description + "When the policy is used for RIB resolution to a specific + Segment Routing Traffic Engineering path, the policy is used + when the color required in the policy (which may be specified + based on the value of a BGP extended colour community) matches + the value of this leaf. The color being set to 0 indicates + that the colour is a wildcard in the policy resolution."; + } + + leaf endpoint { + type oc-srt:srte-endpoint-type; + description + "When the policy is used for RIB resolution to a Segment + Routing Traffic Engineering path, the policy is used when the + required endpoint (which may be the protocol next-hop) matches + the endpoint address specified in this leaf. When the leaf is + set to all zeros (0.0.0.0 or ::), the endpoint acts as a + wildcard in the policy resolution."; + } + } + + grouping oc-srte-policy-state { + description + "Operational states specific to a SR-TE policy."; + + uses oc-srte-policy-keys; + + leaf name { + type string; + description + "The user friendly SR-TE policy name."; + } + + leaf bsid { + type oc-srt:sr-sid-type; + description + "The Binding SID (BSID) assigned to the SR-TE policy, + expressed as an MPLS label or IPv6 address. Packets that are + ingress to the system with active segment matching the SID + value specified in this leaf should be forwarded according + to the policy. The specified Binding SID must be removed + from the segment list by the system."; + } + + leaf active { + type boolean; + description + "A SR-TE policy is marked as active when at least one of its + candidate paths is valid/active and the policy has been + instantiated in the forwarding plane."; + } + + leaf active-since { + type oc-types:timeticks64; + description + "Indication of the time the policy transitioned to the active + state. + + The value is the timestamp in nanoseconds relative to the Unix + Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf active-transitions { + type oc-yang:counter64; + description + "The number of transitions to active state for the policy."; + } + + } + + grouping oc-srte-policy-counters { + description + "A collection of traffic counters on the SR-TE policy level."; + + leaf in-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the incoming packets steered to + the SR-TE policy. It includes both labeled and unlabeled + steered traffic."; + } + + leaf in-octets { + type oc-yang:counter64; + description + "The cumulative counter of the total incoming bytes steered + to the SR-TE policy. It includes both labeled and unlabeled + steered traffic."; + } + + leaf in-labeled-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the incoming labeled packets steered + to the SR-TE policy. Labeled packets carries an active SID + (top-most SID in the stack) that matches the BSID associated + to this policy."; + } + + leaf in-labeled-octets { + type oc-yang:counter64; + description + "A cumulative counter of the total bytes of incoming labeled + traffic steered to the SR-TE policy. Labeled traffic carries + an active SID (top-most SID in the stack) that matches the + BSID associated to this policy."; + } + + leaf out-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the outgoing packets after being + steered to the SR-TE policy. It includes both labeled and + unlabeled steered traffic."; + } + + leaf out-octets { + type oc-yang:counter64; + description + "The cumulative counter of the total outgoing bytes after + being steered to the SR-TE policy. It includes both labeled + and unlabeled steered traffic. The counter should include the + segments pushed to packets."; + } + + leaf out-labeled-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the outgoing labeled packets after + being steered to the SR-TE policy. Labeled packets carries + an active SID (top-most SID in the stack) that matches the + BSID associated to this policy."; + } + + leaf out-labeled-octets { + type oc-yang:counter64; + description + "A cumulative counter of the total bytes of outgoing labeled + traffic after being steered to the SR-TE policy. Labeled + traffic carries an active SID (top-most SID in the stack) that + matches the BSID associated to this policy. The counter should + include the segments pushed to packets."; + } + } + + grouping oc-srte-candidate-path { + description + "A collection of candidate paths associated with the SR-TE + policy."; + + container candidate-paths { + description + "One or more candidate paths may be associated to a SR-TE + policy. The best and usable one should be used as forwarding + next-hops."; + + list candidate-path { + key "protocol-origin originator-asn originator-addr discriminator"; + description + "An individual candidate path within the list of candidate + paths associated with this SR-TE policy. It is uniquely + identified by the combination of protocol-origin, + originator and discriminator"; + + leaf protocol-origin { + type leafref { + path "../state/protocol-origin"; + } + description + "A reference to the component or protocol that originates + or signals the candidate path"; + } + + leaf originator-asn { + type leafref { + path "../state/originator-asn"; + } + description + "A reference to the autonomous system that the node + originating the candidate path locates."; + } + + leaf originator-addr { + type leafref { + path "../state/originator-addr"; + } + description + "A reference to the address of the node originating the + candidate path."; + } + + leaf discriminator { + type leafref { + path "../state/discriminator"; + } + description + "A reference to the ID uniquely identifying the path + within the context of a policy learnt from a protocol."; + } + + container state { + config false; + description + "Operational state parameters associated with SR-TE + candidate paths."; + + uses oc-srte-candidate-path-state; + } + + container segment-lists { + description + "A collection of segment lists associated with the policy + candidate path."; + + list segment-list { + key "id"; + description + "An individual segment list within the list of segment + lists associated with this candidate path."; + + leaf id { + type leafref { + path "../state/id"; + } + description + "A reference to the segment-list that in use for the + candidate path."; + } + + container state { + config false; + description + "Operational state parameters associated with a + segment-list in a SR-TE candidate paths."; + + uses oc-srte-segment-list-state; + + container counters { + description + "The counters of traffic steered to the segment-list."; + + uses oc-srte-segment-list-common-counters; + } + } + + container sids { + description + "The list of SIDs that make up the segment list. The + order of the SIDs is specified by ordering the list + according to index, in ascending order. The network + device should consider the top-most SID the entry with + the lowest index."; + + list sid { + key "index"; + + description + "List of SIDs that make up the segment list. The segment + list is formed by ordering the set of SIDs that are + specified by their index in ascending numerical order."; + + leaf index { + type leafref { + path "../state/index"; + } + description + "Reference to the SID's index within the segment list + which acts as the key of the list."; + } + + container state { + config false; + description + "Operational state parameters relating to the SID within + the segment list."; + uses oc-srte-segment-list-sids-state; + } + } + } + + container next-hops { + description + "The set of next-hops which the segment-list is resolved to. + Traffic steered to the segment-list should be forwarded over + them."; + + list next-hop { + key "index"; + description + "A next-hop the segment list is resolved to."; + + leaf index { + type leafref { + path "../state/index"; + } + description + "A reference to the nexthop index in the state."; + } + + container state { + config false; + description "State parameters for the nexthop."; + + leaf index { + type uint32; + description + "A unique index identifying the next-hop entry for the + segment-list."; + } + + uses oc-aft:aft-common-entry-nexthop-state; + + container counters { + description + "The counters of traffic steered to the segment-list on + per next-hop basis."; + uses oc-srte-segment-list-common-counters; + } + } + + uses oc-if:interface-ref-state; + } + } + } + } + } + } + } + + grouping oc-srte-segment-list-state { + description + "Operational state specific to a segment-list in a + candidate-path."; + + leaf id { + type uint32; + description + "A unique id identifying the segment-list."; + } + + leaf valid { + type boolean; + description + "The validity of a segment-list should marked as true + when it is usable."; + reference + "draft-ietf-spring-segment-routing-policy."; + } + + leaf invalid-reason { + type oc-srt:srte-invalid-sl-reason; + description + "If a segment-list is marked as invalid, this leaf should + indicate the reason."; + } + + leaf weight { + type uint32; + description + "The weight of the segment list within the set of + segment lists specified for the candidate path. The + traffic that is forwarded according to the policy is + distributed across the set of segment-lists such that + each list receives weight/(sum of all weights) traffic."; + } + + } + + grouping oc-srte-candidate-path-state { + description + "Operational state specific to a SR-TE policy candidate path."; + + leaf name { + type string; + description + "The user friendly SR-TE candidate path name."; + } + + leaf protocol-origin { + type oc-srt:srte-protocol-type; + description + "The component or protocol that originates or signals the + candidate path."; + } + + leaf originator-asn { + type uint32; + description + "The autonomous system that node originating the candidate + path locates."; + reference + "Section 2.4 of draft-ietf-spring-segment-routing-policy."; + } + + leaf originator-addr { + type oc-inet:ipv6-address; + description + "The address of the node originating the candidate path. + Address in IPv4 can be represented as IPv6-encoded-IPv4 e.g. + ::FFFF:192.168.1.2 or a normal IPv6 address with the lowest + 32 bits carrying the actual IPv4 address."; + reference + "Section 2.4 of draft-ietf-spring-segment-routing-policy."; + } + + leaf discriminator { + type uint32; + description + "A 32 bit value uniquely identifying the path within the + context of a policy learnt from a protocol."; + } + + leaf preference { + type uint32; + description + "When there are multiple candidate paths specified a + particular SR-TE policy. The preference is used to resolve + between them. And the one with higher preference is + preferred. + These paths may be learnt from a dynamic routing protocol, + or interface to the device, or from other static entries + configured on the system."; + } + + leaf enlp { + type oc-srt:enlp-type; + description + "ENLP (Explicit NULL Label Policy) indicates whether Explicit + NULL labels are to be pushed on unlabeled IP packets that are + being steered into a given SR policy."; + reference "draft-ietf-idr-segment-routing-te-policy"; + } + + leaf valid { + type boolean; + description + "A path should be marked as valid when it is usable e.g. the + at least one segment-list is valid even though the path may + not be the best."; + } + + leaf active { + type boolean; + description + "A candidate path is active when it is valid and it is + determined to be the best path of the SR-TE Policy."; + } + + leaf active-since { + type oc-types:timeticks64; + description + "Indication of the time the path transitioned to the active + state. + + The value is the timestamp in nanoseconds relative to the + Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf active-transitions { + type oc-yang:counter64; + description + "The number of transitions to active state for the candidate + path."; + } + } + + grouping oc-srte-segment-list-common-counters { + description + "A collection of traffic counters on the segment-list level."; + + leaf out-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the outgoing packets steered to the + segment list. The counter includes both labeled and unlabeled + steered traffic."; + } + + leaf out-octets { + type oc-yang:counter64; + description + "The cumulative counter of the total outgoing bytes steered + to the segment list. The counter includes both labeled and + unlabeled steerted traffic."; + } + + leaf out-labeled-pkts { + type oc-yang:counter64; + description + "A cumulative counter of the incoming labeled packets steered + to the segment list."; + } + + leaf out-labeled-octets { + type oc-yang:counter64; + description + "A cumulative counter of the total bytes of incoming labeled + traffic steered to the segment list."; + } + } + + grouping oc-srte-segment-list-sids-state { + description + "Operational state relating to a SID within an SR-TE segment + list"; + + leaf index { + type uint64; + description + "The index of the SID within the segment list. The segment list is + applied by ordering the SID entries in ascending numerical order + beginning at 0."; + } + + leaf value { + type oc-srt:sr-sid-type; + description + "The value of the SID that is to be used. Specified as an MPLS + label or IPv6 address."; + } + + leaf mpls-ttl { + type uint8; + default 0; + description + "The TTL to be set if the type of the SID is an MPLS label. If the + value of the TTL is set to be 0, the value is picked by the local + implementation."; + } + + leaf mpls-tc { + type uint8 { + range "0..7"; + } + default 0; + description + "The value of the MPLS Traffic Class (TC) bits to be used if the + value of the SID is an MPLS label. In the case that the value is + set to 0, then the local implementation should choose the value."; + } + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-system-logging@2017-01-29.yang b/exp/yangcli/h3c-yang/openconfig-system-logging@2017-01-29.yang new file mode 100644 index 0000000..a221cb6 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-system-logging@2017-01-29.yang @@ -0,0 +1,479 @@ +module openconfig-system-logging { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/system/logging"; + + prefix "oc-log"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import ietf-inet-types { prefix inet; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + for common logging facilities on network systems."; + + oc-ext:openconfig-version "0.1.0"; + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + identity SYSLOG_FACILITY { + description + "Base identity for Syslog message facilities."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity ALL { + base SYSLOG_FACILITY; + description + "All supported facilities"; + } + + identity KERNEL { + base SYSLOG_FACILITY; + description + "The facility for kernel messages"; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity USER { + base SYSLOG_FACILITY; + description + "The facility for user-level messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity MAIL { + base SYSLOG_FACILITY; + description + "The facility for the mail system."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity SYSTEM_DAEMON { + base SYSLOG_FACILITY; + description + "The facility for the system daemons."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity AUTH { + base SYSLOG_FACILITY; + description + "The facility for security/authorization messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity SYSLOG { + base SYSLOG_FACILITY; + description + "The facility for messages generated internally by syslogd + facility."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity AUTHPRIV { + base SYSLOG_FACILITY; + description + "The facility for privileged security/authorization messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + + identity NTP { + base SYSLOG_FACILITY; + description + "The facility for the NTP subsystem."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity AUDIT { + base SYSLOG_FACILITY; + description + "The facility for log audit messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity CONSOLE { + base SYSLOG_FACILITY; + description + "The facility for log alert messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL0 { + base SYSLOG_FACILITY; + description + "The facility for local use 0 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL1 { + base SYSLOG_FACILITY; + description + "The facility for local use 1 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL2 { + base SYSLOG_FACILITY; + description + "The facility for local use 2 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL3 { + base SYSLOG_FACILITY; + description + "The facility for local use 3 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL4 { + base SYSLOG_FACILITY; + description + "The facility for local use 4 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL5 { + base SYSLOG_FACILITY; + description + "The facility for local use 5 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL6 { + base SYSLOG_FACILITY; + description + "The facility for local use 6 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOCAL7 { + base SYSLOG_FACILITY; + description + "The facility for local use 7 messages."; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + identity LOG_DESTINATION_TYPE { + description + "Base identity for destination for logging messages"; + } + + identity DEST_CONSOLE { + base LOG_DESTINATION_TYPE; + description + "Directs log messages to the console"; + } + + identity DEST_BUFFER { + base LOG_DESTINATION_TYPE; + description + "Directs log messages to and in-memory circular buffer"; + } + + identity DEST_FILE { + base LOG_DESTINATION_TYPE; + description + "Directs log messages to a local file"; + } + + identity DEST_REMOTE { + base LOG_DESTINATION_TYPE; + description + "Directs log messages to a remote syslog server"; + } + + // typedef statements + + typedef syslog-severity { + type enumeration { + enum EMERGENCY { + description + "Emergency: system is unusable (0)"; + } + enum ALERT { + description + "Alert: action must be taken immediately (1)"; + } + enum CRITICAL { + description + "Critical: critical conditions (2)"; + } + enum ERROR { + description + "Error: error conditions (3)"; + } + enum WARNING { + description + "Warning: warning conditions (4)"; + } + enum NOTICE { + description + "Notice: normal but significant condition(5)"; + } + enum INFORMATIONAL { + description + "Informational: informational messages (6)"; + } + enum DEBUG { + description + "Debug: debug-level messages (7)"; + } + } + description + "Syslog message severities"; + reference + "IETF RFC 5424 - The Syslog Protocol"; + } + + // grouping statements + + grouping logging-selectors-config { + description + "Configuration data for logging selectors"; + + leaf facility { + type identityref { + base SYSLOG_FACILITY; + } + description + "Specifies the facility, or class of messages to log"; + } + + leaf severity { + type syslog-severity; + description + "Specifies that only messages of the given severity (or + greater severity) for the corresonding facility are logged"; + } + } + + grouping logging-selectors-state { + description + "Operational state data for logging selectors"; + } + + grouping logging-selectors-top { + description + "Top-level grouping for the logging selector list"; + + container selectors { + description + "Enclosing container "; + + list selector { + key "facility severity"; + description + "List of selectors for log messages"; + + leaf facility { + type leafref { + path "../config/facility"; + } + description + "Reference to facility list key"; + } + + leaf severity { + type leafref { + path "../config/severity"; + } + description + "Reference to severity list key"; + } + + container config { + description + "Configuration data "; + + uses logging-selectors-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses logging-selectors-config; + uses logging-selectors-state; + } + } + } + } + + grouping logging-console-config { + description + "Configuration data for console logging"; + } + + grouping logging-console-state { + description + "Operational state data for console logging"; + } + + grouping logging-console-top { + description + "Top-level grouping for console logging data"; + + container console { + description + "Top-level container for data related to console-based + logging"; + + container config { + description + "Configuration data for console logging"; + + uses logging-console-config; + } + + container state { + + config false; + + description + "Operational state data for console logging"; + + uses logging-console-config; + uses logging-console-state; + } + + uses logging-selectors-top; + } + } + + grouping logging-remote-config { + description + "Configuration data for remote log servers"; + + leaf host { + type inet:host; + description + "IP address or hostname of the remote log server"; + } + + leaf source-address { + type inet:ip-address; + description + "Source IP address for packets to the log server"; + } + + leaf remote-port { + type inet:port-number; + default 514; + description + "Sets the destination port number for syslog UDP messages to + the server. The default for syslog is 514."; + } + } + + grouping logging-remote-state { + description + "Operational state data for remote log servers"; + } + + grouping logging-remote-top { + description + "Top-level grouping for remote log servers"; + + container remote-servers { + description + "Enclosing container for the list of remote log servers"; + + list remote-server { + key "host"; + description + "List of remote log servers"; + + leaf host { + type leafref { + path "../config/host"; + } + description + "Reference to the host list key"; + } + + container config { + description + "Configuration data for remote log servers"; + + uses logging-remote-config; + } + + container state { + + config false; + + description + "Operational state data for remote log servers"; + + uses logging-remote-config; + uses logging-remote-state; + } + uses logging-selectors-top; + } + } + } + + grouping logging-top { + description + "Top-level grouping for logging data"; + + container logging { + description + "Top-level container for data related to logging / syslog"; + + uses logging-console-top; + uses logging-remote-top; + } + } + // data definition statements + + // augment statements + + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-system-terminal@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-system-terminal@2018-11-21.yang new file mode 100644 index 0000000..b34811c --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-system-terminal@2018-11-21.yang @@ -0,0 +1,249 @@ +module openconfig-system-terminal { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/system/terminal"; + + prefix "oc-sys-term"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines configuration and operational state data + related to remote terminal services such as ssh and telnet."; + + oc-ext:openconfig-version "0.3.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.3.1"; + } + + revision "2017-09-18" { + description + "Updated to use OpenConfig types modules"; + reference "0.3.0"; + } + + revision "2017-07-06" { + description + "Move to oc-inet types, add IETF attribution, add RADIUS + counters, changed password leaf names to indicate hashed"; + reference "0.2.0"; + } + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + // typedef statements + + // grouping statements + + grouping system-terminal-common-config { + description + "Common configuration data for terminal services"; + + leaf timeout { + type uint16; + units seconds; + description + "Set the idle timeout in seconds on terminal connections to + the system for the protocol."; + } + + leaf rate-limit { + type uint16; + units "conn/min"; + description + "Set a limit on the number of connection attempts per + minute to the system for the protocol."; + } + + leaf session-limit { + type uint16; + description + "Set a limit on the number of simultaneous active terminal + sessions to the system for the protocol (e.g., ssh, + telnet, ...) "; + } + } + + grouping system-terminal-common-state { + description + "Common operational state data for terminal services"; + } + + grouping system-terminal-common-top { + description + "Top-level grouping for common terminal service data"; + + container terminal-servers { + description + "Top-level container for terminal services"; + + container config { + description + "Configuration data for terminal services"; + + uses system-terminal-common-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses system-terminal-common-config; + uses system-terminal-common-state; + } + } + } + + grouping system-ssh-server-config { + description + "Configuration data for system ssh configuration"; + + leaf enable { + type boolean; + default true; + description + "Enables the ssh server. The ssh server is enabled by + default."; + } + + leaf protocol-version { + type enumeration { + enum V2 { + description + "Use SSH v2 only"; + } + enum V1 { + description + "Use SSH v1 only"; + } + enum V1_V2 { + description + "Use either SSH v1 or v2"; + } + } + default V2; + description + "Set the protocol version for SSH connections to the system"; + } + + uses system-terminal-common-config; + } + + grouping system-ssh-server-state { + description + "Operational state data for ssh server"; + } + + grouping system-ssh-server-top { + description + "Top-level grouping for ssh server data"; + + container ssh-server { + description + "Top-level container for ssh server"; + + container config { + description + "Configuration data for the system ssh server"; + + uses system-ssh-server-config; + } + + container state { + + config false; + + description + "Operational state data for the system ssh server"; + + uses system-ssh-server-config; + uses system-ssh-server-state; + } + } + } + + grouping system-telnet-server-config { + description + "Configuration data for telnet server"; + + leaf enable { + type boolean; + default false; + description + "Enables the telnet server. Telnet is disabled by + default"; + } + uses system-terminal-common-config; + + } + + grouping system-telnet-server-state { + description + "Operational state data for telnet server"; + } + + grouping system-telnet-server-top { + description + "Top-level grouping for telnet server "; + + container telnet-server { + description + "Top-level container for telnet terminal servers"; + + container config { + description + "Configuration data for telnet"; + + uses system-telnet-server-config; + } + + container state { + + config false; + + description + "Operational state data for telnet"; + + uses system-telnet-server-config; + uses system-telnet-server-state; + } + } + } + + // data definition statements + + // augment statements + + // rpc statements + + // notification statements + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-system@2017-01-29.yang b/exp/yangcli/h3c-yang/openconfig-system@2017-01-29.yang new file mode 100644 index 0000000..c191eb4 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-system@2017-01-29.yang @@ -0,0 +1,856 @@ +module openconfig-system { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/system"; + + prefix "oc-sys"; + + // import some basic types + import ietf-inet-types { prefix inet; } + import ietf-yang-types { prefix yang; } + import openconfig-types { prefix oc-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-aaa { prefix oc-aaa; } + import openconfig-system-logging { prefix oc-log; } + import openconfig-system-terminal { prefix oc-sys-term; } + import openconfig-procmon { prefix oc-proc; } + + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "Model for managing system-wide services and functions on + network devices. + + This model leverages parts of the IETF system management model + described in RFC 7317 - A YANG Data Model for System + Management."; + + oc-ext:openconfig-version "0.1.0"; + + revision "2017-01-29" { + description + "Initial public release"; + reference "0.1.0"; + } + + // extension statements + + // feature statements + + // identity statements + + identity NTP_AUTH_TYPE { + description + "Base identity for encryption schemes supported for NTP + authentication keys"; + } + + identity NTP_AUTH_MD5 { + base NTP_AUTH_TYPE; + description + "MD5 encryption method"; + } + + // typedef statements + + typedef timezone-name-type { + type string; + description + "[adapted from IETF system model RFC 7317] + + A time zone name as used by the Time Zone Database, + sometimes referred to as the 'Olson Database'. + + The exact set of valid values is an implementation-specific + matter. Client discovery of the exact set of time zone names + for a particular server is out of scope."; + reference + "BCP 175: Procedures for Maintaining the Time Zone Database"; + } + + // grouping statements + + grouping system-clock-config { + description + "Configuration data for system-wide clock configuration"; + + leaf timezone-name { + type timezone-name-type; + description + "The TZ database name to use for the system, such + as 'Europe/Stockholm'."; + reference "IANA Time Zone Database + http://www.iana.org/time-zones"; + } + } + + grouping system-clock-state { + description + "Operational state data for system-wide clock configuration"; + } + + grouping system-clock-top { + description + "Top-level grouping for system-wide clock configuration"; + + container clock { + description + "Top-level container for clock configuration data"; + + container config { + description + "Configuration data for system clock"; + + uses system-clock-config; + } + + container state { + + config false; + + description + "Operational state data for system clock"; + + uses system-clock-config; + uses system-clock-state; + } + } + } + + grouping system-global-config { + description "system-wide configuration parameters"; + + leaf hostname { + type inet:domain-name; + description + "The hostname of the device -- should be a single domain + label, without the domain."; + } + + leaf domain-name { + type inet:domain-name; + description + "Specifies the domain name used to form fully qualified name + for unqualified hostnames."; + } + + leaf login-banner { + type string; + description + "The console login message displayed before the login prompt, + i.e., before a user logs into the system."; + } + + leaf motd-banner { + type string; + description + "The console message displayed after a user logs into the + system. They system may append additional standard + information such as the current system date and time, uptime, + last login timestamp, etc."; + } + } + + grouping system-global-state { + description + "Global operational state data for the system"; + + leaf current-datetime { + type yang:date-and-time; + description + "[adapted from IETF system model RFC 7317] + + The current system date and time."; + } + + leaf boot-time { + type oc-types:timeticks64; + description + "This timestamp indicates the time that the system was last + restarted. The value is the timestamp in seconds relative + to the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + } + + grouping system-dns-config { + description "DNS / resolver related configuration data"; + + leaf-list search { + type inet:domain-name; + ordered-by user; + description + "[adapted from IETF system model RFC 7317] + + An ordered list of domains to search when resolving + a host name."; + } + } + + grouping system-dns-state { + description + "Operational state data for system DNS resolver"; + + } + + grouping system-dns-servers-config { + description + "Configuration data for DNS resolvers"; + + //RFC 7317 includes a single-value choice statement to for + //TCP and UDP transport. This has been removed since it the + //transport protocol is not generally available as an options + //on target devices. It may be added back if and when needed. + + leaf address { + type inet:ip-address; + description + "[adapted from IETF system model RFC 7317] + + The address of the DNS server, can be either IPv4 + or IPv6."; + } + + leaf port { + type inet:port-number; + default 53; + description + "[adapted from IETF system model RFC 7317] + + The port number of the DNS server."; + } + + //RFC 7317 includes resolver timeout and attempts options. These + //have been omitted as they are not available on many targets. If + //and when they are required, they may be added back in. + } + + grouping system-dns-static-config { + description + "Configuration data for static host entries"; + + leaf hostname { + type string; + description + "Hostname for the static DNS entry"; + } + + leaf-list alias { + type string; + description + "Additional aliases for the hostname"; + } + + leaf-list ipv4-address { + type inet:ipv4-address; + description + "List of IPv4 addressses for the host entry"; + } + + leaf-list ipv6-address { + type inet:ipv6-address; + description + "List of IPv6 addresses for the host entry"; + } + } + + grouping system-dns-static-state { + description + "Operational state data for static host entries"; + } + + grouping system-dns-static-top { + description + "Top-level grouping for static DNS host entries"; + + container host-entries { + description + "Enclosing container for list of static host entries"; + + list host-entry { + key "hostname"; + description + "List of static host entries"; + + leaf hostname { + type leafref { + path "../config/hostname"; + } + description + "Reference to the hostname list key"; + } + + container config { + description + "Configuration data for static host entries"; + + uses system-dns-static-config; + } + + container state { + + config false; + + description + "Operational state data for static host entries"; + + uses system-dns-static-config; + uses system-dns-static-state; + } + } + } + } + + grouping system-dns-servers-state { + description + "Operational state data for DNS resolvers"; + + } + + grouping system-dns-servers-top { + description + "Top-level grouping for the list of DNS resolvers."; + + container servers { + description + "Enclosing container for DNS resolver list"; + + list server { + key "address"; + ordered-by user; + description + "[adapted from IETF system model RFC 7317] + + List of the DNS servers that the resolver should query. + + When the resolver is invoked by a calling application, it + sends the query to the first name server in this list. If + no response has been received within 'timeout' seconds, + the resolver continues with the next server in the list. + If no response is received from any server, the resolver + continues with the first server again. When the resolver + has traversed the list 'attempts' times without receiving + any response, it gives up and returns an error to the + calling application. + + Implementations MAY limit the number of entries in this + list."; + + leaf address { + type leafref { + path "../config/address"; + } + description + "References the configured address of the DNS server"; + } + + container config { + description + "Configuration data for each DNS resolver"; + + uses system-dns-servers-config; + } + + container state { + + config false; + + description + "Operational state data for each DNS resolver"; + + uses system-dns-servers-config; + uses system-dns-servers-state; + } + + } + } + } + + grouping system-dns-top { + description + "Top-level grouping for DNS / resolver config and operational + state data"; + + container dns { + description + "Enclosing container for DNS resolver data"; + + container config { + description + "Configuration data for the DNS resolver"; + + uses system-dns-config; + + } + + container state { + + config false; + + description + "Operational state data for the DNS resolver"; + + uses system-dns-config; + uses system-dns-state; + + } + + uses system-dns-servers-top; + uses system-dns-static-top; + } + } + + grouping system-ntp-server-config { + description + "Configuration data for NTP servers"; + + leaf address { + type inet:host; + description + "[adapted from IETF system model RFC 7317] + + The address or hostname of the NTP server."; + } + + leaf port { + type inet:port-number; + default 123; + description + "[adapted from IETF system model RFC 7317] + + The port number of the NTP server."; + } + + leaf version { + type uint8 { + range 1..4; + } + default 4; + description + "[adapted from IETF system model RFC 7317] + + Version number to put in outgoing NTP packets"; + } + + leaf association-type { + type enumeration { + enum SERVER { + description + "Use client association mode. This device + will not provide synchronization to the + configured NTP server."; + } + enum PEER { + description + "Use symmetric active association mode. + This device may provide synchronization + to the configured NTP server."; + } + enum POOL { + description + "Use client association mode with one or + more of the NTP servers found by DNS + resolution of the domain name given by + the 'address' leaf. This device will not + provide synchronization to the servers."; + } + } + default SERVER; + description + "[adapted from IETF system model RFC 7317] + + The desired association type for this NTP server."; + } + leaf iburst { + type boolean; + default false; + description + "[adapted from IETF system model RFC 7317] + + Indicates whether this server should enable burst + synchronization or not."; + } + leaf prefer { + type boolean; + default false; + description + "[adapted from IETF system model RFC 7317] + + Indicates whether this server should be preferred + or not."; + } + } + + grouping system-ntp-server-state { + description + "Operational state data for NTP servers"; + + leaf stratum { + type uint8; + description + "Indicates the level of the server in the NTP hierarchy. As + stratum number increases, the accuracy is degraded. Primary + servers are stratum while a maximum value of 16 indicates + unsynchronized. The values have the following specific + semantics: + + | 0 | unspecified or invalid + | 1 | primary server (e.g., equipped with a GPS receiver) + | 2-15 | secondary server (via NTP) + | 16 | unsynchronized + | 17-255 | reserved"; + reference + "RFC 5905 - Network Time Protocol Version 4: Protocol and + Algorithms Specification"; + } + + leaf root-delay { + type uint32; + // TODO: reconsider units for these values -- the spec defines + // rootdelay and rootdisperson as 2 16-bit integers for seconds + // and fractional seconds, respectively. This gives a + // precision of ~15 us (2^-16). Using milliseconds here based + // on what implementations typically provide and likely lack + // of utility for less than millisecond precision with NTP + // time sync. + units "milliseconds"; + description + "The round-trip delay to the server, in milliseconds."; + reference + "RFC 5905 - Network Time Protocol Version 4: Protocol and + Algorithms Specification"; + } + + leaf root-dispersion { + type uint64; + units "milliseconds"; + description + "Dispersion (epsilon) represents the maximum error inherent + in the measurement"; + reference + "RFC 5905 - Network Time Protocol Version 4: Protocol and + Algorithms Specification"; + } + + leaf offset { + type uint64; + units "milliseconds"; + description + "Estimate of the current time offset from the peer. This is + the time difference between the local and reference clock."; + } + + leaf poll-interval { + type uint32; + units "seconds"; + description + "Polling interval of the peer"; + } + } + + grouping system-ntp-server-top { + description + "Top-level grouping for the list of NTP servers"; + + container servers { + description + "Enclosing container for the list of NTP servers"; + + list server { + key "address"; + description + "[adapted from IETF system model RFC 7317] + + List of NTP servers to use for system clock + synchronization. If '/system/ntp/enabled' + is 'true', then the system will attempt to + contact and utilize the specified NTP servers."; + + leaf address { + type leafref { + path "../config/address"; + } + description + "References the configured address or hostname of the + NTP server."; + } + + container config { + description + "Configuration data for an NTP server."; + + uses system-ntp-server-config; + } + + container state { + + config false; + + description + "Operational state data for an NTP server."; + + uses system-ntp-server-config; + uses system-ntp-server-state; + } + + } + } + } + + grouping system-ntp-auth-keys-config { + description + "Configuration data "; + + leaf key-id { + type uint16; + description + "Integer identifier used by the client and server to + designate a secret key. The client and server must use + the same key id."; + } + + leaf key-type { + type identityref { + base NTP_AUTH_TYPE; + } + description + "Encryption type used for the NTP authentication key"; + } + + leaf key-value { + type string; + description + "NTP authentication key value"; + } + } + + grouping system-ntp-auth-keys-state { + description + "Operational state data for NTP auth key data"; + } + + grouping system-ntp-auth-keys-top { + description + "Top-level grouping for NTP auth key data"; + + container ntp-keys { + description + "Enclosing container for list of NTP authentication keys"; + + list ntp-key { + key "key-id"; + description + "List of NTP authentication keys"; + + leaf key-id { + type leafref { + path "../config/key-id"; + } + description + "Reference to auth key-id list key"; + } + + container config { + description + "Configuration data for NTP auth keys"; + + uses system-ntp-auth-keys-config; + } + + container state { + + config false; + + description + "Operational state data for NTP auth keys"; + + uses system-ntp-auth-keys-config; + uses system-ntp-auth-keys-state; + } + } + } + } + + grouping system-ntp-config { + description + "Configuration data for system-wide NTP operation."; + + leaf enabled { + type boolean; + default false; + description + "[adapted from IETF system model RFC 7317] + + Enables the NTP protocol and indicates that the system should + attempt to synchronize the system clock with an NTP server + from the servers defined in the 'ntp/server' list."; + } + + leaf ntp-source-address { + type inet:ip-address; + description + "[adapted from IETF system model RFC 7317] + + Source address to use on outgoing NTP packets"; + } + + leaf enable-ntp-auth { + type boolean; + default false; + description + "Enable or disable NTP authentication -- when enabled, the + system will only use packets containing a trusted + authentication key to synchronize the time."; + } + } + + grouping system-ntp-state { + description + "Operational state data for system-wide NTP operation."; + + leaf auth-mismatch { + type yang:counter64; + description + "Count of the number of NTP packets received that were not + processed due to authentication mismatch."; + } + } + + grouping system-ntp-top { + description + "Top-level grouping for configuration and state data for NTP"; + + container ntp { + description + "Top-level container for NTP configuration and state"; + + container config { + description + "Configuration data for NTP client."; + + uses system-ntp-config; + } + + container state { + + config false; + + description + "Operational state data for NTP services."; + + uses system-ntp-config; + uses system-ntp-state; + } + uses system-ntp-auth-keys-top; + uses system-ntp-server-top; + } + } + + grouping system-memory-config { + description + "Configuration data for system memory"; + } + + grouping system-memory-state { + description + "Operational state data for system memory"; + + leaf physical { + type uint64; + units bytes; + // TODO: consider making units in megabytes + description + "Reports the total physical memory available on the + system."; + } + + leaf reserved { + type uint64; + units bytes; + description + "Memory reserved for system use"; + } + } + + grouping system-memory-top { + description + "Top-level grouping for system memory data definitions"; + + container memory { + description + "Top-level container for system memory data"; + + container config { + description + "Configuration data for system memory"; + + uses system-memory-config; + } + + container state { + + config false; + + description + "Operational state data for system memory"; + + uses system-memory-config; + uses system-memory-state; + } + } + } + + + grouping system-top { + description + "Top level system data containers"; + + container system { + description + "Enclosing container for system-related configuration and + operational state data"; + + container config { + description "Global configuration data for the system"; + + uses system-global-config; + + } + + container state { + + config false; + + description "Global operational state data for the system"; + + uses system-global-config; + uses system-global-state; + + } + + uses system-clock-top; + uses system-dns-top; + uses system-ntp-top; + uses oc-sys-term:system-ssh-server-top; + uses oc-sys-term:system-telnet-server-top; + uses oc-log:logging-top; + uses oc-aaa:aaa-top; + uses system-memory-top; + uses oc-proc:procmon-processes-top; + } + } + + // data definition statements + + uses system-top; + +} diff --git a/exp/yangcli/h3c-yang/openconfig-telemetry-types@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-telemetry-types@2018-11-21.yang new file mode 100644 index 0000000..66c0bf6 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-telemetry-types@2018-11-21.yang @@ -0,0 +1,124 @@ +module openconfig-telemetry-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/telemetry-types"; + + prefix "oc-telemetry-types"; + + import openconfig-extensions { prefix oc-ext; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module defines type and identities used by the OpenConfig + telemetry model."; + + oc-ext:openconfig-version "0.4.2"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.4.2"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.4.1"; + } + + revision "2017-02-20" { + description + "Fixes for YANG 1.0 compliance, add types module"; + reference "0.4.0"; + } + + revision "2016-04-05" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // identity statements + + identity DATA_ENCODING_METHOD { + description + "Base identity for supported encoding for configuration and + operational state data"; + } + + identity ENC_XML { + base DATA_ENCODING_METHOD; + description + "XML encoding"; + } + + identity ENC_JSON_IETF { + base DATA_ENCODING_METHOD; + description + "JSON encoded based on IETF draft standard"; + reference + "draft-ietf-netmod-yang-json"; + } + + identity ENC_PROTO3 { + base DATA_ENCODING_METHOD; + description + "Protocol buffers v3"; + reference + "https://developers.google.com/protocol-buffers/docs/overview"; + } + + identity STREAM_PROTOCOL { + description "Base identity for a telemetry stream protocol"; + } + + identity STREAM_SSH { + base "STREAM_PROTOCOL"; + description + "Telemetry stream is carried over a SSH connection"; + } + + identity STREAM_GRPC { + base "STREAM_PROTOCOL"; + description + "Telemetry stream is carried over via the gRPC framework"; + } + + identity STREAM_JSON_RPC { + base "STREAM_PROTOCOL"; + description + "Telemetry stream is carried via the JSON-RPC framework"; + } + + identity STREAM_THRIFT_RPC { + base "STREAM_PROTOCOL"; + description + "Telemetry stream is carried via the Apache Thrift framework"; + } + + identity STREAM_WEBSOCKET_RPC { + base "STREAM_PROTOCOL"; + description + "Telemetry stream is carried by the WebSocket framework"; + } + + + // typedef statements + + + +} diff --git a/exp/yangcli/h3c-yang/openconfig-telemetry@2018-11-21.yang b/exp/yangcli/h3c-yang/openconfig-telemetry@2018-11-21.yang new file mode 100644 index 0000000..54ebb98 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-telemetry@2018-11-21.yang @@ -0,0 +1,782 @@ +module openconfig-telemetry { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/telemetry"; + + prefix "oc-telemetry"; + + // import some basic types + import openconfig-inet-types { prefix oc-inet; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-telemetry-types { prefix oc-telemetry-types; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group www.openconfig.net"; + + description + "Data model which creates the configuration for the telemetry + systems and functions on the device."; + + oc-ext:openconfig-version "0.5.1"; + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.5.1"; + } + + revision "2018-08-17" { + description + "Update telemetry model to comply with the OpenConfig + style for lists and their containers. Remove subscription + exclusions."; + reference "0.5.0"; + } + + revision "2017-08-24" { + description + "Minor formatting fixes"; + reference "0.4.1"; + } + + revision "2017-02-20" { + description + "Fixes for YANG 1.0 compliance, add types module"; + reference "0.4.0"; + } + + revision "2016-04-05" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping telemetry-top { + description + "Top level grouping for telemetry configuration and operational + state data"; + + container telemetry-system { + description + "Top level configuration and state for the + device's telemetry system."; + + container sensor-groups { + description + "Top level container for sensor-groups."; + + list sensor-group { + key "sensor-group-id"; + description + "List of telemetry sensory groups on the local + system, where a sensor grouping represents a resuable + grouping of multiple paths and exclude filters."; + + leaf sensor-group-id { + type leafref { + path "../config/sensor-group-id"; + } + description + "Reference to the name or identifier of the + sensor grouping"; + } + + container config { + description + "Configuration parameters relating to the + telemetry sensor grouping"; + uses telemetry-sensor-group-config; + } + + container state { + config false; + description + "State information relating to the telemetry + sensor group"; + uses telemetry-sensor-group-config; + } + + container sensor-paths { + description + "Top level container to hold a set of sensor + paths grouped together"; + + list sensor-path { + key "path"; + description + "List of paths in the model which together + comprise a sensor grouping. Filters for each path + to exclude items are also provided."; + + leaf path { + type leafref { + path "../config/path"; + } + description + "Reference to the path of interest"; + } + + container config { + description + "Configuration parameters to configure a set + of data model paths as a sensor grouping"; + uses telemetry-sensor-path-config; + } + + container state { + config false; + description + "Configuration parameters to configure a set + of data model paths as a sensor grouping"; + uses telemetry-sensor-path-config; + } + } + } + } + } + + container destination-groups { + description + "Top level container for destination group configuration + and state."; + + list destination-group { + key "group-id"; + description + "List of destination-groups. Destination groups allow the + reuse of common telemetry destinations across the + telemetry configuration. An operator references a + set of destinations via the configurable + destination-group-identifier. + + A destination group may contain one or more telemetry + destinations"; + + leaf group-id { + type leafref { + path "../config/group-id"; + } + description + "Unique identifier for the destination group"; + } + + container config { + description + "Top level config container for destination groups"; + leaf group-id { + type string; + description + "Unique identifier for the destination group"; + } + } + + container state { + config false; + description + "Top level state container for destination groups"; + + leaf group-id { + type string; + description + "Unique identifier for destination group"; + } + } + + container destinations { + description + "The destination container lists the destination + information such as IP address and port of the + telemetry messages from the network element."; + list destination { + key "destination-address destination-port"; + description + "List of telemetry stream destinations"; + + leaf destination-address { + type leafref { + path "../config/destination-address"; + } + description + "Reference to the destination address of the + telemetry stream"; + } + + leaf destination-port { + type leafref { + path "../config/destination-port"; + } + description + "Reference to the port number of the stream + destination"; + } + + container config { + description + "Configuration parameters relating to + telemetry destinations"; + uses telemetry-stream-destination-config; + } + + container state { + config false; + description + "State information associated with + telemetry destinations"; + uses telemetry-stream-destination-config; + } + } + } + } + } + + container subscriptions { + description + "This container holds information for both persistent + and dynamic telemetry subscriptions."; + + container persistent-subscriptions { + description + "This container holds information relating to persistent + telemetry subscriptions. A persistent telemetry + subscription is configued locally on the device through + configuration, and is persistent across device restarts or + other redundancy changes."; + + list persistent-subscription { + key "name"; + + description + "List of telemetry subscriptions. A telemetry + subscription consists of a set of collection + destinations, stream attributes, and associated paths to + state information in the model (sensor data)"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the identifier of the subscription + itself. The id will be the handle to refer to the + subscription once created"; + } + + container config { + description + "Config parameters relating to the telemetry + subscriptions on the local device"; + + uses telemetry-subscription-name-config; + uses telemetry-local-source-address-config; + uses telemetry-qos-marking-config; + uses telemetry-stream-protocol-config; + uses telemetry-stream-encoding-config; + } + + container state { + config false; + description + "State parameters relating to the telemetry + subscriptions on the local device"; + + uses telemetry-subscription-name-config; + uses telemetry-subscription-config; + uses telemetry-subscription-state; + uses telemetry-local-source-address-config; + uses telemetry-qos-marking-config; + uses telemetry-stream-protocol-config; + uses telemetry-stream-encoding-config; + } + + container sensor-profiles { + description + "A sensor profile is a set of sensor groups or + individual sensor paths which are associated with a + telemetry subscription. This is the source of the + telemetry data for the subscription to send to the + defined collectors."; + list sensor-profile { + key "sensor-group"; + description + "List of telemetry sensor groups used + in the subscription"; + + leaf sensor-group { + type leafref { + path "../config/sensor-group"; + } + description + "Reference to the telemetry sensor group name"; + } + + container config { + description + "Configuration parameters related to the sensor + profile for a subscription"; + uses telemetry-sensor-profile-config; + } + + container state { + config false; + description + "State information relating to the sensor profile + for a subscription"; + uses telemetry-sensor-profile-config; + } + } + } + + container destination-groups { + description + "A subscription may specify destination addresses. + If the subscription supplies destination addresses, + the network element will be the initiator of the + telemetry streaming, sending it to the destination(s) + specified. + + If the destination set is omitted, the subscription + preconfigures certain elements such as paths and + sample intervals under a specified subscription ID. + In this case, the network element will NOT initiate an + outbound connection for telemetry, but will wait for + an inbound connection from a network management + system. + + It is expected that the network management system + connecting to the network element will reference + the preconfigured subscription ID when initiating + a subscription."; + + list destination-group { + key "group-id"; + description + "Identifier of the previously defined destination + group"; + + leaf group-id { + type leafref { + path "../config/group-id"; + } + description + "The destination group id references a configured + group of destinations for the telemetry stream."; + } + + container config { + description + "Configuration parameters related to telemetry + destinations."; + + leaf group-id { + type leafref { + path "../../../../../../../destination-groups" + + "/destination-group/group-id"; + } + description + "The destination group id references a reusable + group of destination addresses and ports for + the telemetry stream."; + } + } + + container state { + config false; + description + "State information related to telemetry + destinations"; + + leaf group-id { + type leafref { + path "../../../../../../../destination-groups" + + "/destination-group/group-id"; + } + description + "The destination group id references a reusable + group of destination addresses and ports for + the telemetry stream."; + } + } + } + } + } + } + + container dynamic-subscriptions { + description + "This container holds information relating to dynamic + telemetry subscriptions. A dynamic subscription is + typically configured through an RPC channel, and does not + persist across device restarts, or if the RPC channel is + reset or otherwise torn down."; + + + list dynamic-subscription { + key "id"; + + config false; + description + "List representation of telemetry subscriptions that + are configured via an inline RPC, otherwise known + as dynamic telemetry subscriptions."; + + leaf id { + type leafref { + path "../state/id"; + } + + description + "Reference to the identifier of the subscription + itself. The id will be the handle to refer to the + subscription once created"; + } + + container state { + config false; + description + "State information relating to dynamic telemetry + subscriptions."; + + uses telemetry-subscription-config; + uses telemetry-stream-destination-config; + uses telemetry-stream-frequency-config; + uses telemetry-heartbeat-config; + uses telemetry-suppress-redundant-config; + uses telemetry-qos-marking-config; + uses telemetry-stream-protocol-config; + uses telemetry-stream-encoding-config; + } + + container sensor-paths { + description + "Top level container to hold a set of sensor + paths grouped together"; + + list sensor-path { + key "path"; + description + "List of paths in the model which together + comprise a sensor grouping. Filters for each path + to exclude items are also provided."; + + leaf path { + type leafref { + path "../state/path"; + } + description + "Reference to the path of interest"; + } + + container state { + config false; + description + "State information for a dynamic subscription's + paths of interest"; + uses telemetry-sensor-path-config; + } + } + } + } + } + } + } + } + + // identity statements + + // typedef statements + + // grouping statements + + grouping telemetry-sensor-path-config { + description + "Configuration parameters relating to the + grouping of data model paths comprising a + sensor grouping"; + leaf path { + type string; + description + "Path to a section of operational state of interest + (the sensor)."; + } + + leaf exclude-filter { + type string; + description + "Filter to exclude certain values out of the state + values"; + //May not be necessary. Could remove. + } + } + + grouping telemetry-heartbeat-config { + description + "Configuration parameters relating to the + heartbeat of the telemetry subscription"; + leaf heartbeat-interval { + type uint64; + description + "Maximum time interval in seconds that may pass + between updates from a device to a telemetry collector. + If this interval expires, but there is no updated data to + send (such as if suppress_updates has been configured), the + device must send a telemetry message to the collector."; + } + } + + grouping telemetry-suppress-redundant-config { + description + "Configuration parameters relating to suppression of + redundant upstream updates"; + leaf suppress-redundant { + type boolean; + description + "Boolean flag to control suppression of redundant + telemetry updates to the collector platform. If this flag is + set to TRUE, then the collector will only send an update at + the configured interval if a subscribed data value has + changed. Otherwise, the device will not send an update to + the collector until expiration of the heartbeat interval."; + } + } + + grouping telemetry-sensor-profile-config { + description + "Configuration parameters relating to the sensor groups + used in the sensor profile"; + leaf sensor-group { + type leafref { + path "../../../../../../../sensor-groups/sensor-group" + + "/config/sensor-group-id"; + } + description + "Reference to the sensor group which is used in the profile"; + } + uses telemetry-stream-subscription-config; + } + + grouping telemetry-stream-subscription-config { + description + "Configuration used when the sensor is a stream based sensor."; + + uses telemetry-stream-frequency-config; + uses telemetry-heartbeat-config; + uses telemetry-suppress-redundant-config; + + } + + grouping telemetry-qos-marking-config { + description + "Config parameters relating to the quality of service + marking on device generated telemetry packets"; + + leaf originated-qos-marking { + type oc-inet:dscp; + description + "DSCP marking of packets generated by the telemetry + subsystem on the network device."; + } + } + + + grouping telemetry-sensor-group-config { + description + "Config parameters related to the sensor groups + on the device"; + leaf sensor-group-id { + type string; + description + "Name or identifier for the sensor group itself. + Will be referenced by other configuration specifying a + sensor group"; + } + } + + grouping telemetry-subscription-config { + description + "Configuration parameters relating to the telemetry + subscription"; + + leaf id { + type uint64; + description + "System generated identifer of the telemetry + subscription."; + } + } + + grouping telemetry-subscription-name-config { + description + "Configuration parameters relating to the configured + name of the telemetry subscription. The name is a user + configured string value which uniquely identifies the + subscription in the configuration database."; + + leaf name { + type string; + description + "User configured identifier of the telemetry + subscription. This value is used primarily for + subscriptions configured locally on the network + element."; + } + } + + grouping telemetry-subscription-state { + description + "State values for the telemetry subscription"; + //TODO add values + } + + grouping telemetry-stream-protocol-config { + description + "Configuration parameters relating to the + transport protocol carrying telemetry + data."; + + leaf protocol { + type identityref { + base oc-telemetry-types:STREAM_PROTOCOL; + } + description + "Selection of the transport protocol for the telemetry + stream."; + } + } + + grouping telemetry-stream-encoding-config { + description + "Configuration parameters relating to the + encoding of telemetry data to and from the + network element. The encoding method controls + specifically the wire format of the telemetry + data, and also controls which RPC framework + may be in use to exchange telemetry data."; + + leaf encoding { + type identityref { + base oc-telemetry-types:DATA_ENCODING_METHOD; + } + description + "Selection of the specific encoding or RPC framework + for telemetry messages to and from the network element."; + } + } + + grouping telemetry-stream-destination-config { + description + "Configuration parameters for the stream destinations"; + leaf destination-address { + type oc-inet:ip-address; + description + "IP address of the telemetry stream destination"; + } + leaf destination-port { + type uint16; + description + "Protocol (udp or tcp) port number for the telemetry + stream destination"; + } + } + + grouping telemetry-stream-frequency-config { + description + "Config parameters for the frequency of updates to + the collector"; + leaf sample-interval { + type uint64; + description + "Time in milliseconds between the device's sample of a + telemetry data source. For example, setting this to 100 + would require the local device to collect the telemetry + data every 100 milliseconds. There can be latency or jitter + in transmitting the data, but the sample must occur at + the specified interval. + + The timestamp must reflect the actual time when the data + was sampled, not simply the previous sample timestamp + + sample-interval. + + If sample-interval is set to 0, the telemetry sensor + becomes event based. The sensor must then emit data upon + every change of the underlying data source."; + } + } + + grouping telemetry-sensor-specification { + description + "Config related to creating telemetry sensor groups. A sensor + group is a related set of sensor paths and/or filters to + exclude items. A group is assigned a reusable identifer, so + it can be used in multiple telemetry subscriptions."; + list telemetry-sensor-group { + key "telemetry-sensor-group-id"; + description + "List of telemetry sensor groups"; + + leaf telemetry-sensor-group-id { + type string; + description + "The sensor group identifer is a reusable handle which + identifies a single sensor group. It is referenced from + the subscription configuration."; + } + uses telemetry-sensor-paths; + } + } + + grouping telemetry-sensor-paths { + description + "This grouping contains these paths to leaves or containers + in the data model which are the sources of telemetry + information."; + + list telemetry-sensor-paths { + key "telemetry-sensor-path"; + description + "A list of sensor paths and exclude filters which comprise + a sensor grouping"; + + leaf telemetry-sensor-path { + type string; + description + "The sensor path is a path to a portion of operational + state of interest in the data model"; + } + } + } + + + grouping telemetry-local-source-address-config { + description + "Config relating to the local source address for telemetry + messages"; + // TODO: Make this a reference to an interface. + leaf local-source-address { + type oc-inet:ip-address; + description + "The IP address which will be the source of packets from + the device to a telemetry collector destination."; + } + } + + // data definition statements + + uses telemetry-top; + + // augment statements + + // rpc statements + + // notification statements + +} diff --git a/exp/yangcli/h3c-yang/openconfig-tencent-interfaces-ext@2019-02-01.yang b/exp/yangcli/h3c-yang/openconfig-tencent-interfaces-ext@2019-02-01.yang new file mode 100644 index 0000000..ced20cc --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-tencent-interfaces-ext@2019-02-01.yang @@ -0,0 +1,278 @@ +/* + * Copyright (C) 2018-2019 THL A29 Limited, a Tencent company. All rights reserved. + */ + +module openconfig-tencent-interfaces-ext { + // namespace + namespace "urn:tencent:yang:openconfig-tencent-interfaces-ext"; + + prefix "oc-tc-if-ext"; + + import openconfig-interfaces { prefix oc-if;} + + organization "Tencent DCN working group"; + + contact + "Tencent TDCP working group"; + + description "This module defines optional extensions to the OpenConfig interfaces model."; + + revision "2019-02-01" { + description + "Initial revision"; + reference "0.1.0"; + } + + //augment statements + augment "/oc-if:interfaces/oc-if:interface/oc-if:state" { + description + "Adding extension state data to interface"; + + leaf alias { + type string; + description + "the alias name of the interface."; + } + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/oc-if:subinterface/oc-if:ipv4/oc-if:state/oc-if:counters" { + description + "Adding extension state data to interface"; + + leaf in-L2-MTU-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of L2 MTU"; + } + + leaf out-L2-MTU-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of L2 MTU"; + } + + leaf in-vlan-mismatch-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of mismatching of vlan"; + } + + leaf out-vlan-mismatch-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of mismatching of vlan"; + } + + leaf in-spanningtree-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the filter of spanning tree"; + } + + leaf out-spanningtree-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of the filter of spanning tree"; + } + + leaf in-same-interface-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the same interface to transmit and receive"; + } + + leaf in-L3-header-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 header errors"; + } + + leaf in-L3-ttl-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 ttl0/ttl1 errors"; + } + + leaf in-storm-control-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the storm control"; + } + + leaf in-L3-rib-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 rib errors"; + } + + leaf in-L3-nexthop-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 nexthop behavior is dorp"; + } + + leaf in-L3-MTU-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of L3 MTU"; + } + + leaf in-ACL-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of ACL behavior"; + } + + leaf out-ACL-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of ACL behavior"; + } + + leaf in-checksum-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of checksum errors"; + } + + leaf out-checksum-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of checksum errors"; + } + + leaf in-illegal-interface-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of illegal interface"; + } + } + + + + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/oc-if:subinterface/oc-if:state" { + description + "Adding extension state data to subinterface"; + + leaf alias { + type string; + description + "the alias name of the interface."; + } + } + + augment "/oc-if:interfaces/oc-if:interface/oc-if:subinterfaces/oc-if:subinterface/oc-if:ipv6/oc-if:state/oc-if:counters" { + description + "Adding extension state data to subinterface"; + + leaf in-L2-MTU-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of L2 MTU"; + } + + leaf out-L2-MTU-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of L2 MTU"; + } + + leaf in-vlan-mismatch-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of mismatching of vlan"; + } + + leaf out-vlan-mismatch-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of mismatching of vlan"; + } + + leaf in-spanningtree-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the filter of spanning tree"; + } + + leaf out-spanningtree-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of the filter of spanning tree"; + } + + leaf in-same-interface-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the same interface to transmit and receive"; + } + + leaf in-L3-header-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 header errors"; + } + + leaf in-L3-ttl-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 ttl0/ttl1 errors"; + } + + leaf in-storm-control-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the storm control"; + } + + leaf in-L3-rib-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 rib errors"; + } + + leaf in-L3-nexthop-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of the L3 nexthop behavior is dorp"; + } + + leaf in-L3-MTU-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of L3 MTU"; + } + + leaf in-ACL-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of ACL behavior"; + } + + leaf out-ACL-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of ACL behavior"; + } + + leaf in-checksum-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of checksum errors"; + } + + leaf out-checksum-errors{ + type oc-yang:counter32; + description + "the reason of outbound packets could not be transmitted because of checksum errors"; + } + + leaf in-illegal-interface-errors{ + type oc-yang:counter32; + description + "the reason of inbound packets could not be transmitted because of illegal interface"; + } + } +} + diff --git a/exp/yangcli/h3c-yang/openconfig-tencent-platform-chip@2019-01-24.yang b/exp/yangcli/h3c-yang/openconfig-tencent-platform-chip@2019-01-24.yang new file mode 100644 index 0000000..b965415 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-tencent-platform-chip@2019-01-24.yang @@ -0,0 +1,830 @@ +/* + * Copyright (C) 2018-2019 THL A29 Limited, a Tencent company. All rights reserved. + */ + +module openconfig-tencent-platform-chip { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/platform/chip"; + + prefix "oc-tc-platform-chip"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + import openconfig-yang-types { prefix oc-yang; } + import openconfig-types { prefix oc-types; } + import openconfig-platform { prefix oc-platform; } + import openconfig-platform-types { prefix oc-platform-types; } + import openconfig-interfaces { prefix oc-if; } + + // meta + organization "Tencent DCN working group"; + + contact + "Tencent TDCP working group"; + + description + "This module defines a schema for chip components in + the OpenConfig platform model."; + + oc-ext:openconfig-version "0.2.0"; + + revision "2019-01-24" { + description + "Initial revision"; + reference "0.1.0"; + } + + + identity CHIP_BUFFER_TYPE { + description + "Base identity for buffer types"; + } + + identity SHARED_BUFFER { + base CHIP_BUFFER_TYPE; + description + "The shared buffer on chip"; + } + + identity EXCLUSIVE_BUFFER { + base CHIP_BUFFER_TYPE; + description + "The exclusive buffer on chip"; + } + + identity HEADROOM { + base CHIP_BUFFER_TYPE; + description + "The headroom buffer on chip"; + } + + // grouping statements + + grouping chip-config { + description + "Configuration data for chip components"; + + } + + grouping chip-state { + description + "Operational state data for chip components"; + leaf error-reason { + type string; + description + "the error reason of chip(for example:ECC,parity error and so on)"; + } + + } + + grouping chip-top { + description + "Top-level grouping for chip data"; + + container chip { + description + "Top-level container for chip data"; + + container config { + description + "Configuration data for chip"; + + uses chip-config; + } + + container state { + + config false; + + description + "Operational state data for chip"; + + uses chip-config; + uses chip-state; + } + uses chip-buffer-top; + } + } + + + + grouping chip-buffer-config { + description + "Configuration data for buffer"; + leaf name { + + type identityref { + base CHIP_BUFFER_TYPE; + } + description + "buffer includs shared-buffer, exclusive-buffer and headroom, the name should be one of it"; + } + + } + + grouping chip-buffer-state { + description + "Operational state data for buffer"; + uses chip-buffer-input-top; + uses chip-buffer-output-top; + + leaf congest-discard { + type boolean; + description + "the congest happend(TCB)"; + } + + } + + grouping chip-buffer-top { + description + "Top-level grouping for chip data"; + + container buffers { + description + "Top-level container for buffer data"; + + list buffer { + key "name"; + + description + "Top-level container for the buffer associated with this + chip"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name of the buffer + instantiated on the chip."; + } + + container config { + description + "Configuration data for buffer"; + + uses chip-buffer-config; + } + + container state { + + config false; + + description + "Operational state data for buffer"; + + uses chip-buffer-config; + uses chip-buffer-state; + } + uses chip-buffer-input-top; + uses chip-buffer-output-top; + uses chip-buffer-interfaces-top; + uses chip-buffer-slices-top; + } + } + } + + + grouping chip-buffer-interfaces-config { + description + "Configuration data for interfaces referenced in the chip + model"; + + leaf interface-id { + type string; + description + "Identifier for the interface."; + } + } + + grouping chip-buffer-interfaces-state { + description + "Operational state data for interfaces referenced in the chip + model"; + leaf current-usage { + type oc-yang:counter64; + units bytes; + description + "current usage of buffer size"; + } + + leaf available-usage { + type oc-yang:counter64; + units bytes; + description + "available-usage of buffer size"; + } + + leaf current-utilization { + type oc-types:percentage; + description + "current usage of buffer size"; + } + + leaf historical-peak { + type oc-yang:counter64; + units bytes; + description + "historical peak of buffer size"; + } + + leaf historical-peak-time { + type oc-types:timeticks64; + description + "the time of exceeding the historical-peek"; + } + + leaf alarm-threshold { + type oc-types:percentage; + description + "the threshold of alarm"; + } + + leaf alarm-count { + type oc-yang:counter32; + description + "the count of alarm"; + } + + leaf discard-pkt { + type oc-yang:counter64; + description + "the count of packet that dropped since buffer overflow"; + } + + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of packet that forwarded"; + } + + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that forwarded"; + } + + // definitions per-interface counters for QoS + } + + grouping chip-buffer-interfaces-top { + description + "Top-level grouping for interfaces referenced in the buffer + model"; + + container interfaces { + description + "Enclosing container for the list of interface references"; + + list interface { + key "interface-id"; + description + "List of interfaces referenced by buffer entities."; + + leaf interface-id { + type leafref { + path "../config/interface-id"; + } + description + "Reference to the interface-id list key"; + } + + container config { + description + "Configuration data "; + + uses chip-buffer-interfaces-config; + } + + container state { + config false; + description + "Operational state data "; + + uses chip-buffer-interfaces-config; + uses chip-buffer-interfaces-state; + } + + uses oc-if:interface-ref; + uses chip-buffer-input-top; + uses chip-buffer-output-top; + + } + } + } + + + + grouping chip-buffer-slices-config { + description + "Configuration data for slices referenced in the chip + model"; + + leaf slice-name { + type string; + description + "Identifier for the slice."; + } + } + + + + grouping chip-buffer-slices-state { + description + "Operational state data for slices referenced in the chip + model"; + leaf current-usage { + type oc-yang:counter64; + units bytes; + description + "current usage of buffer size"; + } + + leaf available-usage { + type oc-yang:counter64; + units bytes; + description + "available-usage of buffer size"; + } + + leaf current-utilization { + type oc-types:percentage; + description + "current usage of buffer size"; + } + + leaf historical-peak { + type oc-yang:counter64; + units bytes; + description + "historical peak of buffer size"; + } + + leaf historical-peak-time { + type oc-types:timeticks64; + description + "the time of exceeding the historical-peek"; + } + + leaf alarm-threshold { + type oc-types:percentage; + description + "the threshold of alarm"; + } + + leaf alarm-count { + type oc-yang:counter32; + description + "the count of alarm"; + } + + leaf discard-pkt { + type oc-yang:counter64; + description + "the count of packet that dropped since buffer overflow"; + } + + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of packet that forwarded"; + } + + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that forwarded"; + } + // definitions per-interface counters for QoS + } + + grouping chip-buffer-slices-top { + description + "Top-level grouping for slices referenced in the buffer + model"; + + container slices { + description + "Enclosing container for the list of interface references"; + + list slice { + key "slice-name"; + description + "List of slices referenced by buffer entities."; + + leaf slice-name { + type string; + description + "Reference to the slice-name list key"; + } + + container config { + description + "Configuration data "; + + uses chip-buffer-slices-config; + } + + container state { + config false; + description + "Operational state data "; + + uses chip-buffer-slices-config; + uses chip-buffer-slices-state; + } + + uses oc-if:interface-ref; + uses chip-buffer-input-top; + uses chip-buffer-output-top; + + } + } + } + grouping chip-buffer-queue-config { + description + "Configuration data for the queue associated with the + buffer"; + leaf name { + + type string; + description + "Reference to the queue associated with the buffer. + A queue may be explicitly configured, or implicitly created + by the system based on default queues that are instantiated + by a hardware component, or are assumed to be default on + the system."; + } + + } + + grouping chip-buffer-queue-state { + description + "Operational data for the queue associated with the + buffer"; + + leaf current-usage { + type oc-yang:counter64; + units bytes; + description + "current usage of buffer size"; + } + + leaf available-usage { + type oc-yang:counter64; + units bytes; + description + "available-usage of buffer size"; + } + + leaf current-utilization { + type oc-types:percentage; + description + "current usage of buffer size"; + } + + leaf historical-peak { + type oc-yang:counter64; + units bytes; + description + "historical peak of buffer size"; + } + + leaf historical-peak-time { + type oc-types:timeticks64; + description + "the time of exceeding the historical-peek"; + } + + leaf alarm-threshold { + type oc-types:percentage; + description + "the threshold of alarm"; + } + + leaf alarm-count { + type oc-yang:counter32; + description + "the count of alarm"; + } + + leaf discard-pkt { + type oc-yang:counter64; + description + "the count of packet that dropped since buffer overflow"; + } + + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of packet that forwarded"; + } + + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that forwarded"; + } + + } + + grouping chip-buffer-queue-top { + description + "Top-level grouping for the queue associated with the + buffer"; + + container queues { + description + "Surrounding container for a list of queues that are + instantiated on the buffer."; + + list queue { + key "name"; + + description + "Top-level container for the queue associated with this + buffer"; + + leaf name { + type leafref { + path "../config/name"; + } + description + "Reference to the name of the queue + instantiated on the buffer."; + } + + container config { + description + "Configuration data for the queue associated with the + buffer"; + + uses chip-buffer-queue-config; + } + + container state { + config false; + description + "Operational state data for the queue associated with the + buffer"; + + uses chip-buffer-queue-config; + uses chip-buffer-queue-state; + } + } + } + } + + + grouping chip-buffer-output-config { + description + "Configuration data for Buffer on the egress chip"; + } + + grouping chip-buffer-output-state { + description + "Operational state data for Buffer on the egress chip"; + + leaf current-usage { + type oc-yang:counter64; + units bytes; + description + "current usage of buffer size"; + } + + leaf available-usage { + type oc-yang:counter64; + units bytes; + description + "available-usage of buffer size"; + } + + leaf current-utilization { + type oc-types:percentage; + description + "current usage of buffer size"; + } + + leaf historical-peak { + type oc-yang:counter64; + units bytes; + description + "historical peak of buffer size"; + } + + leaf historical-peak-time { + type oc-types:timeticks64; + description + "the time of exceeding the historical-peek"; + } + + leaf alarm-threshold { + type oc-types:percentage; + description + "the threshold of alarm"; + } + + leaf alarm-count { + type oc-yang:counter32; + description + "the count of alarm"; + } + + leaf discard-pkt { + type oc-yang:counter64; + description + "the count of packet that dropped since buffer overflow"; + } + + leaf discard-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that dropped since buffer overflow"; + } + + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of packet that forwarded"; + } + + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that forwarded"; + } + + } + + grouping chip-buffer-output-top { + description + "Top-level grouping for Buffer on the egress chip"; + + container output { + description + "Top-level container for Buffer data related to the egress + chip"; + + container config { + description + "Configuration data for Buffer on the egress chip"; + + uses chip-buffer-output-config; + } + + container state { + config false; + description + "Operational state data for Buffer on the egress chip"; + + uses chip-buffer-output-config; + uses chip-buffer-output-state; + } + uses chip-buffer-queue-top; + } + } + + + + grouping chip-buffer-input-config { + description + "Configuration data for Buffer on the ingress chip"; + } + + grouping chip-buffer-input-state { + description + "Operational state data for Buffer on the ingress chip"; + + leaf current-usage { + type oc-yang:counter64; + units bytes; + description + "current usage of buffer size"; + } + + leaf available-usage { + type oc-yang:counter64; + units bytes; + description + "available-usage of buffer size"; + } + + leaf current-utilization { + type oc-types:percentage; + description + "current usage of buffer size"; + } + + leaf historical-peak { + type oc-yang:counter64; + units bytes; + description + "historical peak of buffer size"; + } + + leaf historical-peak-time { + type oc-types:timeticks64; + description + "the time of exceeding the historical-peek"; + } + + leaf alarm-threshold { + type oc-types:percentage; + description + "the threshold of alarm"; + } + + leaf alarm-count { + type oc-yang:counter32; + description + "the count of alarm"; + } + + leaf discard-pkt { + type oc-yang:counter64; + description + "the count of packet that dropped since buffer overflow"; + } + + leaf discard-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that dropped since buffer overflow"; + } + + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of packet that forwarded"; + } + + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of packet size that forwarded"; + } + } + + grouping chip-buffer-input-top { + description + "Top-level grouping for Buffer on the ingress chip"; + + container input { + description + "Top-level container for Buffer data related to the ingress + chip"; + + container config { + description + "Configuration data for Buffer on the ingress chip"; + + uses chip-buffer-input-config; + } + + container state { + config false; + description + "Operational state data for Buffer on the ingress chip"; + + uses chip-buffer-input-config; + uses chip-buffer-input-state; + } + uses chip-buffer-queue-top; + } + } + + + + // data definition statements + + // augment statements + + augment "/oc-platform:components/oc-platform:component/oc-platform:integrated-circuit" { + description + "Adding chip data to physical inventory"; + + uses chip-top { + when "current()/../oc-platform:state/" + + "oc-platform:type = 'CHIP'" { + description + "Augment is active when component is of type chip"; + } + } + } + + uses chip-top; + // rpc statements + + // notification statements +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-tencent-qos-ext@2019-02-01.yang b/exp/yangcli/h3c-yang/openconfig-tencent-qos-ext@2019-02-01.yang new file mode 100644 index 0000000..0b62b0b --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-tencent-qos-ext@2019-02-01.yang @@ -0,0 +1,144 @@ +/* + * Copyright (C) 2018-2019 THL A29 Limited, a Tencent company. All rights reserved. + */ + +module openconfig-tencent-qos-ext { + // namespace + namespace "urn:tencent:yang:openconfig-tencent-qos-ext"; + + prefix "oc-tc-if-ext"; + + import openconfig-qos { prefix oc-qos;} + import openconfig-yang-types { prefix oc-yang; } + + organization "Tencent DCN working group"; + + contact + "Tencent TDCP working group"; + + description "This module defines optional extensions to the OpenConfig qos model."; + + revision "2019-02-01" { + description + "Initial revision"; + reference "0.1.0"; + } + + //augment statements + augment "/oc-qos:qos/oc-qos:interfaces/oc-qos:interface/oc-qos:input/oc-qos:queues/oc-qos:queue/oc-qos:state" { + description + "Adding extension state data to interface"; + + leaf pfc-pkts { + type oc-yang:counter64; + description + "Number of PFC packets transmit by the queue. This leaf is defined by Tencent"; + } + + leaf pfc-deadlock-detect { + type oc-yang:counter64; + description + "The times of the detection of pfc-deadlock. This leaf is defined by Tencent"; + } + + leaf pfc-deadlock-recover { + type boolean; + description + "The notification for the recover of pfc-deadlock. This leaf is defined by Tencent"; + } + + leaf ecn-sign-pkts { + type oc-yang:counter64; + description + "Number of packets signed by ecn. This leaf is defined by Tencent"; + } + + leaf rocev2-nack-pkts { + type oc-yang:counter64; + description + "Number of RoceV2 nack packets. This leaf is defined by Tencent"; + } + leaf pfc-speed-threshold { + type oc-yang:counter64; + description + "Speed of PFC packets. This leaf is defined by Tencent"; + } + leaf pfc-overspeed { + type boolean; + description + "PFC packets is overspeed. This leaf is defined by Tencent"; + } + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of forwarded packets. This leaf is defined by Tencent"; + } + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of forwarded packets size. This leaf is defined by Tencent"; + } + leaf cnp { + type oc-yang:counter64; + description + "the count of congestion notification packets. This leaf is defined by Tencent"; + } + } + + augment "/oc-qos:qos/oc-qos:interfaces/oc-qos:interface/oc-qos:output/oc-qos:queues/oc-qos:queue/oc-qos:state" { + description + "Adding extension state data to interface"; + + leaf pfc-pkts { + type oc-yang:counter64; + description + "Number of PFC packets transmit by the queue. This leaf is defined by Tencent"; + } + + leaf ecn-sign-pkts { + type oc-yang:counter64; + description + "Number of packets signed by ecn. This leaf is defined by Tencent"; + } + + leaf wred-drop-pkts { + type oc-yang:counter64; + description + "Number of packets dropped by WRED. This leaf is defined by Tencent"; + } + + leaf rocev2-nack-pkts { + type oc-yang:counter64; + description + "Number of RoceV2 nack packets. This leaf is defined by Tencent"; + } + leaf pfc-speed-threshold { + type oc-yang:counter64; + description + "Speed of PFC packets. This leaf is defined by Tencent"; + } + leaf pfc-overspeed { + type boolean; + description + "PFC packets is overspeed. This leaf is defined by Tencent"; + } + leaf forward-pkt { + type oc-yang:counter64; + description + "the count of forwarded packets. This leaf is defined by Tencent"; + } + leaf forward-traffic { + type oc-yang:counter64; + units bytes; + description + "the count of forwarded packets size. This leaf is defined by Tencent"; + } + leaf cnp { + type oc-yang:counter64; + description + "the count of congestion notification packets. This leaf is defined by Tencent"; + } + } +} + diff --git a/exp/yangcli/h3c-yang/openconfig-terminal-device@2021-07-29.yang b/exp/yangcli/h3c-yang/openconfig-terminal-device@2021-07-29.yang new file mode 100644 index 0000000..e3bc9b7 --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-terminal-device@2021-07-29.yang @@ -0,0 +1,1672 @@ +module openconfig-terminal-device { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/terminal-device"; + + prefix "oc-opt-term"; + + import openconfig-types { prefix oc-types; } + import openconfig-transport-types { prefix oc-opt-types; } + import openconfig-if-ethernet { prefix oc-eth; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-platform { prefix oc-platform; } + import openconfig-platform-transceiver { prefix oc-transceiver; } + import openconfig-lldp { prefix oc-lldp; } + import openconfig-extensions { prefix oc-ext; } + import ietf-yang-types { prefix yang; } + import openconfig-yang-types { prefix oc-yang; } + + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module describes a terminal optics device model for + managing the terminal systems (client and line side) in a + DWDM transport network. + + Elements of the model: + + physical port: corresponds to a physical, pluggable client + port on the terminal device. Examples includes 10G, 40G, 100G + (e.g., 10x10G, 4x25G or 1x100G) and 400G/1T in the future. + Physical client ports will have associated operational state or + PMs. + + physical channel: a physical lane or channel in the + physical client port. Each physical client port has 1 or more + channels. An example is 100GBASE-LR4 client physical port having + 4x25G channels. Channels have their own optical PMs and can be + monitored independently within a client physical port (e.g., + channel power). Physical client channels are defined in the + model as part of a physical client port, and are modeled + primarily for reading their PMs. + + logical channel: a logical grouping of logical grooming elements + that may be assigned to subsequent grooming stages for + multiplexing / de-multiplexing, or to an optical channel for + line side transmission. The logical channels can represent, for + example, an ODU/OTU logical packing of the client + data onto the line side. Tributaries are similarly logical + groupings of demand that can be represented in this structure and + assigned to an optical channel. Note that different types of + logical channels may be present, each with their corresponding + PMs. + + optical channel: corresponds to an optical carrier and is + assigned a wavelength/frequency. Optical channels have PMs + such as power, BER, and operational mode. + + Directionality: + + To maintain simplicity in the model, the configuration is + described from client-to-line direction. The assumption is that + equivalent reverse configuration is implicit, resulting in + the same line-to-client configuration. + + Physical layout: + + The model does not assume a particular physical layout of client + and line ports on the terminal device (e.g., such as number of + ports per linecard, separate linecards for client and line ports, + etc.)."; + + oc-ext:openconfig-version "1.9.0"; + + revision "2021-07-29" { + description + "Add several coherent performance monitors to optical channel. + Re-group and add PHY-related performance monitors to optical + channel and logical channel."; + reference "1.9.0"; + } + + revision "2021-02-23" { + description + "Small additions to support ZR transceivers. Adds a new + ingress type of interface and a client mapping mode leaf."; + reference "1.8.0"; + } + + revision "2020-05-09" { + description + "Remove references from read-write contexts to read-only + contexts in when statements."; + reference "1.7.3"; + } + + revision "2019-11-28" { + description + "Additional xpath fixes in when statement"; + reference "1.7.2"; + } + + revision "2019-10-12" { + description + "Fix when statement paths"; + reference "1.7.1"; + } + + revision "2019-08-08" { + description + "Add ALS config to logical-channel/ethernet/config and remove + legacy interfaces augment for this config. Client FEC was + previosuly migrated to the components model and should not + be here anymore."; + reference "1.7.0"; + } + + revision "2019-07-26" { + description + "Add support for LLDP natively on logical-channels."; + reference "1.6.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "1.5.1"; + } + + revision "2018-10-23" { + description + "Adds support of logical-channel tributary slot allocation to + logical-channel-assignments with different channel speeds. + Enables logical channel mapping procedure specification."; + reference "1.5.0"; + } + + revision "2018-08-28" { + description + "Adds terminal device related Ethernet counters"; + reference "1.4.0"; + } + + revision "2018-07-30" { + description + "Adds lldp snooping config leaf and augmented it to oc-lldp"; + reference "1.3.0"; + } + + revision "2018-07-26" { + description + "Adds OTN protocol counter stats of errored-blocks and + fec-uncorrectable-blocks, adds ethernet-config-ext grouping + and uses it to augment oc-eth"; + reference "1.2.0"; + } + + revision "2018-07-17" { + description + "Adds testing enum to link-state"; + reference "1.1.0"; + } + + revision "2017-07-08" { + description + "Adds test-signal"; + reference "1.0.0"; + } + + revision "2016-12-22" { + description + "Fixes and additions to terminal optics model"; + reference "0.4.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + grouping terminal-input-optical-power { + description + "Reusable leaves related to input optical power"; + + leaf input-power { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The input optical power of this port in units of 0.01dBm. + If the port is an aggregate of multiple physical channels, + this attribute is the total power or sum of all channels."; + } + } + + grouping terminal-ethernet-protocol-config { + description + "Configuration data for logical channels with Ethernet + framing"; + + leaf client-als { + type enumeration { + enum NONE { + description + "The client port will do nothing when a failure is + detected on the line port or the remote client port"; + } + enum LASER_SHUTDOWN { + description + "The client port will shut down the laser to notify the + subtending Ethernet equipment of the failure detected on + the line port or the remote client port."; + } + enum ETHERNET { + description + "The client port will propagate the local fault or remote + fault signal to the subtending Ethernet equipment."; + } + } + default ETHERNET; + description + "Sets the client port behavior that defines if the actions + of automatic laser shutdown (als), ethernet fault + propagation, or nothing will be done upon the detection + of a failure on the line port or the upstream remote + client port."; + } + + leaf als-delay { + type uint32; + units milliseconds; + default 0; + description + "The timer to delay the client-als actions on the client + port when a local or remote fault is detected on the line + port. The delay will only be valid when the client-als is + set to LASER_SHUTDOWN"; + } + } + + grouping terminal-ethernet-protocol-state { + description + "Ethernet-specific counters when logical channel + is using Ethernet protocol framing, e.g., 10GE, 100GE"; + + uses oc-eth:ethernet-interface-state-counters; + uses terminal-ethernet-protocol-state-counters; + uses terminal-phy-protocol-stats { + description + "When 400ZR/ZR+ transceivers are plugged in switches or routers, + this grouping will be attached to logical channel with Ethernet + protocol framing, in order to involve host-side fec-related + error performances."; + } + } + + grouping terminal-ethernet-protocol-state-counters { + description + "Ethernet-specific counters for terminal devices when + logical channel is using Ethernet protocol framing, + e.g., 10GE, 100GE"; + + // ingress counters + + leaf in-pcs-bip-errors { + type oc-yang:counter64; + description + "The number of received bit interleaved parity (BIP) errors + at the physical coding sublayer (PCS). If the interface + consists of multiple lanes, this will be the sum of all + errors on the lane"; + } + + leaf in-pcs-errored-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a sytem defined threshold indicating the + link is erroring"; + } + + leaf in-pcs-severely-errored-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a system defined threshold indicating the + link is severely erroring"; + } + + leaf in-pcs-unavailable-seconds { + type oc-yang:counter64; + description + "The number of seconds that physical coding sublayer (PCS) + errors have crossed a system defined threshold indicating the + link is unavailable"; + } + + // egress counters + + leaf out-pcs-bip-errors { + type oc-yang:counter64; + description + "The number of transmitted bit interleaved parity (BIP) errors + at the physical coding sublayer (PCS). If the interface + consists of multiple lanes, this will be the sum of all + errors on the lane"; + } + + leaf out-crc-errors { + type oc-yang:counter64; + description + "Number of FCS/CRC error check failures sent on the interface"; + } + + leaf out-block-errors { + type oc-yang:counter64; + description + "The number of transmitted errored blocks. Error detection + codes are capable of detecting whether one or more errors have + occurred in a given sequence of bits - the block. It is + normally not possible to determine the exact number of errored + bits within the block"; + } + } + + grouping terminal-ethernet-protocol-top { + description + "Top-level grouping for data related to Ethernet protocol + framing on logical channels"; + + container ethernet { + description + "Top level container for data related to Ethernet framing + for the logical channel"; + + container config { + description + "Configuration data for Ethernet protocol framing on + logical channels"; + + uses terminal-ethernet-protocol-config; + } + + container state { + config false; + description + "Operational state data for Ethernet protocol framing + on logical channels"; + + uses terminal-ethernet-protocol-config; + uses terminal-ethernet-protocol-state; + } + + uses lldp-logical-channel-top; + } + } + + grouping lldp-logical-channel-top { + description + "Top-level grouping for LLDP data for a logical channel"; + + container lldp { + description + "LLDP data for logical channels"; + + container config { + description + "LLDP configuration data for logical channels"; + + uses lldp-logical-channel-config; + } + + container state { + config false; + description + "LLDP operational state data for logical channels"; + + uses lldp-logical-channel-config; + uses oc-lldp:lldp-interface-state; + } + + uses lldp-logical-channel-neighbor-top; + } + } + + grouping lldp-logical-channel-config { + description + "Configuration data for LLDP for logical-channels"; + + leaf enabled { + type boolean; + default "false"; + description + "Enable or disable the LLDP protocol on the logical channel."; + } + + leaf snooping { + type boolean; + default "false"; + description + "If true, LLDP PDUs are only received and processed on + the logical-channel, but are not originated by the local + agent. The PDUs are not dropped by the logical channel after + processing, but relayed to the downstream link layer + neighbors. The snooping mode is valid only when LLDP is + enabled on the logical channel. The snooping mode is useful + when a logical channel does not want its link layer neighbors + to discover itself since, for example, it is a lower-layer + logical channel."; + } + } + + grouping lldp-logical-channel-neighbor-top { + description + "Top-level grouping for the LLDP neighbor list"; + + container neighbors { + config false; + description + "Enclosing container for list of LLDP neighbors on + a logical channel"; + + list neighbor { + key "id"; + description + "List of LLDP neighbors. If the implementation only + supports one neighbor, this would always be a list with + one item. If the device and neighbor supported multiple + neighbors, which can be achieved via LLDP forwarding, then + this would be supported"; + reference + "IEEE Std 802.1AB-2016, section 7.1, Destination address"; + + leaf id { + type leafref { + path "../state/id"; + } + description + "System generated identifier for the neighbor on + the logical channel."; + } + + container config { + description + "Configuration data "; + + uses lldp-logical-channel-neighbor-config; + } + + container state { + + config false; + + description + "Operational state data "; + + uses oc-lldp:lldp-system-info-config; + uses oc-lldp:lldp-system-info-state; + uses oc-lldp:lldp-neighbor-config; + uses oc-lldp:lldp-neighbor-state; + } + + uses oc-lldp:lldp-custom-tlv-top; + } + } + } + + grouping lldp-logical-channel-neighbor-config { + description + "Configuration data for LLDP neighbors"; + } + + grouping terminal-otn-protocol-config { + description + "OTU configuration when logical channel + framing is using an OTU protocol, e.g., OTU1, OTU3, etc."; + + leaf tti-msg-transmit { + type string; + description + "Trail trace identifier (TTI) message transmitted"; + } + + leaf tti-msg-expected { + type string; + description + "Trail trace identifier (TTI) message expected"; + } + + leaf tti-msg-auto { + type boolean; + description + "Trail trace identifier (TTI) transmit message automatically + created. If true, then setting a custom transmit message + would be invalid."; + } + + leaf tributary-slot-granularity { + type identityref { + base oc-opt-types:TRIBUTARY_SLOT_GRANULARITY; + } + description + "Granularity value of OPUk or OPUCn tributary slots for OTN + signal allocation. The currently defined values follow the + existing ITU-T G.709 standard, which can be extended as + needed in future."; + } + } + + grouping terminal-otn-protocol-counter-stats { + description + "Counter based statistics containers for logical channels + using OTN framing"; + + leaf errored-seconds { + type yang:counter64; + description + "The number of seconds that at least one errored blocks + occurs, at least one code violation occurs, loss of sync is + detected or loss of signal is detected"; + } + + leaf severely-errored-seconds { + type yang:counter64; + description + "The number of seconds that loss of frame is detected OR + the number of errored blocks, code violations, loss of sync + or loss of signal is detected exceeds a predefined + threshold"; + } + + leaf unavailable-seconds { + type yang:counter64; + description + "The number of seconds during which the link is unavailable"; + } + + leaf code-violations { + type yang:counter64; + description + "For ethernet or fiberchannel links, the number of 8b/10b + coding violations. For SONET/SDH, the number of BIP (bit + interleaved parity) errors"; + } + + leaf errored-blocks { + type yang:counter64; + description + "The number of errored blocks. Error detection codes are + capable to detect whether one or more errors have occurred + in a given sequence of bits - the block. It is normally not + possible to determine the exact number of errored bits within + the block."; + reference "ITU-T Rec. G.826"; + } + + leaf fec-uncorrectable-words { + type yang:counter64; + description + "The number of words that were uncorrectable by the FEC"; + } + + leaf fec-corrected-bytes { + type yang:counter64; + description + "The number of bytes that were corrected by the FEC"; + } + + leaf fec-corrected-bits { + type yang:counter64; + description + "The number of bits that were corrected by the FEC"; + } + + leaf background-block-errors { + type yang:counter64; + description + "The number of background block errors"; + } + } + + grouping terminal-phy-protocol-stats { + description + "Counters and multi-value statistics for FEC-related error + performance"; + + container pre-fec-ber { + description + "Bit error rate before forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container post-fec-ber { + description + "Bit error rate after forward error correction -- computed + value with 18 decimal precision. Note that decimal64 + supports values as small as i x 10^-18 where i is an + integer. Values smaller than this should be reported as 0 + to inidicate error free or near error free performance. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision18-ber; + } + + container q-value { + description + "Quality value (factor) in dB of a channel with two + decimal precision. Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected + to just supply the instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + container esnr { + description + "Electrical signal to noise ratio. Baud rate + normalized signal to noise ratio based on + error vector magnitude in dB with two decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected + to just supply the instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + leaf fec-uncorrectable-blocks { + type yang:counter64; + description + "The number of blocks or frames that were uncorrectable by + the FEC"; + } + } + + grouping terminal-otn-protocol-state { + description + "OTU operational state when logical channel + framing is using an OTU protocol, e.g., OTU1, OTU3, etc."; + + + leaf tti-msg-recv { + type string; + description + "Trail trace identifier (TTI) message received"; + } + + leaf rdi-msg { + type string; + description + "Remote defect indication (RDI) message received"; + } + uses terminal-otn-protocol-counter-stats; + uses terminal-phy-protocol-stats { + description + "This grouping may be used when the logical-channel-type + is 'PROT_OTN."; + } + } + + grouping terminal-otn-protocol-top { + description + "Top-level grouping for data related to OTN protocol framing"; + + container otn { + description + "Top level container for OTU configuration when logical + channel framing is using an OTU protocol, e.g., OTU1, OTU3, + etc."; + + container config { + description + "Configuration data for OTN protocol framing"; + + uses terminal-otn-protocol-config; + } + + container state { + + config false; + + description + "Operational state data for OTN protocol PMs, statistics, + etc."; + + uses terminal-otn-protocol-config; + uses terminal-otn-protocol-state; + } + } + } + + grouping terminal-client-port-assignment-config { + description + "Configuration data for assigning physical client ports to + logical channels"; + + leaf index { + type uint32; + description + "Index of the client port assignment"; + } + + leaf description { + type string; + description + "Descriptive name for the client port-to-logical channel + mapping"; + } + + leaf logical-channel { + type leafref { + path "/oc-opt-term:terminal-device/oc-opt-term:logical-channels" + + "/oc-opt-term:channel/oc-opt-term:index"; + } + description + "Reference to the logical channel for this + assignment"; + } + + leaf allocation { + type decimal64 { + fraction-digits 3; + } + units Gbps; + description + "Allocation of the client physical port to the assigned + logical channel expressed in Gbps. In most cases, + the full client physical port rate is assigned to a single + logical channel."; + } + + } + + grouping terminal-client-port-assignment-state { + description + "Operational state data for assigning physical client ports + to logical channels"; + } + + grouping terminal-client-port-assignment-top { + description + "Top-level grouping for the assigment of client physical ports + to logical channels"; + //TODO: this grouping could be removed, instead reusing a common + //grouping for logical client assignment pointers + + container logical-channel-assignments { + description + "Enclosing container for client port to logical client + mappings"; + + list assignment { + key "index"; + description + "List of assignments to logical clients"; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index of this logical client + assignment"; + } + + container config { + description + "Configuration data for the logical client assignment"; + + uses terminal-client-port-assignment-config; + } + + container state { + + config false; + + description + "Operational state data for the logical client + assignment"; + + uses terminal-client-port-assignment-config; + uses terminal-client-port-assignment-state; + } + } + } + } + + + grouping terminal-logical-chan-assignment-config { + description + "Configuration data for assigning client logical channels + to line-side tributaries"; + + leaf index { + type uint32; + description + "Index of the current logical client channel to tributary + mapping"; + } + + leaf description { + type string; + description + "Name assigned to the logical client channel"; + } + + leaf assignment-type { + type enumeration { + enum LOGICAL_CHANNEL { + description + "Subsequent channel is a logical channel"; + } + enum OPTICAL_CHANNEL { + description + "Subsequent channel is a optical channel / carrier"; + } + } + description + "Each logical channel element may be assigned to subsequent + stages of logical elements to implement further grooming, or + can be assigned to a line-side optical channel for + transmission. Each assignment also has an associated + bandwidth allocation."; + } + + leaf logical-channel { + type leafref { + path "/oc-opt-term:terminal-device/" + + "oc-opt-term:logical-channels/oc-opt-term:channel/" + + "oc-opt-term:index"; + } + must "../assignment-type = 'LOGICAL_CHANNEL'" { + description + "The assignment-type must be set to LOGICAL_CHANNEL for + this leaf to be valid"; + } + description + "Reference to another stage of logical channel elements."; + } + + leaf optical-channel { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + must "../assignment-type = 'OPTICAL_CHANNEL'" { + description + "The assignment-type must be set to OPTICAL_CHANNEL for + this leaf to be valid"; + } + description + "Reference to the line-side optical channel that should + carry the current logical channel element. Use this + reference to exit the logical element stage."; + } + + leaf allocation { + type decimal64 { + fraction-digits 3; + } + units Gbps; + description + "Allocation of the logical client channel to the tributary + or sub-channel, expressed in Gbps. Please note that if the + assignment is to an OTN logical channel, the allocation must + be an integer multiplication to tributary-slot-granularity + of the OTN logical channel."; + } + + leaf tributary-slot-index { + type int32; + description + "Indicates the first tributary slot index allocated to the + client signal or logical channel in the assignment. Valid + only when the assignment is to an OTN logical channel."; + } + + leaf mapping { + type identityref { + base oc-opt-types:FRAME_MAPPING_PROTOCOL; + } + description + "Logical channel mapping procedure. Valid only when the + assignment is to an OTN logical channel."; + } + } + + grouping terminal-logical-chan-assignment-state { + description + "Operational state data for the assignment of logical client + channel to line-side tributary"; + } + + grouping terminal-logical-chan-assignment-top { + description + "Top-level grouping for the list of logical client channel-to- + tributary assignments"; + + container logical-channel-assignments { + //TODO: we need a commonly understood name for this logical + //channel structure + description + "Enclosing container for tributary assignments"; + + list assignment { + key "index"; + description + "Logical channel elements may be assigned directly to + optical channels for line-side transmission, or can be + further groomed into additional stages of logical channel + elements. The grooming can multiplex (i.e., split the + current element into multiple elements in the subsequent + stage) or de-multiplex (i.e., combine the current element + with other elements into the same element in the subsequent + stage) logical elements in each stage. + + Note that to support the ability to groom the logical + elements, the list of logical channel elements should be + populated with an entry for the logical elements at + each stage, starting with the initial assignment from the + respective client physical port. + + Each logical element assignment consists of a pointer to + an element in the next stage, or to an optical channel, + along with a bandwidth allocation for the corresponding + assignment (e.g., to split or combine signal)."; + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index for the current tributary + assignment"; + } + + container config { + description + "Configuration data for tributary assignments"; + + uses terminal-logical-chan-assignment-config; + } + + container state { + + config false; + + description + "Operational state data for tributary assignments"; + + uses terminal-logical-chan-assignment-config; + uses terminal-logical-chan-assignment-state; + } + } + } + } + + grouping terminal-logical-channel-ingress-config { + description + "Configuration data for ingress signal to logical channel"; + + leaf transceiver { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "Reference to the transceiver carrying the input signal + for the logical channel. If specific physical channels + are mapped to the logical channel (as opposed to all + physical channels carried by the transceiver), they can be + specified in the list of physical channel references."; + } + + leaf-list physical-channel { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-transceiver:transceiver/" + + "oc-transceiver:physical-channels/" + + "oc-transceiver:channel/oc-transceiver:index"; + } + description + "This list should be populated with references + to the client physical channels that feed this logical + channel from the transceiver specified in the 'transceiver' + leaf, which must be specified. If this leaf-list is empty, + all physical channels in the transceiver are assumed to be + mapped to the logical channel."; + } + + leaf interface { + type oc-if:base-interface-ref; + description + "Reference to the interface carrying the input signal + for the logical channel. The ingress will specify an interface + in the case of a transceiver being utilized directly in a + router and bypassing a dedicated terminal device. When + specified, the other leaves in the ingress config must be + empty."; + } + } + + grouping terminal-logical-channel-ingress-state { + description + "Operational state data for ingress signal to logical channel"; + } + + grouping terminal-logical-channel-ingress-top { + description + "Top-level grouping for ingress signal to logical channel"; + + container ingress { + description + "Top-level container for specifying references to the + source of signal for the logical channel, either a + transceiver, individual physical channels, or an interface"; + + container config { + description + "Configuration data for the signal source for the + logical channel"; + + uses terminal-logical-channel-ingress-config; + } + + container state { + + config false; + + description + "Operational state data for the signal source for the + logical channel"; + + uses terminal-logical-channel-ingress-config; + uses terminal-logical-channel-ingress-state; + } + } + } + + grouping terminal-logical-channel-config { + description + "Configuration data for logical channels"; + + leaf index { + type uint32; + description + "Index of the current logical channel"; + } + + leaf description { + type string; + description + "Description of the logical channel"; + } + + leaf admin-state { + type oc-opt-types:admin-state-type; + description + "Sets the admin state of the logical channel"; + } + + leaf rate-class { + type identityref { + base oc-opt-types:TRIBUTARY_RATE_CLASS_TYPE; + } + description + "Rounded bit rate of the tributary signal. Exact bit rate + will be refined by protocol selection."; + } + + leaf trib-protocol { + type identityref { + base oc-opt-types:TRIBUTARY_PROTOCOL_TYPE; + } + description + "Protocol framing of the tributary signal. If this + LogicalChannel is directly connected to a Client-Port or + Optical-Channel, this is the protocol of the associated port. + If the LogicalChannel is connected to other LogicalChannels, + the TributaryProtocol of the LogicalChannels will define a + specific mapping/demapping or multiplexing/demultiplexing + function. + + Not all protocols are valid, depending on the value + of trib-rate-class. The expectation is that the NMS + will validate that a correct combination of rate class + and protocol are specfied. Basic combinations are: + + rate class: 1G + protocols: 1GE + + rate class: 2.5G + protocols: OC48, STM16 + + rate class: 10G + protocols: 10GE LAN, 10GE WAN, OC192, STM64, OTU2, OTU2e, + OTU1e, ODU2, ODU2e, ODU1e + + rate class: 40G + protocols: 40GE, OC768, STM256, OTU3, ODU3 + + rate class: 100G + protocols: 100GE, 100G MLG, OTU4, OTUCn, ODU4"; + } + + leaf logical-channel-type { + type identityref { + base oc-opt-types:LOGICAL_ELEMENT_PROTOCOL_TYPE; + } + description + "The type / stage of the logical element determines the + configuration and operational state parameters (PMs) + available for the logical element"; + } + + leaf loopback-mode { + type oc-opt-types:loopback-mode-type; + description + "Sets the loopback type on the logical channel. Setting the + mode to something besides NONE activates the loopback in + the specified mode."; + } + + leaf test-signal { + type boolean; + description + "When enabled the logical channel's DSP will generate a pseudo + randmon bit stream (PRBS) which can be used during testing."; + } + + leaf client-mapping-mode { + type identityref { + base oc-opt-types:CLIENT_MAPPING_MODE; + } + description + "The client side mapping mode internal to the device that + specifies the number of client electrical interfaces and + the data rate of each client electrical interface. For + example, a ZR+ transceiver with an optical line rate of 400G + could be configured to break out into four 100G client + signals which might connect to an interface or a + physical-channel. This would be configured on the aggregate + logical channel as MODE_4X100G. This is only valid on the + aggregate logical channel that is connected directly to the + optical-channel."; + } + } + + + grouping terminal-logical-channel-state { + description + "Operational state data for logical client channels"; + + leaf link-state { + type enumeration { + enum UP { + description + "Logical channel is operationally up"; + } + enum DOWN { + description + "Logical channel is operationally down"; + } + enum TESTING { + description + "Logical channel is under test as a result of + enabling test-signal"; + } + } + description + "Link-state of the Ethernet protocol on the logical channel, + SONET / SDH framed signal, etc."; + } + + } + + grouping terminal-logical-channel-top { + description + "Top-level grouping for logical channels"; + + container logical-channels { + description + "Enclosing container the list of logical channels"; + + list channel { + key "index"; + description + "List of logical channels"; + //TODO: naming for this list of logical elements should be + //revisited. + + leaf index { + type leafref { + path "../config/index"; + } + description + "Reference to the index of the logical channel"; + } + + container config { + description + "Configuration data for logical channels"; + + uses terminal-logical-channel-config; + + } + + container state { + + config false; + + description + "Operational state data for logical channels"; + + uses terminal-logical-channel-config; + uses terminal-logical-channel-state; + } + + uses terminal-otn-protocol-top { + when "./config/logical-channel-type = 'PROT_OTN'" { + description + "Include the OTN protocol data only when the + channel is using OTN framing."; + } + } + uses terminal-ethernet-protocol-top { + when "./config/logical-channel-type = 'PROT_ETHERNET'" { + description + "Include the Ethernet protocol statistics only when the + protocol used by the link is Ethernet."; + } + } + uses terminal-logical-channel-ingress-top; + uses terminal-logical-chan-assignment-top; + } + } + } + + + grouping terminal-optical-channel-config { + description + "Configuration data for describing optical channels"; + + leaf frequency { + type oc-opt-types:frequency-type; + description + "Frequency of the optical channel, expressed in MHz"; + } + + leaf target-output-power { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "Target output optical power level of the optical channel, + expressed in increments of 0.01 dBm (decibel-milliwats)"; + } + + leaf operational-mode { + type uint16; + description + "Vendor-specific mode identifier -- sets the operational + mode for the channel. The specified operational mode must + exist in the list of supported operational modes supplied + by the device"; + // + // Ideally, this leaf should be a leafref to the supported + // operational modes, but YANG 1.0 does not allow a r/w + // leaf to be a leafref to a r/o leaf. + } + + leaf line-port { + type leafref { + path "/oc-platform:components/oc-platform:component/" + + "oc-platform:name"; + } + description + "Reference to the line-side physical port that carries + this optical channel. The target port should be + a component in the physical inventory data model."; + } + } + + grouping terminal-optical-channel-state { + description + "Operational state data for optical channels"; + + leaf group-id { + type uint32; + description + "If the device places constraints on which optical + channels must be managed together (e.g., transmitted on the + same line port), it can indicate that by setting the group-id + to the same value across related optical channels."; + } + + uses oc-transceiver:optical-power-state; + + container chromatic-dispersion { + description + "Chromatic Dispersion of an optical channel in + picoseconds / nanometer (ps/nm) as reported by receiver + with two decimal precision. Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected to just + supply the instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps-nm; + } + + container polarization-mode-dispersion { + description + "Polarization Mode Dispersion of an optical channel + in picosends (ps) as reported by receiver with two decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply the + instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps; + } + + container second-order-polarization-mode-dispersion { + description + "Second Order Polarization Mode Dispersion of an optical + channel in picoseconds squared (ps^2) as reported by + receiver with two decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target + is expected to just supply the instant value"; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-ps2; + } + + container polarization-dependent-loss { + description + "Polarization Dependent Loss of an optical channel + in dB as reported by receiver with two decimal precision. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not + supported, the target is expected to just supply the + instant value"; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + container modulator-bias-xi { + description + "The bias on in-phase path and Polarization X of + the coherent modulator. This is represented as a percentage + with 2 decimal precision. This term is defined by OIF + Implementation Agreement for Coherent CMIS. Values include + the instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container modulator-bias-xq { + description + "The bias on quadrature path and Polarization X of + the coherent modulator. This is represented as a percentage + with 2 decimal precision. This term is defined by OIF + Implementation Agreement for Coherent CMIS. Values include + the instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container modulator-bias-yi { + description + "The bias on in-phase path and Polarization Y of + the coherent modulator. This is represented as a percentage + with 2 decimal precision. This term is defined by OIF + Implementation Agreement for Coherent CMIS. Values include + the instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container modulator-bias-yq { + description + "The bias on quadrature path and Polarization Y of + the coherent modulator. This is represented as a percentage + with 2 decimal precision. This term is defined by OIF + Implementation Agreement for Coherent CMIS. Values include + the instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container modulator-bias-x-phase { + description + "The X-Phase bias of the coherent modulator. This is + represented as a percentage with 2 decimal precision. This + term is defined by OIF Implementation Agreement for + Coherent CMIS. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply + the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container modulator-bias-y-phase { + description + "The Y-Phase bias of the coherent modulator. This is + represented as a percentage with 2 decimal precision. This + term is defined by OIF Implementation Agreement for + Coherent CMIS. Values include the instantaneous, average, + minimum, and maximum statistics. If avg/min/max statistics + are not supported, the target is expected to just supply + the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision2-pct; + } + + container osnr { + description + "Optical signal to noise ratio at 12.5GHz noise bandwidth + in dB with two decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target + is expected to just supply the instant value."; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + container carrier-frequency-offset { + description + "Carrier frequency offset in MHz with 1 decimal precision. + Values include the instantaneous, average, minimum, and + maximum statistics. If avg/min/max statistics are not supported, + the target is expected to just supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision1-mhz; + } + + container sop-roc { + description + "State-of-polarization rate-of-change (SOP-ROC) in krad/s with 1 + decimal precision. This term is defined by OIF Implementation + Agreement for Coherent CMIS. Values include the instantaneous, + average, minimum, and maximum statistics. If avg/min/max + statistics are not supported, the target is expected to just + supply the instant value."; + + uses oc-opt-types:avg-min-max-instant-stats-precision1-krads; + } + + container modulation-error-ratio { + description + "Modulation error ratio in dB with two decimal precision. Values + include the instantaneous, average, minimum, and maximum statistics. + If avg/min/max statistics are not supported, the target is + expected to just supply the instant value."; + + uses oc-types:avg-min-max-instant-stats-precision2-dB; + } + + uses terminal-phy-protocol-stats { + description + "When there is no OTN framing e.g. 400ZR, this grouping will be used."; + } + } + + grouping terminal-optical-channel-top { + description + "Top-level grouping for optical channel data"; + + container optical-channel { + description + "Enclosing container for the list of optical channels"; + + container config { + description + "Configuration data for optical channels"; + + uses terminal-optical-channel-config; + } + + container state { + + config false; + + description + "Operational state data for optical channels"; + + uses terminal-optical-channel-config; + uses terminal-optical-channel-state; + } + } + } + + grouping terminal-operational-mode-config { + description + "Configuration data for vendor-supported operational modes"; + } + + grouping terminal-operational-mode-state { + description + "Operational state data for vendor-supported operational + modes"; + + leaf mode-id { + type uint16; + description + "Two-octet encoding of the vendor-defined operational + mode"; + } + + leaf description { + type string; + description + "Vendor-supplied textual description of the characteristics + of this operational mode to enable operators to select the + appropriate mode for the application."; + } + + //TODO: examples of the kind of info that would be useful to + //report in the operational mode: + //Symbol rate (32G, 40G, 43G, 64G, etc.) + //Modulation (QPSK, 8-QAM, 16-QAM, etc.) + //Differential encoding (on, off/pilot symbol, etc) + //State of polarization tracking mode (default, med. + //high-speed, etc.) + //Pulse shaping (RRC, RC, roll-off factor) + //FEC mode (SD, HD, % OH) + + leaf vendor-id { + type string; + description + "Identifier to represent the vendor / supplier of the + platform and the associated operational mode information"; + } + } + + grouping terminal-operational-mode-top { + description + "Top-level grouping for vendor-supported operational modes"; + + container operational-modes { + description + "Enclosing container for list of operational modes"; + + list mode { + key "mode-id"; + config false; + description + "List of operational modes supported by the platform. + The operational mode provides a platform-defined summary + of information such as symbol rate, modulation, pulse + shaping, etc."; + + leaf mode-id { + type leafref { + path "../state/mode-id"; + } + description + "Reference to mode-id"; + } + + container config { + description + "Configuration data for operational mode"; + + uses terminal-operational-mode-config; + } + + container state { + + config false; + + description + "Operational state data for the platform-defined + operational mode"; + + uses terminal-operational-mode-config; + uses terminal-operational-mode-state; + } + } + } + } + + grouping terminal-device-config { + description + "Configuration data for transport terminal devices at a + device-wide level"; + } + + grouping terminal-device-state { + description + "Operational state data for transport terminal devices at a + device-wide level"; + } + + grouping terminal-device-top { + description + "Top-level grouping for data for terminal devices"; + + container terminal-device { + description + "Top-level container for the terminal device"; + + container config { + description + "Configuration data for global terminal-device"; + + uses terminal-device-config; + } + + container state { + + config false; + + description + "Operational state data for global terminal device"; + + uses terminal-device-config; + uses terminal-device-state; + } + + uses terminal-logical-channel-top; + uses terminal-operational-mode-top; + + } + } + + // data definition statements + + uses terminal-device-top; + + // augment statements + + augment "/oc-platform:components/oc-platform:component" { + description + "Adding optical channel data to physical inventory. This + augmentation is only valid when the type of the component + is OPTICAL_CHANNEL."; + + uses terminal-optical-channel-top; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-transport-types@2021-07-29.yang b/exp/yangcli/h3c-yang/openconfig-transport-types@2021-07-29.yang new file mode 100644 index 0000000..c0b574c --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-transport-types@2021-07-29.yang @@ -0,0 +1,1496 @@ +module openconfig-transport-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/transport-types"; + + prefix "oc-opt-types"; + + import openconfig-platform-types { prefix oc-platform-types; } + import openconfig-extensions { prefix oc-ext; } + import openconfig-types { prefix oc-types; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + www.openconfig.net"; + + description + "This module contains general type definitions and identities + for optical transport models."; + + oc-ext:openconfig-version "0.15.0"; + + revision "2021-07-29" { + description + "Add several avg-min-max-instant-stats groupings"; + reference "0.15.0"; + } + + revision "2021-03-22" { + description + "Add client mapping mode identityref."; + reference "0.14.0"; + } + + revision "2021-02-26" { + description + "Additional PMD types, form factors, and protocol types."; + reference "0.13.0"; + } + + revision "2020-08-12" { + description + "Additional tributary rates."; + reference "0.12.0"; + } + + revision "2020-04-24" { + description + "Add 400G protocol and additional tributary half rates."; + reference "0.11.0"; + } + + revision "2020-04-22" { + description + "Add AOC and DAC connector identities."; + reference "0.10.0"; + } + + revision "2019-06-27" { + description + "Add FIBER_JUMPER_TYPE identityref."; + reference "0.9.0"; + } + + revision "2019-06-21" { + description + "Generalize and rename optical port type identity"; + reference "0.8.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.7.1"; + } + + revision "2018-10-23" { + description + "Added frame mapping protocols for logical channels assignments + and tributary slot granularity for OTN logical channels"; + reference "0.7.0"; + } + + revision "2018-05-16" { + description + "Added interval,min,max time to interval stats."; + reference "0.6.0"; + } + + revision "2017-08-16" { + description + "Added ODU Cn protocol type"; + reference "0.5.0"; + } + + revision "2016-12-22" { + description + "Fixes and additions for terminal optics model"; + reference "0.4.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + // typedef statements + + typedef frequency-type { + type uint64; + units "MHz"; + description + "Type for optical spectrum frequency values"; + } + + typedef admin-state-type { + type enumeration { + enum ENABLED { + description + "Sets the channel admin state to enabled"; + } + enum DISABLED { + description + "Sets the channel admin state to disabled"; + } + enum MAINT { + description + "Sets the channel to maintenance / diagnostic mode"; + } + } + description "Administrative state modes for + logical channels in the transponder model."; + } + + typedef loopback-mode-type { + type enumeration { + enum NONE { + description + "No loopback is applied"; + } + enum FACILITY { + description + "A loopback which directs traffic normally transmitted + on the port back to the device as if received on the same + port from an external source."; + } + enum TERMINAL { + description + "A loopback which directs traffic received from an external + source on the port back out the transmit side of the same + port."; + } + } + default NONE; + description + "Loopback modes for transponder logical channels"; + } + + identity FRAME_MAPPING_PROTOCOL { + description + "Base identity for frame mapping protocols that can be used + when mapping Ethernet, OTN or other client signals to OTN + logical channels."; + } + + identity AMP { + base FRAME_MAPPING_PROTOCOL; + description "Asynchronous Mapping Procedure"; + } + + identity GMP { + base FRAME_MAPPING_PROTOCOL; + description "Generic Mapping Procedure"; + } + + identity BMP { + base FRAME_MAPPING_PROTOCOL; + description "Bit-synchronous Mapping Procedure"; + } + + identity CBR { + base FRAME_MAPPING_PROTOCOL; + description "Constant Bit Rate Mapping Procedure"; + } + + identity GFP_T { + base FRAME_MAPPING_PROTOCOL; + description "Transparent Generic Framing Protocol"; + } + + identity GFP_F { + base FRAME_MAPPING_PROTOCOL; + description "Framed-Mapped Generic Framing Protocol"; + } + + identity TRIBUTARY_SLOT_GRANULARITY { + description + "Base identity for tributary slot granularity for OTN + logical channels."; + } + + identity TRIB_SLOT_1.25G { + base TRIBUTARY_SLOT_GRANULARITY; + description + "The tributary slot with a bandwidth of approximately 1.25 Gb/s + as defined in ITU-T G.709 standard."; + } + + identity TRIB_SLOT_2.5G { + base TRIBUTARY_SLOT_GRANULARITY; + description + "The tributary slot with a bandwidth of approximately 2.5 Gb/s + as defined in ITU-T G.709 standard."; + } + + identity TRIB_SLOT_5G { + base TRIBUTARY_SLOT_GRANULARITY; + description + "The tributary slot with a bandwidth of approximately 5 Gb/s + as defined in ITU-T G.709 standard."; + } + + // grouping statements + + grouping avg-min-max-instant-stats-precision2-ps-nm { + description + "Common grouping for recording picosecond per nanometer + values with 2 decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + Statistics are computed and reported based on a moving time + interval (e.g., the last 30s). If supported by the device, + the time interval over which the statistics are computed, and + the times at which the minimum and maximum values occurred, + are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units ps-nm; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units ps-nm; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units ps-nm; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units ps-nm; + description + "The maximum value of the statistic over the time interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-ps { + description + "Common grouping for recording picosecond values with + 2 decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + Statistics are computed and reported based on a moving time + interval (e.g., the last 30s). If supported by the device, + the time interval over which the statistics are computed, and + the times at which the minimum and maximum values occurred, + are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units ps; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units ps; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units ps; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units ps; + description + "The maximum value of the statistic over the time interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-ps2 { + description + "Common grouping for recording picosecond^2 values with + 2 decimal precision. Values include the + instantaneous, average, minimum, and maximum statistics. + Statistics are computed and reported based on a moving time + interval (e.g., the last 30s). If supported by the device, + the time interval over which the statistics are computed, and + the times at which the minimum and maximum values occurred, + are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units ps^2; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units ps^2; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units ps^2; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units ps^2; + description + "The maximum value of the statistic over the time + interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision18-ber { + description + "Common grouping for recording bit error rate (BER) values + with 18 decimal precision. Note that decimal64 supports + values as small as i x 10^-18 where i is an integer. Values + smaller than this should be reported as 0 to inidicate error + free or near error free performance. Values include the + instantaneous, average, minimum, and maximum statistics. + Statistics are computed and reported based on a moving time + interval (e.g., the last 30s). If supported by the device, + the time interval over which the statistics are computed, and + the times at which the minimum and maximum values occurred, + are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 18; + } + units bit-errors-per-second; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 18; + } + units bit-errors-per-second; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 18; + } + units bit-errors-per-second; + description + "The minimum value of the statistic over the time + interval."; + } + + leaf max { + type decimal64 { + fraction-digits 18; + } + units bit-errors-per-second; + description + "The maximum value of the statistic over the time + interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision1-mhz { + description + "Common grouping for recording frequency values in MHz with + 1 decimal precision. Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed and + reported based on a moving time interval (e.g., the last 30s). + If supported by the device, the time interval over which the + statistics are computed, and the times at which the minimum and + maximum values occurred, are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 1; + } + units MHz; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 1; + } + units MHz; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 1; + } + units MHz; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 1; + } + units MHz; + description + "The maximum value of the statistic over the time interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision1-krads { + description + "Common grouping for recording state-of-polarization rate-of- + change (SOP-ROC) values in krad/s with 1 decimal precision. + Values include the instantaneous, average, minimum, and maximum + statistics. Statistics are computed and reported based on a + moving time interval (e.g., the last 30s). If supported by the + device, the time interval over which the statistics are computed, + and the times at which the minimum and maximum values occurred, + are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 1; + } + units "krad/s"; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 1; + } + units "krad/s"; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 1; + } + units "krad/s"; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 1; + } + units "krad/s"; + description + "The maximum value of the statistic over the time interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-pct { + description + "Common grouping for percentage statistics with 2 decimal precision. + Values include the instantaneous, average, minimum, and maximum + statistics. Statistics are computed and reported based on a moving + time interval (e.g., the last 30s). If supported by the device, + the time interval over which the statistics are computed, and the + times at which the minimum and maximum values occurred, are also + reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units percentage; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units percentage; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units percentage; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units percentage; + description + "The maximum value of the statistic over the time interval."; + } + + uses oc-types:stat-interval-state; + uses oc-types:min-max-time; + } + + + // identity statements + + identity TRIBUTARY_PROTOCOL_TYPE { + description + "Base identity for protocol framing used by tributary + signals."; + } + + identity PROT_1GE { + base TRIBUTARY_PROTOCOL_TYPE; + description "1G Ethernet protocol"; + } + + identity PROT_OC48 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OC48 protocol"; + } + + identity PROT_STM16 { + base TRIBUTARY_PROTOCOL_TYPE; + description "STM 16 protocol"; + } + + identity PROT_10GE_LAN { + base TRIBUTARY_PROTOCOL_TYPE; + description "10G Ethernet LAN protocol"; + } + + identity PROT_10GE_WAN { + base TRIBUTARY_PROTOCOL_TYPE; + description "10G Ethernet WAN protocol"; + } + + identity PROT_OC192 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OC 192 (9.6GB) port protocol"; + } + + identity PROT_STM64 { + base TRIBUTARY_PROTOCOL_TYPE; + description "STM 64 protocol"; + } + + identity PROT_OTU2 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU 2 protocol"; + } + + identity PROT_OTU2E { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU 2e protocol"; + } + + identity PROT_OTU1E { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU 1e protocol"; + } + + identity PROT_ODU2 { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU 2 protocol"; + } + + identity PROT_ODU2E { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU 2e protocol"; + } + + identity PROT_40GE { + base TRIBUTARY_PROTOCOL_TYPE; + description "40G Ethernet port protocol"; + } + + identity PROT_OC768 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OC 768 protocol"; + } + + identity PROT_STM256 { + base TRIBUTARY_PROTOCOL_TYPE; + description "STM 256 protocol"; + } + + identity PROT_OTU3 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU 3 protocol"; + } + + identity PROT_ODU3 { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU 3 protocol"; + } + + identity PROT_100GE { + base TRIBUTARY_PROTOCOL_TYPE; + description "100G Ethernet protocol"; + } + + identity PROT_100G_MLG { + base TRIBUTARY_PROTOCOL_TYPE; + description "100G MLG protocol"; + } + + identity PROT_OTU4 { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU4 signal protocol (112G) for transporting + 100GE signal"; + } + + identity PROT_OTUCN { + base TRIBUTARY_PROTOCOL_TYPE; + description "OTU Cn protocol"; + } + + identity PROT_ODUCN { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU Cn protocol"; + } + + identity PROT_ODU4 { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU 4 protocol"; + } + + identity PROT_400GE { + base TRIBUTARY_PROTOCOL_TYPE; + description "400G Ethernet protocol"; + } + + identity PROT_OTSIG { + base TRIBUTARY_PROTOCOL_TYPE; + description "Optical tributary signal group protocol"; + } + + identity PROT_ODUFLEX_CBR { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU Flex with CBR protocol"; + } + + identity PROT_ODUFLEX_GFP { + base TRIBUTARY_PROTOCOL_TYPE; + description "ODU Flex with GFP protocol"; + } + + identity TRANSCEIVER_FORM_FACTOR_TYPE { + description + "Base identity for identifying the type of pluggable optic + transceiver (i.e,. form factor) used in a port."; + } + + identity CFP { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "C form-factor pluggable, that can support up to a + 100 Gb/s signal with 10x10G or 4x25G physical channels"; + } + + identity CFP2 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "1/2 C form-factor pluggable, that can support up to a + 200 Gb/s signal with 10x10G, 4x25G, or 8x25G physical + channels"; + } + + identity CFP2_ACO { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "CFP2 analog coherent optics transceiver, supporting + 100 Gb, 200Gb, and 250 Gb/s signal."; + } + + identity CFP4 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "1/4 C form-factor pluggable, that can support up to a + 100 Gb/s signal with 10x10G or 4x25G physical channels"; + } + + identity QSFP { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "OriginalQuad Small Form-factor Pluggable transceiver that can + support 4x1G physical channels. Not commonly used."; + } + + identity QSFP_PLUS { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Quad Small Form-factor Pluggable transceiver that can support + up to 4x10G physical channels."; + } + + identity QSFP28 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "QSFP pluggable optic with support for up to 4x28G physical + channels"; + } + + identity QSFP56_DD_TYPE1 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "QSFP DD pluggable optic with support for up to 8x56G physical + channels. Type 1 uses eight optical and electrical signals."; + } + + identity QSFP56_DD_TYPE2 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "QSFP DD pluggable optic with support for up to 4x112G physical + channels. Type 2 uses four optical and eight electrical + signals."; + } + + identity CPAK { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Cisco CPAK transceiver supporting 100 Gb/s."; + } + + identity SFP { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Small form-factor pluggable transceiver supporting up to + 10 Gb/s signal"; + } + + identity SFP_PLUS { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Enhanced small form-factor pluggable transceiver supporting + up to 16 Gb/s signals, including 10 GbE and OTU2"; + } + + identity XFP { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "10 Gigabit small form factor pluggable transceiver supporting + 10 GbE and OTU2"; + } + + identity X2 { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "10 Gigabit small form factor pluggable transceiver supporting + 10 GbE using a XAUI inerface and 4 data channels."; + } + + identity OSFP { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Octal small form factor pluggable transceiver supporting + 400 Gb/s."; + } + + identity NON_PLUGGABLE { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Represents a port that does not require a pluggable optic, + e.g., with on-board optics like COBO"; + } + + identity OTHER { + base TRANSCEIVER_FORM_FACTOR_TYPE; + description + "Represents a transceiver form factor not otherwise listed"; + } + + identity FIBER_CONNECTOR_TYPE { + description + "Type of optical fiber connector"; + } + + identity SC_CONNECTOR { + base FIBER_CONNECTOR_TYPE; + description + "SC type fiber connector"; + } + + identity LC_CONNECTOR { + base FIBER_CONNECTOR_TYPE; + description + "LC type fiber connector"; + } + + identity MPO_CONNECTOR { + base FIBER_CONNECTOR_TYPE; + description + "MPO (multi-fiber push-on/pull-off) type fiber connector + 1x12 fibers"; + } + + identity AOC_CONNECTOR { + base FIBER_CONNECTOR_TYPE; + description + "AOC (active optical cable) type fiber connector"; + } + + identity DAC_CONNECTOR { + base FIBER_CONNECTOR_TYPE; + description + "DAC (direct attach copper) type fiber connector"; + } + + identity ETHERNET_PMD_TYPE { + description + "Ethernet compliance codes (PMD) supported by transceivers"; + } + + identity ETH_10GBASE_LRM { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 10GBASE_LRM"; + } + + identity ETH_10GBASE_LR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 10GBASE_LR"; + } + + identity ETH_10GBASE_ZR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 10GBASE_ZR"; + } + + identity ETH_10GBASE_ER { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 10GBASE_ER"; + } + + identity ETH_10GBASE_SR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 10GBASE_SR"; + } + + identity ETH_40GBASE_CR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 40GBASE_CR4"; + } + + identity ETH_40GBASE_SR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 40GBASE_SR4"; + } + + identity ETH_40GBASE_LR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 40GBASE_LR4"; + } + + identity ETH_40GBASE_ER4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 40GBASE_ER4"; + } + + identity ETH_40GBASE_PSM4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 40GBASE_PSM4"; + } + + identity ETH_4X10GBASE_LR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 4x10GBASE_LR"; + } + + identity ETH_4X10GBASE_SR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 4x10GBASE_SR"; + } + + identity ETH_100G_AOC { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100G_AOC"; + } + + identity ETH_100G_ACC { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100G_ACC"; + } + + identity ETH_100GBASE_SR10 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_SR10"; + } + + identity ETH_100GBASE_SR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_SR4"; + } + + identity ETH_100GBASE_LR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_LR4"; + } + + identity ETH_100GBASE_ER4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_ER4"; + } + + identity ETH_100GBASE_CWDM4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_CWDM4"; + } + + identity ETH_100GBASE_CLR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_CLR4"; + } + + identity ETH_100GBASE_PSM4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_PSM4"; + } + + identity ETH_100GBASE_CR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_CR4"; + } + + identity ETH_100GBASE_FR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 100GBASE_FR"; + } + + identity ETH_400GBASE_ZR { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 400GBASE_ZR"; + } + + identity ETH_400GBASE_LR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 400GBASE_LR4"; + } + + identity ETH_400GBASE_FR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 400GBASE_FR4"; + } + + identity ETH_400GBASE_LR8 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 400GBASE_LR8"; + } + + identity ETH_400GBASE_DR4 { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: 400GBASE_DR4"; + } + + identity ETH_UNDEFINED { + base ETHERNET_PMD_TYPE; + description "Ethernet compliance code: undefined"; + } + + identity SONET_APPLICATION_CODE { + description + "Supported SONET/SDH application codes"; + } + + identity VSR2000_3R2 { + base SONET_APPLICATION_CODE; + description + "SONET/SDH application code: VSR2000_3R2"; + } + + identity VSR2000_3R3 { + base SONET_APPLICATION_CODE; + description + "SONET/SDH application code: VSR2000_3R3"; + } + + identity VSR2000_3R5 { + base SONET_APPLICATION_CODE; + description + "SONET/SDH application code: VSR2000_3R5"; + } + + identity SONET_UNDEFINED { + base SONET_APPLICATION_CODE; + description + "SONET/SDH application code: undefined"; + } + + identity OTN_APPLICATION_CODE { + description + "Supported OTN application codes"; + } + + identity P1L1_2D1 { + base OTN_APPLICATION_CODE; + description + "OTN application code: P1L1_2D1"; + } + + identity P1S1_2D2 { + base OTN_APPLICATION_CODE; + description + "OTN application code: P1S1_2D2"; + } + + identity P1L1_2D2 { + base OTN_APPLICATION_CODE; + description + "OTN application code: P1L1_2D2"; + } + + identity OTN_UNDEFINED { + base OTN_APPLICATION_CODE; + description + "OTN application code: undefined"; + } + + identity TRIBUTARY_RATE_CLASS_TYPE { + description + "Rate of tributary signal _- identities will typically reflect + rounded bit rate."; + } + + identity TRIB_RATE_1G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1G tributary signal rate"; + } + + identity TRIB_RATE_2.5G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "2.5G tributary signal rate"; + } + + identity TRIB_RATE_10G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "10G tributary signal rate"; + } + + identity TRIB_RATE_40G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "40G tributary signal rate"; + } + + identity TRIB_RATE_100G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "100G tributary signal rate"; + } + + identity TRIB_RATE_150G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "150G tributary signal rate"; + } + + identity TRIB_RATE_200G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "200G tributary signal rate"; + } + + identity TRIB_RATE_250G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "250G tributary signal rate"; + } + + identity TRIB_RATE_300G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "300G tributary signal rate"; + } + + identity TRIB_RATE_350G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "350G tributary signal rate"; + } + + identity TRIB_RATE_400G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "400G tributary signal rate"; + } + + identity TRIB_RATE_450G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "450G tributary signal rate"; + } + + identity TRIB_RATE_500G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "500G tributary signal rate"; + } + + identity TRIB_RATE_550G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "550G tributary signal rate"; + } + + identity TRIB_RATE_600G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "600G tributary signal rate"; + } + + identity TRIB_RATE_650G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "650G tributary signal rate"; + } + + identity TRIB_RATE_700G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "700G tributary signal rate"; + } + + identity TRIB_RATE_750G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "750G tributary signal rate"; + } + + identity TRIB_RATE_800G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "800G tributary signal rate"; + } + + identity TRIB_RATE_850G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "850G tributary signal rate"; + } + + identity TRIB_RATE_900G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "900G tributary signal rate"; + } + + identity TRIB_RATE_950G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "950G tributary signal rate"; + } + + identity TRIB_RATE_1000G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1000G tributary signal rate"; + } + + identity TRIB_RATE_1050G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1050G tributary signal rate"; + } + + identity TRIB_RATE_1100G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1100G tributary signal rate"; + } + + identity TRIB_RATE_1150G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1150G tributary signal rate"; + } + + identity TRIB_RATE_1200G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1200G tributary signal rate"; + } + + identity TRIB_RATE_1250G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1250G tributary signal rate"; + } + + identity TRIB_RATE_1300G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1300G tributary signal rate"; + } + + identity TRIB_RATE_1350G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1350G tributary signal rate"; + } + + identity TRIB_RATE_1400G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1400G tributary signal rate"; + } + + identity TRIB_RATE_1450G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1450G tributary signal rate"; + } + + identity TRIB_RATE_1500G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1500G tributary signal rate"; + } + + identity TRIB_RATE_1550G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1550G tributary signal rate"; + } + + identity TRIB_RATE_1600G { + base TRIBUTARY_RATE_CLASS_TYPE; + description + "1600G tributary signal rate"; + } + + identity LOGICAL_ELEMENT_PROTOCOL_TYPE { + description + "Type of protocol framing used on the logical channel or + tributary"; + } + + identity PROT_ETHERNET { + base LOGICAL_ELEMENT_PROTOCOL_TYPE; + description + "Ethernet protocol framing"; + } + + identity PROT_OTN { + base LOGICAL_ELEMENT_PROTOCOL_TYPE; + description + "OTN protocol framing"; + } + + identity OPTICAL_CHANNEL { + base oc-platform-types:OPENCONFIG_HARDWARE_COMPONENT; + description + "Optical channels act as carriers for transport traffic + directed over a line system. They are represented as + physical components in the physical inventory model."; + } + + identity FIBER_JUMPER_TYPE { + description + "Types of fiber jumpers used for connecting device ports"; + } + + identity FIBER_JUMPER_SIMPLEX { + base FIBER_JUMPER_TYPE; + description + "Simplex fiber jumper"; + } + + identity FIBER_JUMPER_MULTI_FIBER_STRAND { + base FIBER_JUMPER_TYPE; + description + "One strand of a fiber jumper which contains multiple fibers + within it, such as an MPO based fiber jumper"; + } + + identity OPTICAL_PORT_TYPE { + description + "Type definition for optical transport port types"; + } + + identity INGRESS { + base OPTICAL_PORT_TYPE; + description + "Ingress port, corresponding to a signal entering + a line system device such as an amplifier or wavelength + router."; + } + + identity EGRESS { + base OPTICAL_PORT_TYPE; + description + "Egress port, corresponding to a signal exiting + a line system device such as an amplifier or wavelength + router."; + } + + identity ADD { + base OPTICAL_PORT_TYPE; + description + "Add port, corresponding to a signal injected + at a wavelength router."; + } + + identity DROP { + base OPTICAL_PORT_TYPE; + description + "Drop port, corresponding to a signal dropped + at a wavelength router."; + } + + identity MONITOR { + base OPTICAL_PORT_TYPE; + description + "Monitor port, corresponding to a signal used by an optical + channel monitor. This is used to represent the connection + that a channel monitor port is connected to, typically on a + line system device. This connection may be via physical cable + and faceplate ports or internal to the device"; + } + + identity TERMINAL_CLIENT { + base OPTICAL_PORT_TYPE; + description + "Client-facing port on a terminal optics device (e.g., + transponder or muxponder)."; + } + + identity TERMINAL_LINE { + base OPTICAL_PORT_TYPE; + description + "Line-facing port on a terminal optics device (e.g., + transponder or muxponder)."; + } + + identity CLIENT_MAPPING_MODE { + description + "Type definition for optical transport client mapping modes."; + } + + identity MODE_1X100G { + base CLIENT_MAPPING_MODE; + description + "1 x 100G client mapping mode."; + } + + identity MODE_1X200G { + base CLIENT_MAPPING_MODE; + description + "1 x 200G client mapping mode."; + } + + identity MODE_1X400G { + base CLIENT_MAPPING_MODE; + description + "1 x 400G client mapping mode."; + } + + identity MODE_2X100G { + base CLIENT_MAPPING_MODE; + description + "2 x 100G client mapping mode."; + } + + identity MODE_2X200G { + base CLIENT_MAPPING_MODE; + description + "2 x 200G client mapping mode."; + } + + identity MODE_3X100G { + base CLIENT_MAPPING_MODE; + description + "3 x 100G client mapping mode."; + } + + identity MODE_4X100G { + base CLIENT_MAPPING_MODE; + description + "4 x 100G client mapping mode."; + } + + identity TRANSCEIVER_MODULE_FUNCTIONAL_TYPE { + description + "Type definition for transceiver module functional types."; + } + + identity TYPE_STANDARD_OPTIC { + base TRANSCEIVER_MODULE_FUNCTIONAL_TYPE; + description + "Standard optic using a grey wavelength (i.e. 1310, 1550, etc.) + and on-off-keying (OOK) modulation."; + } + + identity TYPE_DIGITAL_COHERENT_OPTIC { + base TRANSCEIVER_MODULE_FUNCTIONAL_TYPE; + description + "Digital coherent module which transmits a phase / amplitude + modulated signal and uses a digital signal processor to receive + and decode the received signal."; + } +} diff --git a/exp/yangcli/h3c-yang/openconfig-types@2019-04-16.yang b/exp/yangcli/h3c-yang/openconfig-types@2019-04-16.yang new file mode 100644 index 0000000..749d8ec --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-types@2019-04-16.yang @@ -0,0 +1,536 @@ +/* + * This file is subject to the Apache License Version 2.0 (the "License"). + * You may not use the software except in compliance with the License. + * + * This file in this distribution may have been modified by Tencent ("Tencent Modifications"). + * All Tencent Modifications are Copyright (c) 2019 Shenzhen tencent computer systems + * company limited and are made available subject to the Tencent end user agreement or + * other applicable agreement between you and Tencent. + */ + +module openconfig-types { + yang-version "1"; + + namespace "http://openconfig.net/yang/openconfig-types"; + + prefix "oc-types"; + + // import statements + import openconfig-extensions { prefix oc-ext; } + + // meta + organization + "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module contains a set of general type definitions that + are used across OpenConfig models. It can be imported by modules + that make use of these types."; + + oc-ext:openconfig-version "0.6.0"; + + revision "2019-04-16" { + description + "Clarify definition of timeticks64."; + reference "0.6.0"; + } + + revision "2018-11-21" { + description + "Add OpenConfig module metadata extensions."; + reference "0.5.1"; + } + + revision "2018-05-05" { + description + "Add grouping of min-max-time and + included them to all stats with min/max/avg"; + reference "0.5.0"; + } + + revision "2018-01-16" { + description + "Add interval to min/max/avg stats; add percentage stat"; + reference "0.4.0"; + } + + revision "2017-08-16" { + description + "Apply fix for ieetfloat32 length parameter"; + reference "0.3.3"; + } + + revision "2017-01-13" { + description + "Add ADDRESS_FAMILY identity"; + reference "0.3.2"; + } + + revision "2016-11-14" { + description + "Correct length of ieeefloat32"; + reference "0.3.1"; + } + + revision "2016-11-11" { + description + "Additional types - ieeefloat32 and routing-password"; + reference "0.3.0"; + } + + revision "2016-05-31" { + description + "OpenConfig public release"; + reference "0.2.0"; + } + + // OpenConfig specific extensions for module metadata. + oc-ext:regexp-posix; + oc-ext:catalog-organization "openconfig"; + oc-ext:origin "openconfig"; + + typedef percentage { + type uint8 { + range "0..100"; + } + description + "Integer indicating a percentage value"; + } + + typedef std-regexp { + type string; + description + "This type definition is a placeholder for a standard + definition of a regular expression that can be utilised in + OpenConfig models. Further discussion is required to + consider the type of regular expressions that are to be + supported. An initial proposal is POSIX compatible."; + } + + typedef timeticks64 { + type uint64; + units "nanoseconds"; + description + "The timeticks64 represents the time, modulo 2^64 in + nanoseconds between two epochs. The leaf using this + type must define the epochs that tests are relative to."; + } + + typedef ieeefloat32 { + type binary { + length "4"; + } + description + "An IEEE 32-bit floating point number. The format of this number + is of the form: + 1-bit sign + 8-bit exponent + 23-bit fraction + The floating point value is calculated using: + (-1)**S * 2**(Exponent-127) * (1+Fraction)"; + } + + typedef routing-password { + type string; + description + "This type is indicative of a password that is used within + a routing protocol which can be returned in plain text to the + NMS by the local system. Such passwords are typically stored + as encrypted strings. Since the encryption used is generally + well known, it is possible to extract the original value from + the string - and hence this format is not considered secure. + Leaves specified with this type should not be modified by + the system, and should be returned to the end-user in plain + text. This type exists to differentiate passwords, which + may be sensitive, from other string leaves. It could, for + example, be used by the NMS to censor this data when + viewed by particular users."; + } + + typedef stat-interval { + type uint64; + units nanoseconds; + description + "A time interval over which a set of statistics is computed. + A common usage is to report the interval over which + avg/min/max stats are computed and reported."; + } + + grouping stat-interval-state { + description + "Reusable leaf definition for stats computation interval"; + + leaf interval { + type oc-types:stat-interval; + description + "If supported by the system, this reports the time interval + over which the min/max/average statistics are computed by + the system."; + } + } + + grouping min-max-time { + description + "Common grouping for recording the absolute time at which + the minimum and maximum values occurred in the statistics"; + + leaf min-time { + type oc-types:timeticks64; + description + "The absolute time at which the minimum value occurred. + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + + leaf max-time { + type oc-types:timeticks64; + description + "The absolute time at which the maximum value occurred. + The value is the timestamp in nanoseconds relative to + the Unix Epoch (Jan 1, 1970 00:00:00 UTC)."; + } + } + + grouping avg-min-max-stats-precision1 { + description + "Common nodes for recording average, minimum, and + maximum values for a statistic. These values all have + fraction-digits set to 1. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed is also reported."; + + leaf avg { + type decimal64 { + fraction-digits 1; + } + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 1; + } + description + "The minimum value of the statistic over the time + interval."; + } + + leaf max { + type decimal64 { + fraction-digits 1; + } + description + "The maximum value of the statitic over the time + interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + grouping avg-min-max-instant-stats-precision1 { + description + "Common grouping for recording an instantaneous statistic value + in addition to avg-min-max stats"; + + leaf instant { + type decimal64 { + fraction-digits 1; + } + description + "The instantaneous value of the statistic."; + } + + uses avg-min-max-stats-precision1; + } + + grouping avg-min-max-instant-stats-precision2-dB { + description + "Common grouping for recording dB values with 2 decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed, and the times at which the minimum + and maximum values occurred, are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units dB; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units dB; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units dB; + description + "The minimum value of the statistic over the time interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units dB; + description + "The maximum value of the statistic over the time + interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-dBm { + description + "Common grouping for recording dBm values with 2 decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed, and the times at which the minimum + and maximum values occurred, are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The minimum value of the statistic over the time + interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units dBm; + description + "The maximum value of the statistic over the time interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + grouping avg-min-max-instant-stats-precision2-mA { + description + "Common grouping for recording mA values with 2 decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed, and the times at which the minimum + and maximum values occurred, are also reported."; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units mA; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units mA; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units mA; + description + "The minimum value of the statistic over the time + interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units mA; + description + "The maximum value of the statistic over the time + interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + + grouping avg-min-max-instant-stats-precision2-V { + description + "Common grouping for recording V values with 2 decimal + precision. Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed, and the times at which the minimum + and maximum values occurred, are also reported. + This type is defined by tencent"; + + leaf instant { + type decimal64 { + fraction-digits 2; + } + units V; + description + "The instantaneous value of the statistic."; + } + + leaf avg { + type decimal64 { + fraction-digits 2; + } + units V; + description + "The arithmetic mean value of the statistic over the + time interval."; + } + + leaf min { + type decimal64 { + fraction-digits 2; + } + units V; + description + "The minimum value of the statistic over the time + interval."; + } + + leaf max { + type decimal64 { + fraction-digits 2; + } + units V; + description + "The maximum value of the statistic over the time + interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + grouping avg-min-max-instant-stats-pct { + description + "Common grouping for percentage statistics. + Values include the instantaneous, average, + minimum, and maximum statistics. Statistics are computed + and reported based on a moving time interval (e.g., the last + 30s). If supported by the device, the time interval over which + the statistics are computed, and the times at which the minimum + and maximum values occurred, are also reported."; + + leaf instant { + type oc-types:percentage; + description + "The instantaneous percentage value."; + } + + leaf avg { + type oc-types:percentage; + description + "The arithmetic mean value of the percentage measure of the + statistic over the time interval."; + } + + leaf min { + type oc-types:percentage; + description + "The minimum value of the percentage measure of the + statistic over the time interval."; + } + + leaf max { + type oc-types:percentage; + description + "The maximum value of the percentage measure of the + statistic over the time interval."; + } + + uses stat-interval-state; + uses min-max-time; + } + + identity ADDRESS_FAMILY { + description + "A base identity for all address families"; + } + + identity IPV4 { + base ADDRESS_FAMILY; + description + "The IPv4 address family"; + } + + identity IPV6 { + base ADDRESS_FAMILY; + description + "The IPv6 address family"; + } + + identity MPLS { + base ADDRESS_FAMILY; + description + "The MPLS address family"; + } + + identity L2_ETHERNET { + base ADDRESS_FAMILY; + description + "The 802.3 Ethernet address family"; + } + +} \ No newline at end of file diff --git a/exp/yangcli/h3c-yang/openconfig-vlan-types@2016-05-26.yang b/exp/yangcli/h3c-yang/openconfig-vlan-types@2016-05-26.yang new file mode 100644 index 0000000..dd095ce --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-vlan-types@2016-05-26.yang @@ -0,0 +1,180 @@ +module openconfig-vlan-types { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/vlan-types"; + + prefix "oc-vlan-types"; + + // import some basic types + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module defines configuration and state variables for VLANs, + in addition to VLAN parameters associated with interfaces"; + + oc-ext:openconfig-version "1.0.2"; + + revision "2016-05-26" { + description + "OpenConfig public release"; + reference "1.0.2"; + } + + // extension statements + + // feature statements + + // identity statements + + identity TPID_TYPES { + description + "Base identity for TPID values that can override the VLAN + ethertype value"; + } + + identity TPID_0x8100 { + base TPID_TYPES; + description + "Default TPID value for 802.1q single-tagged VLANs."; + } + + identity TPID_0x8A88 { + base TPID_TYPES; + description + "TPID value for 802.1ad provider bridging, Q-in-Q, + or stacked VLANs"; + } + + identity TPID_0x9100 { + base TPID_TYPES; + description + "Alternate TPID value"; + } + + identity TPID_0X9200 { + base TPID_TYPES; + description + "Alternate TPID value"; + } + + // typedef statements + + // TODO: typedefs should be defined in a vlan-types.yang file. + typedef vlan-id { + type uint16 { + range 1..4094; + } + description + "Type definition representing a single-tagged VLAN"; + } + + typedef vlan-range { + type string { + // range specified as [lower]..[upper] + pattern "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])\.\.(409[0-4]|" + + "40[0-8][0-9]|[1-3][0-9]{3}|[1-9][0-9]{1,2}|" + + "[1-9])"; + } + description + "Type definition representing a range of single-tagged + VLANs. A range is specified as x..y where x and y are + valid VLAN IDs (1 <= vlan-id <= 4094). The range is + assumed to be inclusive, such that any VLAN-ID matching + x <= VLAN-ID <= y falls within the range."; + } + + typedef qinq-id { + type string { + pattern + "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])\." + + "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])|\*)"; + } + description + "Type definition representing a single double-tagged/QinQ VLAN + identifier. The format of a QinQ VLAN-ID is x.y where X is the + 'outer' VLAN identifier, and y is the 'inner' VLAN identifier. + Both x and y must be valid VLAN IDs (1 <= vlan-id <= 4094) + with the exception that y may be equal to a wildcard (*). In + cases where y is set to the wildcard, this represents all inner + VLAN identifiers where the outer VLAN identifier is equal to + x"; + } + + typedef qinq-id-range { + type union { + type string { + // match cases where the range is specified as x..y.z + pattern + "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])\.\." + + "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])\." + + "((409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])|\*)"; + } + type string { + // match cases where the range is specified as x.y..z + pattern + "(\*|(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9]))\." + + "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])\.\." + + "(409[0-4]|40[0-8][0-9]|[1-3][0-9]{3}|" + + "[1-9][0-9]{1,2}|[1-9])"; + } + } + description + "A type definition representing a range of double-tagged/QinQ + VLAN identifiers. The format of a QinQ VLAN-ID range can be + specified in three formats. Where the range is outer VLAN IDs + the range is specified as x..y.z. In this case outer VLAN + identifiers meeting the criteria x <= outer-vlan-id <= y are + accepted iff the inner VLAN-ID is equal to y - or any inner-tag + if the wildcard is specified. Alternatively the range can be + specified as x.y..z. In this case only VLANs with an + outer-vlan-id qual to x are accepted (x may again be the + wildcard). Inner VLANs are accepted if they meet the inequality + y <= inner-vlan-id <= z."; + } + + typedef vlan-mode-type { + type enumeration { + enum ACCESS { + description "Access mode VLAN interface (No 802.1q header)"; + } + enum TRUNK { + description "Trunk mode VLAN interface"; + } + } + description + "VLAN interface mode (trunk or access)"; + } + + typedef vlan-ref { + type union { + type vlan-id; + type string; + // TODO: string should be changed to leafref to reference + // an existing VLAN. this is not allowed in YANG 1.0 but + // is expected to be in YANG 1.1. + // type leafref { + // path "vlan:vlans/vlan:vlan/vlan:config/vlan:name"; + // } + } + description + "Reference to a VLAN by name or id"; + } + +} diff --git a/exp/yangcli/h3c-yang/openconfig-vlan@2016-05-26.yang b/exp/yangcli/h3c-yang/openconfig-vlan@2016-05-26.yang new file mode 100644 index 0000000..afc61fd --- /dev/null +++ b/exp/yangcli/h3c-yang/openconfig-vlan@2016-05-26.yang @@ -0,0 +1,407 @@ +module openconfig-vlan { + + yang-version "1"; + + // namespace + namespace "http://openconfig.net/yang/vlan"; + + prefix "oc-vlan"; + + // import some basic types + import openconfig-vlan-types { prefix oc-vlan-types; } + import openconfig-interfaces { prefix oc-if; } + import openconfig-if-ethernet { prefix oc-eth; } + import openconfig-if-aggregate { prefix oc-lag; } + import iana-if-type { prefix ift; } + import openconfig-extensions { prefix oc-ext; } + + // meta + organization "OpenConfig working group"; + + contact + "OpenConfig working group + netopenconfig@googlegroups.com"; + + description + "This module defines configuration and state variables for VLANs, + in addition to VLAN parameters associated with interfaces"; + + oc-ext:openconfig-version "1.0.2"; + + revision "2016-05-26" { + description + "OpenConfig public release"; + reference "1.0.2"; + } + + + + // grouping statements + + grouping vlan-config { + description "VLAN configuration container."; + + leaf vlan-id { + type oc-vlan-types:vlan-id; + description "Interface VLAN id."; + } + + leaf name { + type string; + description "Interface VLAN name."; + } + + leaf status { + type enumeration { + enum ACTIVE { + description "VLAN is active"; + } + enum SUSPENDED { + description "VLAN is inactive / suspended"; + } + } + default ACTIVE; + description "Admin state of the VLAN"; + } + + leaf tpid { + type identityref { + base oc-vlan-types:TPID_TYPES; + } + default oc-vlan-types:TPID_0x8100; + description + "Optionally set the tag protocol identifier field (TPID) that + is accepted on the VLAN"; + } + + } + + grouping vlan-state { + description "State variables for VLANs"; + + } + + grouping vlan-members-state { + description + "List of interfaces / subinterfaces belonging to the VLAN."; + + container members { + description + "Enclosing container for list of member interfaces"; + + list member { + config false; + description + "List of references to interfaces / subinterfaces + associated with the VLAN."; + + uses oc-if:interface-ref-state; + } + } + } + + grouping vlan-ethernet-config { + description + "VLAN related configuration that is part of the physical + Ethernet interface."; + + leaf interface-mode { + type oc-vlan-types:vlan-mode-type; + description + "Set the interface to access or trunk mode for + VLANs"; + } + + leaf native-vlan { + when "interface-mode = 'TRUNK'" { + description + "Native VLAN is valid for trunk mode interfaces"; + } + type union { + type oc-vlan-types:vlan-id; + type oc-vlan-types:qinq-id; + } + description + "Set the native VLAN id for untagged frames arriving on + a trunk interface. This configuration is only valid on + a trunk interface."; + } + + leaf access-vlan { + when "interface-mode = 'ACCESS'" { + description + "Access VLAN assigned to the interfaces"; + } + type union { + type oc-vlan-types:vlan-id; + type oc-vlan-types:qinq-id; + } + description + "Assign the access vlan to the access port."; + } + + leaf-list trunk-vlans { + when "interface-mode = 'TRUNK'" { + description + "Allowed VLANs may be specified for trunk mode + interfaces."; + } + type union { + type oc-vlan-types:vlan-id; + type oc-vlan-types:vlan-range; + type oc-vlan-types:qinq-id; + type oc-vlan-types:qinq-id-range; + } + description + "Specify VLANs, or ranges thereof, that the interface may + carry when in trunk mode. If not specified, all VLANs are + allowed on the interface. Ranges are specified in the form + x..y, where xUz`)?bq?y^tz`*br#DQT(DC08+0|Uc!h7^Vc zkfOxA;^frKveY64*NTGtqLS1ig@VN7?8Nj`JuWWa{FKt1)MACiqEv;<+=86c+|<01 z)D(rZ{G6Qp^31$+g_4X^g_P9d%=A2k%shqSg4E<<{St(sx~Wh@bs>s$%PjSBQ}np} zG#PKP$H%ASC&$OHWcUnn=PzgdjQreG{mRnHBK?%qGX3K6%#!4c_?*Nf{k+tYjK literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/api.cpython-312.pyc b/src/exporter/__pycache__/api.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47c62b0bb87f7d14de0e236cdfade0722f97e70f GIT binary patch literal 7941 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 a2@qETEaAn-$oGK(M1rM0GJ%-jR0#lC)#R7} literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/connection.cpython-312.pyc b/src/exporter/__pycache__/connection.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8f493db5c585da4f1b1a58fb3c97daaf777d5bbe GIT binary patch literal 4934 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 literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/errors.cpython-312.pyc b/src/exporter/__pycache__/errors.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ab87d86b45dc51b011bf56ede9d9bcf5ca5d23f4 GIT binary patch literal 1507 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 E0Ko!G761SM literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/metrics.cpython-312.pyc b/src/exporter/__pycache__/metrics.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85cf2032a5e10894c738433c64ba04294328ea05 GIT binary patch literal 6799 zcmX@j%ge>Uz`(GcPcw6YGy}t95C?`?APmOOF$@e0(-~42QW$d>av7r-89{8O9Hw06 zDCS(2D3)B-C|0l-a}HZBdlY*vM-)dcXA~zRLkdd@YYtZ~cNBLnPZSR$0~3QgLke39 zLkjz9CWz@#ypWWFWroL`z(l3L`OT2hpm?3S3DnNxX7&^@sL%yJCp-ESkld~CV&CMa z?Yo|JHawft`K+h?*@E`R4NYJ(lbK--XJB9ext*DTf$_5f*zGlpH4O1^=^CaQhImlW zfJG`9G#ULgnQpPgCxdLf#U7sl4ku8A6sP8--C~7^vq6N5LDncJDExBL&&bbB)vqkA zEYeR&Ez>V9&n!vKh|ft(($7mRNzTtpi%+d6$S*2MEz&P8O4f&Sa>3D9tXEKZiz7Zh zGcU6wKE6s8TY%}or1=>b7>b1$7#JEDK5#LJ%XF~xaNiJ@?O^HU`3&+zGTb)|3=G^1 z3=GO3zh`kWFnBXCGE8SEfy>u0WP!p4qzMUUu_AGx%+)X&s<)OA#S}KEG!jLWDNH4t zFfA#JDNHHM>5OYwR)YeSfq|ix8A+BEl%h~%S&(GeQ#jD{vLeZHrf{LjvXy|s1#EQ+ zcM4Ama|&-d6OzsBCA?rs1_p*2rqwV%bJQ@oFvPBBV2EL2V5sG+<*MPz;)AI}(2cS+ z%vpj6K8#hvna+q^2dqF~WT@fF0>vy$3zTkDtYN`pA{HG*OeuVMj4AvmCW}CgL!ugG zYgqA^j70~EiDF1bL7ByjJ(FtKv71@Lm4!t|I#UWC!qlFPEDT6-Cy*kT&X6Ls2svGF zBgqS=h+xR`AjylSh+)X{BFT%VNTf5QNTQg}ha@kRB8?%>k0dXXB8wp}fFv)MB99?2 zSRx4xEQS; zcDZV}ig>W6u42X>^%{{Z8H7F<%Y|VAW2`y@L#=3yXqFsI6hYUBW`T-SgaDXTBbucI zW}p!1%(Y@QqFE{^f?!UgObs{I^nyb@BCXVjW~qUVKp`4sYIty(hebV#c^W82fjN!F zHKJKq#Iv-)(kKM1oJ>*6)?i?O<-%I=8eSYO5=XI}!Z5B8%>q@=C@x}Ps9-E+Vq{2B zuMy4CLz7}a$b#h!aLd<-W*Om@P3NeUs1d^IM~O@ZgdZm`_Gqy%)QDu6V44L^ZORM` zwURZGSW}xM*3>4MWrk^1jU?7I$Wkj-BbjA^slHLBh7YUjai~Z5s75l&3afeiIL*VN z9>qKxtmX;eG!Kh<6!Yw`nkR_UJS^&w%oE0{kK!0BafG?DMl#C@#zxSvk_<=8vZAFj zH5P^mOg)oX7;2cOF-~V>WT;_*(yUOL4N9{^X>KUZ1EqPPG#`}ahtdL2S`bPLL1|$K zUCFSPxtvi`!|#?ntmRjnT$EUl8lO^H1a95O7pErY=cN=^X}Lf}6!Oy)auSP66#QI6 zoc;aW6d*bj3Q~&{QoybCTWku7TGg3=3Qj4&f z2v(GulA5BRVW_E)U!;(hn3)6O8ED>8g&7EPN<72~@gb#RfyKpXr8x>nTCoI(G|aV7ho%-4i`UWLTG6orz?g4A1FV5xWzI~|hvKG;JU z3=FsAk=zttlA2qPT9jB)T9g`}oSIXdSz27Bh17CaKvJNPnWvDFnqHKeTCCs0f5}%itn|ce`_wmK01qC^k@n!irC5h>&V7j6;vn&bpRDK3>BaPItm5~`Jm)eo>`o#iRz5xjKsXW z)SURDiui*3^3RnF-HL`1x~t9^$Hp(PPv+zEMV^zftm)l z*r8HI%AgQH@hem&z69A44Y1R5GfN2Ba!VQ6=Pv# zLz4b2o{Yqzl=8%))cB&*vRe|!RzqDD53;FB0@(>r8L%5PS&=MP2gMdIR60I0FD11C z;vn{bAlG15zmQuDno74=ax#lciUdGvSu;ygbBl`v85kIfI6wqDNR%ZdGr8oJ2y!t4 zD;sZdC8ngrLpsH`gppN13x->w$b#_F=@vg&7?F94Kpo3l%;~8mw|J0zT@3ckEuNhG zbWmcA2jxA87kH6kE z4V&Uy{4g7!BDZ*ubImOt=tuzNl_7~4W=no1nTnL;s%dJ z#Dl~577t`Z0?OlumWuFj<%0^qf{_m#UQof3;#-{Xa`_eyI255p=`Aj(xw(l2kg#LQ zD89vBQUP|{E$)&Ec)Jvk#D}HO#aL1V>fYSqhQ>jB87S3*6oH0VK(!%Laz-(zI0X$TVaG+HptQ%H z3>ko`l0i!G@Np+SsH`|>h-D=U1H%i39}Nso#H41J%(tFteO+4TqO{IsX}!y0`W@VN z#HDAr%=ek;b6rO7qKw{U8H3B>h8;X#*chaBZt&>d;IX(NA~V723p z8$2pEcwAw^Qd}K;P+{X6JeFv}qG~sI3~ul^!GuM*Iyk>@F-U0N;L*In<90(tW=75h zVeK#MED~HDJYV=2#H42ETozUD;QGMEAg%t1frHbVvD2%=ZGzJce!=VfY8Uy{F7O-O z5Rktvpmk9|YlYhiiw!~7O?@t!`dkt41*=iL$gg^V-|&Wj+;suXivpS}%vNaZFuHCX zc*#0&qw|IEs4D`|V1?=z`PDD*8>1-P;B?)@=b{PRFvZLKiZ=vgt_!GN6i{Cwwn6B+ zq4PyU=L;Gx2a>M}czqBAIq-`ZgRlxDv~CHTe_>}4=IUVo!o?u2af3(i29E|rP@JoS z`wJI?nEDMK#Tz^h5J54n4z4deFqNjagq^;yvp`iswVR;`f-Ew;!D9#!gjyu2b%V$H z1`kxbBv%LT7aj&-7^2uOTjV-ST?D6h!`#v4-7 z^EGB_EO1=zx6p5c<8>34izY4?BwZ)4-4GU;Za>lfg0S8V5$Wq9Y8OS+7L=_hTwlMk z{)&kG4PlY%!m1aARWAq|-Vl+$E~0f&L~DiF2E*&dt{076uZXyT^jl7}ydbP`LsM(L zMUP(f5*w`hp-3+i#-ZB@vAUNgo6`<%K42 ze-L31l(;USbWuQQf%OKaYXZg}v_*MMJ{T~F%U>5$zbK~unL&hCXads>DVh12Gc^|k zEstLqzaiX%9j}Nu-4GVNF06S`So4Cg=?xLZ>moWAMRZn#f%1m;MN{u9B0diU#33GeAR#rM zb0+5v390$~Gx={wNL`oEx+tM_M?!jr({&l0i!wTwC3L~UninNBKX9{&ihbZ?5EcI> z$SElFNnC_i=!2~hr_hHiMh1SlOB}K{_+&0|$iPVPF8&*QQkOWS9`K2F@!sH*yu=}S zgHPfThXjlb5dlj|U*eFy0Z}K~&HJ+$G+^1}Vi;u1c*MllKFFBSPm`@kn1O+zN&z&J z5M5kSq@#d!oIkb*G|X2egRTr|q&@Z)TTyCBX;I!S7Qg(wR86KL(Bwc7XrNe=4K#2K zYO}`2-{Ojo&&^LM%}I@qzr_wAR0Zf3VWQsw<6fF!NnV48PK5($H%01xM|G>(|D))hnK~VPtJBY=>z{U5OlZ{pG zi$F3Hs~E&6kSTted?06}m4e&l@kOA)VW5z{1Fqal(f>>}b{Nk{Ic-^ij zkAZ;!G-g~3YTbTdW@Kc%%b@g}LH#0w`g4Zpiwx1v8En3@6)-W1ePRHSV8;Uhfz7r0 literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/models.cpython-312.pyc b/src/exporter/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e5d718c33f0d47fb29a0c0c6677a9b37ffbc0c4 GIT binary patch literal 2970 zcmX@j%ge>Uz`)?bq?vhyje+4Yhy%l{5C-GtM+^)M(-~42QW$d>av7r-89{8O9HuCy z6owS$9Hw06C}yx2OAbpeYZPlPTNE230~13ka|-Jkw$+RfbC?+18B*9=7*aS^GeJaF zLnwwQcC2bSTNqNfFw}BjRmXPbHJgO$`Hkv!Vtw2%80i> zOA1>ma|%0@#|q|gKzVE_oTf6n8yv}ae!6wKzW>C9xs%~1?KTVdE8(gKZsY! zswr?wFr+9kuQ)k1vn;hJC^b31DCHJ&aY@lFwv^Pe%;eNte98H_1^IcYc_s0AiMgq_ zcyjX7Gm{f@;tTSNO8kED!h$5axTGld7JETaYH?~_$t~{ug4Ck;;*!LY(&AtIa7Af3 z`H3a5w|GlZa|=?75=%;pQsa|v2^5zW6y#LKm*wY_B&Mgvm)&A3OU+BkFS^B6oLZEb zm~)G}AhD<YYJ5>@nI_LIj(D)s;^S{|#mDF7rd~{ ziH|QVP0Rr~IzIjue|$Vr%*MwT@iQGdYDsc_URr!=1t>^Ti}Z_&lJ()7-29Z( zoMOF#$|6pXnIM9Lfq|hog@J*gmEi#of3x=u5%J3`;x~juFSCf=kX3AO?})w3qIg45 zwZVIW>}3|!8>*TOz7y;(vuNJX(7C`OG9mvmi_Q%hg$B0{-^(ltNGyaFCA9{h3A$HU z)QV(b)?!bh6(lCnROS>mP~rh6Wk^Ehh++XJMo7}+h++lvAW4%W3X*IgNs}WAl5D|A zvywxT@0J8o@^j8e%*#v7fuzDBP~lX>4RSmWh~Q;lV7SGcnOAa)HyNTXJ~J;Rwc-{( zEI~qr{fY!ZN_mPZ;tTT2Q;XtLl5%hHlpyo?lQI*FA|E5vm|U4MeDe2pJFo4re(KO94iJ5>T-Rj))c(yUZeXLsa52 zi^L5TjRv0y`j=TWkXY*44gM42FSBUh(AK}eB0fX@3X47@GC}5Jk4!V%k;$COoB}On z;8Dn)%A5i&T`D;>xo(NNfOEWWYDrOMa&d58VnK06ehDHTZn1)M?=7C>{G6QB`j=VsZ}1siVKIUPAV@9t01Uwhz$oSvrc{;`Xi*)-n!=LGlEMnf z0a0vV9yC8hv8S-7vOoefg)@pHg)5aM1)K{i88vxs2||L`BQ-InBqO*au_V>6iVt2e zCgtbn#DdddNqli~QDQ-Ad~s=Va%yogBsq)ZBo@PEQc8=!HPkIpWYLn$+|=Td#N2`+ zK2QeW2g{`v73CMjmsA#{7J+KsB1MptNOFE&acXjDNoHAUd|F~=PH9nUu_h;aSQ~)C z6`be|K`bK>VGJTnKm=MO=!3*Sgbt{5vw$ReEj>`mmAlNMcSFbE0*k~9{mU!{H*^gz zut?6ZzszC?D%t!e#DYpT1x1j&@)Z_ENF0HT%KZQTe|<8v4FM{K89?n4W(Eev&q?5j zs$pngtYqY5D1ob~VSu$cN3Q%YBH7fGB7Z3DJUo?xTKb(7UgECFYc-Dimkrm*%7>B&8~p6s0DXq^2k&7As`tl_ln6rs#2j%?d~@da-Wb zi**YX$}FuEo^RUseBrvMJv(2v_9}S#g%}&f`#MG_Jnh~5VtLz>9lM@QU+`>d$K!@3 zuwFM!R!A&z!j<0Q3Io~f3X1DnoFSD3sSqZwe_3i#T26jBn5)Tnixup`Vo+!)6oJaB zTLPKI@ldzLgC&cs85kHq(N}EAz`)SJ@PUVcgSVmf2EWJ$CT3RAJN!ZuOuMV*L|)`q zyTGCL;|`D59L^=S7q|^SF)*@<-sBhgz|6=h`l}dJXtxTAGfWrJV_wUs$E?XxWCcnh z;KG@$D7B=tDDM^vDA{ZBg6i$GQgCA+z6jKKy2TA|cBK{W?p&`Cm0SNX%5o+@M#bE#63af3ZwXUCT>Rc4-DLl>Ytezm?S=cxF2N@vYd%K_ATA#R6Zdx}Rz{@{46KYwAPMddV6FfIuXqFJ7dCE2QE=J^ E0JhKki2wiq literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/netconf_client.cpython-312.pyc b/src/exporter/__pycache__/netconf_client.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..da6c850cf39661810548a5ae9b2fb98d70e4c7bd GIT binary patch literal 7428 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 literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/scraper.cpython-312.pyc b/src/exporter/__pycache__/scraper.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b4086f76acc4031d8291745ba44d6c7cd34a1527 GIT binary patch literal 5176 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 literal 0 HcmV?d00001 diff --git a/src/exporter/__pycache__/sqlite_store.cpython-312.pyc b/src/exporter/__pycache__/sqlite_store.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8a6542e20d17558c3405a32ce8695a235f27307 GIT binary patch literal 8490 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 None: + if expected is None or expected == "": + return + if x_api_token != expected: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Unauthorized", + ) + + +def create_app( + registry: DeviceRegistry, + store: SQLiteDeviceStore, + collector: TransceiverCollector, + global_cfg: GlobalConfig, +) -> FastAPI: + """ + 创建 FastAPI 应用,挂载 /metrics, /healthz, /api/v1/devices 等路由。 + """ + app = FastAPI() + + # 独立的 Prometheus registry,以便测试隔离 + prom_registry = CollectorRegistry() + prom_registry.register(collector) + + def require_token(x_api_token: str | None = Header(default=None, alias="X-API-Token")): + _require_token(x_api_token, global_cfg.api_token) + + @app.get("/metrics") + def metrics() -> PlainTextResponse: + data = generate_latest(prom_registry) + return PlainTextResponse( + content=data.decode("utf-8"), + media_type="text/plain; version=0.0.4", + ) + + @app.get("/healthz") + def healthz() -> JSONResponse: + devices = registry.list_devices() + total = len(devices) + enabled = len([d for d in devices if d.enabled]) + return JSONResponse( + content={ + "status": "ok", + "scraper_running": True, + "devices_total": total, + "devices_enabled": enabled, + } + ) + + @app.get("/api/v1/devices", response_model=List[DeviceOut], dependencies=[Depends(require_token)]) + def list_devices_api() -> List[DeviceOut]: + devices = registry.list_devices() + return [ + DeviceOut( + name=d.name, + host=d.host, + port=d.port, + enabled=d.enabled, + scrape_interval_seconds=d.scrape_interval_seconds, + supports_xpath=d.supports_xpath, + source=d.source, + ) + for d in devices + ] + + @app.post( + "/api/v1/devices", + response_model=DeviceOut, + status_code=status.HTTP_201_CREATED, + dependencies=[Depends(require_token)], + ) + def create_device_api(device: DeviceIn) -> DeviceOut: + # 检查是否已有同名 runtime 设备 + runtime_devices = {d.name: d for d in store.load_runtime_devices()} + if device.name in runtime_devices: + raise HTTPException( + status_code=status.HTTP_409_CONFLICT, + detail="Runtime device already exists", + ) + + cfg = DeviceConfig( + name=device.name, + host=device.host, + port=device.port, + username=device.username, + password=device.password, + enabled=device.enabled, + scrape_interval_seconds=device.scrape_interval_seconds, + supports_xpath=device.supports_xpath, + source="runtime", + ) + # 持久化并注册到 registry + try: + store.save_device(cfg) + except sqlite3.OperationalError as exc: # type: ignore[name-defined] + raise HTTPException( + status_code=status.HTTP_503_SERVICE_UNAVAILABLE, + detail=str(exc), + ) from exc + + registry.register_runtime_device(cfg) + + return DeviceOut( + name=cfg.name, + host=cfg.host, + port=cfg.port, + enabled=cfg.enabled, + scrape_interval_seconds=cfg.scrape_interval_seconds, + supports_xpath=cfg.supports_xpath, + source=cfg.source, + ) + + @app.delete( + "/api/v1/devices/{name}", + status_code=status.HTTP_204_NO_CONTENT, + dependencies=[Depends(require_token)], + ) + def delete_device_api(name: str): + # 判断是不是静态设备 + devices = {d.name: d for d in registry.list_devices()} + existing = devices.get(name) + if existing is not None and existing.source == "static": + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail="Cannot delete static device", + ) + + # 删除 runtime 设备 + try: + store.delete_device(name) + except sqlite3.OperationalError as exc: # type: ignore[name-defined] + raise HTTPException( + status_code=status.HTTP_503_SERVICE_UNAVAILABLE, + detail=str(exc), + ) from exc + + registry.delete_runtime_device(name) + return JSONResponse(status_code=status.HTTP_204_NO_CONTENT, content=None) + + return app + diff --git a/src/exporter/config.py b/src/exporter/config.py new file mode 100644 index 0000000..75936a0 --- /dev/null +++ b/src/exporter/config.py @@ -0,0 +1,131 @@ +from __future__ import annotations + +import base64 +import dataclasses +import warnings +from dataclasses import dataclass, field +from pathlib import Path +from typing import Any, List, Optional + +import yaml + + +@dataclass +class GlobalConfig: + http_listen: str = "0.0.0.0:9100" + scrape_interval_seconds: int = 60 + netconf_port: int = 830 + connect_timeout_seconds: int = 5 + rpc_timeout_seconds: int = 10 + max_workers: int = 10 + + api_token: str = "changeme" + + runtime_db_path: str = "./devices.db" + password_secret: str = "" + + ssh_keepalive_seconds: int = 30 + failure_threshold: int = 3 + max_backoff_factor: int = 8 + shutdown_timeout_seconds: int = 30 + + log_level: str = "INFO" + log_to_stdout: bool = True + log_file: str = "" + log_file_max_bytes: int = 10 * 1024 * 1024 + log_file_backup_count: int = 5 + + hostkey_verify: bool = False + known_hosts_path: Optional[str] = None + + +@dataclass +class DeviceConfig: + name: str + host: str + port: int + username: str + password: str + enabled: bool = True + scrape_interval_seconds: Optional[int] = None + supports_xpath: bool = False + source: str = "static" # "static" | "runtime" + + +@dataclass +class Config: + global_: GlobalConfig = field(default_factory=GlobalConfig) + devices: List[DeviceConfig] = field(default_factory=list) + + # ---- 工厂方法 ---- + + @classmethod + def from_file(cls, path: str | Path) -> "Config": + with open(path, "r", encoding="utf-8") as f: + data = yaml.safe_load(f) or {} + return cls.from_dict(data) + + @classmethod + def from_dict(cls, data: dict[str, Any]) -> "Config": + global_cfg = cls._load_global(data.get("global", {})) + devices_cfg = cls._load_devices(data.get("devices", [])) + + cfg = cls(global_=global_cfg, devices=devices_cfg) + cfg._validate_timing() + return cfg + + # ---- 解析 helpers ---- + + @staticmethod + def _load_global(raw: dict[str, Any]) -> GlobalConfig: + gc = GlobalConfig() + # 简单字段赋值 + for field_ in dataclasses.fields(GlobalConfig): + if field_.name in raw: + setattr(gc, field_.name, raw[field_.name]) + + # 校验 Fernet key 格式(32-byte URL-safe base64) + if not gc.password_secret: + raise ValueError("global.password_secret must be configured") + try: + decoded = base64.urlsafe_b64decode(gc.password_secret.encode("utf-8")) + except Exception as exc: # noqa: BLE001 + raise ValueError("Invalid Fernet key in global.password_secret") from exc + if len(decoded) != 32: + raise ValueError("Invalid Fernet key length in global.password_secret") + + return gc + + @staticmethod + def _load_devices(raw_list: list[dict[str, Any]]) -> List[DeviceConfig]: + devices: List[DeviceConfig] = [] + for raw in raw_list: + dev = DeviceConfig( + name=str(raw["name"]), + host=str(raw["host"]), + port=int(raw.get("port", 830)), + username=str(raw["username"]), + password=str(raw["password"]), + enabled=bool(raw.get("enabled", True)), + scrape_interval_seconds=raw.get("scrape_interval_seconds"), + supports_xpath=bool(raw.get("supports_xpath", False)), + source="static", + ) + devices.append(dev) + return devices + + # ---- 校验逻辑 ---- + + def _validate_timing(self) -> None: + """对 shutdown_timeout 与 interval/rpc_timeout 做基本合理性检查。""" + g = self.global_ + min_needed = g.scrape_interval_seconds + g.rpc_timeout_seconds + if g.shutdown_timeout_seconds < min_needed: + warnings.warn( + "global.shutdown_timeout_seconds is smaller than " + "scrape_interval_seconds + rpc_timeout_seconds; " + "shutdown may terminate scraper before RPCs finish.", + UserWarning, + stacklevel=2, + ) + diff --git a/src/exporter/connection.py b/src/exporter/connection.py new file mode 100644 index 0000000..232a937 --- /dev/null +++ b/src/exporter/connection.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +import threading +import time +from dataclasses import dataclass +from typing import Dict, Optional + +import ncclient.manager + +from .config import DeviceConfig, GlobalConfig + + +@dataclass +class NetconfSessionEntry: + manager: ncclient.manager.Manager + last_used_at: float + valid: bool = True + + +class ConnectionManager: + """管理 per-device NETCONF 会话,并启用 SSH keepalive.""" + + def __init__(self, global_cfg: GlobalConfig) -> None: + self._global_cfg = global_cfg + self._sessions: Dict[str, NetconfSessionEntry] = {} + self._lock = threading.RLock() + + def acquire_session(self, cfg: DeviceConfig) -> ncclient.manager.Manager: + """获取或建立对应设备的 NETCONF 会话.""" + name = cfg.name + with self._lock: + entry = self._sessions.get(name) + if entry is not None and entry.valid: + entry.last_used_at = time.time() + return entry.manager + + # 新建会话 + mgr = ncclient.manager.connect( + host=cfg.host, + port=cfg.port, + username=cfg.username, + password=cfg.password, + hostkey_verify=self._global_cfg.hostkey_verify, + # timeout: SSH 连接超时(秒) + timeout=self._global_cfg.connect_timeout_seconds, + allow_agent=False, + look_for_keys=False, + ) + # 设置 RPC 调用的超时时间(ncclient Manager 的 timeout 属性) + try: + mgr.timeout = self._global_cfg.rpc_timeout_seconds # type: ignore[attr-defined] + except Exception: # noqa: BLE001 + # 某些 ncclient 版本可能不支持此属性,忽略即可 + pass + self._enable_ssh_keepalive(mgr, self._global_cfg.ssh_keepalive_seconds) + entry = NetconfSessionEntry(manager=mgr, last_used_at=time.time(), valid=True) + self._sessions[name] = entry + return mgr + + def mark_session_invalid(self, device_name: str) -> None: + """标记设备会话为无效,下一次获取时会重建.""" + with self._lock: + entry = self._sessions.get(device_name) + if entry is not None: + entry.valid = False + try: + entry.manager.close_session() + except Exception: # noqa: BLE001 + pass + + def close_all(self) -> None: + """关闭所有会话.""" + with self._lock: + for entry in self._sessions.values(): + try: + entry.manager.close_session() + except Exception: # noqa: BLE001 + pass + self._sessions.clear() + + @staticmethod + def _enable_ssh_keepalive(manager: ncclient.manager.Manager, interval: int) -> None: + """在底层 paramiko Transport 上启用 SSH keepalive.""" + transport = getattr(manager, "transport", None) or getattr( + getattr(manager, "_session", None), "_transport", None + ) + if transport is not None and hasattr(transport, "set_keepalive"): + transport.set_keepalive(interval) diff --git a/src/exporter/errors.py b/src/exporter/errors.py new file mode 100644 index 0000000..613f1a0 --- /dev/null +++ b/src/exporter/errors.py @@ -0,0 +1,44 @@ +from __future__ import annotations + +import xml.etree.ElementTree as ET +from typing import Any + +import paramiko +from ncclient.operations.errors import TimeoutExpiredError + + +def classify_error(exc: Exception) -> str: + """ + 将异常映射为设计中定义的 error_type 字符串. + + 约定的 error_type: + - SSHError + - SessionCloseError + - TimeoutError + - AuthenticationError + - XMLParseError + - FilterError + - UnknownError + """ + if isinstance(exc, paramiko.SSHException): + return "SSHError" + # ncclient 的 RPC 超时错误 + if isinstance(exc, TimeoutExpiredError): + return "TimeoutError" + if isinstance(exc, TimeoutError): + return "TimeoutError" + if isinstance(exc, ET.ParseError): + return "XMLParseError" + # 认证相关异常可以按需扩展,这里简单用 PermissionError 代表 + if isinstance(exc, PermissionError): + return "AuthenticationError" + + msg = str(exc) + if "filter" in msg.lower(): + return "FilterError" + + # ncclient 会话关闭错误可能是自定义异常;简单通过名称匹配 + if exc.__class__.__name__ in {"SessionCloseError", "SessionError"}: + return "SessionCloseError" + + return "UnknownError" diff --git a/src/exporter/logging_utils.py b/src/exporter/logging_utils.py new file mode 100644 index 0000000..cfcc75a --- /dev/null +++ b/src/exporter/logging_utils.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +import logging +import logging.handlers +import sys +from typing import Any, Mapping, MutableMapping, Optional + +from .config import GlobalConfig + + +class DeviceLoggerAdapter(logging.LoggerAdapter): + """ + 为日志记录注入 device 字段的 LoggerAdapter。 + + - 如果 extra 中包含 device,则使用该值; + - 否则使用 "-" 作为默认值,确保 formatter 中的 %(device)s 始终有值。 + """ + + def process(self, msg: str, kwargs: MutableMapping[str, Any]) -> tuple[str, MutableMapping[str, Any]]: + extra: MutableMapping[str, Any] = kwargs.setdefault("extra", {}) + # 以 Adapter 自身的 extra 为基础,必要时填充 device + device = extra.get("device", self.extra.get("device", "-")) + extra["device"] = device or "-" + return msg, kwargs + + +class DeviceFieldFilter(logging.Filter): + """ + 确保每条日志记录都有 device 字段,避免 formatter 中 %(device)s 抛 KeyError。 + + - 若 record 上不存在 device 属性,则填充为 "-"; + - 总是返回 True,不会过滤掉任何记录。 + """ + + def filter(self, record: logging.LogRecord) -> bool: # type: ignore[override] + if not hasattr(record, "device"): + record.device = "-" # type: ignore[attr-defined] + return True + + +def init_logging(global_cfg: GlobalConfig) -> None: + """ + 根据 GlobalConfig 初始化根 logger。 + + - 设置日志级别; + - 根据 log_to_stdout / log_file 添加 handler; + - 使用统一的格式与时间格式(ISO8601)。 + """ + root = logging.getLogger() + + # 清理现有 handler,避免重复添加 + for handler in list(root.handlers): + root.removeHandler(handler) + + level_name = (global_cfg.log_level or "INFO").upper() + level = getattr(logging, level_name, logging.INFO) + root.setLevel(level) + + fmt = "%(asctime)s %(levelname)s [%(name)s] device=%(device)s %(message)s" + datefmt = "%Y-%m-%dT%H:%M:%S%z" + formatter = logging.Formatter(fmt=fmt, datefmt=datefmt) + + # 为所有 handler 共享一个 DeviceFieldFilter 实例 + device_filter = DeviceFieldFilter() + + if global_cfg.log_to_stdout: + stream_handler = logging.StreamHandler(sys.stdout) + stream_handler.setFormatter(formatter) + stream_handler.addFilter(device_filter) + root.addHandler(stream_handler) + + if global_cfg.log_file: + file_handler = logging.handlers.RotatingFileHandler( + global_cfg.log_file, + maxBytes=global_cfg.log_file_max_bytes, + backupCount=global_cfg.log_file_backup_count, + encoding="utf-8", + ) + file_handler.setFormatter(formatter) + file_handler.addFilter(device_filter) + root.addHandler(file_handler) diff --git a/src/exporter/main.py b/src/exporter/main.py new file mode 100644 index 0000000..fafb585 --- /dev/null +++ b/src/exporter/main.py @@ -0,0 +1,170 @@ +from __future__ import annotations + +import argparse +import asyncio +import logging +import threading +from typing import Dict, List, Tuple + +import uvicorn + +from .api import create_app +from .config import Config +from .connection import ConnectionManager +from .logging_utils import init_logging +from .metrics import TransceiverCollector +from .models import DeviceHealthState, DeviceMetricsSnapshot +from .scraper import scraper_loop +from .sqlite_store import PasswordEncryptor, SQLiteDeviceStore +from .registry import DeviceRegistry + +logger = logging.getLogger(__name__) + + +def _parse_http_listen(http_listen: str) -> Tuple[str, int]: + """解析 global.http_listen 字符串为 (host, port).""" + if ":" not in http_listen: + raise ValueError(f"Invalid http_listen value: {http_listen!r}") + host, port_str = http_listen.rsplit(":", 1) + if not host: + host = "0.0.0.0" + try: + port = int(port_str) + except ValueError as exc: # noqa: BLE001 + raise ValueError(f"Invalid port in http_listen: {http_listen!r}") from exc + return host, port + + +def _build_arg_parser() -> argparse.ArgumentParser: + parser = argparse.ArgumentParser(description="NETCONF Transceiver Exporter") + parser.add_argument( + "--config", + dest="config_path", + default="config.yaml", + help="Path to configuration YAML file", + ) + parser.add_argument( + "--log-level", + dest="log_level", + default=None, + help="Override log level from config (e.g. INFO, DEBUG)", + ) + return parser + + +def _netconf_get_rpc(manager, filter_xml: str) -> str: + """ + 默认 NETCONF RPC 调用封装。 + + - 使用 subtree filter; + - 返回 rpc-reply 的 XML 字符串表示。 + """ + reply = manager.get(filter=("subtree", filter_xml)) + return str(reply) + + +async def async_main(argv: List[str] | None = None) -> None: + """ + 应用入口(异步部分): + + - 解析 CLI 参数并加载配置; + - 初始化日志、SQLite、Registry、ConnectionManager、Collector 与 FastAPI 应用; + - 启动 Scraper 线程与 Uvicorn Server; + - 在 server 结束后触发 Scraper 优雅退出并关闭资源。 + """ + parser = _build_arg_parser() + args = parser.parse_args(argv) + + cfg = Config.from_file(args.config_path) + if args.log_level: + cfg.global_.log_level = args.log_level + + # 初始化日志 + init_logging(cfg.global_) + logger.info("Starting NETCONF Transceiver Exporter") + + # 初始化加密与 SQLite + encryptor = PasswordEncryptor(cfg.global_.password_secret) + store = SQLiteDeviceStore(cfg.global_.runtime_db_path, encryptor) + store.init_db() + + # 初始化 Registry:先注册静态设备,再加载并注册 runtime 设备 + registry = DeviceRegistry(global_scrape_interval=cfg.global_.scrape_interval_seconds) + for dev in cfg.devices: + registry.register_static_device(dev) + for dev in store.load_runtime_devices(): + registry.register_runtime_device(dev) + + # Metrics cache & health state + metrics_cache: Dict[str, DeviceMetricsSnapshot] = {} + health_state: Dict[str, DeviceHealthState] = {} + collector = TransceiverCollector(metrics_cache, health_state) + + # Connection manager + connection_manager = ConnectionManager(cfg.global_) + + # FastAPI 应用 + app = create_app(registry, store, collector, cfg.global_) + + host, port = _parse_http_listen(cfg.global_.http_listen) + uv_config = uvicorn.Config( + app, + host=host, + port=port, + log_level=cfg.global_.log_level.lower(), + ) + server = uvicorn.Server(uv_config) + + stop_event = threading.Event() + + scraper_thread = threading.Thread( + target=scraper_loop, + args=( + stop_event, + registry, + connection_manager, + _netconf_get_rpc, + metrics_cache, + health_state, + cfg.global_, + ), + daemon=True, + name="netconf-scraper", + ) + scraper_thread.start() + + try: + await server.serve() + finally: + # 触发 Scraper 退出并等待其在超时时间内结束 + stop_event.set() + scraper_thread.join(timeout=cfg.global_.shutdown_timeout_seconds) + if scraper_thread.is_alive(): + logger.error( + "Scraper thread did not stop gracefully within timeout=%s seconds", + cfg.global_.shutdown_timeout_seconds, + ) + + # 关闭所有 NETCONF 连接与 SQLite 存储 + try: + connection_manager.close_all() + except Exception as exc: # noqa: BLE001 + logger.error("Error closing NETCONF connections: %s", exc) + + try: + store.close() + except Exception as exc: # noqa: BLE001 + logger.error("Error closing SQLite store: %s", exc) + + +def main() -> None: + """同步入口,供 `python -m exporter.main` 或命令行使用。""" + try: + asyncio.run(async_main()) + except KeyboardInterrupt: + # 优雅退出:忽略 Ctrl+C 引发的 traceback + pass + + +if __name__ == "__main__": # pragma: no cover + main() diff --git a/src/exporter/metrics.py b/src/exporter/metrics.py new file mode 100644 index 0000000..5d38b81 --- /dev/null +++ b/src/exporter/metrics.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +from typing import Dict, Iterable, List + +from prometheus_client.core import CounterMetricFamily, GaugeMetricFamily, InfoMetricFamily + +from .models import DeviceHealthState, DeviceMetricsSnapshot + + +class TransceiverCollector: + """ + 自定义 Collector,基于 MetricsCache 与 HealthState 输出所有指标。 + """ + + def __init__( + self, + cache: Dict[str, DeviceMetricsSnapshot], + health: Dict[str, DeviceHealthState], + ) -> None: + self._cache = cache + self._health = health + + def collect(self) -> Iterable: + # 复制快照,避免长时间持锁(由调用方负责线程安全) + cache_items = list(self._cache.items()) + health_items = list(self._health.items()) + + # 健康指标 + scrape_duration = GaugeMetricFamily( + "netconf_scrape_duration_seconds", + "Duration of last NETCONF scrape per device", + labels=["device"], + ) + scrape_success = GaugeMetricFamily( + "netconf_scrape_success", + "Whether last NETCONF scrape succeeded (1) or failed (0)", + labels=["device"], + ) + last_scrape_ts = GaugeMetricFamily( + "netconf_last_scrape_timestamp_seconds", + "Timestamp of last NETCONF scrape per device", + labels=["device"], + ) + staleness = GaugeMetricFamily( + "transceiver_data_staleness_seconds", + "Age of last successful transceiver scrape per device", + labels=["device"], + ) + errors_total = CounterMetricFamily( + "netconf_scrape_errors_total", + "Total number of NETCONF scrape errors by device and type", + labels=["device", "error_type"], + ) + + # health map for quick lookup + health_map = dict(health_items) + + # 填充健康指标 + for device, hs in health_items: + if hs.last_scrape_duration is not None: + scrape_duration.add_metric([device], hs.last_scrape_duration) + if hs.last_scrape_success is not None: + scrape_success.add_metric([device], 1.0 if hs.last_scrape_success else 0.0) + if hs.last_scrape_timestamp is not None: + last_scrape_ts.add_metric([device], hs.last_scrape_timestamp) + if hs.last_error_type: + errors_total.add_metric([device, hs.last_error_type], 1.0) + + # 业务指标 + tx_temp = GaugeMetricFamily( + "transceiver_temperature_celsius", + "Transceiver temperature in degrees Celsius", + labels=["device", "port", "component_name"], + ) + tx_supply_v = GaugeMetricFamily( + "transceiver_supply_voltage_volts", + "Transceiver supply voltage", + labels=["device", "port", "component_name"], + ) + tx_present = GaugeMetricFamily( + "transceiver_present", + "Transceiver present state (1 present, 0 otherwise)", + labels=["device", "port", "component_name"], + ) + + ch_rx_power = GaugeMetricFamily( + "transceiver_channel_rx_power_dbm", + "Receive optical power per channel (dBm)", + labels=["device", "port", "channel", "component_name"], + ) + ch_tx_power = GaugeMetricFamily( + "transceiver_channel_tx_power_dbm", + "Transmit optical power per channel (dBm)", + labels=["device", "port", "channel", "component_name"], + ) + ch_bias = GaugeMetricFamily( + "transceiver_channel_bias_current_ma", + "Laser bias current per channel (mA)", + labels=["device", "port", "channel", "component_name"], + ) + ch_laser_temp = GaugeMetricFamily( + "transceiver_channel_laser_temperature_celsius", + "Laser temperature per channel (Celsius)", + labels=["device", "port", "channel", "component_name"], + ) + + tx_info = InfoMetricFamily( + "transceiver_info", + "Transceiver static information", + labels=["device", "port", "component_name", "vendor", "serial", "form_factor", "part_number", "hardware_rev"], + ) + ch_info = InfoMetricFamily( + "transceiver_channel_info", + "Transceiver channel info", + labels=["device", "port", "channel", "channel_index", "component_name"], + ) + + # 为 last_scrape_success==True 的设备导出业务指标 + for device, snapshot in cache_items: + hs = health_map.get(device) + if not hs or not hs.last_scrape_success: + continue + + # transceiver 指标 + for t in snapshot.transceivers: + labels = [t.device, t.logical_port, t.component_name] + if t.temperature_c is not None: + tx_temp.add_metric(labels, t.temperature_c) + if t.supply_voltage_v is not None: + tx_supply_v.add_metric(labels, t.supply_voltage_v) + if t.present is not None: + present_val = 1.0 if t.present.upper() == "PRESENT" else 0.0 + tx_present.add_metric(labels, present_val) + + # Info + info_labels = [ + t.device, + t.logical_port, + t.component_name, + t.vendor or "", + t.serial or "", + "", # form_factor 留空占位 + t.part_number or "", + t.hardware_rev or "", + ] + tx_info.add_metric(info_labels, {}) + + # channel 指标 + for ch in snapshot.channels: + labels = [ch.device, ch.logical_port, ch.logical_channel, ch.component_name] + if ch.rx_power_dbm is not None: + ch_rx_power.add_metric(labels, ch.rx_power_dbm) + if ch.tx_power_dbm is not None: + ch_tx_power.add_metric(labels, ch.tx_power_dbm) + if ch.bias_current_ma is not None: + ch_bias.add_metric(labels, ch.bias_current_ma) + if ch.laser_temperature_c is not None: + ch_laser_temp.add_metric(labels, ch.laser_temperature_c) + + ch_info.add_metric( + [ + ch.device, + ch.logical_port, + ch.logical_channel, + str(ch.channel_index), + ch.component_name, + ], + {}, + ) + + # 依次 yield 所有指标 + yield scrape_duration + yield scrape_success + yield last_scrape_ts + yield staleness + yield errors_total + + yield tx_temp + yield tx_supply_v + yield tx_present + yield ch_rx_power + yield ch_tx_power + yield ch_bias + yield ch_laser_temp + yield tx_info + yield ch_info + diff --git a/src/exporter/models.py b/src/exporter/models.py new file mode 100644 index 0000000..5c57d50 --- /dev/null +++ b/src/exporter/models.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +import dataclasses +from dataclasses import dataclass +from typing import Optional, Tuple + + +@dataclass(frozen=True) +class TransceiverRecord: + device: str + component_name: str + logical_port: str + present: Optional[str] = None + oper_status: Optional[str] = None + temperature_c: Optional[float] = None + supply_voltage_v: Optional[float] = None + vendor: Optional[str] = None + serial: Optional[str] = None + part_number: Optional[str] = None + hardware_rev: Optional[str] = None + + +@dataclass(frozen=True) +class TransceiverChannelRecord: + device: str + component_name: str + logical_port: str + channel_index: int + logical_channel: str + rx_power_dbm: Optional[float] = None + tx_power_dbm: Optional[float] = None + bias_current_ma: Optional[float] = None + laser_temperature_c: Optional[float] = None + + +@dataclass(frozen=True) +class DeviceMetricsSnapshot: + device: str + collected_at: float + transceivers: Tuple[TransceiverRecord, ...] + channels: Tuple[TransceiverChannelRecord, ...] + + +@dataclass +class DeviceHealthState: + last_scrape_success: Optional[bool] = None + last_scrape_duration: Optional[float] = None + last_scrape_timestamp: Optional[float] = None + last_error_type: Optional[str] = None + consecutive_failures: int = 0 + + +INT32_MAX = 2147483647 + + +def is_invalid_value(value: Optional[float]) -> bool: + """ + Determine whether a parsed numeric value should be treated as invalid. + + Per设计 v9: 精确匹配 INT32_MAX 即视为无效。 + """ + if value is None: + return False + try: + return int(value) == INT32_MAX + except (ValueError, TypeError, OverflowError): + return False + diff --git a/src/exporter/netconf_client.py b/src/exporter/netconf_client.py new file mode 100644 index 0000000..1197418 --- /dev/null +++ b/src/exporter/netconf_client.py @@ -0,0 +1,226 @@ +from __future__ import annotations + +import xml.etree.ElementTree as ET +from typing import Iterable, List, Tuple + +from .models import ( + TransceiverChannelRecord, + TransceiverRecord, + is_invalid_value, +) + +NS = { + "oc-platform": "http://openconfig.net/yang/platform", + "oc-transceiver": "http://openconfig.net/yang/platform/transceiver", +} + + +def build_transceiver_filter() -> str: + """ + 构造 subtree filter 的 XML 片段(不包含外层 元素), + 用于一次性获取所有包含 transceiver 的 component 及其 state。 + """ + return ( + '' + "" + '' + "" + "" + "" + ) + + +def parse_port_and_channel( + description: str | None, + component_name: str, + channel_index: int, +) -> Tuple[str, str]: + """ + 从 description 中解析 (logical_port, logical_channel),并在异常时提供安全 fallback。 + - 正常格式: "1/0/66:1" -> ("1/0/66", "1/0/66:1") + - description 为空/缺失: 使用 (component_name, f"{component_name}:ch{index}") + - 其他格式: logical_port = description; logical_channel = f"{description}:ch{index}" + """ + if not description: + logical_port = component_name + logical_channel = f"{component_name}:ch{channel_index}" + return logical_port, logical_channel + try: + if ":" in description: + port, _ = description.split(":", 1) + logical_port = port or component_name + logical_channel = description + else: + logical_port = description + logical_channel = f"{description}:ch{channel_index}" + return logical_port, logical_channel + except Exception: + logical_port = component_name + logical_channel = f"{component_name}:ch{channel_index}" + return logical_port, logical_channel + + +def _get_text(elem: ET.Element | None) -> str | None: + if elem is None: + return None + text = (elem.text or "").strip() + return text or None + + +def _parse_float(elem: ET.Element | None) -> float | None: + text = _get_text(elem) + if text is None: + return None + try: + value = float(text) + except ValueError: + return None + if is_invalid_value(value): + return None + return value + + +def parse_netconf_response( + xml_str: str, + device_name: str, +) -> Tuple[List[TransceiverRecord], List[TransceiverChannelRecord]]: + """ + 解析 NETCONF `` RPC 返回的 XML,生成 transceiver 与 channel 记录。 + """ + root = ET.fromstring(xml_str) + + tx_records: List[TransceiverRecord] = [] + ch_records: List[TransceiverChannelRecord] = [] + + components_path = ".//oc-platform:components/oc-platform:component" + for comp in root.findall(components_path, NS): + name_elem = comp.find("oc-platform:name", NS) + component_name = _get_text(name_elem) or "" + + # 类型检查:只保留 TRANSCEIVER + type_elem = comp.find("oc-platform:state/oc-platform:type", NS) + comp_type = _get_text(type_elem) + if comp_type and "TRANSCEIVER" not in comp_type: + continue + + # transceiver state + tx_state = comp.find( + "oc-transceiver:transceiver/oc-transceiver:state", NS + ) + + present = _get_text( + tx_state.find("oc-transceiver:present", NS) if tx_state is not None else None + ) + vendor = _get_text( + tx_state.find("oc-transceiver:vendor", NS) if tx_state is not None else None + ) + serial = _get_text( + tx_state.find("oc-transceiver:serial-no", NS) if tx_state is not None else None + ) + part_number = _get_text( + tx_state.find("oc-transceiver:vendor-part", NS) if tx_state is not None else None + ) + hardware_rev = _get_text( + tx_state.find("oc-transceiver:hardware-version", NS) if tx_state is not None else None + ) + + oper_status = _get_text(comp.find("oc-platform:state/oc-platform:oper-status", NS)) + + # 组件温度 + temp_elem = comp.find( + "oc-platform:state/oc-platform:temperature/oc-platform:instant", + NS, + ) + temperature_c = _parse_float(temp_elem) + + # 电压(transceiver state 下) + voltage_elem = None + if tx_state is not None: + voltage_elem = ( + tx_state.find("oc-transceiver:voltage/oc-transceiver:instant", NS) + or tx_state.find("oc-transceiver:supply-voltage/oc-transceiver:instant", NS) + ) + supply_voltage_v = _parse_float(voltage_elem) + + # 遍历 channel + channels_path = ( + "oc-transceiver:transceiver/oc-transceiver:physical-channels/" + "oc-transceiver:channel" + ) + channel_elems: Iterable[ET.Element] = comp.findall(channels_path, NS) + + # logical_port 以第一个 channel 的 description 为主,fallback 到 component_name + logical_port_for_tx: str | None = None + + for ch in channel_elems: + idx_elem = ch.find("oc-transceiver:index", NS) + idx_text = _get_text(idx_elem) + try: + ch_index = int(idx_text) if idx_text is not None else 0 + except ValueError: + ch_index = 0 + + desc_elem = ch.find("oc-transceiver:state/oc-transceiver:description", NS) + description = _get_text(desc_elem) + logical_port, logical_channel = parse_port_and_channel( + description, component_name, ch_index + ) + if logical_port_for_tx is None: + logical_port_for_tx = logical_port + + state = ch.find("oc-transceiver:state", NS) + rx_power_dbm = _parse_float( + state.find("oc-transceiver:input-power/oc-transceiver:instant", NS) + if state is not None + else None + ) + tx_power_dbm = _parse_float( + state.find("oc-transceiver:output-power/oc-transceiver:instant", NS) + if state is not None + else None + ) + bias_current_ma = _parse_float( + state.find("oc-transceiver:laser-bias-current/oc-transceiver:instant", NS) + if state is not None + else None + ) + laser_temperature_c = _parse_float( + state.find("oc-transceiver:laser-temperature/oc-transceiver:instant", NS) + if state is not None + else None + ) + + ch_records.append( + TransceiverChannelRecord( + device=device_name, + component_name=component_name, + logical_port=logical_port, + channel_index=ch_index, + logical_channel=logical_channel, + rx_power_dbm=rx_power_dbm, + tx_power_dbm=tx_power_dbm, + bias_current_ma=bias_current_ma, + laser_temperature_c=laser_temperature_c, + ) + ) + + # transceiver record(逻辑端口) + logical_port_tx = logical_port_for_tx or component_name + + tx_records.append( + TransceiverRecord( + device=device_name, + component_name=component_name, + logical_port=logical_port_tx, + present=present, + oper_status=oper_status, + temperature_c=temperature_c, + supply_voltage_v=supply_voltage_v, + vendor=vendor, + serial=serial, + part_number=part_number, + hardware_rev=hardware_rev, + ) + ) + + return tx_records, ch_records diff --git a/src/exporter/registry.py b/src/exporter/registry.py new file mode 100644 index 0000000..d276f7f --- /dev/null +++ b/src/exporter/registry.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +import threading +import time +from dataclasses import dataclass, field +from typing import Dict, List + +from .config import DeviceConfig + + +@dataclass +class DeviceRuntimeState: + cfg: DeviceConfig + next_scrape_at: float + consecutive_failures: int = 0 + backoff_factor: int = 1 + + +class DeviceRegistry: + """维护设备配置与运行时调度状态.""" + + def __init__(self, global_scrape_interval: int = 60) -> None: + self._lock = threading.RLock() + self._states: Dict[str, DeviceRuntimeState] = {} + self._global_scrape_interval = global_scrape_interval + + # --- 注册与删除 --- + + def register_static_device(self, cfg: DeviceConfig) -> None: + self._register_device(cfg) + + def register_runtime_device(self, cfg: DeviceConfig) -> None: + cfg.source = "runtime" + self._register_device(cfg) + + def _register_device(self, cfg: DeviceConfig) -> None: + now = time.time() + with self._lock: + interval = cfg.scrape_interval_seconds or self._global_scrape_interval + state = DeviceRuntimeState( + cfg=cfg, + next_scrape_at=now, # 初始立即可采集 + ) + self._states[cfg.name] = state + + def delete_runtime_device(self, name: str) -> None: + with self._lock: + state = self._states.get(name) + if state is not None and state.cfg.source == "runtime": + del self._states[name] + + # --- 查询 --- + + def list_devices(self) -> List[DeviceConfig]: + with self._lock: + return [s.cfg for s in self._states.values()] + + def get_enabled_devices(self, now: float) -> List[DeviceRuntimeState]: + with self._lock: + return [ + s + for s in self._states.values() + if s.cfg.enabled and s.next_scrape_at <= now + ] + + # --- 调度更新 --- + + def update_after_scrape( + self, + device_name: str, + success: bool, + now: float, + scrape_interval: int, + failure_threshold: int, + max_backoff_factor: int, + ) -> None: + """Scraper 在单次采集后调用,更新运行状态.""" + with self._lock: + state = self._states.get(device_name) + if state is None: + return + + interval = state.cfg.scrape_interval_seconds or scrape_interval + + if success: + state.consecutive_failures = 0 + state.backoff_factor = 1 + state.next_scrape_at = now + interval + else: + state.consecutive_failures += 1 + if state.consecutive_failures >= failure_threshold: + state.backoff_factor = min( + max_backoff_factor, max(2, state.backoff_factor * 2) + ) + state.next_scrape_at = now + interval * state.backoff_factor + diff --git a/src/exporter/scraper.py b/src/exporter/scraper.py new file mode 100644 index 0000000..3f22c18 --- /dev/null +++ b/src/exporter/scraper.py @@ -0,0 +1,148 @@ +from __future__ import annotations + +import logging +import threading +import time +from typing import Dict + +from .config import DeviceConfig, GlobalConfig +from .errors import classify_error +from .models import DeviceHealthState, DeviceMetricsSnapshot +from .netconf_client import parse_netconf_response, build_transceiver_filter +from .registry import DeviceRegistry, DeviceRuntimeState +from .connection import ConnectionManager + + +logger = logging.getLogger(__name__) + + +def scraper_loop( + stop_event: threading.Event, + registry: DeviceRegistry, + connection_manager: ConnectionManager, + netconf_get_rpc, + cache: Dict[str, DeviceMetricsSnapshot], + health: Dict[str, DeviceHealthState], + global_cfg: GlobalConfig, +) -> None: + """ + Scraper 主循环。 + + - 使用固定 next_run 调度,避免时间漂移; + - 在等待期间通过 stop_event.wait() 支持快速退出。 + - netconf_get_rpc: 可调用对象,签名为 (manager, filter_xml) -> str(返回 rpc-reply XML 字符串)。 + """ + interval = global_cfg.scrape_interval_seconds + failure_threshold = global_cfg.failure_threshold + max_backoff = global_cfg.max_backoff_factor + + next_run = time.time() + while not stop_event.is_set(): + now = time.time() + if now >= next_run: + run_one_scrape_round( + now, + registry, + connection_manager, + netconf_get_rpc, + cache, + health, + global_cfg, + failure_threshold, + max_backoff, + ) + next_run += interval + + remaining = max(0.0, next_run - time.time()) + if stop_event.wait(timeout=remaining): + break + + +def run_one_scrape_round( + now: float, + registry: DeviceRegistry, + connection_manager: ConnectionManager, + netconf_get_rpc, + cache: Dict[str, DeviceMetricsSnapshot], + health: Dict[str, DeviceHealthState], + global_cfg: GlobalConfig, + failure_threshold: int, + max_backoff_factor: int, +) -> None: + """执行一轮对需要采集设备的采集.""" + devices = registry.get_enabled_devices(now) + for state in devices: + scrape_device( + now, + state, + registry, + connection_manager, + netconf_get_rpc, + cache, + health, + global_cfg, + failure_threshold, + max_backoff_factor, + ) + + +def scrape_device( + now: float, + state: DeviceRuntimeState, + registry: DeviceRegistry, + connection_manager: ConnectionManager, + netconf_get_rpc, + cache: Dict[str, DeviceMetricsSnapshot], + health: Dict[str, DeviceHealthState], + global_cfg: GlobalConfig, + failure_threshold: int, + max_backoff_factor: int, +) -> None: + """采集单台设备的指标,并更新 cache/health/registry.""" + device = state.cfg.name + start = time.time() + success = False + error_type = None + + if device not in health: + health[device] = DeviceHealthState() + + try: + mgr = connection_manager.acquire_session(state.cfg) + # 构造 filter 并调用外部提供的 RPC 函数 + flt = build_transceiver_filter() + xml_reply = netconf_get_rpc(mgr, flt) + tx_records, ch_records = parse_netconf_response(xml_reply, device) + + snapshot = DeviceMetricsSnapshot( + device=device, + collected_at=now, + transceivers=tuple(tx_records), + channels=tuple(ch_records), + ) + cache[device] = snapshot + success = True + except Exception as exc: # noqa: BLE001 + error_type = classify_error(exc) + # 记录异常以便排查(包括堆栈与 error_type) + logger.exception( + "NETCONF scrape failed for device %s (error_type=%s)", device, error_type + ) + # 标记会话失效,避免下次继续使用坏连接 + connection_manager.mark_session_invalid(device) + finally: + duration = time.time() - start + hs = health[device] + hs.last_scrape_success = success + hs.last_scrape_duration = duration + hs.last_scrape_timestamp = now + hs.last_error_type = error_type + + registry.update_after_scrape( + device_name=device, + success=success, + now=now, + scrape_interval=global_cfg.scrape_interval_seconds, + failure_threshold=failure_threshold, + max_backoff_factor=max_backoff_factor, + ) diff --git a/src/exporter/sqlite_store.py b/src/exporter/sqlite_store.py new file mode 100644 index 0000000..96c0ded --- /dev/null +++ b/src/exporter/sqlite_store.py @@ -0,0 +1,181 @@ +from __future__ import annotations + +import sqlite3 +import threading +import time +from dataclasses import dataclass, field +from typing import Callable, Iterable, List + +from cryptography.fernet import Fernet + +from .config import DeviceConfig + + +class PasswordEncryptor: + """对称加密/解密设备密码的封装.""" + + def __init__(self, secret: str) -> None: + """ + :param secret: Fernet key 字符串(32-byte URL-safe base64,长度 44) + """ + try: + key_bytes = secret.encode("utf-8") + self._fernet = Fernet(key_bytes) + except Exception as exc: # noqa: BLE001 + raise ValueError("Invalid Fernet key in password_secret") from exc + + def encrypt(self, password: str) -> bytes: + return self._fernet.encrypt(password.encode("utf-8")) + + def decrypt(self, cipher: bytes) -> str: + return self._fernet.decrypt(cipher).decode("utf-8") + + +@dataclass +class SQLiteDeviceStore: + """管理 runtime 设备持久化的 SQLite 存储.""" + + db_path: str + encryptor: PasswordEncryptor + timeout: float = 5.0 + lock: threading.Lock = field(default_factory=threading.Lock, repr=False) + + def init_db(self) -> None: + """初始化 DB:设置 WAL 模式并创建 devices 表.""" + conn = sqlite3.connect(self.db_path, timeout=self.timeout) + try: + conn.execute("PRAGMA journal_mode=WAL;") + conn.execute("PRAGMA foreign_keys=ON;") + conn.execute( + """ + CREATE TABLE IF NOT EXISTS devices ( + name TEXT PRIMARY KEY, + host TEXT NOT NULL, + port INTEGER NOT NULL, + username TEXT NOT NULL, + password_cipher BLOB NOT NULL, + enabled INTEGER NOT NULL, + scrape_interval_seconds INTEGER, + supports_xpath INTEGER NOT NULL DEFAULT 0, + created_at INTEGER NOT NULL, + updated_at INTEGER NOT NULL + ); + """ + ) + conn.commit() + finally: + conn.close() + + # internal helper + def _with_conn(self, fn: Callable[[sqlite3.Connection], object]) -> object: + conn = sqlite3.connect(self.db_path, timeout=self.timeout) + try: + conn.execute("PRAGMA foreign_keys=ON;") + return fn(conn) + finally: + conn.close() + + def save_device(self, cfg: DeviceConfig) -> None: + """保存或更新 runtime 设备.""" + cipher = self.encryptor.encrypt(cfg.password) + now_ts = int(time.time()) + + def _do(conn: sqlite3.Connection) -> None: + try: + conn.execute( + """ + INSERT OR REPLACE INTO devices ( + name, host, port, username, password_cipher, enabled, + scrape_interval_seconds, supports_xpath, + created_at, updated_at + ) VALUES ( + ?, ?, ?, ?, ?, ?, + ?, ?, + COALESCE( + (SELECT created_at FROM devices WHERE name=?), + ? + ), + ? + ); + """, + ( + cfg.name, + cfg.host, + cfg.port, + cfg.username, + cipher, + int(cfg.enabled), + cfg.scrape_interval_seconds, + int(cfg.supports_xpath), + cfg.name, + now_ts, + now_ts, + ), + ) + conn.commit() + except Exception: # noqa: BLE001 + conn.rollback() + raise + + # 串行化写入,避免并发竞争 + with self.lock: + self._with_conn(_do) + + def delete_device(self, name: str) -> None: + """删除 runtime 设备;不存在时静默忽略.""" + + def _do(conn: sqlite3.Connection) -> None: + try: + conn.execute("DELETE FROM devices WHERE name = ?", (name,)) + conn.commit() + except Exception: # noqa: BLE001 + conn.rollback() + raise + + with self.lock: + self._with_conn(_do) + + def load_runtime_devices(self) -> List[DeviceConfig]: + """加载所有 runtime 设备.""" + + def _do(conn: sqlite3.Connection) -> List[DeviceConfig]: + cur = conn.execute( + """ + SELECT + name, host, port, username, password_cipher, + enabled, scrape_interval_seconds, supports_xpath + FROM devices; + """ + ) + rows: Iterable[sqlite3.Row] = cur.fetchall() + devices: List[DeviceConfig] = [] + for ( + name, + host, + port, + username, + password_cipher, + enabled, + scrape_interval_seconds, + supports_xpath, + ) in rows: + password = self.encryptor.decrypt(password_cipher) + dev = DeviceConfig( + name=name, + host=host, + port=int(port), + username=username, + password=password, + enabled=bool(enabled), + scrape_interval_seconds=scrape_interval_seconds, + supports_xpath=bool(supports_xpath), + source="runtime", + ) + devices.append(dev) + return devices + + return self._with_conn(_do) # type: ignore[return-value] + + def close(self) -> None: + """兼容接口;当前使用短连接,每次操作后即关闭.""" + return diff --git a/tests/__pycache__/conftest.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/conftest.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..fa984d071f9243fc5d620e2cfc962fa1bb46ac9d GIT binary patch literal 1703 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 L7Gh&G1bYww;@H^9 literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_config.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_config.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..181447386ccb3266aabf2112a95112f6f1671b5e GIT binary patch literal 8753 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 literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_h3c_live_netconf.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_h3c_live_netconf.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c258c399dd0862af1a12069a20d14c7fff1de8ff GIT binary patch literal 5321 zcmX@j%ge>Uz`)=rrJ0$}%fRp$#DQTp2!ru+2_pl;bcPg$6viBeT*fFyMg~q0k12;K ziaCWLg(-(6mo=G*ks+5Yik%T6!x6;+mf?)z1k+qmTqz7G%sJe-JW)JQHM~*0DGVtr zIefYNQT$*r)*OLc!6?C8p(r6n1}277jx05Z8<5EqwiNc&Oc0SM5hjLIQJg9{QaE8M zS2IF&h~ZStmBI~E9VMP3kiyf#5+#9CH80G>3dUk~uxlk&L#$wkl1vdy5lZ1}VU3bX z<;^mK3L{Zj7DyZ@GetOszl8;EhHNF1rpQZ>oF?Nf?!>&j{F20y%>2A!KTXD4ECGon z8Jdi@*mD!}64O(QG?{KmB$a07q{NpLCFT_;r)HL=7R9G!=9Hus-4ZKEEGkZo&r2;y z&d*DWFG?*g$j>WIy(Qpb>>Tgs8shBl=N9kb9~@G}X=r4wXP{@GXNW2p;2#uni^ami z*Z@^LG}txh77xte(&E&jWRQbln1z9Xfti7U@v|Q|0fCYcM5+WDeGCk+K+Ix=$RLxj zpvZzIL}a-XMo9(+hFXRih7_hMZU%-FW-!SDBGJTHL1O7lwTva4FcY%Ci5|v-&?#&% zx70G#FuE|rdNVN8GS@I?@j~R0Ntnxu8GA%(n6vniey zq*fH@S0?7AC+B1;JlWCxd{)bgmRZl{ta-9y?Th7$pUs<~psQPuSX^A5UzB32uBWG` zuEzy7;>G@%&lYTd+Q0tE?xio=d!J8P@nr9Ur`tC@-`)RmRnLp{jW71MKcCg205kk) zf77$68{Y5fdC}1GWJmAQIV+xR?S8R->dW??=L^?7-!tv`g2t!o+nz6IeB96kv7vh@ z%q_i7*UkXx=$Q6w&Z=jf`<`}eP=LAW{hpqu9W!6-pYn9}yyq)-JzYEf`I==T4Fdy11H%_S1|ESa9Nl);xfL&RD_-VS zzRs3kFUW|UkOQ0ZX3#Vv3{SYo>MMC%!alkG0?D1P8&V^#XV$H2q)8I(nCi6EC`0gl1J z;r>A`$;==*Cj?##Lg;ugM+7^zmtCk`xOoa z5SyoyXF|#hmkBXfIFxSi3xD8X;Ng4L>`SFFFfk*fg10$>G4Staa96S)=5A2Mr zqQ5_|!PWgL24%o4DvnwV2emkz*q9F*GdgiH9Aag3Vq-qU#tdR}3OPwLqg1b;N(`K) zmoS6cXV|LO5|FRK$pV%xi&aYCX)=ogEQLa(Fd{1F*$gR62oq*Aq%hBAMWo#lc-n%c z!&-(Ccx9Qzhhi+4gD@FkYKZ_?ih+TlL4Bh|;VSbOQv{)I=EUJ%uW%h0`Wy_xS+1#F42amM>0bPCWfGExM60%=qAP#&I-m__FA?|PGtr| zhGNEYCQu2?$iT=jfw9LNQp#$Im2xve8*NYa?teaI#q&AypRSvy;9=~n@M7J*r%T!) zt*!TaW`P?`x(a#8$vK&+c_j)jn)g20(FalVboZ|3tGgATO?QPSduF{@KllBf*-$;W zIszJ+3eV=XylhwiYRMIsCY2PWrYb=C2ntW56`X~%|_b3rY-=es9An>Pp6oU7sic^&4F zUyN3zpy*ZrH7Wbozu31A)WXE5G2C9tF)%P_aun$?FfbJ9gNkzwP~RgjF*o%V2dsT_ zi!UR;xFkEZGQKReC^N0H$N;2}J259GzdSxMJvFc77H>{|es+9Xeo=gOYGv^)c4(Mr zGTvf?1dCr4ONMc>E~o>Rl3JFToEi_Zql#TsqoC4Av-lQsL8Z|x9;7Z;F+|P;B4=`o zBRL~6FE2HxxCm4nmYOgyFn~M^38`muRzU*m$?n}x_D)qmGDjb(PvP0r4bOVlRS9s} zB^DQ_7L_P~tTu-jZ>}j0uDNb;fSNy`4jhC9?ya#ERD#-rw^)j^GYg79Ey^NL7pn-A z#39Ncoi~tHSc~Zvb9!pYE#~5qq9RZoaf`>HpfVnmno2VBif^&yTQ6yM@$X zfMG}*LLC&qh^97D^u-qyB*!P_fg0OI#i>Q{3=9mQMpLmNBe-=fz`!FhhhvGx6>jZ2 z9DM!Uo!k?0mRKy%TH&}RV@1>j^RNpd;a4~!o^UB$=2B^Je!?lxFW)JDhgTGY1SRhX z%H9x{xgj8QLqzh1nDiGxPA;|&4BV`;AA}gVxNisuPG_CSIwNz1@C8}j39Od|^g3AY z2#HQeovhWt{#~4#RrZS%gPh3*_Y)>p0wPXSUGR*$A{%{?MXJGPg2qQS2G$tH4x0-s z(VaFkEUvReBcn?!(H%Arfy)Tyb(ZK$AmtDV2ziYq8m9X)f(emBCNHr>Urc0w{H`fKs3)6O`kZpO>mBcZ(}NKCQH*v?w(`z6jKHxWxfW`bFL# zO_K4Dbgu_VR+;&EdPS+_MVTe3w>aTKpw1##tOyk0x0v#ai^M>QQXOOhJE*IdlbHnW zU>3Q8gg9UYJUDmW5{Gr>^kBU^NbwKJz~D^DmY!OYnpalj3^FzmM7V$mcMt(;MHYF0 zSfCc|EtcHGqU>878OF)r&LB7)u4E`u0Vx1AD}Hg<lhdq zJ}@&fGTvoS`oJQ{$nsr{fswI=p_%hG1Lti9-n$GEk3po&bB2%)Yz#c29Y+0@ot76w z)mKPg<~D8MxXI1eQQ1+{U)foCK~j4~*kyhbu=ovb5rk5?%iIM$r#a3``vD(v8yB8AUHLihg2}VT@t?%*?Uz`zipqM6B}!octt#DQTJ2!rvn1tSB)bcPg$6viBeT*fFyMi84Rhbf9V zg&~D0hb5OanTe4hmo17ND#H=Q0hZy6;sn!NQCwh}JBk}j^F;B0Y2GN_6owS$9KKxs zD1NYBmK=dx!6?C8p(r6RpD9N;N*JtGBuXTOA%!(ZG*>K2jFBN#I7<)WK4db>0GS72 zr*NdOwXm#)a2TQ_iPwokr3ut1Br1g?g&koB+%D-#CQZ(lAa$CIx40AY^72a(OEUBG ziv2VhZ?OaGaWgWSz)3zY$ZxC-C0^N z7J|kvn8njx0ME3qhwS z)kvfN*Z83O9Wh%`?erY=Qw4r>(~14FH3idu?#jbtVxm?wou!ALfG zAbbg9)kwiig3(QkDIyh&wID27!B{I+!B{I%E1t*9$uNPj=VXdzidKqticX4dieQS~ z9JX5N6#W#o6oWZTwKCweXqaMzl-~Sc_8{mQX_!q}fe29;3z6<>WY!qN(g7k}r!PgS0ZVQDW)JjNa;#}YUxS<<{N_P3a&DbF+~B%)!5RNEX>pt zvpG!Q7?nfP5d;e@1f61DBQTpG#iB-NHWQ+pO0fi$rYTl6a?o@kPjtGFhq(Yo!_q~q zEK>YZQl2Q(D5O|}Yiq?6&05hK#Trp?tjgBN7Uv-O7JID9rZJ}2fb<|@6-f`aFja*4 zgn&ADUQMxuhP_gXU5b5;5;P2zi4H?$n2j(R8itA$jJ2}0qBROB4p9F)jzs^1%L^x1 z*g*5RO07_eJX#)~i4HS7*8UnPuCf8AB~7KffdpgKjmT{Ok_WL3(~p@t|61t`19$1WR+c$~?vt4!6 zNu)Y>?N7iwEtq*Jo^#m1wTM)TSBiIy6tpDMCb}fkhM5GTkxQ})##)UE##+q^##-@O zEkfDYj_d*&>I6-}$aEwgOP!a(X%Zh@r5H!r6j0|A?u?QI$D;}CYkSSk!fs$dfnVIl|`Rt|#Yv4sFDatK5+REi*MB@iq9;83L? zR`TS@370$;mFX5q zGg1?CN;0Z+6!a4dGWE+0^;1&IGLut_brke-Q%j06lZ%n`uj+ZRzVT&i@AJLuo^~yG zv3Kv|hQ{DPpUjd}g{K{JpDyoy+B5BOL!)DWr^1Wv>z_~A_+&?)LO@Y|ZfZ$JYH6{; zi+z)yw(oj2b<2~zlV48W_hS3{r~T`nPg(J}p$Y87UtCbz^-_|mxRdkq(lXQaDid>a zs`w3!%=HZP4D<}G3@r@}3|@i;)n0-|bZ>DaXC&sOr{<=vWWU9oQBqP6pOaZ!lA3o* zyg0ciu^=@*Gp{7Is4OujzBn~GKQE>DmT*x)a(qcAh9Il7JorvadCNmQ3^%nW)V!5Ux7gBi@{Ul+3*Jm!QGMTg=5p$+x%yB11g<{Q?|AJbp3h=KkVEiM(GN zy1I~H2wBN`i#fSGR!)W*)+~^@5CJ$@ z!&t*m!&Jju!C1`1$dJjfh7H!wWd!NKGOh|MjcVCy*s|bbtZ)Mv;PRmHNo*spY+3vW z)i4%JR}Fg_a}8^jAWR%V!&ERb1T!du+=f>TJm<3e6@k*>FHU%fXU_3rV0Z}{kzUDo ziyf3|@=HrrGTmZH%1^1h#h#Ixn37slypj`=QuUH^GE?(PZm~gWK2X+l&do?23rT3nEySDbo_r6@Hq1r+s(C8fo;xY9wH3vBEy*5sW0;?$KK zw^+dGlns>c@>7aH1Cm9cIfPp*pcHb8B{@GY4`fVn!7Y}Q#FE5f4h9AWQ27JGzr6G_ z@^e%5D@!YjK&63xad~D*az=bkVv;^+z&<}OEgqIg^-EHVONzl{Jjm$yRHIb5q+UVg zEnbK))E`wQAoXws5V_R6l=zbT_|&`On?vdW zzi@wbXZ3Y{&5Qh+E3`M19!R{vuX&l@ql4uG6C0=G4IY7hpH80{Vhco8xa?5hrF$T# z!{-W*#|>fe>%z(xg_SQ0t9H2D5Eh?qIni>mHH2wB(Ru;Pa{h(+_?-1;Y6C8I<0ZIEp%PF&yF&a*| z3VHb@3dJRfMI{QEc?zJUpvM&);^H3~V#W1~6U1~43bNv=Qh;kpt;j4%O;JcqEXt`= zD9CNmcm8g`|-KR${+A0kRe}ih7GFKYJzPFD6@CO~xuuRgHp5GtFYIYA8d& zRsqB^f(aRE7DI&$G>i4pQ%ksNH9!hXG>bL4Y87lD$}KgEZ?Qq@22Ivm%mtMOAi@Yl zn1Bc~5Mf!xpIBU+T2unI!O&2%_!dh+rJ><-NXB|#U&WJZl&T9U2XzgrxC||g^bGWj z^b8F$?U)%DZt=jUs5z@i+m z!uJ+?YF=VePHIY(Kw?2bPG)ieM@K+a(+&Mz%WPQAqrt+0M^!0PZ{$m&fs zi>tUm6^4F6PGV+W6;CoWs7fjeQdctGV#>_ZWULASc^l+{%shDXLJ}1yqM=F16qc$? zK~4p$Ge${O=9;g+zz!%bDS{+}5|GP4X`zZIsj?)sSfNJ2FF!98T#QzUg61%zi%W`h6pBlV zVxe-HhDD%C@D@*cYF=tlVo7Rzc53AuGEUuv z7LP+gWqeX;W==_FUhyq9NJ)Q7BEC2yzceQWtTZ0da*7A%bIy2B$bd|^B^;lYUzD3z z0;)K267#_M{1&HcMRIBZD9hhsEzU_zEx5%B3dQ1EY~WT_>McQ-E=X3%Elvlyv^=%w z7I!hI&MD4J&r8g?#RjF>gFW3tT!VaXv6LrfmfYeCfwT`@D+)4;Qd4fRWM}5&XzJeL zD9J5=v;vtyvC9r?6LKV{r9;HoAPu%#EJgYGB}Je~&08GBMad9JE=VgKTs^aZBIy=K zQetsxd}&cm5oiYJ7Dq~IVoFYCUg|CGoW$aicxXe98PwWiPAw`b0+;xV@kREa1PbbK z-r@#@EX0$B$Q)y2jwv$70-0kDi5f@{8ycYSjBfEkO7HlB#7a;!gVR5qT2+S zV|I%ZRMN$R(+H9q4UiQ5D;`7}TyI8W%Z$Y?Q^@R4D@0zMw{8u@F0`Ve&m*)=!h zm2OBXf8^&7=K3JSAR_irlv|Fi!R>O`B%{0a>oHv~ndi%%4vA#+(!t-ISdi7hZNAwg#6ELJR^L4IW=uxL74WNH{XGsy%_V!WIZ!6jtuwxFIId z!F_{I=nlVde`RN7clC^jOZ=)g1VpCuP2{^Gpm0N4{<^gGMQQB~ju)i0FH4(EdtZC0%X$8j{1@CK zE<~hUNX@vAl6fJsoA351D8-Vl-ez|J6|_)(OBU-*LtgQ)Ti5rrEf;x{DJZb&HH5SRYQ%Pz&$!S_Lk zL012UwCYDzW?`-l_KzG4(i%5-WN!#d-Vqd?E;UhVhTmmD?dyU@7X^(rm|qsOz9Az0 zg_Bj9tCPQjZ35#2lMg%$QnD8~QaZ|J2zSc~HMUW_jcNxLF!jUpV z7$SO|BjtjE&xx=T9v4EQFT^BVh)%vB2Qm*XeVrra8b`_<5sB$u6TN1X%&(qVy~6ym zyzylblMc=s{1P+7F7hi};4oU?cY(v`0>8onzl;1v*EvAwDpUZ%yA0+**q1=+AxvcQ zGKUe!M2U<1N*6fv7i3=G(7(X1v>@{$zy5U&5V{H#fbcGZc@Xv`ka`FcnY_%Q|B;PB z&3J>=WmUV297-K*6L@B%+>n&Hz##(*KAGzrGFKto>l`2soV*AUh43yTm{&MtK*5Ki z@;ZmiMGl!81~%8lY*(_ZU|eB1p>TTn#PZ3N3lt~TToAME;JzqkdxKy40*BL#>iP9E z>o0IPt*E=e;k2XZ0*BMg`W1CMiZ07LUEpx)sJS5Tbb;ULItK_{g$h7;mq9!T6HbCn zgzzqd42LkUa5&AVhcGXJY=Sd)6v3Gn3mj$}R3N;|2qr`TLSE)D`@q4#BhYWzY1wUk zfm`ka6Em;k4FQqs0ty!e6qblBms==zMZn+#8w;-*sLbM=$hkmi0_Rl$)epQ3Jn}!j z_%bqx$bMpA;#GJeATph6BG(M#>HHs9nRpfce70i{xBKx$1gwA&Y%HkEyC$IUftit4 z@%I-F1`)aI!a5g)bwCEd%%8%IWYIMNRght7zd!I3a^_V5gCBQ&r;f=E%*WM1aSJd7Yx zKrq#i`LU9G3KPo{M#fY_<|j;&DRS&jq?tf$Sw;|Bjv2&O5=t>;d13-qV``eJ%l=dg zq~@s(BZ#fbl4{6|eI23>Hv>bv%yfnn#uTO;hAx>B=$ID+Ll&sD4(aE@Nzk|$d{&SV zu^NqlF4hz_m@e3iL@g5mJ?tqQFg>-*1k`e-z}FzwvZUCg*mlUIF{W_0@Yb?2G1Rcu zFxD`^%qo^Cfse{%fks#1euFSlcxo7DGoviUVkw_3Iuh7^9#D#Tj$8io`BFpDEaFhwXuI7OrczCN;s9TrM8Y$>8CVsqG2#6fa3@lt28A{+QDNEpM z!(i^nl82dypy57NK#0LuDYD?z5L_jo!9%cM7JU8z%mou!s$dF*fSFp$jT9bSDRQ8& zg1M%ar-nOA9Yq_MlLBAqQp;PzTg+6$lc#{>0xYX4v$Vk)QHUCz8eXKeo7^e#;I*5e zMmAU-wzbM7@U_ZWMqouKM2bR+Vu})ye>h-1NoPe8<${UUaF@W>Rc2vXp^RTPMPiLI zeC;M5XuV5{N(*Z(KPN+pIm}tu)+WM2K1CI@(x_H|SoJjm&^4QUS@6|~Fnbu_nCGhoyDe5(Xvl&t}YJ||%Z1QE1VjVSI#%DLS=cHNrJwAX96_Ys8CZmbinR$H2glln!bZj6zw3X@ulzY--`F zCR2=|bL|o-CMl*h63}%Hl8Cf{WD;mB4Q3sbu7R%vhJ|GlV+s>^U4vMSD7I2M1-_cG zRw~7;R=P&IMyiaVR;)&hU|5^ih@~;6Sb%gO!Wzka*nA4NEya>*aROffS|m!qcDTws z#uUpGD;kBhbgfto-kb_v*T9Eu^-@U~G$I+Y;42(pA`A?$I0dh3;LD0e$iP@B)`)V2 zk)e{Ql1Z7N1itPVx~>6H9%9Rtx(Hh$K`UmTz-GnJOaiTCAW-&2GW3KZ=|+_9F);Tc zXy{r7zN~nJ7>otWpWxCIo3DkDeI3bA$%L?#KumzvGEfu~;I$0MAxu=bpsZyeA|}CW z8R!;%Sk^K)l-j`7GCbX}?D?GePuI;;@Gy2(c(HEZ(3aI~rc>UH7uR{pIYorxW_#@9BXqv4G9HC_G!-@NE9l7web8{r|La z>C;`?pY^mqThRV&#`>odmOWiNOTacVb;5(8+?WF9d5j*D`Z5)G%XR9RS|}#0XLW?{`2gV_;yY zVW?qDLsA7c3D2qkMutj8Wrh;aJT2G|6^0^V(5kB%W_)W2K;<7&IY2-yOr<8XUx=F~ z`z^NO{N!xV9E_t|yr-XQ$Sv+*e`oLb;E*6!N8ejq#i=ErITq09Jv(UDJvF(c$O05I z?Eb;vSrtvzTZ|dE7z>I(ZS7l(#YGnw7#NB{3kX2t)eVrbXrcJz#JqT@{&?`zNtGRz z@oCVUaeRhxay(?v9%()uL;nJhHKhy;3_lteZtw{8`*!-yP@AteQ*VXZbuF8VS~iz? zY&#e~FtKxr-QeK`&!~%E;ZX#!Jv%)o6wXkbkah($5GekEgMpW?-@Vhl*Yn30b_N0Q zPYjHlk~f4U9`Nu&gg>w|a!UUGzy??Ms~9vbvQouSp5dT8r=vCVK@CPnJBEW+j3Bl( zGl*>`WJmAQ{`D{R?R&qc=f(ET;6+Ww&XAn#YUHW_ zDO!p^NveuJ8N7@L6fAn688`H$M23+0dr-0}DgaHb^1#*;>1G%w7lFF9Ra_ay$+|h2 zWvRM`Aw{67w+Pg)ECOw~D*|=pia?#iB2d4u2()Rg2(&Pu2-GPo0`>liKwIEO*WiG& zBm=G1;DC$A%(-3+3`O9m1g*y?0@Z{?pkkR!N;E*($JNMHlhA^cB3Dq-*TSL^$D))X z(E9HpP}imi)W0eUW?*1=37Y;cN&`(yg4W0uftqOG`O2aMkXSm10L}9k<$_olAR-S$ zfad0l@oWQYN{AT6o|X<|!HElJHQE4l~fKxV0Lu@q-#7Jw)0i$KL-Q5i@p*rIX} zs{%w+f(TIMSOn_y7gd9}H6Q{M=SB4(Rs)D=1QAUjq8UWAfQVKQ(FP*gK|}|L=mZg6 zAfg*Y^ni$75HTG@%m5J+K*U54F$qLW1`$(0#8eP54MfZZ5%WOAd=LRD$%__(Sc^a& zmn~WhVuQK`MUfy6vw)V)6oHzxU;)=%pT!thg`RNpf=1;ph^nuUzRYdf;BtqXucrt!g?K?ydqvn~ zeiNuDT$$WuZi@z&JN$wWMfw|rF7ul-czk2wWEJ};#=s*tBV~ch6>iNt9DM!Uo!k?0 z7MLthTfw+OWrf%U{jdun;a4~!o^S~eobkONrG1fK8+poC6>Z8_9Wv!B#vrMBLqZ0G zWE5`5sN9g2|H#YE%lCnqQ-tfIs0es2SPS1=@DpzSp)wQvMF>0vtcqm@n7ql~=nFCN z7orm`BxGO6$-j_Ya6z^3vRKgtfg;e{5O^k;z~pb>g`lwOL5UZG5-$WMT}aBikY98m zulPc7-3JB+2PS8x4-5?Tj4mKb&6Vjh1B195h%M;G^nr;L$As`CThJscGlPiY2hb$z z7X=1R-hQr5t_g-cydT*Zq%~G>U6wM2&6Cn>nh&yEk{**|ptT5~Y)IbZm^5_iOW_XE z+!!+>ufp#y3Q#G~WZTf56$6#p$4#6xf{hqX$qEJ0X!hFe?5k#7s2J16l)?);bMuK6&%vV_CLsVF< zC^LfCDw3fL>{o1=Kx}))PzLs^49sD|%vV{2Ld99Gihfx3*hIACkIia-_AEy;LDeX0jpf|Hq_ zr&p8;UgdU+6D|Z=%LW!J0#|RK@*7+;7lFc~2wZ1^t4mNN30cjSlbHlr564zgS&*5R zUIgk96@kuNC<2|_QUt1=ZwV(CRTh-wrxzs_WK`;}I6yrkP%9o>iL7M!3~FP5Yo1>mHo5sJr8%i~MPC^h7(iX$Vo=5Yftit!@h*eX za|VVMhGy>D44k(acyBWZ-e%ys&A@$^LE=7x%wv!U_gx0H4{Quf9PQGL($^V9FEWaL oVya|hRQt@#z$Eqo%=}QnjH2KMBRf{rU@ae6K)Q>*FfcFx053SFeEUz`$@tK{Hd0i-F-Why%k+5C-GtItB)Y=?p0hDU3M`xr|Yaj372s4pS6! z3PTE04ofa;G7}?1E?X2kRE8spBZVP_IfpZsD~by&#*)LG%M--|X0zt-=JG}HPk&9uTRiSL`ALa6&iQ$1ndzF$w}f3%%QBNwee%=O zQ;Qr^5(`RFi*5-*1l=-Ib5h(gb3j5onR%Hd@j3bF>6v-y$&4VIpqPb$fq|KUf${SX za1fNhFzb>G7Q9$tqPrwZU)i12f zf@}?*A2=9Td9JfaTx5}$A$f&G`34Kubr#W!ETR+AudvA7VBu=_Z}gwyKHX=c&lMKM z8{C2u%scEautVN zLoH)16DLCn$Xu|38io|66y{7ur1Z>;Ej_2Oz)WFesA0sGp5Zx-rG_C3OKL_=?;V2P>iDrqxSO^;C?lOjAQ6w`Z5Gr7-8h98KA*;k@J6vTRV+uzK=NzUgHU@@T z_7tuZ?i%(?Mlg?~L>gu?lD#r8F$7)10rLxtZemPfs9>yRtz}E$sb#HU$&yE?hOuD& zO5p`1I?Es9TsR73HZd0DB+ zCB^ZOlJXWClx9guEi<3Y90Ej~xEM>F&DT#JhGi*57*-y%@Xy~PfVl_DjO&$&TXL&DAA781t@ z!hx7;g3K|4a3Fe&AsmP@Q)G^LF%JU+1E`LH;UZ9Ra7z;$B#>yvpH7M#7#JAD85kIf z6&NAahsbqaxr@AV7v!BU^SU&+-4WAVp>|o!u+hK4t;78T6DzCQ9U;{PX)7vrh+WWg zxGdz@!G42-zn`a*XF}{14&@ty;?w0P%3l^#>R@}o!FQcQ<|2p8jPNTQst>p&F0d$d z*v@dfz^!zh1%$3b_z=!z5C_79lNVT&X1GCkmk~^e0EE2EqV#~9?*fbR1hwfp6Llu* zEfBmYq7nFdUN*cGG6YUIp4Q(W(l}WFT1mAve}2ul|@xs{UBO)gQRRB)vFJ zVH@D;k1d5ATF|qDszT~ke(8jSsa(-S( zYDGyE2PD7S>K1`2*&;dB8)(UF^Dh$5vCx*3}hH5TFF;r0g?h+YYAdmfe335VFM~;IFXAhNLi&0 z_9w*cu(Ar~O=x8npORRdQRK|PzyR_^@eyc47hY1?UgovKEUDO7)t-P$s-(+8hVVk_ zf~dw74o!Tel;{N(`3|cYVi&mOud{&ARR|x#xeVe!m~ip}i~I~R2=6k22@!yhS6JkK zd|<^|n&`T4G92L)c9B6XO*mi;Y9%(*(gf74OJQEavKrb=tYtuS0})MVMx=&y7N{bH zwYH!%tkG4=Si_hFvI{B>qiUIIn2P&LK;<1+C<|24fLRD41<`b6t72eaNMT26QekPX z!R!P#U=b!`Yka{w2t}euZU9xX2FgT6o!*!U4_c%q5_@4{Q>WUJ0-O z3W4Y*BQ@eUYniZzo(sbS#@H$bhFX>ymMke0gTS0DERE+{Q1cj@S~;*56rz?bg{zjm zhP{ThjG>mJhNE~UlIs;vl!7@a+%+6&j43=I9Y`fJA`Y;HEIZ7nDZEsRS9ppc7_V@Z zd5kH%DSXiQ;!NRB5vbvWHo>`wjy*1zUtn|-V+v;lV=a3vM~WagB-yex7>El?A#hj< z*Ra>Hkr9?6R0~Tsm|qBnC0u15V~PkZ!*T*+Pb~{Wif9W1u6zM218SK{K-CgBbs{?4 zwcIt_#ZyznQpAZ4B}t@|kEJ9j0aZm{Ti~IEtOHBB$JCL>m?Dm33l=>H9}rLn?+T_! z%wYz1u6c+~!#pq_z-VY1W~$|`d>s_aSJd~;M zv}5km<=szvrafD*QvuS(c-+ubB+S6T5ORw_llc~BPJVhkcu?*ZFNj%^A75OOl3!YK zivz?>%gjlw(kaT%FM;Y-fOMl2G7`&D6%tDna#9nEOBC|+QWc;BV^w-wc98B2xa(-7 zSSr2h7Ax3-g$y){^`MH2xoU5*fJ_IC<`q;LfclO`epP~yRszy+AW~BYRG6VP zb&5daVw#M%7ezp&647>tgSQ$8lCm3Im(7eu}^?{j%pX~;R)<+Qi6Fl76 zq^-+XrGpgDCa`!mL5^n)Xv}MJ)!t%G%&XL7F7g7k5xqf#Ca7I0R0J9qECRJm5Y5$F z955dgf!e3H1Yuorh=sYu=|yM_RdC}K-dZgJRra@7;?r_Vz%gG0Zr}!k?Bl(~l%8A! z3I$028e*a$gahe$8-wGb2%OG9>81!2Tt%o2+#*|$4?sDw7&N2->y?9PaKzm*BssQ< zq8Jz$K+W!AP9{(n{RyY&4IzmeVp2B*g}<<~aIrNwec@qX6`UY+g+=5Ex6pNNnTy;q zm$~H{Tpn=q_uF>bUSRR)w7t&aagD{}f|SQ~78G=u#iPRnB8J4g!s5{Z(gKlykQZ1y z9tew1x1DJFnSq7Xpo9GeXpmX{BA@(qK9!4nDjm!>ge0#EDPI&)zAmJFQAoRk{RY3% z1rE&%{7MUwFYs$#=K!IrPyq<f(a3TkXJeMKX9_J8hqpf9rGU zzp#R`00RpvTaWPvQ11B5z{11!0VMDd#QFwez2|tz@ST%|mF*LZ_l1*zhyOc>_Yp*Z z6d;7)sy=YC@Uwwcfei$y`oPJ;0}%p?!_lv$E`ixVz%iybNk&Zgk}dy6SEA2Jcc z51Z=HgOpO>jDAZDE(-MtWYz=HHw6`kkfH$GUj+?WfqR4CoUxJt91`H%^^3zMH$SB` zC)KVfje&syG*MOzDk(lNGcq#XWl(y~z|g|b%y*YT{3(OReTMLh4B?;IxEQ5BOYtzO Re3s*8RQMtz$;bva5CDj*;0OQ! literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_main_lifecycle.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_main_lifecycle.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..acad9dbb8ba873c952c9368a311a0d308b814e11 GIT binary patch literal 8820 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 N8JI*rf|=lk1pqpjHW2^- literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_metrics.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_metrics.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7d41b7cdbf18d6b753f73c66c6f10d7d7f1783c0 GIT binary patch literal 11961 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 literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_netconf_parser.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_netconf_parser.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1bd3cca588746238d0fc570b4b6619055fd23e2 GIT binary patch literal 22673 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 literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_registry.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_registry.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e1cf457f4b2518b7206e7358cb459210c79eedcb GIT binary patch literal 12931 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 literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_scraper_stop_event.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_scraper_stop_event.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f40c9f5a81e3ca244b29083bfa1b2d168eb727d2 GIT binary patch literal 2610 zcmX@j%ge>Uz`&5iubCOc%E0g##DQTZDC2Vp0|Uc!h7^Vr#vFzyMlj8k%bd)_$dJnt z#mWegVT)n|%dkhWr!b^2<#6P3Msb4Wm~*&txudvqd7^m0e3l&ET)rqiFq<`pKUW}1 z0L*5~5zG~e5@KXXVQ*oG60T&_9=^?bMliCb09oT##?+4*`U<)%;J)wN=?RFJjKaHi3O=e@j3bV1)7Yv z1fBEq@=}vaGV}9%6Y~<&Q;U)rLDoSrC|sBs7#Kc_FoS$w0+(A2RZz>A!dSx?4;L?C zg-S5gFlNER4kpCFz_5mCHB@aaQwcjvqJ|MJ%ACU7!cfbS$xzFh$xzEy!UEu+*^Du+=c8v8S-CVO9A%*~R4u@H0$R}D`ZV+vSL z8q;bPh)fDki9CeGz>uW?VG4pS8y14Auu3SSC;4R0nRn8#P54l^0aBn_Atg0A6%nFOPo7*hl)7;AZI zxhn-U1xsTY7#O$|6ciMm&ROw%ZRgW{tuLodFzlKg`B)UwpP zlJ|Rhp6;6Re0BHJ-pwx?8lJZAdcUXVMMKY%9lg(HtOw~{*Yj-ZmZuX}JexEBaYGZ> z+?O^C3=Eo#x5U!HxjP<`h2t~xN>Yo;5_6K#vl%F9eg?(UbcRYsO(wr8Ih&$_WZk0F zf}Bb_o0Pwonwy`O4w7YH_+SrZh&X66-eNDw%uUTNErE)0 zIA}8dVzkj@tP)h!D5x~hELN~l0I`fUi*K=~<|Gyrr>1B!-C{1NGyoCCReXuX#i>Ol zU`3{y#UMdbKTXjhkfUyiqs2>nacXjYUP^Hh8v_GF5eEYU!!6E|jH1-Ul+3*JTdc02 z^l*y>79^G= zXWZg~nw6ZEev6|BTEpDpONQ4cpafMU2=X>-a$<5u>Mgd6)Wn>Uj9XlYlu@Jzl4mR_ zk^s@%ARj=2*yt7##}LASxXA>WV^+-1z`y{?d`P$mREpn{0|yl(PN0bqIf)fnGB7Z3 zgHn_jBLhPN!xs()A-TzN4PG}iwHv&yu&6!Zm)#I`-8B57Y4{cXhz5^4qG}7OE{hs9 z_F!};-%ng3wFYGLwYz>YdxENU3+T9!7TRfkzaI||h zdUX`H_}^gRYxisPyTT%JgN3!-tGoyeP9I^%f^w=oULvtVk7<{AED|sK&U(T2fh%T3iIGOK<1S+*4xk(T%1xs7td~{0yE)I=aNTv~n3nLOBIM0FOxd_xc0Q&} literal 0 HcmV?d00001 diff --git a/tests/__pycache__/test_sqlite_store.cpython-312-pytest-9.0.1.pyc b/tests/__pycache__/test_sqlite_store.cpython-312-pytest-9.0.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..76296d67f1fd90259ded44b69e2b49963e15c7b3 GIT binary patch literal 20648 zcmX@j%ge>Uz`)?bqM3P9ihwS#+1U|!m=7F8YPm#k;;|AnJSpZlET%( z5+#bn=Wbz%5<}wiw6H{pBk_4#SfV75_)b7Z>JamZZiPgZ!*lP#VQO83=IrVxCE|q$zJ4=z04(lolET^m)d16jRxmC+%hwQFLNtiU{U-G z^2#lalH7v$g2a*xumQ=)Ap`O&IQ(pwK;c)zkiuBS&A?F0gb2wJkUYp7h8iYVc+@bi zhMH2#T*HhnJQwSEs5HHHRRaY@lF_RPG@lK7OQTkH@w8Q)@0&dMbsZf=ZC*;uDK*3C1TU=H$c|r4|$= z=jRqA7Ny?eaVV&aPb$sKDap($zQvZ4pPZOed`lv}I3vF_Ck3oDK0PNtDKRG=6ePDe z>L`#Hul%4geL=GJI%xxvNPuhXe>gTwDLGZQ!4b2h%ljOMHl ztPHFiAJ`aJIorJ&y;^*3h)G>wk?Js>kkVm)oki+8i_}#J7s7#)7eS&B-em;y3X9Z) z6o@D?d5J};NPvNX0i`hHgjFW1*l1rErZA;2r?8~3rm%ss;~LJ@pd`w`z);Il!<+?j z2_ol#Sv4%MY{$q@!;Gz1gcUWltR?Vb5m8jsvZZj2&1MIBt6)|g&XEN0_sQ)Kan}iGzmZM3dUM&VW@xzdl;*hErpG&Fccl3 zVWIsgkdFvrnp}bs7SuWl9F0xSjBFr2Zk^0m>C#uF_zw9 zEC{*9UR0V_l9`*jlKmD7xCz3NkzZVLiv`sExW!RgoLU4H*yZiXgfl@7>MW6ff83k@}k z^*}C1v1}!Ckvjte1K8*y4{*N>r;9-bz&wp&h$dr|9v({}p@OPI2;9sp0u|Clpi;RA z)X%)dU7T2!3T-{z63NL=Oo@j^22`-P$OYtDQ2H-Y2C+cByCPK(3)KBDQU|d#K!hfU zumlmdAi|!3fng;NqHS2D1rpT;2W?7fS&=JP*n|YB`PQ=KpKjY;D#dDe~Ec1@nF9}nu$fB3=9mQQn6T$3Di|3qJ8*;OY8=( z@C{zE8@vKH1VundK;#C$#20=JZng&J4?+yAT-RAdFS3YENWQ`%b%R&vIH*#BkUr# z@^uyvy2_&5VK*ZT!nq7m3SnLXiNl#N1rPxUd6h*OZi7mP<#le^i`=poSX34WUtm$W zz%9E#_#(H;brul13Kf9xF0+7?gC#D3B_P6=Kw2S8Wb!JD3fvkEkTud5xuq|#Xw0a* zz@l-1TY5(2MQ)AjEFg3hDgfbKW&tS&OI!j=K!h)Wv_hE3;sQ+fO?`3m7pRJ%t8<~@TOdm zD3VLCG(iz6^B7b338+OhoCTm`9GoeFDMCmMXGNGBkW2y%7RiISpvFfLD7uP3`J9M`)h%|Yn>7WnHK~gHL8j_}h$s*N zYF8EMfmr$=!T>}Bf}#$otp#mSLA+vC6bzCEj}=1NScZnhpsqA>y9&gHw5?RZZ7X z2wj5;KzMNSB8z^9C4_ew!Mp-eECUgSlNVU@LCr9bVV4n1uu>I>qDvr~AxvcQ8jC(= z(*`uk2bxg%EXTsY&@R|6G@XI?NtYC+HO#9)x)~T4x`aA~@K3y?Gjs{2u#|u%rogpT z3Tp~O8cT;@hfo?*3R??LEprKcoG}Gng}N~Gvm`U6GbA&`N`Xcr@i%d5m}^+l7}s#X zrh_Ij^~kU=)UwvH)UdiR#0oJm)UwsEVQc8X8V!sLJt8a&D5~)^d?2dR8EV-(1(8NF zXW}0LOyLAKYq&sqkSbX25>Pi395z{?ZYY?AAYd*8H*4U{ENl&+PC-~PUnGj;5-bfM zgvva|6mI-#Yv6H`!UJ#C@TTw~HETd69oWH0CV>h*uo!~C*R1Ij$^vyd5sJYqnBQx; zYq(t)`gxL>GC(PUkAb0}SIbhvTf+x#GJ&Sza*+IkWsEt66Fe0s0MdhqPb589LcWF<7Dois@xj!k2tq@h zKSd}-xP~9v2oNYCHq-@RCc$WEBY+n?X~tK{09rnf%v8%#4rB4aSuEuYnj(I`xS%z= zUP{t)aKtctuwTh|iybtUlV4hLi!rkZG^v^l8l8d2GcbTMH7L1$Uc|t_FqLUK11CcX zTt0=dh5;1t$kPvNIN*~HjGZi5&;kZ#9Eh%gw+k5=DjAd+N}#i!3=Ap^MbfoQoy=LF zf(@h;2_xo<85trOQW$EP>X<5_bU9-=Lj`jrLpdX8<`6V;rCSsZszc#zpdwJUhSUPm zWC4$-fGhi3oURqgsRf|Pv0H431qG>jDVnTB86f?jYWfyq>MgcZ(0p2P5okCB+yGKg zP-tj?)U9mg`9;~OMOCKYIyN~!FS)d+C^fGnzPu7Ff@bVAnQpO_Bo?KomfT`VEJ`m1H_}!jHS3@w zZ^oL%MR}l5L2J`xLE3cSR-hrM-3Dm|nrIelGJ(g=KqGP{RmhX6W}3y2u{881*e&MF zypmh2MTvRoskb;wGKx|YQ!?|?Z?T1dnV@;f#G;a0ELr)PdBnEGihMzi290!S3Zpm1 z@lR~5Q3$Brh14uFhKy}N8eyhIK_COcp#)AVpsWLG zhM`~w2T00+w8{vjn4$&-28IAotE`KWf#GKZ18De5<|3ae%Jk@t;wwDPNE4(F`a*ZJiy^2;wM+Yq?H0t+{zOQ zI~@Dny4@~tD_>v%k$YSZDDC#VrtY?(aD~c>!WGG@xGt!>f#lRd(iha-E^@nFX91zB zU=0`4LG0@+ZkNGah}0z(H@G-N1VUb6ar^m6kb&Qi@#iN21|F54m(<;gLCZQ0^2&QK zupAW=_F!c>YQf{d#gdF%;(@Xki2r#DsDZ}Y&ezW0E`ZcXV=jT0aM;!ubqS<1bn&M% zbn!7UxHEL{b?~P#r7*Q{q%gypNL{=gyd45*Oeria9JMSpOxPN62s=_(Ygk}SKIFAD zh)TAGc{Q|juVGAKTf+`hT?-mv;)XjG&VW_zj0}ir;uLsa-i0C70@P?Lflm#maMrMa zYYeUw?i3!-bZZL#8Uc8X!Cu3PZKMj(cwuB9G)mQD#lnCXA?bwooohLeMB&wPEoTi! z4JWv%z*WOFfw8y&e={ycu!bv*F+~WZ3(;6e5k^d=W?^YAz(NT;jg4p~g8G;6kc2Qw zKqWPp35$m!NhB9xX^vs)$YV?qP7xv6MWRUNV{s881dEVWVsQyVWgcUS2$HE-)Yib$ z$RG?mQL2R62+dv30i*|#gW3gKKRuWsm7spThGFK*s8U|1k4lIX6V5^X77&94a zn3gd1F$Ob0L!qb*)Zzh|r^#H@4q_L9LVzv19MqPCdL1&w2OdkSa-zW3sgN~wwIEM} z%Blv28^UT6Or~2;w7xE^c2QVu19?1&Sslj972Y2uk3fm`9QYF|oCk(Bql82$Z=YX&f~EtH}h8 z>08|3VhEbOL1sg9H+Yb^%7K!22dxnWqOcacYKM#&W(l^ep)RG@NE zSmm;?+68D1*JOf}b(&naIO4$zL*wIbamB~y=BJeAq{heJ;)#zhEKSS-4d=(l7lFpN zZ*hSNOh_SG)CtPDpj-@2xkaGZ1^Y#lsb~^Nssj{DAdkYjz1$$p(9*UD6o(Zc6`+yp zA1w?Yn3y=#7pPxXGP$T^@_~VgQ+T`6NySCe(Q6ra zF$Jo)KqC)K44o`B44DiyjGzLjmWhd>lNm880L_^z88lgoKqXL7H^|xGA$E|_w|I(D z6LVnI26`W!zoaNJIXg84CSPSoVhp0`?*fGdD2#tJFx=#qo)L0^UuQwsMSh(QmYe)i zGfXb?D_r1E0H&B1V%8xy>v~+DnHOv3YNtz*jLY3z$REM zKpl1Pgor70nT;8ES_QIv1Qgrgc-LeD&#HjC@kp~Opmi`spsAH2(9lIuET{q$1}7@8 zcW$v4rn!3I zS;XhCFOXc}e}%>731S5_dKdo*uh0a;?ubte+^nh{jCc5?ZU~D^2%O+NK^(N)MNs4h zWb{Zx;)bxy7k&VQ)IxZd5zH%K!yv+N@&b$D5@87MGJ**axXxmDiN$b1G=z5okTd@870jM0e5CW^)^@r+jf-_&;|goEUbG`B#G#RW1A(x)RD)S z!h>HA!UqJ@A!a~$p(}bh5FI@vy;wT%i0&%PC(w=(TP=GfgC?I}5vY>{o_Z%xY@-aW zgPJm+>3VQW+?#=sVLC$%L#!|ZLoH(sBete#3PZLz1H&}N>5PmFJ)$fOm5ghd%NaG9 zz&877G8TbHIhk%T=^23QkYZ4c4P9XOi_-?Q*Q}zT$gWBcT)m~F=A@RS#-~p^k=3Wk7~@ zmw+^aS_zPKj^HVJEQ=jAIT4jd5qxzcWGWssx(k_ruLBuY5Aramgn(BD;8y)DX*}Up zw2Xm)VKGSKdH60CjA2^TT`aIwityQU5xleKH&{3!wZjayD=hM;!=g9&3|5F;;WN0v zV$frJfzRMFH;8$W+u%A20$l}3LIf@&m{(W~F7QDWU1Bk~fU4&@i@{|U1I+Rh6eXba z`x#Vmg3>MZH~ZCKod`lJ`9QG*E@Kb`tb_vf)is$Rd9#W$FF#KgoYXa0(UaFwP@IDr zBbqGOk_b3)gHi${5y&Gag1r1Z^bAzAf`NfyJ18N5R=XfK0dQ_-0xfgkg2pZP6&4k6 zOv_zlk-N$QX(eK>x@rdb)}j(_SftQ*MPm#TXwq`-+;YnizZTqQVLmICZLhRGTwq*xqR~cxZDX82B zJ0lD4SY#3M3PVs44Az4n5Ia8e7(r9uRC59HDo})5vAF=Q5;8&#osj2E5ls=R;f0Q! z@|A$r%7dMa6tbY&1T2OiYTzTb$W4M;o*J$i_G}l((guRDBMy!o36LJ7*pZ}K*udBS z5{w~p%tVT1(1Jlk1cO=7 z{38w0gA_wDR0|(?8ALFA;41SNQ)G}_jV-0aOPmy0XgCU_$fd~F2tZT0AknEDz8DEP zl~*v<^3?KIGH5D5Dpzpx^A=NvA!5-f`htrp8|aeLWbh8)l=#FF9fi_@l*E!$5S!4- zQwPwPGE;`pEv5n^w<;&RX6Yz^wj&WT5mYy8VlHwp(k#Bk0d=DhoMouVglMCptYk3J zEG`1KSs8yZ+G#RY34(@WKx<*`z%5{~aZqm>-Qs|<42z0EEe_E5JK6$SO%e3A38cExvcqEfc*VAPU)Y zgw3)W^2+mTX4c%`@cGQlq=0O+EXe2?ETBdqblds^Zs7?P7rEuHvw+Z57Woc~2^A0y zoV*AUh43yTm=J;MEb^CFn!pYS>$hU3s19ZwQNnmWr56FhO1_Vlu%5dFcnFJ=_5m z11%MSGC@m4piE@-msrFxyD40-VIC!V@BU#2w;n+Y>Oh;LM>pbw>rq_&P*Vmxc~j&JQVpK|01rR8fw-O^ z0z9(<8oJYDyv3ARtjSnq25MGdndJfPI7YREs}^*u4M;g?k)=0iW(IO%4cb;>NSgvQ z=mDAX0W~9u*w|9E1LQzIP%R9~w#XGbq*|8+SL>*5iZ4hlD$Xn}Nlhu*#lXPu8l*b{ zzQsiPBA*J%T1H|9$;72WHLD;ecsH-eklW3x4cY{&d=a#IQF}qj1s3fK+{z0|E^upK zX91zBPyq<UcWO|?@$}-cztFCW}!bKtZ46+%i2(-Bb-2A=8o|air zQd*P>-q{5{9tgY#9K1mZydD-j&jucG1&_9Yn}*=DRWuXiR?to;aB}>`VUr7<0k88lGczy=fJHuVaWYD85c$Bs$tZonDflyp{vaXDsJVjW1A{Q5 z<^@Zy&mj7PjyR*i2A2;E;*16tT*E$t=np1xjP8seK@bfV1u;H2G3qlKfrRxLjliP% zj7A?)7zG&(SEzho5M(sGVD0l6M1Rm=XH;B~@_~V!QSpL(z-JKsK}4NVVn@jb26aY> g3jv9rLG*_ZMj=L>6)qnbgcx-$*!q0|(cr`Z0N$KNTL1t6 literal 0 HcmV?d00001 diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..ff907e2 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +""" +Pytest 全局配置: +- 在测试启动时自动加载项目根目录下的 .env 文件,把其中的变量注入到 os.environ。 +- 这样可以在不手动 export 的情况下,将 H3C_NETCONF_* 等变量提供给 live 测试与 HTTP E2E。 +""" + +import os +from pathlib import Path + + +def _load_dotenv_from_project_root() -> None: + root = Path(__file__).resolve().parents[1] + env_file = root / ".env" + if not env_file.exists(): + return + + try: + content = env_file.read_text(encoding="utf-8") + except OSError: + return + + for line in content.splitlines(): + line = line.strip() + if not line or line.startswith("#"): + continue + if "=" not in line: + continue + key, value = line.split("=", 1) + key = key.strip() + value = value.strip() + # 去掉首尾成对的引号(支持单引号或双引号) + if (value.startswith("'") and value.endswith("'")) or ( + value.startswith('"') and value.endswith('"') + ): + value = value[1:-1] + # 已存在的环境变量优先生效,.env 只作为默认值 + os.environ.setdefault(key, value) + + +_load_dotenv_from_project_root() + diff --git a/tests/test_api_devices.py b/tests/test_api_devices.py new file mode 100644 index 0000000..690d561 --- /dev/null +++ b/tests/test_api_devices.py @@ -0,0 +1,183 @@ +from typing import Tuple + +import sqlite3 + +import pytest +from fastapi.testclient import TestClient + +from exporter.api import create_app +from exporter.config import DeviceConfig, GlobalConfig +from exporter.metrics import TransceiverCollector +from exporter.models import DeviceHealthState, DeviceMetricsSnapshot +from exporter.registry import DeviceRegistry +from exporter.sqlite_store import PasswordEncryptor, SQLiteDeviceStore + + +VALID_FERNET_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" + + +@pytest.fixture +def global_cfg(tmp_path) -> GlobalConfig: + cfg = GlobalConfig() + cfg.api_token = "changeme" + cfg.runtime_db_path = str(tmp_path / "devices.db") + cfg.password_secret = VALID_FERNET_KEY + return cfg + + +def _make_app_and_registry(global_cfg: GlobalConfig) -> Tuple[TestClient, DeviceRegistry]: + encryptor = PasswordEncryptor(global_cfg.password_secret) + store = SQLiteDeviceStore(global_cfg.runtime_db_path, encryptor) + store.init_db() + + registry = DeviceRegistry(global_scrape_interval=global_cfg.scrape_interval_seconds) + + # cache/health 可共享空 dict + cache: dict[str, DeviceMetricsSnapshot] = {} + health: dict[str, DeviceHealthState] = {} + collector = TransceiverCollector(cache, health) + + app = create_app(registry, store, collector, global_cfg) + return TestClient(app), registry + + +@pytest.fixture +def app_with_registry(global_cfg) -> Tuple[TestClient, DeviceRegistry]: + return _make_app_and_registry(global_cfg) + + +def test_get_devices_requires_auth(app_with_registry): + client, _ = app_with_registry + resp = client.get("/api/v1/devices") + assert resp.status_code == 401 + + +def test_get_devices_returns_list(app_with_registry): + client, _ = app_with_registry + resp = client.get("/api/v1/devices", headers={"X-API-Token": "changeme"}) + assert resp.status_code == 200 + assert isinstance(resp.json(), list) + + +def test_post_device_creates_runtime_device(app_with_registry): + client, registry = app_with_registry + + device_data = { + "name": "new-device", + "host": "192.168.1.100", + "port": 830, + "username": "admin", + "password": "secret", + "enabled": True, + } + + resp = client.post( + "/api/v1/devices", + headers={"X-API-Token": "changeme"}, + json=device_data, + ) + assert resp.status_code == 201 + body = resp.json() + assert body["name"] == "new-device" + assert body["source"] == "runtime" + + # registry 中也应该有 + devices = registry.list_devices() + assert any(d.name == "new-device" and d.source == "runtime" for d in devices) + + +def test_post_duplicate_device_returns_409(app_with_registry): + client, _ = app_with_registry + + device_data = { + "name": "dup-dev", + "host": "192.168.1.100", + "port": 830, + "username": "admin", + "password": "secret", + "enabled": True, + } + + resp1 = client.post( + "/api/v1/devices", + headers={"X-API-Token": "changeme"}, + json=device_data, + ) + assert resp1.status_code == 201 + + resp2 = client.post( + "/api/v1/devices", + headers={"X-API-Token": "changeme"}, + json=device_data, + ) + assert resp2.status_code == 409 + + +def test_delete_runtime_device(app_with_registry): + client, _ = app_with_registry + + device_data = { + "name": "to-delete", + "host": "192.168.1.100", + "port": 830, + "username": "admin", + "password": "secret", + "enabled": True, + } + client.post( + "/api/v1/devices", + headers={"X-API-Token": "changeme"}, + json=device_data, + ) + + resp = client.delete( + "/api/v1/devices/to-delete", + headers={"X-API-Token": "changeme"}, + ) + assert resp.status_code == 204 + + devices = client.get( + "/api/v1/devices", + headers={"X-API-Token": "changeme"}, + ).json() + assert "to-delete" not in [d["name"] for d in devices] + + +def test_delete_static_device_fails(app_with_registry): + client, registry = app_with_registry + + static_dev = DeviceConfig( + name="static-1", + host="10.0.0.2", + port=830, + username="u", + password="p", + source="static", + ) + registry.register_static_device(static_dev) + + resp = client.delete( + "/api/v1/devices/static-1", + headers={"X-API-Token": "changeme"}, + ) + assert resp.status_code == 400 + assert "static device" in resp.json()["detail"].lower() + + +def test_healthz_endpoint(app_with_registry): + client, _ = app_with_registry + resp = client.get("/healthz") + assert resp.status_code == 200 + data = resp.json() + assert "status" in data + assert "devices_total" in data + + +def test_metrics_endpoint_returns_prometheus_format(app_with_registry): + client, _ = app_with_registry + resp = client.get("/metrics") + assert resp.status_code == 200 + assert "text/plain" in resp.headers["content-type"] + assert "# HELP" in resp.text + assert "netconf_scrape_success" in resp.text + diff --git a/tests/test_config.py b/tests/test_config.py new file mode 100644 index 0000000..821438e --- /dev/null +++ b/tests/test_config.py @@ -0,0 +1,86 @@ +from pathlib import Path + +import pytest + +from exporter.config import Config + + +VALID_FERNET_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" # 44 chars base64 -> 32 bytes + + +def test_config_loads_global_fields(tmp_path: Path): + yaml_content = f""" + global: + http_listen: "0.0.0.0:9100" + scrape_interval_seconds: 60 + netconf_port: 830 + connect_timeout_seconds: 5 + rpc_timeout_seconds: 10 + max_workers: 10 + api_token: "changeme" + runtime_db_path: "./devices.db" + password_secret: "{VALID_FERNET_KEY}" + ssh_keepalive_seconds: 30 + failure_threshold: 3 + max_backoff_factor: 8 + shutdown_timeout_seconds: 30 + log_level: INFO + log_to_stdout: true + log_file: "" + log_file_max_bytes: 10485760 + log_file_backup_count: 5 + """ + cfg_file = tmp_path / "config.yaml" + cfg_file.write_text(yaml_content) + + cfg = Config.from_file(cfg_file) + g = cfg.global_ + + assert g.http_listen == "0.0.0.0:9100" + assert g.scrape_interval_seconds == 60 + assert g.rpc_timeout_seconds == 10 + assert g.runtime_db_path == "./devices.db" + assert g.password_secret == VALID_FERNET_KEY + assert g.ssh_keepalive_seconds == 30 + assert g.failure_threshold == 3 + assert g.max_backoff_factor == 8 + assert g.shutdown_timeout_seconds == 30 + + +def test_config_invalid_fernet_key_raises(): + data = { + "global": { + "runtime_db_path": "./devices.db", + "password_secret": "too-short", + } + } + with pytest.raises(ValueError, match="Invalid Fernet key"): + Config.from_dict(data) + + +def test_shutdown_timeout_too_small_warns(): + data = { + "global": { + "http_listen": "0.0.0.0:9100", + "scrape_interval_seconds": 60, + "netconf_port": 830, + "connect_timeout_seconds": 5, + "rpc_timeout_seconds": 20, + "max_workers": 10, + "api_token": "changeme", + "runtime_db_path": "./devices.db", + "password_secret": VALID_FERNET_KEY, + "ssh_keepalive_seconds": 30, + "failure_threshold": 3, + "max_backoff_factor": 8, + "shutdown_timeout_seconds": 10, + "log_level": "INFO", + "log_to_stdout": True, + "log_file": "", + "log_file_max_bytes": 10485760, + "log_file_backup_count": 5, + } + } + with pytest.warns(UserWarning): + Config.from_dict(data) + diff --git a/tests/test_connection.py b/tests/test_connection.py new file mode 100644 index 0000000..7ac789f --- /dev/null +++ b/tests/test_connection.py @@ -0,0 +1,125 @@ +from types import SimpleNamespace + +import pytest + +from exporter.config import DeviceConfig, GlobalConfig +from exporter.connection import ConnectionManager + + +class DummyManager: + def __init__(self) -> None: + self.transport = SimpleNamespace(set_keepalive=lambda interval: None) + self.closed = False + + def close_session(self) -> None: + self.closed = True + + +@pytest.fixture +def global_cfg() -> GlobalConfig: + cfg = GlobalConfig() + cfg.ssh_keepalive_seconds = 30 + return cfg + + +@pytest.fixture +def device_cfg() -> DeviceConfig: + return DeviceConfig( + name="dev1", + host="1.1.1.1", + port=830, + username="u", + password="p", + ) + + +def test_acquire_session_uses_ncclient_connect(monkeypatch, global_cfg, device_cfg): + called = {} + + def fake_connect(**kwargs): + called.update(kwargs) + return DummyManager() + + monkeypatch.setattr("exporter.connection.ncclient.manager.connect", fake_connect) + + mgr = ConnectionManager(global_cfg) + session = mgr.acquire_session(device_cfg) + + assert isinstance(session, DummyManager) + assert called["host"] == device_cfg.host + assert called["port"] == device_cfg.port + assert called["username"] == device_cfg.username + assert called["password"] == device_cfg.password + + +def test_enable_ssh_keepalive_called(monkeypatch, global_cfg, device_cfg): + class DummyTransport: + def __init__(self) -> None: + self.keepalive_interval = None + + def set_keepalive(self, interval: int) -> None: + self.keepalive_interval = interval + + class ManagerWithTransport(DummyManager): + def __init__(self) -> None: + super().__init__() + self.transport = DummyTransport() + + mgr_instance = ManagerWithTransport() + + def fake_connect(**kwargs): + return mgr_instance + + monkeypatch.setattr("exporter.connection.ncclient.manager.connect", fake_connect) + + cm = ConnectionManager(global_cfg) + cm.acquire_session(device_cfg) + + assert mgr_instance.transport.keepalive_interval == global_cfg.ssh_keepalive_seconds + + +def test_mark_session_invalid_triggers_reconnect(monkeypatch, global_cfg, device_cfg): + mgr_instances = [] + + def fake_connect(**kwargs): + mgr = DummyManager() + mgr_instances.append(mgr) + return mgr + + monkeypatch.setattr("exporter.connection.ncclient.manager.connect", fake_connect) + + cm = ConnectionManager(global_cfg) + sess1 = cm.acquire_session(device_cfg) + assert len(mgr_instances) == 1 + + cm.mark_session_invalid(device_cfg.name) + sess2 = cm.acquire_session(device_cfg) + assert len(mgr_instances) == 2 + assert sess2 is mgr_instances[1] + # 原会话应被关闭 + assert mgr_instances[0].closed is True + + +def test_close_all_closes_all_sessions(monkeypatch, global_cfg): + mgr_instances = [] + + def fake_connect(**kwargs): + mgr = DummyManager() + mgr_instances.append(mgr) + return mgr + + monkeypatch.setattr("exporter.connection.ncclient.manager.connect", fake_connect) + + cm = ConnectionManager(global_cfg) + dev1 = DeviceConfig(name="dev1", host="1.1.1.1", port=830, username="u", password="p") + dev2 = DeviceConfig(name="dev2", host="2.2.2.2", port=830, username="u", password="p") + + cm.acquire_session(dev1) + cm.acquire_session(dev2) + assert len(mgr_instances) == 2 + + cm.close_all() + + assert mgr_instances[0].closed is True + assert mgr_instances[1].closed is True + diff --git a/tests/test_error_classification.py b/tests/test_error_classification.py new file mode 100644 index 0000000..c9ba711 --- /dev/null +++ b/tests/test_error_classification.py @@ -0,0 +1,16 @@ +import xml.etree.ElementTree as ET + +import paramiko +from ncclient.operations.errors import TimeoutExpiredError + +from exporter.errors import classify_error + + +def test_classify_error_from_exception(): + assert classify_error(paramiko.SSHException()) == "SSHError" + assert classify_error(TimeoutError()) == "TimeoutError" + assert classify_error(TimeoutExpiredError("rpc timeout")) == "TimeoutError" + assert classify_error(ET.ParseError()) == "XMLParseError" + assert classify_error(PermissionError()) == "AuthenticationError" + assert classify_error(RuntimeError("filter failed")) == "FilterError" + assert classify_error(RuntimeError("something else")) == "UnknownError" diff --git a/tests/test_h3c_live_netconf.py b/tests/test_h3c_live_netconf.py new file mode 100644 index 0000000..c588879 --- /dev/null +++ b/tests/test_h3c_live_netconf.py @@ -0,0 +1,106 @@ +from __future__ import annotations + +""" +与真实 H3C 设备联调的“活体”测试用例。 + +说明: +- 连接参数参考 exp/yangcli/run_yangcli.sh: + - server=127.0.0.1 + - ncport=8830 + - user=netconf_user + - password='...' +- 为避免在仓库中硬编码明文密码,本测试通过环境变量注入密码: + - H3C_NETCONF_PASSWORD + - 可选:H3C_NETCONF_HOST / H3C_NETCONF_PORT / H3C_NETCONF_USER + +默认行为: +- 若未设置 H3C_NETCONF_PASSWORD,或无法建立到指定 host:port 的 TCP 连接, + 则使用 pytest.skip() 自动跳过,不影响普通单元测试/CI。 +- 仅在本地联调时、显式设置上述环境变量后,此测试才会真正访问设备。 +""" + +import os +import re +import socket +from pathlib import Path + +import pytest +from ncclient import manager + +from exporter.netconf_client import build_transceiver_filter, parse_netconf_response + + +H3C_HOST = os.getenv("H3C_NETCONF_HOST", "127.0.0.1") +H3C_PORT = int(os.getenv("H3C_NETCONF_PORT", "8830")) +H3C_USER = os.getenv("H3C_NETCONF_USER", "netconf_user") + + +def _load_password_from_script() -> str: + """ + 尝试从 exp/yangcli 下的脚本中解析 --password='...'. + + 这样可以重用你已经验证过的 yangcli 参数,而不在测试里硬编码密码。 + 若脚本不存在或未找到 password,则返回空字符串。 + """ + root = Path(__file__).resolve().parents[1] + candidates = [ + root / "exp" / "yangcli" / "run_yangcli_h3c.sh", + root / "exp" / "yangcli" / "run_yangcli.sh", + ] + pattern = re.compile(r"--password='([^']*)'") + for path in candidates: + if not path.exists(): + continue + text = path.read_text(encoding="utf-8") + match = pattern.search(text) + if match: + return match.group(1) + return "" + + +H3C_PASSWORD = os.getenv("H3C_NETCONF_PASSWORD") or _load_password_from_script() + + +def _can_connect(host: str, port: int, timeout: float = 2.0) -> bool: + """快速探测 host:port 是否可连,用于决定是否跳过 live 测试。""" + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + sock.settimeout(timeout) + sock.connect((host, port)) + return True + except OSError: + return False + finally: + sock.close() + + +@pytest.mark.h3c_live +def test_h3c_live_transceiver_rpc_and_parse() -> None: + """ + 使用真实 H3C 设备验证: + - ncclient 能与设备建立 NETCONF 会话; + - build_transceiver_filter() 构造的 subtree filter 在设备上可用; + - parse_netconf_response() 能正确解析设备返回的 XML,并得到非空结果。 + """ + if not _can_connect(H3C_HOST, H3C_PORT): + pytest.skip(f"H3C NETCONF {H3C_HOST}:{H3C_PORT} 不可达,跳过 live 测试") + + flt = build_transceiver_filter() + + with manager.connect( + host=H3C_HOST, + port=H3C_PORT, + username=H3C_USER, + password=H3C_PASSWORD, + hostkey_verify=False, + timeout=30, + allow_agent=False, + look_for_keys=False, + ) as m: + reply = m.get(filter=("subtree", flt)) + xml_str = str(reply) + + transceivers, channels = parse_netconf_response(xml_str, device_name=f"h3c-{H3C_HOST}") + + # 只要返回非空结果,就说明“连接 + filter + 解析”在真实设备上可以工作 + assert transceivers or channels, "H3C 设备未返回任何 transceiver/channel 数据" diff --git a/tests/test_http_e2e_exporter.py b/tests/test_http_e2e_exporter.py new file mode 100644 index 0000000..d60071d --- /dev/null +++ b/tests/test_http_e2e_exporter.py @@ -0,0 +1,265 @@ +from __future__ import annotations + +import json +import os +import signal +import subprocess +import sys +import time +from pathlib import Path +from typing import Any, Dict + +import pytest +import yaml +from cryptography.fernet import Fernet + + +@pytest.mark.http_e2e +def test_exporter_http_end_to_end(tmp_path) -> None: + """ + 端到端集成测试: + - 使用独立子进程启动 `python -m exporter.main`; + - 通过 HTTP 访问 /healthz, /api/v1/devices, /metrics; + - 验证配置加载、SQLite 初始化、API 路由与 Prometheus 输出整体链路可用。 + """ + # 1. 生成最小可用 config.yaml + key = Fernet.generate_key().decode() + db_path = tmp_path / "devices.db" + cfg_path = tmp_path / "config.yaml" + + config: Dict[str, Any] = { + "global": { + "http_listen": "127.0.0.1:19100", + "scrape_interval_seconds": 2, + "rpc_timeout_seconds": 2, + "shutdown_timeout_seconds": 10, + "runtime_db_path": str(db_path), + "password_secret": key, + "api_token": "changeme", + }, + "devices": [], + } + cfg_path.write_text(yaml.safe_dump(config), encoding="utf-8") + + # 2. 启动 exporter 子进程 + root = Path(__file__).resolve().parents[1] + env = os.environ.copy() + src_path = str(root / "src") + pythonpath = env.get("PYTHONPATH") + env["PYTHONPATH"] = src_path if not pythonpath else os.pathsep.join([src_path, pythonpath]) + + proc = subprocess.Popen( + [sys.executable, "-m", "exporter.main", "--config", str(cfg_path)], + cwd=str(root), + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + ) + + base_url = "http://127.0.0.1:19100" + + def _http_request(path: str, method: str = "GET", body: bytes | None = None, headers: Dict[str, str] | None = None): + import http.client + + conn = http.client.HTTPConnection("127.0.0.1", 19100, timeout=5) + try: + conn.request(method, path, body=body, headers=headers or {}) + resp = conn.getresponse() + data = resp.read() + return resp.status, resp.getheaders(), data + finally: + conn.close() + + try: + # 3. 等待 HTTP server 启动(轮询 /healthz) + deadline = time.time() + 30 + last_stdout = "" + while True: + if time.time() > deadline: + proc.terminate() + out, err = proc.communicate(timeout=5) + raise AssertionError(f"Exporter did not start in time.\nSTDOUT:\n{out}\nSTDERR:\n{err}") + if proc.poll() is not None: + out, err = proc.communicate(timeout=5) + raise AssertionError(f"Exporter exited early with code {proc.returncode}.\nSTDOUT:\n{out}\nSTDERR:\n{err}") + try: + status, _, data = _http_request("/healthz") + if status == 200: + health = json.loads(data.decode("utf-8")) + assert health.get("status") == "ok" + break + except Exception: + # server 可能尚未 ready,稍后重试 + time.sleep(0.5) + + # 4. 通过 API 注册一个 runtime 设备 + device_payload = { + "name": "e2e-device-1", + "host": "192.0.2.10", + "port": 830, + "username": "netconf_user", + "password": "secret", + "enabled": True, + } + headers = { + "Content-Type": "application/json", + "X-API-Token": "changeme", + } + status, _, data = _http_request( + "/api/v1/devices", + method="POST", + body=json.dumps(device_payload).encode("utf-8"), + headers=headers, + ) + assert status == 201, f"unexpected status for POST /api/v1/devices: {status}, body={data!r}" + body_json = json.loads(data.decode("utf-8")) + assert body_json["name"] == "e2e-device-1" + assert body_json["source"] == "runtime" + + # 5. 访问 /metrics,验证 Prometheus 输出可用 + status, headers_list, data = _http_request("/metrics") + assert status == 200 + header_dict = {k.lower(): v for k, v in headers_list} + assert "text/plain" in header_dict.get("content-type", "") + text = data.decode("utf-8") + assert "# HELP netconf_scrape_success" in text + + finally: + # 6. 优雅关闭 exporter 进程 + if proc.poll() is None: + try: + proc.send_signal(signal.SIGTERM) + except Exception: + proc.terminate() + try: + proc.wait(timeout=20) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait(timeout=10) + + +@pytest.mark.http_e2e +@pytest.mark.h3c_live +def test_exporter_http_with_h3c_device(tmp_path) -> None: + """ + 带真实 H3C 设备的端到端测试: + - 使用 run_yangcli*.sh 中的 H3C 连接参数; + - 启动完整 exporter.main(包含 Scraper 和 HTTP server); + - 静态配置一台 H3C 设备; + - 等待至少一轮采集后,通过 /metrics 检查该设备的健康指标是否存在。 + """ + # 为避免依赖其他测试模块,这里重复读取 H3C 连接参数 + import socket + + host = os.getenv("H3C_NETCONF_HOST", "127.0.0.1") + port = int(os.getenv("H3C_NETCONF_PORT", "8830")) + user = os.getenv("H3C_NETCONF_USER", "netconf_user") + password = os.getenv("H3C_NETCONF_PASSWORD", "") + + def _can_connect_local(h: str, p: int, timeout: float = 2.0) -> bool: + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + try: + s.settimeout(timeout) + s.connect((h, p)) + return True + except OSError: + return False + finally: + s.close() + + if not _can_connect_local(host, port): + pytest.skip(f"H3C NETCONF {host}:{port} 不可达,跳过 H3C HTTP E2E 测试") + + key = Fernet.generate_key().decode() + db_path = tmp_path / "devices.db" + cfg_path = tmp_path / "config_h3c.yaml" + + config: Dict[str, Any] = { + "global": { + "http_listen": "127.0.0.1:19101", + "scrape_interval_seconds": 5, + "rpc_timeout_seconds": 10, + "shutdown_timeout_seconds": 20, + "runtime_db_path": str(db_path), + "password_secret": key, + "api_token": "changeme-h3c", + }, + "devices": [ + { + "name": "h3c-live-1", + "host": host, + "port": port, + "username": user, + "password": password, + "enabled": True, + } + ], + } + cfg_path.write_text(yaml.safe_dump(config), encoding="utf-8") + + root = Path(__file__).resolve().parents[1] + env = os.environ.copy() + src_path = str(root / "src") + pythonpath = env.get("PYTHONPATH") + env["PYTHONPATH"] = src_path if not pythonpath else os.pathsep.join([src_path, pythonpath]) + + proc = subprocess.Popen( + [sys.executable, "-m", "exporter.main", "--config", str(cfg_path)], + cwd=str(root), + env=env, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + text=True, + ) + + def _http_request(path: str, method: str = "GET", body: bytes | None = None, headers: Dict[str, str] | None = None): + import http.client + + conn = http.client.HTTPConnection("127.0.0.1", 19101, timeout=10) + try: + conn.request(method, path, body=body, headers=headers or {}) + resp = conn.getresponse() + data = resp.read() + return resp.status, resp.getheaders(), data + finally: + conn.close() + + try: + # 等待 server 起 + deadline = time.time() + 60 + while True: + if time.time() > deadline: + proc.terminate() + out, err = proc.communicate(timeout=5) + raise AssertionError(f"Exporter (H3C E2E) did not start in time.\nSTDOUT:\n{out}\nSTDERR:\n{err}") + if proc.poll() is not None: + out, err = proc.communicate(timeout=5) + raise AssertionError(f"Exporter (H3C E2E) exited early with code {proc.returncode}.\nSTDOUT:\n{out}\nSTDERR:\n{err}") + try: + status, _, data = _http_request("/healthz") + if status == 200: + break + except Exception: + time.sleep(0.5) + + # 等待至少一轮 Scraper(scrape_interval_seconds=5) + time.sleep(7) + + # 检查 /metrics 可访问且包含健康指标定义 + status, _, data = _http_request("/metrics") + assert status == 200 + text = data.decode("utf-8") + assert "# HELP netconf_scrape_success" in text + + finally: + if proc.poll() is None: + try: + proc.send_signal(signal.SIGTERM) + except Exception: + proc.terminate() + try: + proc.wait(timeout=30) + except subprocess.TimeoutExpired: + proc.kill() + proc.wait(timeout=10) diff --git a/tests/test_logging_utils.py b/tests/test_logging_utils.py new file mode 100644 index 0000000..92797f0 --- /dev/null +++ b/tests/test_logging_utils.py @@ -0,0 +1,77 @@ +from __future__ import annotations + +import logging +from io import StringIO + +from exporter.config import GlobalConfig +from exporter.logging_utils import DeviceLoggerAdapter, DeviceFieldFilter, init_logging + + +def _capture_log_output(logger: logging.Logger) -> tuple[StringIO, logging.Handler]: + stream = StringIO() + handler = logging.StreamHandler(stream) + formatter = logging.Formatter( + fmt="%(asctime)s %(levelname)s [%(name)s] device=%(device)s %(message)s", + datefmt="%Y-%m-%dT%H:%M:%S%z", + ) + handler.setFormatter(formatter) + logger.addHandler(handler) + logger.setLevel(logging.INFO) + return stream, handler + + +def test_device_logger_adapter_injects_device() -> None: + logger = logging.getLogger("test_logger_adapter_injects_device") + stream, handler = _capture_log_output(logger) + try: + adapter = DeviceLoggerAdapter(logger, {"device": "dev1"}) + adapter.info("hello world") + output = stream.getvalue() + finally: + logger.removeHandler(handler) + + assert "device=dev1" in output + # 简单校验时间格式中包含 "T"(ISO8601 风格) + assert "T" in output.split()[0] + + +def test_device_logger_fallback_device_dash() -> None: + logger = logging.getLogger("test_logger_adapter_fallback") + stream, handler = _capture_log_output(logger) + try: + # 不在 extra 中显式提供 device,Adapter 应该使用 "-" 作为默认值 + adapter = DeviceLoggerAdapter(logger, {}) + adapter.info("no device context") + output = stream.getvalue() + finally: + logger.removeHandler(handler) + + assert "device=-" in output + + +def test_init_logging_configures_root_logger_handlers() -> None: + """验证 init_logging 根据 GlobalConfig 初始化根 logger。""" + gc = GlobalConfig( + log_level="INFO", + log_to_stdout=True, + log_file="", + ) + # 调用被测函数 + init_logging(gc) + + root = logging.getLogger() + # 至少应该有一个 handler(stdout) + assert root.handlers, "root logger should have at least one handler" + + for handler in root.handlers: + fmt = handler.formatter._fmt # type: ignore[attr-defined] + datefmt = handler.formatter.datefmt # type: ignore[attr-defined] + assert "device=%(device)s" in fmt + assert "%Y-%m-%dT%H:%M:%S%z" == datefmt + + # 至少有一个 handler 安装了 DeviceFieldFilter,保证没有 device 字段的记录也能格式化 + assert any( + isinstance(flt, DeviceFieldFilter) + for handler in root.handlers + for flt in handler.filters + ) diff --git a/tests/test_main_lifecycle.py b/tests/test_main_lifecycle.py new file mode 100644 index 0000000..2f11333 --- /dev/null +++ b/tests/test_main_lifecycle.py @@ -0,0 +1,121 @@ +from __future__ import annotations + +import asyncio +from typing import Any, Dict + +import pytest +import yaml +from cryptography.fernet import Fernet + + +@pytest.mark.asyncio +async def test_async_main_starts_and_stops_cleanly(tmp_path, monkeypatch) -> None: + """ + 集成级测试: + - 使用最小 config.yaml; + - 替换 SQLiteDeviceStore / ConnectionManager / scraper_loop / uvicorn.Server; + - 验证 async_main 能够启动并在 server 结束后优雅关闭 Scraper 和连接。 + """ + # 延迟导入以便 monkeypatch 作用于 exporter.main 模块对象 + from exporter import main as exporter_main + + # 准备配置文件 + key = Fernet.generate_key().decode() + config_path = tmp_path / "config.yaml" + config_data: Dict[str, Any] = { + "global": { + "http_listen": "127.0.0.1:0", + "runtime_db_path": str(tmp_path / "devices.db"), + "password_secret": key, + # 其他字段使用默认值 + }, + "devices": [], + } + config_path.write_text(yaml.safe_dump(config_data), encoding="utf-8") + + created_store: Dict[str, Any] = {} + created_cm: Dict[str, Any] = {} + seen: Dict[str, Any] = {} + + class DummyStore: + def __init__(self, db_path: str, encryptor, timeout: float = 5.0) -> None: + self.db_path = db_path + self.encryptor = encryptor + self.timeout = timeout + self.init_db_called = False + self.closed = False + created_store["instance"] = self + + def init_db(self) -> None: + self.init_db_called = True + + def load_runtime_devices(self): + return [] + + def save_device(self, cfg) -> None: # pragma: no cover - not used here + raise NotImplementedError + + def delete_device(self, name: str) -> None: # pragma: no cover - not used here + raise NotImplementedError + + def close(self) -> None: + self.closed = True + + class DummyConnectionManager: + def __init__(self, global_cfg) -> None: + self.global_cfg = global_cfg + self.closed = False + created_cm["instance"] = self + + def acquire_session(self, cfg): # pragma: no cover - Scraper 不会真正调用 + raise NotImplementedError + + def close_all(self) -> None: + self.closed = True + + def dummy_scraper_loop( + stop_event, + registry, + connection_manager, + netconf_get_rpc, + cache, + health, + global_cfg, + ) -> None: + # 记录 stop_event,并等待它被置位后退出 + seen["stop_event"] = stop_event + stop_event.wait(timeout=1.0) + + class DummyServer: + def __init__(self, config) -> None: + self.config = config + self.served = False + + async def serve(self) -> None: + # 立即返回以触发 shutdown 流程 + await asyncio.sleep(0) + self.served = True + + # 应用 monkeypatch + monkeypatch.setattr(exporter_main, "SQLiteDeviceStore", DummyStore) + monkeypatch.setattr(exporter_main, "ConnectionManager", DummyConnectionManager) + monkeypatch.setattr(exporter_main, "scraper_loop", dummy_scraper_loop) + monkeypatch.setattr(exporter_main.uvicorn, "Server", DummyServer) + + # 运行 async_main(应当能够在短时间内返回) + await exporter_main.async_main(["--config", str(config_path)]) + + store = created_store["instance"] + cm = created_cm["instance"] + + # 验证 DB 初始化与关闭被调用 + assert store.init_db_called is True + assert store.closed is True + + # 验证连接被关闭 + assert cm.closed is True + + # 验证 Scraper 收到 stop_event 并退出 + assert "stop_event" in seen + assert seen["stop_event"].is_set() + diff --git a/tests/test_metrics.py b/tests/test_metrics.py new file mode 100644 index 0000000..98488b8 --- /dev/null +++ b/tests/test_metrics.py @@ -0,0 +1,132 @@ +import time + +from exporter.metrics import TransceiverCollector +from exporter.models import ( + DeviceHealthState, + DeviceMetricsSnapshot, + TransceiverChannelRecord, + TransceiverRecord, +) + + +def _collect_metrics(collector: TransceiverCollector): + return list(collector.collect()) + + +def test_collector_exports_transceiver_and_info_with_component_name(): + snapshot = DeviceMetricsSnapshot( + device="dev1", + collected_at=time.time(), + transceivers=( + TransceiverRecord( + device="dev1", + component_name="comp1", + logical_port="1/0/1", + present="PRESENT", + oper_status="ACTIVE", + temperature_c=40.0, + supply_voltage_v=3.3, + vendor="H3C", + serial="SN1", + part_number="PN", + hardware_rev="1.0", + ), + ), + channels=(), + ) + cache = {"dev1": snapshot} + health = { + "dev1": DeviceHealthState( + last_scrape_success=True, + last_scrape_duration=0.1, + last_scrape_timestamp=time.time(), + last_error_type=None, + ) + } + + collector = TransceiverCollector(cache, health) + metrics = _collect_metrics(collector) + + temp_metric = [m for m in metrics if m.name == "transceiver_temperature_celsius"][0] + sample = temp_metric.samples[0] + assert sample.value == 40.0 + assert sample.labels["device"] == "dev1" + assert sample.labels["port"] == "1/0/1" + assert sample.labels["component_name"] == "comp1" + + info_metric = [m for m in metrics if m.name == "transceiver_info"][0] + info_labels = info_metric.samples[0].labels + assert info_labels["device"] == "dev1" + assert info_labels["component_name"] == "comp1" + assert info_labels["vendor"] == "H3C" + assert info_labels["serial"] == "SN1" + + +def test_collector_channel_metrics_include_component_name(): + snapshot = DeviceMetricsSnapshot( + device="dev1", + collected_at=time.time(), + transceivers=(), + channels=( + TransceiverChannelRecord( + device="dev1", + component_name="comp1", + logical_port="1/0/1", + channel_index=0, + logical_channel="1/0/1:1", + rx_power_dbm=-3.0, + tx_power_dbm=-1.0, + bias_current_ma=10.0, + laser_temperature_c=25.0, + ), + ), + ) + cache = {"dev1": snapshot} + health = { + "dev1": DeviceHealthState( + last_scrape_success=True, + last_scrape_duration=0.1, + last_scrape_timestamp=time.time(), + last_error_type=None, + ) + } + + collector = TransceiverCollector(cache, health) + metrics = _collect_metrics(collector) + + tx_metric = [m for m in metrics if m.name == "transceiver_channel_tx_power_dbm"][0] + sample = tx_metric.samples[0] + assert sample.labels["device"] == "dev1" + assert sample.labels["port"] == "1/0/1" + assert sample.labels["channel"] == "1/0/1:1" + assert sample.labels["component_name"] == "comp1" + + info_metric = [m for m in metrics if m.name == "transceiver_channel_info"][0] + info_labels = info_metric.samples[0].labels + assert info_labels["device"] == "dev1" + assert info_labels["channel"] == "1/0/1:1" + assert info_labels["component_name"] == "comp1" + + +def test_collector_no_business_metrics_on_failure(): + cache = {} # 没有成功快照 + health = { + "dev1": DeviceHealthState( + last_scrape_success=False, + last_scrape_duration=0.2, + last_scrape_timestamp=time.time(), + last_error_type="TimeoutError", + ) + } + + collector = TransceiverCollector(cache, health) + metrics = _collect_metrics(collector) + + # 有健康指标 + success_metric = [m for m in metrics if m.name == "netconf_scrape_success"][0] + assert any(s.labels["device"] == "dev1" and s.value == 0 for s in success_metric.samples) + + # 不应有 transceiver_temperature_celsius + temp_metrics = [m for m in metrics if m.name == "transceiver_temperature_celsius"] + assert not temp_metrics or not temp_metrics[0].samples + diff --git a/tests/test_models.py b/tests/test_models.py new file mode 100644 index 0000000..634ab12 --- /dev/null +++ b/tests/test_models.py @@ -0,0 +1,67 @@ +import dataclasses + +import pytest + +from exporter.models import ( + DeviceMetricsSnapshot, + INT32_MAX, + TransceiverChannelRecord, + TransceiverRecord, + is_invalid_value, +) + + +def test_transceiver_record_is_frozen(): + record = TransceiverRecord( + device="dev1", + component_name="comp1", + logical_port="1/0/1", + present="PRESENT", + oper_status="ACTIVE", + temperature_c=40.0, + supply_voltage_v=3.3, + vendor="H3C", + serial="SN1", + part_number="PN", + hardware_rev="1.0", + ) + with pytest.raises(dataclasses.FrozenInstanceError): + record.device = "dev2" + + +def test_transceiver_channel_record_is_frozen(): + channel = TransceiverChannelRecord( + device="dev1", + component_name="comp1", + logical_port="1/0/1", + channel_index=0, + logical_channel="1/0/1:1", + rx_power_dbm=-3.0, + tx_power_dbm=-1.0, + bias_current_ma=10.0, + laser_temperature_c=25.0, + ) + with pytest.raises(dataclasses.FrozenInstanceError): + channel.channel_index = 1 + + +def test_snapshot_is_frozen(): + tx = TransceiverRecord(device="d", component_name="c", logical_port="p") + snap = DeviceMetricsSnapshot(device="d", collected_at=0.0, transceivers=(tx,), channels=()) + with pytest.raises(dataclasses.FrozenInstanceError): + snap.device = "other" + + +@pytest.mark.parametrize( + "value, expected", + [ + (float(INT32_MAX), True), + (INT32_MAX, True), + (INT32_MAX - 1, False), + (-INT32_MAX, False), + (None, False), + ], +) +def test_is_invalid_value_exact_int32_max(value, expected): + assert is_invalid_value(value) is expected + diff --git a/tests/test_netconf_parser.py b/tests/test_netconf_parser.py new file mode 100644 index 0000000..39680da --- /dev/null +++ b/tests/test_netconf_parser.py @@ -0,0 +1,174 @@ +import xml.etree.ElementTree as ET + +import pytest + +from exporter.netconf_client import ( + build_transceiver_filter, + parse_netconf_response, + parse_port_and_channel, +) + + +def test_build_transceiver_filter_contains_expected_paths(): + flt = build_transceiver_filter() + assert " + + + + 323.FourHundredGigE1/0/66 + + TRANSCEIVER + + 45.5 + + + + + PRESENT + Cisco + ABC123 + + + + 0 + + 1/0/66:1 + -2.5 + + + + + + + + +""" + + +def test_parse_transceiver_basic(): + txs, chs = parse_netconf_response(SAMPLE_XML, "dev1") + assert len(txs) == 1 + r = txs[0] + assert r.device == "dev1" + assert r.component_name == "323.FourHundredGigE1/0/66" + assert r.temperature_c == 45.5 + assert r.vendor == "Cisco" + assert r.serial == "ABC123" + assert r.logical_port == "1/0/66" + assert len(chs) == 1 + + +def test_parse_channel_and_description(): + _, chs = parse_netconf_response(SAMPLE_XML, "dev1") + assert len(chs) == 1 + ch = chs[0] + assert ch.logical_port == "1/0/66" + assert ch.logical_channel == "1/0/66:1" + assert ch.tx_power_dbm == -2.5 + + +def test_missing_temperature_not_fatal(): + root = ET.fromstring(SAMPLE_XML) + # remove temperature node + ns_platform = "{http://openconfig.net/yang/platform}" + temp_elem = root.find(f".//{ns_platform}temperature") + parent = root.find(f".//{ns_platform}state") + if temp_elem is not None and parent is not None: + parent.remove(temp_elem) + xml_no_temp = ET.tostring(root, encoding="unicode") + + txs, _ = parse_netconf_response(xml_no_temp, "dev1") + assert txs[0].temperature_c is None + + +def test_invalid_power_filtered(): + xml_invalid = SAMPLE_XML.replace("-2.5", "2147483647.00") + _, chs = parse_netconf_response(xml_invalid, "dev1") + assert chs[0].tx_power_dbm is None + + +@pytest.mark.parametrize( + "description, component_name, index, expected_port, expected_channel", + [ + (None, "comp1", 0, "comp1", "comp1:ch0"), + ("", "comp1", 1, "comp1", "comp1:ch1"), + ("1/0/1:1", "comp1", 2, "1/0/1", "1/0/1:1"), + ("GigabitEthernet1/0/1", "comp1", 3, "GigabitEthernet1/0/1", "GigabitEthernet1/0/1:ch3"), + ], +) +def test_parse_port_and_channel_fallbacks( + description, component_name, index, expected_port, expected_channel +): + lp, lc = parse_port_and_channel(description, component_name, index) + assert lp == expected_port + assert lc == expected_channel + + +def test_multiple_channels_missing_description_produce_unique_logical_channel(): + xml = """\ + + + + + comp1 + TRANSCEIVER + + + + 0 + + + + 1 + + + + + + + + +""" + _, channels = parse_netconf_response(xml, "dev1") + assert len(channels) == 2 + ch0 = next(c for c in channels if c.channel_index == 0) + ch1 = next(c for c in channels if c.channel_index == 1) + assert ch0.logical_port == "comp1" + assert ch1.logical_port == "comp1" + assert ch0.logical_channel != ch1.logical_channel + + +def test_h3c_multi_component_same_serial(): + xml_multi = """\ + + + + + 63.TwoHundredGigE1/0/1:1 + TRANSCEIVER + + SN001 + + + + 64.TwoHundredGigE1/0/1:2 + TRANSCEIVER + + SN001 + + + + + +""" + txs, _ = parse_netconf_response(xml_multi, "h3c") + assert len(txs) == 2 + assert txs[0].serial == "SN001" + assert txs[1].serial == "SN001" + assert txs[0].component_name != txs[1].component_name + diff --git a/tests/test_password_encryptor.py b/tests/test_password_encryptor.py new file mode 100644 index 0000000..c0b7701 --- /dev/null +++ b/tests/test_password_encryptor.py @@ -0,0 +1,19 @@ +from cryptography.fernet import Fernet + +import pytest + +from exporter.sqlite_store import PasswordEncryptor + + +def test_encrypt_decrypt_roundtrip(): + key = Fernet.generate_key().decode() + enc = PasswordEncryptor(key) + cipher = enc.encrypt("secret") + assert cipher != b"secret" + assert enc.decrypt(cipher) == "secret" + + +def test_encryptor_rejects_invalid_key(): + with pytest.raises(ValueError): + PasswordEncryptor("too-short") + diff --git a/tests/test_registry.py b/tests/test_registry.py new file mode 100644 index 0000000..7612016 --- /dev/null +++ b/tests/test_registry.py @@ -0,0 +1,130 @@ +import time + +import pytest + +from exporter.config import DeviceConfig +from exporter.registry import DeviceRegistry + + +def test_register_static_and_runtime_device(): + registry = DeviceRegistry(global_scrape_interval=60) + + static = DeviceConfig( + name="dev1", + host="1.1.1.1", + port=830, + username="u", + password="p", + source="static", + ) + runtime = DeviceConfig( + name="dev1", + host="10.0.0.1", + port=830, + username="u", + password="p2", + source="runtime", + ) + + registry.register_static_device(static) + registry.register_runtime_device(runtime) + + devices = registry.list_devices() + assert len(devices) == 1 + dev = devices[0] + assert dev.name == "dev1" + assert dev.host == "10.0.0.1" + assert dev.password == "p2" + assert dev.source == "runtime" + + +def test_get_enabled_devices_respects_next_scrape_at(monkeypatch): + registry = DeviceRegistry(global_scrape_interval=60) + now = time.time() + + dev1 = DeviceConfig( + name="dev1", + host="h1", + port=830, + username="u", + password="p", + ) + dev2 = DeviceConfig( + name="dev2", + host="h2", + port=830, + username="u", + password="p", + ) + + registry.register_static_device(dev1) + registry.register_static_device(dev2) + + # 手动调整 next_scrape_at + registry._states["dev1"].next_scrape_at = now - 1 + registry._states["dev2"].next_scrape_at = now + 100 + + ready = registry.get_enabled_devices(now) + assert len(ready) == 1 + assert ready[0].cfg.name == "dev1" + + +def test_backoff_increases_on_failure(): + registry = DeviceRegistry(global_scrape_interval=60) + now = time.time() + dev = DeviceConfig( + name="dev", + host="h", + port=830, + username="u", + password="p", + ) + registry.register_static_device(dev) + state = registry._states["dev"] + state.next_scrape_at = now + + # 连续失败三次 + for _ in range(3): + registry.update_after_scrape( + device_name="dev", + success=False, + now=now, + scrape_interval=60, + failure_threshold=3, + max_backoff_factor=8, + ) + + state = registry._states["dev"] + assert state.consecutive_failures == 3 + assert state.backoff_factor >= 2 + assert state.next_scrape_at > now + + +def test_reset_backoff_on_success(): + registry = DeviceRegistry(global_scrape_interval=60) + now = time.time() + dev = DeviceConfig( + name="dev", + host="h", + port=830, + username="u", + password="p", + ) + registry.register_static_device(dev) + state = registry._states["dev"] + state.consecutive_failures = 5 + state.backoff_factor = 4 + + registry.update_after_scrape( + device_name="dev", + success=True, + now=now, + scrape_interval=60, + failure_threshold=3, + max_backoff_factor=8, + ) + + state = registry._states["dev"] + assert state.consecutive_failures == 0 + assert state.backoff_factor == 1 + assert state.next_scrape_at == pytest.approx(now + 60, rel=0.01) diff --git a/tests/test_scraper_stop_event.py b/tests/test_scraper_stop_event.py new file mode 100644 index 0000000..8252353 --- /dev/null +++ b/tests/test_scraper_stop_event.py @@ -0,0 +1,46 @@ +import threading +import time +from types import SimpleNamespace + +from exporter.config import DeviceConfig, GlobalConfig +from exporter.registry import DeviceRegistry +from exporter.scraper import scraper_loop +from exporter.connection import ConnectionManager + + +def test_scraper_stop_during_sleep(monkeypatch): + """ + 在等待间隔时设置 stop_event,应立即退出,而不是等完整周期。 + """ + global_cfg = GlobalConfig() + global_cfg.scrape_interval_seconds = 60 + + registry = DeviceRegistry(global_scrape_interval=global_cfg.scrape_interval_seconds) + connection_mgr = ConnectionManager(global_cfg) + + # netconf_get_rpc: 不做任何事 + def fake_get_rpc(_mgr, _flt): + return "" + + cache = {} + health = {} + + # run_one_scrape_round 在当前实现中是真实采集,但我们不关心,只要快速返回即可 + stop_event = threading.Event() + start = time.time() + + t = threading.Thread( + target=scraper_loop, + args=(stop_event, registry, connection_mgr, fake_get_rpc, cache, health, global_cfg), + daemon=True, + ) + t.start() + + time.sleep(1.0) # 给 loop 一点时间进入 wait + stop_event.set() + t.join(timeout=5.0) + + elapsed = time.time() - start + # 如果 stop_event.wait 工作正常,不应等完整 60 秒 + assert elapsed < 3.0 + diff --git a/tests/test_sqlite_store.py b/tests/test_sqlite_store.py new file mode 100644 index 0000000..502abf9 --- /dev/null +++ b/tests/test_sqlite_store.py @@ -0,0 +1,253 @@ +import sqlite3 +import threading +import time +from pathlib import Path + +from cryptography.fernet import Fernet + +import pytest + +from exporter.config import DeviceConfig +from exporter.sqlite_store import PasswordEncryptor, SQLiteDeviceStore + + +@pytest.fixture +def encryptor() -> PasswordEncryptor: + key = Fernet.generate_key().decode() + return PasswordEncryptor(key) + + +def test_init_db_creates_devices_table(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "test.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + conn = sqlite3.connect(str(db_path)) + row = conn.execute( + "SELECT name FROM sqlite_master WHERE type='table' AND name='devices'" + ).fetchone() + conn.close() + assert row is not None + + +def test_save_and_load_device(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "test.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + dev = DeviceConfig( + name="dev1", + host="1.1.1.1", + port=830, + username="u", + password="p", + enabled=True, + source="runtime", + ) + store.save_device(dev) + loaded = store.load_runtime_devices() + assert len(loaded) == 1 + assert loaded[0].name == "dev1" + assert loaded[0].password == "p" + assert loaded[0].source == "runtime" + + +def test_password_not_stored_in_plaintext(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "test.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + dev = DeviceConfig( + name="dev1", + host="h", + port=830, + username="u", + password="plain", + enabled=True, + source="runtime", + ) + store.save_device(dev) + + conn = sqlite3.connect(str(db_path)) + cipher = conn.execute( + "SELECT password_cipher FROM devices WHERE name='dev1'" + ).fetchone()[0] + conn.close() + + assert cipher != b"plain" + assert encryptor.decrypt(cipher) == "plain" + + +def test_concurrent_writes_are_serialized(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "devices.db" + store = SQLiteDeviceStore(str(db_path), encryptor, timeout=1.0) + store.init_db() + + errors: list[Exception] = [] + + def worker(i: int) -> None: + try: + dev = DeviceConfig( + name=f"dev-{i}", + host="h", + port=830, + username="u", + password="p", + enabled=True, + source="runtime", + ) + store.save_device(dev) + except Exception as e: # noqa: BLE001 + errors.append(e) + + threads = [threading.Thread(target=worker, args=(i,)) for i in range(10)] + for t in threads: + t.start() + for t in threads: + t.join() + + assert errors == [] + loaded = store.load_runtime_devices() + assert {d.name for d in loaded} == {f"dev-{i}" for i in range(10)} + + +def test_each_operation_closes_connection(tmp_path: Path, encryptor: PasswordEncryptor, monkeypatch): + db_path = tmp_path / "devices.db" + + real_connect = sqlite3.connect + connect_calls: list[sqlite3.Connection] = [] + close_calls: list[sqlite3.Connection] = [] + + class ConnWrapper: + def __init__(self, inner: sqlite3.Connection) -> None: + self._inner = inner + connect_calls.append(self) + + def execute(self, *args, **kwargs): + return self._inner.execute(*args, **kwargs) + + def commit(self) -> None: + return self._inner.commit() + + def rollback(self) -> None: + return self._inner.rollback() + + def close(self) -> None: + close_calls.append(self) + return self._inner.close() + + def tracked_connect(*args, **kwargs): + conn = real_connect(*args, **kwargs) + return ConnWrapper(conn) + + monkeypatch.setattr(sqlite3, "connect", tracked_connect) + + store = SQLiteDeviceStore(str(db_path), encryptor, timeout=1.0) + store.init_db() + + for i in range(5): + dev = DeviceConfig( + name=f"d{i}", + host="h", + port=830, + username="u", + password="p", + enabled=True, + source="runtime", + ) + store.save_device(dev) + store.load_runtime_devices() + + assert len(connect_calls) == len(close_calls) + + +def test_delete_existing_device(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "devices.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + dev = DeviceConfig( + name="dev1", + host="h", + port=830, + username="u", + password="p", + enabled=True, + source="runtime", + ) + store.save_device(dev) + store.delete_device("dev1") + loaded = store.load_runtime_devices() + assert all(d.name != "dev1" for d in loaded) + + +def test_delete_non_existing_device(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "devices.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + # 删除不存在的设备应为 no-op + store.delete_device("non-exist") + store.load_runtime_devices() # 不应抛异常 + + +def test_created_at_preserved_and_updated_at_changes(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "devices.db" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + dev1 = DeviceConfig( + name="dev1", + host="h1", + port=830, + username="u", + password="p", + enabled=True, + source="runtime", + ) + store.save_device(dev1) + + conn = sqlite3.connect(str(db_path)) + created1, updated1 = conn.execute( + "SELECT created_at, updated_at FROM devices WHERE name='dev1'" + ).fetchone() + + time.sleep(1) + dev2 = DeviceConfig( + name="dev1", + host="h2", + port=830, + username="u", + password="p2", + enabled=False, + source="runtime", + ) + store.save_device(dev2) + created2, updated2, host = conn.execute( + "SELECT created_at, updated_at, host FROM devices WHERE name='dev1'" + ).fetchone() + conn.close() + + assert created2 == created1 + assert updated2 > updated1 + assert host == "h2" + + +def test_supports_xpath_persisted(tmp_path: Path, encryptor: PasswordEncryptor): + db_path = tmp_path / "db.sqlite" + store = SQLiteDeviceStore(str(db_path), encryptor) + store.init_db() + + dev = DeviceConfig( + name="dev1", + host="h", + port=830, + username="u", + password="p", + enabled=True, + supports_xpath=True, + source="runtime", + ) + store.save_device(dev) + loaded = store.load_runtime_devices() + assert len(loaded) == 1 + assert loaded[0].supports_xpath is True