blob: 6bddf1a28d94ab951d00c51b5981bbf0a1f07669 [file] [log] [blame]
Gaurav Agrawal28920d82017-10-06 17:39:42 +05301submodule ietf-snmp-community {
2
3 belongs-to ietf-snmp {
4 prefix snmp;
5 }
6
7 import ietf-netconf-acm {
8 prefix nacm;
9 }
10
11 include ietf-snmp-common;
12 include ietf-snmp-target;
13 include ietf-snmp-proxy;
14
15 organization
16 "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
17
18 contact
19 "WG Web: <http://tools.ietf.org/wg/netmod/>
20 WG List: <mailto:netmod@ietf.org>
21
22 WG Chair: Thomas Nadeau
23 <mailto:tnadeau@lucidvision.com>
24
25 WG Chair: Juergen Schoenwaelder
26 <mailto:j.schoenwaelder@jacobs-university.de>
27 Editor: Martin Bjorklund
28 <mailto:mbj@tail-f.com>
29
30 Editor: Juergen Schoenwaelder
31 <mailto:j.schoenwaelder@jacobs-university.de>";
32
33 description
34 "This submodule contains a collection of YANG definitions
35 for configuring community-based SNMP.
36
37 Copyright (c) 2014 IETF Trust and the persons identified as
38 authors of the code. All rights reserved.
39
40 Redistribution and use in source and binary forms, with or
41 without modification, is permitted pursuant to, and subject
42 to the license terms contained in, the Simplified BSD License
43 set forth in Section 4.c of the IETF Trust's Legal Provisions
44 Relating to IETF Documents
45 (http://trustee.ietf.org/license-info).
46
47 This version of this YANG module is part of RFC 7407; see
48 the RFC itself for full legal notices.";
49
50 reference
51 "RFC 3584: Coexistence between Version 1, Version 2, and
52 Version 3 of the Internet-standard Network
53 Management Framework";
54
55 revision 2014-12-10 {
56 description
57 "Initial revision.";
58 reference
59 "RFC 7407: A YANG Data Model for SNMP Configuration";
60 }
61
62 augment /snmp:snmp {
63
64 list community {
65 key index;
66
67 description
68 "List of communities.";
69 reference
70 "RFC 3584: Coexistence between Version 1, Version 2,
71 and Version 3 of the Internet-standard
72 Network Management Framework.
73 SNMP-COMMUNITY-MIB.snmpCommunityTable";
74
75 leaf index {
76 type snmp:identifier;
77 description
78 "Index into the community list.";
79 reference
80 "RFC 3584: Coexistence between Version 1, Version 2,
81 and Version 3 of the Internet-standard
82 Network Management Framework.
83 SNMP-COMMUNITY-MIB.snmpCommunityIndex";
84 }
85 choice name {
86 nacm:default-deny-all;
87 description
88 "The community name, specified as either a string or
89 a binary value. The binary name is used when the
90 community name contains characters that are not legal
91 in a string.
92
93 If not set, the value of 'security-name' is operationally
94 used as the snmpCommunityName.";
95 reference
96 "RFC 3584: Coexistence between Version 1, Version 2,
97 and Version 3 of the Internet-standard
98 Network Management Framework.
99 SNMP-COMMUNITY-MIB.snmpCommunityName";
100 leaf text-name {
101 type string;
102 description
103 "A community name that can be represented as a
104 YANG string.";
105 }
106 leaf binary-name {
107 type binary;
108 description
109 "A community name represented as a binary value.";
110 }
111 }
112 leaf security-name {
113 type snmp:security-name;
114 mandatory true;
115 nacm:default-deny-all;
116 description
117 "The snmpCommunitySecurityName of this entry.";
118 reference
119 "RFC 3584: Coexistence between Version 1, Version 2,
120 and Version 3 of the Internet-standard
121 Network Management Framework.
122 SNMP-COMMUNITY-MIB.snmpCommunitySecurityName";
123 }
124 leaf engine-id {
125 if-feature snmp:proxy;
126 type snmp:engine-id;
127 description
128 "If not set, the value of the local SNMP engine is
129 operationally used by the device.";
130 reference
131 "RFC 3584: Coexistence between Version 1, Version 2,
132 and Version 3 of the Internet-standard
133 Network Management Framework.
134 SNMP-COMMUNITY-MIB.snmpCommunityContextEngineID";
135 }
136 leaf context {
137 type snmp:context-name;
138 default "";
139 description
140 "The context in which management information is accessed
141 when using the community string specified by this entry.";
142 reference
143 "RFC 3584: Coexistence between Version 1, Version 2,
144 and Version 3 of the Internet-standard
145 Network Management Framework.
146 SNMP-COMMUNITY-MIB.snmpCommunityContextName";
147 }
148 leaf target-tag {
149 type snmp:tag-value;
150 description
151 "Used to limit access for this community to the specified
152 targets.
153
154 Implementations MAY restrict the values of this leaf
155 to be one of the available values of /snmp/target/tag in
156 a valid configuration.";
157 reference
158 "RFC 3584: Coexistence between Version 1, Version 2,
159 and Version 3 of the Internet-standard
160 Network Management Framework.
161 SNMP-COMMUNITY-MIB.snmpCommunityTransportTag";
162 }
163 }
164 }
165
166 grouping v1-target-params {
167 container v1 {
168 description
169 "SNMPv1 parameters type.
170 Represents snmpTargetParamsMPModel '0',
171 snmpTargetParamsSecurityModel '1', and
172 snmpTargetParamsSecurityLevel 'noAuthNoPriv'.";
173 leaf security-name {
174 type snmp:security-name;
175 mandatory true;
176 description
177 "Implementations MAY restrict the values of this leaf
178 to be one of the available values of
179 /snmp/community/security-name in a valid configuration.";
180 reference
181 "RFC 3413: Simple Network Management Protocol (SNMP).
182 Applications.
183 SNMP-TARGET-MIB.snmpTargetParamsSecurityName";
184 }
185 }
186 }
187
188 grouping v2c-target-params {
189 container v2c {
190 description
191 "SNMPv2 community parameters type.
192 Represents snmpTargetParamsMPModel '1',
193 snmpTargetParamsSecurityModel '2', and
194 snmpTargetParamsSecurityLevel 'noAuthNoPriv'.";
195 leaf security-name {
196 type snmp:security-name;
197 mandatory true;
198 description
199 "Implementations MAY restrict the values of this leaf
200 to be one of the available values of
201 /snmp/community/security-name in a valid configuration.";
202 reference
203 "RFC 3413: Simple Network Management Protocol (SNMP).
204 Applications.
205 SNMP-TARGET-MIB.snmpTargetParamsSecurityName";
206 }
207 }
208 }
209
210 augment /snmp:snmp/snmp:target-params/snmp:params {
211 case v1 {
212 uses v1-target-params;
213 }
214 case v2c {
215 uses v2c-target-params;
216 }
217 }
218
219 augment /snmp:snmp/snmp:target {
220 when "snmp:v1 or snmp:v2c";
221 leaf mms {
222 type union {
223 type enumeration {
224 enum "unknown" { value 0; }
225 }
226 type int32 {
227 range "484..max";
228 }
229 }
230 default "484";
231 description
232 "The maximum message size.";
233 reference
234 "RFC 3584: Coexistence between Version 1, Version 2,
235 and Version 3 of the Internet-standard
236 Network Management Framework.
237 SNMP-COMMUNITY-MIB.snmpTargetAddrMMS";
238 }
239 }
240
241}