-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
frr-nexthop.yang
205 lines (187 loc) · 3.99 KB
/
frr-nexthop.yang
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
module frr-nexthop {
yang-version 1.1;
namespace "http://frrouting.org/yang/nexthop";
prefix frr-nexthop;
import ietf-inet-types {
prefix inet;
}
import ietf-routing-types {
prefix rt-types;
}
import frr-interface {
prefix frr-interface;
}
import frr-vrf {
prefix "frr-vrf";
}
organization
"Free Range Routing";
contact
"FRR Users List: <mailto:frog@lists.frrouting.org>
FRR Development List: <mailto:dev@lists.frrouting.org>";
description
"This module defines a model for managing FRR nexthop information.";
revision 2019-08-15 {
description
"Initial revision.";
}
typedef gateway-address {
type inet:ip-address;
}
/*
* Nexthop types.
*/
typedef nexthop-type {
type enumeration {
enum "ifindex" {
value 1;
description
"Specific interface.";
}
enum "ip4" {
value 2;
description
"IPv4 address.";
}
enum "ip4-ifindex" {
value 3;
description
"IPv4 address and interface.";
}
enum "ip6" {
value 4;
description
"IPv6 address.";
}
enum "ip6-ifindex" {
value 5;
description
"IPv6 address and interface.";
}
enum "blackhole" {
value 6;
description
"Unreachable or prohibited.";
}
}
description
"Nexthop types.";
}
/*
* Blockhole nexthop type.
*/
typedef blackhole-type {
type enumeration {
enum "unspec" {
value 0;
description
"Generic unreachable.";
}
enum "null" {
value 1;
description
"Null type.";
}
enum "reject" {
value 2;
description
"ICMP unreachable.";
}
enum "prohibited" {
value 3;
description
"ICMP admin-prohibited.";
}
}
default "null";
description
"Nexthop blackhole types.";
}
/*
* Common nexthop attributes grouping.
*/
grouping frr-nexthop-attributes {
leaf nh-type {
type nexthop-type;
mandatory true;
description
"The nexthop type.";
}
leaf vrf {
type frr-vrf:vrf-ref;
description
"The nexthop vrf name, if different from the route.";
}
leaf gateway {
type frr-nexthop:gateway-address;
description
"The nexthop gateway address.";
}
leaf interface {
type frr-interface:interface-ref;
description
"The nexthop egress interface.";
}
leaf bh-type {
when "../nh-type = 'blackhole'";
type blackhole-type;
description
"A blackhole sub-type, if the nexthop is a blackhole type.";
}
leaf onlink {
when "../nh-type = 'ip4-ifindex' or
../nh-type = 'ip6-ifindex'";
type boolean;
default false;
description
"Nexthop is directly connected.";
}
uses rt-types:mpls-label-stack {
description
"Nexthop's MPLS label stack.";
}
}
/*
* Single nexthop grouping.
*/
grouping frr-nexthop {
container frr-nexthops {
description
"FRR nexthop object.";
list nexthops {
key "nh-type gateway interface";
description
"A list of nexthop objects.";
uses frr-nexthop-attributes;
}
}
}
/*
* Container for FRR nexthop group.
*/
container frr-nexthop-group {
description
"A nexthop-group, represented as a list of nexthop objects.";
list nexthop-group {
key "name";
description
"A group of nexthops.";
leaf name {
type string;
description
"The nexthop-group name.";
}
uses frr-nexthop;
}
}
/*
* Agument weight attributes to nexthop group.
*/
augment "/frr-nexthop-group/nexthop-group/frr-nexthops/nexthops" {
leaf weight {
type uint8;
description
"Weight to be used by the nexthop for purposes of ECMP";
}
}
}