first commit

This commit is contained in:
yuyr 2025-11-28 14:35:21 +08:00
commit c9634f672a
195 changed files with 73003 additions and 0 deletions

8
.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
.venv
.env
devices.db
exporter.log
specs/

287
README.md Normal file
View File

@ -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 tokencurl/客户端需携带
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 `<get>` 拉取 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 会话会发送 `<close-session>` 并关闭;
- `KeyboardInterrupt` 会被捕获,退出不会打印 Python traceback。
Exporter 本身不持久化运行时状态,只有:
- `config.yaml`:静态全局配置 + 静态设备;
- `devices.db`:运行时注册的设备列表(已加密的密码)。
因此重启 Exporter 不会影响 H3C 设备,只会重新加载配置并恢复运行时设备列表。

25
config.yaml Normal file
View File

@ -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 注册

View File

@ -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
}
}
}
}
}

View File

@ -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
}
}
}
}
}
}

View File

@ -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
...

View File

@ -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
}
}
}
}
}
}
}
}
}

3
exp/yangcli/get_component.sh Executable file
View File

@ -0,0 +1,3 @@
./run_yangcli.sh "sget /oc-platform:components/oc-platform:component[oc-platform:name='323.FourHundredGigE1/0/66']"

View File

@ -0,0 +1 @@
./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-transceiver:transceiver"

View File

@ -0,0 +1 @@
./run_yangcli.sh "sget /oc-platform:components/oc-platform:component/oc-platform:state/oc-platform:type"

2
exp/yangcli/get_interface.sh Executable file
View File

@ -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']"

View File

@ -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.";
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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).";
}
}
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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).";
}
}
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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:
$<id>[$<param>=<value>(,<param>=<value>)*][$<salt>[$<hash>]]
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.";
}
}

View File

@ -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
}

View File

@ -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 '<if name>.<subif index>'";
}
}
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
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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.";
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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;
}
}

View File

@ -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.";
}
}

View File

@ -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;
}
}
}

View File

@ -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.";
}
}

View File

@ -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)";
}
}
}

View File

@ -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;
}
}
}
}

View File

@ -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";
}
}
}

View File

@ -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";
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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:
// <as number> 2 octets
// <community value> 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:<CO bits>:<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.";
}
}

View File

@ -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;
}

View File

@ -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.";
}
}

View File

@ -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
}

View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -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";
}
}

View File

@ -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
}

View File

@ -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";
}
}

View File

@ -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;
}

View File

@ -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.";
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -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;
}
}
}
}

View File

@ -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.";
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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";
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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
}

View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -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
}

View File

@ -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;
}
}
}
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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
}

View File

@ -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: <ip-address>:<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";
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}

View File

@ -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.";
}
}

View File

@ -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;
}
}
}
}
}
}
}

View File

@ -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;
}
}
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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;
}
}
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}
}
}
}

View File

@ -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 <lower>..<higher>, 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";
}
}

View File

@ -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;
}
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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.";
}
}
}

View File

@ -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;
}
}

View File

@ -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";
}
}

View File

@ -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
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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";
}
}

View File

@ -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
}

View File

@ -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;
}
}
}

View File

@ -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";
}
}

View File

@ -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
}

Some files were not shown because too many files have changed in this diff Show More