-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnetgate-snmp.yang
337 lines (263 loc) · 5.74 KB
/
netgate-snmp.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
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
module netgate-snmp {
yang-version 1.1;
namespace "https://netgate.com/ns/netgate-snmp";
prefix "ngsnmp";
import ietf-inet-types {
prefix "inet";
}
import netgate-cli-extensions {
prefix "ngcliext";
}
import netgate-common {
prefix "ngcom";
}
organization "Netgate";
contact "Web: <http://www.netgate.com>";
description
"This YANG module provides a data model for SNMP Services.
Copyright 2019-2020 Rubicon Communications, LLC.";
revision 2022-02-15 {
description
"TNSR Release 22.02.";
}
revision 2021-02-15 {
description
"TNSR Release 21.02.";
}
revision 2020-06-15 {
description
"TNSR Release 20.06.";
}
revision 2020-02-15 {
description
"TNSR Release 20.02.";
}
revision 2019-12-15 {
description
"TNSR Release 19.12.";
}
revision 2019-08-30 {
description
"TNSR Release 19.08.";
}
typedef snmp-view-type {
type enumeration {
enum included;
enum excluded;
}
}
typedef snmp-security-level {
type enumeration {
enum noauth;
/* enum auth; */
/* enum priv; */
}
}
typedef snmp-security-model {
type enumeration {
enum any;
enum v1;
enum v2c;
/* enum usm; */
/* enum tsm; */
/* enum ksm; */
}
}
typedef snmp-context-match {
type enumeration {
enum exact;
/* enum prefix; */
}
}
typedef snmp-source {
type union {
type enumeration { enum "default"; }
type inet:ipv6-prefix;
type inet:ipv4-prefix;
}
}
rpc snmp-control {
input {
leaf operation {
type ngcom:service-operation;
mandatory true;
description
"One of the strings 'start', 'stop', 'restart',
or 'status'.";
}
leaf namespace {
type ngcom:network-namespace;
description
"Network namespace.";
}
}
output {
leaf stdout {
type string;
}
}
}
rpc snmp-coredump {
input {
leaf operation {
type ngcom:service-op-enable-disable;
mandatory true;
description
"One of the strings 'enable' or 'disable'.";
}
leaf namespace {
type ngcom:network-namespace;
description
"Network namespace.";
}
}
output {
leaf stdout {
type string;
}
}
}
container snmp-config {
description
"Simple Network Management Protocol (SNMP) configuration.";
ngcliext:parent-fmt "snmp";
leaf snmp-enable {
type boolean;
default "false";
description
"Enable the SNMP daemons.";
ngcliext:node-op "bool";
ngcliext:node-fmt "$< host disable$n|$< host enable$n";
}
container dataplane {
description
"Dataplane-specific parameters of SNMP server.";
ngcliext:parent-fmt "$< dataplane";
leaf enable {
type boolean;
description
"If true, SNMP server is enabled for dataplane
interfaces.";
ngcliext:node-op "bool";
ngcliext:node-fmt "$< disable$n|$< enable$n";
}
}
container snmp-access-control {
ngcliext:parent-fmt "$<";
list community-map {
key "community-name";
description
"Map community name from SNMP request to security name.";
ngcliext:parent-fmt "$< community community-name @{community-name}";
leaf community-name {
type string;
description
"Community name.";
}
list map-entry {
key "context source";
ngcliext:node-fmt "$< source @{source} security-name @{security-name}$n";
leaf context {
type string;
description
"SNMPv3 context.";
}
leaf source {
type snmp-source;
description
"Host name or IP address for source host.";
}
leaf security-name {
type string;
mandatory true;
description
"Security name.";
}
}
}
list group {
key "group-name";
description
"Map security name to group.";
ngcliext:parent-fmt "$< group group-name @{group-name}";
leaf group-name {
type string;
}
list group-entry {
key "security-name security-model";
ngcliext:node-fmt "$< security-name @{security-name} security-model @{security-model}$n";
leaf security-name {
type string;
}
leaf security-model {
type snmp-security-model;
}
}
}
list view {
key "view-name";
description
"Defines a subset of the OID tree.";
ngcliext:parent-fmt "$< view view-name @{view-name}";
leaf view-name {
type string;
}
list view-entry {
key "type oid";
ngcliext:node-fmt "$< view-type @{type} oid @{oid}$n";
leaf type {
type snmp-view-type;
description
"One of 'exclude' or 'include'.";
}
leaf oid {
type ngcom:object-id-view-128;
mandatory true;
description
"SNMP OID.";
}
leaf mask {
type string;
}
}
}
list access {
key "group-name";
description
"Map from group to views.";
ngcliext:parent-fmt "$< access group-name @{group-name}";
leaf group-name {
type string;
}
list access-entry {
key "context prefix security-model security-level";
ngcliext:node-fmt "$< prefix @{prefix} model @{security-model} level @{security-level} read @{read} write @{write}$n";
leaf context {
type string;
}
leaf prefix {
type snmp-context-match;
}
leaf security-model {
type snmp-security-model;
}
leaf security-level {
type snmp-security-level;
}
leaf read {
type string;
mandatory true;
description
"View to use for read ops.";
}
leaf write {
type string;
mandatory true;
description
"View to use for write ops.";
}
}
}
}
}
}