Witness: enum witness_notifyResponse_type
[wireshark-wip.git] / asn1 / snmp / snmp.asn
blobf82d1950d4966e1d7bb83081bbe4cf345d6b60df
1 -- $Id$
2 RFC1157-SNMP DEFINITIONS ::= BEGIN
3    
4 --      IMPORTS
5 --          ObjectName, ObjectSyntax, NetworkAddress, IpAddress, TimeTicks
6 --              FROM RFC1155-SMI;
7 --
8 -- Local imports
9 --      IMPORTS
10 --          ObjectName, ObjectSyntax, NetworkAddress, IpAddress, TimeTicks
11 --              FROM RFC1155-SMI;
13 -- names of objects
14 -- (Note that these definitions of ObjectName and NotificationName
15 --  are not to be IMPORTed by MIB modules.)
18 --ObjectSyntax ::= CHOICE {
19 --     simple SimpleSyntax,
20 --     application-wide ApplicationSyntax
21 --}
23 --SimpleSyntax ::= CHOICE {
24 --   integer-value Integer-value,
25 --   string-value String-value,
26 --   objectID-value ObjectID-value,
27 --       empty  Empty
28 --}
30 --String-value ::= OCTET STRING (SIZE (0..65535))
32   -- includes Integer32
33 --Integer-value ::=  INTEGER (-2147483648..2147483647)
35 --Integer32 ::= INTEGER (-2147483648..2147483647)
37 --ObjectID-value ::= OBJECT IDENTIFIER
39 --Empty ::= NULL
41   -- hundredths of seconds since an event, usualy the last restart
42 --TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295) 
44 --Opaque ::= [APPLICATION 4] IMPLICIT OCTET STRING
46 --Counter64 ::= [APPLICATION 6] IMPLICIT INTEGER (0..18446744073709551615)
48 --ApplicationSyntax ::= CHOICE {
49 --      ipAddress-value IpAddress,
50 --      counter-value Counter32,
51 --      timeticks-value TimeTicks,
52 --      arbitrary-value Opaque,
53 --      big-counter-value Counter64,
54 --      unsigned-integer-value Unsigned32
55      -- includes Gauge32
56 --}
57 --NetworkAddress ::=  CHOICE { internet IpAddress }
58 --IpAddress ::= [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4))
60 NotificationName ::= OBJECT IDENTIFIER
61 EnterpriseOID ::= OBJECT IDENTIFIER
62 NetworkAddress ::= [APPLICATION 0] IMPLICIT OCTET STRING (SIZE (4))
63 TimeTicks ::= [APPLICATION 3] IMPLICIT INTEGER (0..4294967295)
64 Integer32 ::= INTEGER (-2147483648..2147483647)
65 ObjectName ::= OBJECT IDENTIFIER
66 --Counter32 ::= [APPLICATION 1] IMPLICIT INTEGER (0..4294967295)
67 --Gauge32 ::= [APPLICATION 2] IMPLICIT INTEGER (0..4294967295)
68 --Unsigned32 ::= [APPLICATION 2] IMPLICIT INTEGER (0..4294967295)
70 -- End Import
72 Message ::= SEQUENCE {
73         version Version,
74         community OCTET STRING,
75         data PDUs
78 Version ::= INTEGER { version-1(0), v2c(1), v2u (2), snmpv3(3) }
81 Messagev2u ::=
82          SEQUENCE {
83                  version Version,
84                  parameters OCTET STRING,
85                  -- <model=1>
86                  --      <qoS><agentID><agentBoots><agentTime><maxSize>
87                  --      <userLen><userName><authLen><authDigest>
88                  --      <contextSelector>
90                  datav2u CHOICE {
91                                  plaintext PDUs,
92                                  encrypted OCTET STRING
93                          }
96 -- USMSecurityParametersSyntax DEFINITIONS IMPLICIT TAGS ::= BEGIN
98 UsmSecurityParameters ::= SEQUENCE {
99                 -- global User-based security parameters
100         msgAuthoritativeEngineID     SnmpEngineID,
101         msgAuthoritativeEngineBoots  INTEGER (0..2147483647),
102         msgAuthoritativeEngineTime   INTEGER (0..2147483647),
103         msgUserName                  OCTET STRING (SIZE(1..32)),
104                 -- authentication protocol specific parameters
105         msgAuthenticationParameters  OCTET STRING,
106                 -- privacy protocol specific parameters
107         msgPrivacyParameters         OCTET STRING
109  --  END USMSecurityParametersSyntax
111 SnmpEngineID ::= OCTET STRING
113 -- SNMPv3MessageSyntax DEFINITIONS IMPLICIT TAGS ::= BEGIN
115 SNMPv3Message ::= SEQUENCE {
116                 -- identify the layout of the SNMPv3Message
117                 -- this element is in same position as in SNMPv1
118                 -- and SNMPv2c, allowing recognition
119                 -- the value 3 is used for snmpv3
120         msgVersion Version, 
121                 -- INTEGER ( 0 .. 2147483647 ),
122                 -- administrative parameters
123         msgGlobalData HeaderData,
124                 -- security model-specific parameters
125                 -- format defined by Security Model
126         msgSecurityParameters OCTET STRING,
127         msgData  ScopedPduData
130 HeaderData ::= SEQUENCE {
131    msgID      INTEGER (0..2147483647),
132    msgMaxSize INTEGER (484..2147483647),
134    msgFlags   OCTET STRING (SIZE(1)),
135                   --  .... ...1   authFlag
136                   --  .... ..1.   privFlag
137                   --  .... .1..   reportableFlag
138                   --              Please observe:
139                   --  .... ..00   is OK, means noAuthNoPriv
140                   --  .... ..01   is OK, means authNoPriv
141                   --  .... ..10   reserved, must NOT be used.
142                   --  .... ..11   is OK, means authPriv
144    msgSecurityModel INTEGER (1..2147483647)
148 ScopedPduData ::= CHOICE {
149         plaintext    ScopedPDU,
150         encryptedPDU OCTET STRING  -- encrypted scopedPDU value
153 ScopedPDU ::= SEQUENCE {
154         contextEngineID  SnmpEngineID,
155         contextName      OCTET STRING,
156         data             PDUs
157                 -- ANY 
158                 -- e.g., PDUs as defined in RFC 1905
161 -- END SNMPv3MessageSyntax
162           -- protocol data units
164 PDUs ::= CHOICE {
165         get-request GetRequest-PDU,
166         get-next-request GetNextRequest-PDU,
167         get-response GetResponse-PDU,
168         set-request SetRequest-PDU,
169         trap Trap-PDU,
170         getBulkRequest GetBulkRequest-PDU,
171         informRequest InformRequest-PDU,
172         snmpV2-trap SNMPv2-Trap-PDU,
173         report Report-PDU               
176 -- PDUs
178 GetRequest-PDU ::= [0] IMPLICIT PDU
179 GetNextRequest-PDU ::= [1] IMPLICIT PDU
180 GetResponse-PDU ::= [2] IMPLICIT PDU
182 SetRequest-PDU ::= [3] IMPLICIT PDU
184 -- v2 added
185 -- [4] is obsolete
186 GetBulkRequest-PDU ::= [5] IMPLICIT BulkPDU
187 InformRequest-PDU ::= [6] IMPLICIT PDU
188 SNMPv2-Trap-PDU ::= [7] IMPLICIT PDU
190      --   Usage and precise semantics of Report-PDU are not presently
191      --   defined.  Any SNMP administrative framework making use of
192      --   this PDU must define its usage and semantics.
193 Report-PDU ::= [8] IMPLICIT PDU
196 PDU ::= SEQUENCE {
197         request-id INTEGER,
198         error-status INTEGER {
199                 noError(0),
200                 tooBig(1),
201                 noSuchName(2),   -- for proxy compatibility
202                 badValue(3),     -- for proxy compatibility
203                 readOnly(4),     -- for proxy compatibility
204                 genErr(5),
205                 noAccess(6),
206                 wrongType(7),
207                 wrongLength(8),
208                 wrongEncoding(9),
209                 wrongValue(10),
210                 noCreation(11),
211                 inconsistentValue(12),
212                 resourceUnavailable(13),
213                 commitFailed(14),
214                 undoFailed(15),
215                 authorizationError(16),
216                 notWritable(17),
217                 inconsistentName(18)
218         },
219         error-index INTEGER,
220         variable-bindings VarBindList
223 -- v2
224 BulkPDU ::= SEQUENCE { -- MUST be identical in structure to PDU
225          request-id Integer32,
226          non-repeaters INTEGER (0..2147483647),
227          max-repetitions INTEGER (0..2147483647),
228          variable-bindings VarBindList
231 -- end v2
232 Trap-PDU ::= [4] IMPLICIT SEQUENCE {
233         enterprise EnterpriseOID, -- type of object generating trap, see sysObjectID in [5]
234         agent-addr NetworkAddress, -- address of object generating trap
235         generic-trap INTEGER { -- generic trap type
236                 coldStart(0),
237                 warmStart(1),
238                 linkDown(2),
239                 linkUp(3),
240                 authenticationFailure(4),
241                 egpNeighborLoss(5),
242                 enterpriseSpecific(6)
243         },
244         specific-trap  INTEGER, -- specific code, present even if generic-trap is not enterpriseSpecific
245         time-stamp      TimeTicks, -- time elapsed between the last (re)initialization of the network entity and the generation of the trap
246         variable-bindings  VarBindList  -- "interesting" information
250 -- variable bindings
252 VarBind ::= SEQUENCE { name ObjectName, valueType NULL }
253 -- SEQUENCE {
254 --      name ObjectName,
255 --      valueType ValueType
256 -- }
258 --ValueType ::=  CHOICE {
259 --    value ObjectSyntax,
260 --    unSpecified NULL,
261                                 -- in retrieval requests
262                -- exceptions in responses
263 --         noSuchObject[0] IMPLICIT NULL,
264 --     noSuchInstance[1] IMPLICIT NULL,
265 --     endOfMibView[2] IMPLICIT NULL
268 VarBindList ::= SEQUENCE OF VarBind
270 -- SMUX DEFINITIONS ::= BEGIN RFC 1227
272 SMUX-PDUs ::= CHOICE {
273    open OpenPDU,-- SMUX peer uses immediately after TCP open
274    close ClosePDU, -- either uses immediately before TCP close
275    registerRequest RReqPDU, -- SMUX peer uses
277 --           registerResponse .. SNMP agent uses
278 --               RRspPDU,
280 --               PDUs,
281 -- Rewritten
282         registerResponse RegisterResponse,
283                 -- note that roles are reversed:
284                 --   SNMP agent does get/get-next/set
285                 --   SMUX peer does get-response/trap
287    commitOrRollback -- SNMP agent uses
288            SOutPDU
291 RegisterResponse ::= CHOICE {
292         rRspPDU RRspPDU,
293         pDUs    PDUs
296   -- open PDU
297    -- currently only simple authentication
299 OpenPDU ::= CHOICE {
300   smux-simple SimpleOpen
303 SimpleOpen ::= [APPLICATION 0] IMPLICIT SEQUENCE {
304         smux-version INTEGER { version-1(0) },  -- of SMUX protocol
305         identity OBJECT IDENTIFIER,  -- of SMUX peer, authoritative
306         description DisplayString, -- of SMUX peer, implementation-specific
307         password OCTET STRING -- zero length indicates no authentication
310 DisplayString ::= OCTET STRING
312 ClosePDU ::= [APPLICATION 1] IMPLICIT INTEGER {
313         goingDown(0),
314         unsupportedVersion(1),
315         packetFormat(2),
316         protocolError(3),
317         internalError(4),
318         authenticationFailure(5)
322    -- insert PDU
323 RReqPDU ::= [APPLICATION 2] IMPLICIT SEQUENCE {
324         subtree ObjectName,
325         priority INTEGER (-1..2147483647), -- the lower the better, "-1" means default
327         operation INTEGER { 
328                 delete(0),    -- remove registration
329         readOnly(1),  -- add registration, objects are RO
330         readWrite(2)  --   .., objects are RW
331         }
334 RRspPDU ::= [APPLICATION 3] IMPLICIT INTEGER { failure(-1) } -- on success the non-negative priority is returned
335 SOutPDU ::= [APPLICATION 4] IMPLICIT INTEGER { commit(0), rollback(1) }