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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
|
module bgp-gobgp {
yang-version "1";
// namespace
namespace "https://github.com/osrg/gobgp";
prefix "gobgp";
// import some basic types
import bgp { prefix bgp; }
import routing-policy {prefix rpol; }
import bgp-policy {prefix bgp-pol; }
import ietf-inet-types { prefix inet; }
// meta
organization
"GoBGP";
contact
"GoBGP http://osrg.github.io/gobgp/";
description
"This module contains definitions for GoBGP-specific configuration.
It augments bgp modules with GoBGP-specific options.";
revision "2015-08-10" {
description
"Updated model to augment base bgp modules";
reference "TBD";
}
typedef bgp-origin-attr-type {
type enumeration {
enum IGP {
value 0;
description "Origin of the NLRI is internal";
}
enum EGP {
value 1;
description "Origin of the NLRI is EGP";
}
enum INCOMPLETE {
value 2;
description "Origin of the NLRI is neither IGP or EGP";
}
}
}
grouping gobgp-message-counter {
description
"Counters for all BGPMessage types";
leaf OPEN {
type uint64;
description
"Number of BGP open messages announcing, withdrawing
or modifying paths exchanged.";
}
leaf REFRESH {
type uint64;
description
"Number of BGP Route-Refresh messages indicating an
error condition has occurred exchanged.";
}
leaf KEEPALIVE {
type uint64;
description
"Number of BGP Keepalive messages indicating an
error condition has occurred exchanged.";
}
leaf DYNAMIC-CAP {
type uint64;
description
"Number of BGP dynamic-cap messages indicating an
error condition has occurred exchanged.";
}
leaf DISCARDED {
type uint64;
description
"Number of discarded messages indicating an
error condition has occurred exchanged.";
}
leaf TOTAL {
type uint64;
description
"Number of total messages indicating an
error condition has occurred exchanged.";
}
}
grouping gobgp-timer {
description "additional timer";
leaf idle-hold-time-after-reset {
type decimal64 {
fraction-digits 2;
}
default 30;
description
"Time interval in seconds that a BGP session will be
in idle state after neighbor reset operation.";
}
}
grouping gobgp-neighbor-timer {
description "additional timer";
leaf downtime {
type yang:timeticks;
description
"This timer determines the amount of time since the
BGP last transitioned out of the Established state";
}
leaf update-recv-time {
type int64;
description
"The number of seconds elasped since January 1, 1970 UTC
last time the BGP session received an UPDATE message";
}
}
grouping gobgp-in-policy {
description
"additional policy";
leaf-list in-policy {
type leafref {
path "/rpol:routing-policy/rpol:policy-definitions/" +
"rpol:policy-definition/rpol:name";
//require-instance true;
}
description
"list of policy names in sequence to be applied on
sending a routing update in the current context, e.g.,
for the current other route server clients.";
}
leaf default-in-policy {
type rpol:default-policy-type;
default REJECT-ROUTE;
description
"explicitly set a default policy if no policy definition
in the in-policy chain is satisfied.";
}
}
grouping gobgp-route-server-config {
description
"Configuration parameter specifying whether
the neighbor is route server client or not.";
leaf route-server-client {
type boolean;
default "false";
description
"Configure the neighbor as a route server client.";
}
}
grouping gobgp-route-server-config-set {
description
"set of configurations for route server client.";
container route-server {
description
"Configure the local router as a route server";
container config {
description
"Configuration parameters relating to route server
client(s) used for the BGP neighbor";
uses gobgp-route-server-config;
}
container state {
config false;
description
"State information relating to route server
client(s) used for the BGP neighbor";
uses gobgp-route-server-config;
}
}
}
grouping gobgp-rpki-validation-result {
description "additional rpki";
leaf rpki-validation-result {
type rpki-validation-result-type;
default NOT-FOUND;
description
"specify the validation result of RPKI based on ROA as conditions";
}
}
typedef rpki-validation-result-type {
type enumeration {
enum NONE {
description "RPKI disabled";
}
enum NOT-FOUND {
description "If the origin AS, prefix, maximum prefix length
does not exist in the range of ROA";
}
enum VALID {
description "If the origin AS, prefix, maximum prefix length is
exist in the range of ROA";
}
enum INVALID {
description "if the origin AS is different when prefix,
maximum prefix length is exist in the range of ROA";
}
}
description
"indicate the validation result of RPKI based on ROA";
}
// augment statements
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:sent" {
description "additional counters";
uses gobgp-message-counter;
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state/bgp:messages/bgp:received" {
description "additional counters";
uses gobgp-message-counter;
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:state" {
description "additional state elements";
leaf admin-down {
type boolean;
description
"The state of administrative operation. If the state is true, it indicates the neighbor is disabled by the administrator";
}
leaf established-count {
type uint32;
description
"The number of how many the peer became established state";
}
leaf flops {
type uint32;
description
"The number of flip-flops";
}
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:config" {
description "additional timer";
uses gobgp-timer;
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:timers/bgp:state" {
description "additional timers";
uses gobgp-timer;
uses gobgp-neighbor-timer;
}
augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" {
description "route server configuration for peer-group";
uses gobgp-route-server-config-set;
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" {
description "route server configuration for neighbor";
uses gobgp-route-server-config-set;
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:config" {
description "neighbor's local ip address, whose type is inet:ip-address";
leaf local-address {
type inet:ip-address;
}
}
augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/bgp:transport/bgp:state" {
description "neighbor's local ip address, whose type is inet:ip-address";
leaf local-address {
type inet:ip-address;
}
}
augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:config" {
description "addtional policy";
uses gobgp-in-policy;
}
augment "/bgp:bgp/bgp:global/bgp:apply-policy/bgp:state" {
description "additional policy";
uses gobgp-in-policy;
}
augment "/rpol:routing-policy/rpol:policy-definitions/" +
"rpol:policy-definition/rpol:statements/rpol:statement/" +
"rpol:actions/bgp-pol:bgp-actions/bgp-pol:set-as-path-prepend" {
description "as number used for aspath prepend";
leaf as {
type union {
type inet:as-number;
type string {
pattern "last-as";
}
}
description
"autonomous system number or 'last-as' which means
the leftmost as number in the AS-path to be prepended";
}
}
augment "/rpol:routing-policy/rpol:defined-sets/rpol:neighbor-sets/rpol:neighbor-set" {
description "alternative for the existing neighbor element";
list neighbor-info {
leaf address {
type inet:ip-address;
description
"neighbor ip address";
}
}
}
augment "/rpol:routing-policy/rpol:defined-sets/" +
"bgp-pol:bgp-defined-sets/bgp-pol:community-sets/bgp-pol:community-set" {
description "alternative for the existing community-member";
list community {
leaf community {
type string;
description
"community set member";
}
}
}
augment "/rpol:routing-policy/rpol:defined-sets/" +
"bgp-pol:bgp-defined-sets/bgp-pol:ext-community-sets/bgp-pol:ext-community-set" {
description "alternative for the existing ext-community-member";
list ext-community {
leaf ext-community {
type string;
description
"extended community set member";
}
}
}
augment "/rpol:routing-policy/rpol:defined-sets/" +
"bgp-pol:bgp-defined-sets/bgp-pol:as-path-sets/bgp-pol:as-path-set" {
description "alternative for the existing as-path-set-member";
list as-path {
leaf as-path {
type string;
description
"AS path expression";
}
}
}
augment "/rpol:routing-policy/rpol:policy-definitions/" +
"rpol:policy-definition/rpol:statements/rpol:statement/" +
"rpol:conditions/bgp-pol:bgp-conditions" {
description "additional rpki condition";
uses gobgp-rpki-validation-result;
}
}
|