KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > snmp > SnmpDefinitions


1 /*
2  * @(#)file SnmpDefinitions.java
3  * @(#)author Sun Microsystems, Inc.
4  * @(#)version 4.28
5  * @(#)date 08/02/09
6  *
7  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
8  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
9  *
10  */

11 // Copyright (c) 1995-96 by Cisco Systems, Inc.
12

13 package com.sun.jmx.snmp;
14
15
16
17 /**
18  * Contains SNMP constants related to command and response codes.
19  * All members are static and can be used by any application.
20  *
21  *
22  * <p><b>This API is a Sun Microsystems internal API and is subject
23  * to change without notice.</b></p>
24  * @version 4.28 12/19/03
25  * @author Sun Microsystems, Inc
26  * @author Cisco Systems, Inc.
27  */

28
29 public interface SnmpDefinitions {
30      /**
31       * Security level. No authentication, no privacy. Value is 0, as
32       * defined in RFC 2572.
33       *
34       * @since 1.5
35       */

36     public static final int noAuthNoPriv = 0;
37
38     /**
39      * Security level. Authentication, no privacy. Value is 1, as
40      * defined in RFC 2572.
41      *
42      * @since 1.5
43      */

44     public static final int authNoPriv = 1;
45
46     /**
47      * Security level. Authentication, privacy. Value is 3, as defined
48      * in RFC 2572.
49      *
50      * @since 1.5
51      */

52     public static final int authPriv = 3;
53
54     /**
55      * Flag that indicates that a report is to be sent. Value is 4, as
56      * defined in RFC 2572.
57      *
58      * @since 1.5
59      */

60     public static final int reportableFlag = 4;
61
62     /**
63      * Mask used to isolate authentication information within a message flag.
64      *
65      * @since 1.5
66      */

67     public static final int authMask = 1;
68     /**
69      * Mask used to isolate privacy information within a message flag.
70      */

71     public static final int privMask = 2;
72     /**
73      * Mask used to isolate authentication and privacy information within a message flag.
74      *
75      * @since 1.5
76      */

77     public static final int authPrivMask = 3;
78
79     /**
80      * ASN.1 prefix for encoding PDU types.
81      */

82     public final static int CtxtConsFlag = 128|32 ;
83
84     /**
85      * Represents the SNMP protocol version: <CODE>SnmpV1</CODE>.
86      */

87     final public static byte snmpVersionOne = 0 ;
88
89     /**
90      * Represents the SNMP protocol version: <CODE>SnmpV2</CODE>.
91      */

92     final public static byte snmpVersionTwo = 1 ;
93
94
95      /**
96       * Represents the SNMP protocol version: <CODE>SnmpV3</CODE>.
97       *
98       * @since 1.5
99       */

100     final public static byte snmpVersionThree = 3 ;
101
102     /**
103      * Represents a <CODE>GetRequest</CODE> PDU type (V1 or V2).
104      */

105     public final static int pduGetRequestPdu = CtxtConsFlag|0 ;
106
107     /**
108      * Represents a <CODE>GetNextRequest</CODE> PDU type (V1 or V2).
109      */

110     public final static int pduGetNextRequestPdu = CtxtConsFlag|1 ;
111
112     /**
113      * Represents a <CODE>GetResponse</CODE> PDU type (V1 or V2).
114      */

115     public final static int pduGetResponsePdu = CtxtConsFlag|2 ;
116
117     /**
118      * Represents a <CODE>SetRequest</CODE> PDU type (V1 or V2).
119      */

120     public final static int pduSetRequestPdu = CtxtConsFlag|3 ;
121
122     /**
123      * Represents a <CODE>GetBulkRequest</CODE> PDU type (V2 only).
124      */

125     public final static int pduGetBulkRequestPdu = CtxtConsFlag|5 ;
126
127     /**
128      * Represents a <CODE>Walk</CODE> request.
129      * A walk uses the <CODE>getNext</CODE> request to "walk" through a given MIB.
130      */

131     public final static int pduWalkRequest = 0xFD ;
132
133     /**
134      * Represents a <CODE>V1Trap</CODE> PDU type (V1 only).
135      */

136     public final static int pduV1TrapPdu = CtxtConsFlag|4 ;
137
138     /**
139      * Represents a <CODE>V2Trap</CODE> PDU type (V2 only).
140      */

141     public final static int pduV2TrapPdu = CtxtConsFlag|7 ;
142
143     /**
144      * Represents an <CODE>InformRequest</CODE> PDU type (V2 only).
145      */

146     public final static int pduInformRequestPdu = CtxtConsFlag|6 ;
147
148     /**
149      * Represents a <CODE>Report</CODE> PDU type (V2 only).
150      */

151     public final static int pduReportPdu = CtxtConsFlag|8 ;
152
153
154     // SNMPv1 values for generic trap info in Trap-PDU.
155
//-------------------------------------------------
156
/**
157      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>coldStart</CODE>.
158      */

159     public static final int trapColdStart = 0 ;
160
161     /**
162      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>warmStart</CODE>.
163      */

164     public static final int trapWarmStart = 1 ;
165
166     /**
167      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>linkDown</CODE>.
168      */

169     public static final int trapLinkDown = 2 ;
170
171     /**
172      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>linkUp</CODE>.
173      */

174     public static final int trapLinkUp = 3 ;
175
176     /**
177      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>authenticationFailure</CODE>.
178      */

179     public static final int trapAuthenticationFailure = 4 ;
180
181     /**
182      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>egpNeighborLoss</CODE>.
183      */

184     public static final int trapEgpNeighborLoss = 5 ;
185
186     /**
187      * Code as defined in RFC 1157 for generic trap info in Trap-PDU: <CODE>enterpriseSpecific</CODE>.
188      */

189     public static final int trapEnterpriseSpecific = 6 ;
190
191
192     // PDU error status enumeration.
193
//------------------------------
194
/**
195      * Error code as defined in RFC 1448 for: <CODE>noError</CODE>.
196      */

197     final public static int snmpRspNoError = 0;
198
199     /**
200      * Error code as defined in RFC 1448 for: <CODE>tooBig</CODE>.
201      */

202     final public static int snmpRspTooBig = 1;
203
204     /**
205      * Error code as defined in RFC 1448 for: <CODE>noSuchName</CODE>.
206      */

207     final public static int snmpRspNoSuchName = 2;
208
209     /**
210      * Error code as defined in RFC 1448 for: <CODE>badValue</CODE>.
211      */

212     final public static int snmpRspBadValue = 3;
213
214     /**
215      * Error code as defined in RFC 1448 for: <CODE>readOnly</CODE>.
216      */

217     final public static int snmpRspReadOnly = 4;
218
219     /**
220      * Error code as defined in RFC 1448 for: <CODE>genErr</CODE>.
221      */

222     final public static int snmpRspGenErr = 5;
223
224     /**
225      * Error code as defined in RFC 1448 for: <CODE>noAccess</CODE>.
226      */

227     final public static int snmpRspNoAccess = 6;
228
229     /**
230      * Error code as defined in RFC 1448 for: <CODE>wrongType</CODE>.
231      */

232     final public static int snmpRspWrongType = 7;
233
234     /**
235      * Error code as defined in RFC 1448 for: <CODE>wrongLength</CODE>.
236      */

237     final public static int snmpRspWrongLength = 8;
238
239     /**
240      * Error code as defined in RFC 1448 for: <CODE>wrongEncoding</CODE>.
241      */

242     final public static int snmpRspWrongEncoding = 9;
243
244     /**
245      * Error code as defined in RFC 1448 for: <CODE>wrongValue</CODE>.
246      */

247     final public static int snmpRspWrongValue = 10;
248
249     /**
250      * Error code as defined in RFC 1448 for: <CODE>noCreation</CODE>.
251      */

252     final public static int snmpRspNoCreation = 11;
253
254     /**
255      * Error code as defined in RFC 1448 for: <CODE>inconsistentValue</CODE>.
256      */

257     final public static int snmpRspInconsistentValue = 12;
258
259     /**
260      * Error code as defined in RFC 1448 for: <CODE>resourceUnavailable</CODE>.
261      */

262     final public static int snmpRspResourceUnavailable = 13;
263
264     /**
265      * Error code as defined in RFC 1448 for: <CODE>commitFailed</CODE>.
266      */

267     final public static int snmpRspCommitFailed = 14;
268
269     /**
270      * Error code as defined in RFC 1448 for: <CODE>undoFailed</CODE>.
271      */

272     final public static int snmpRspUndoFailed = 15;
273
274     /**
275      * Error code as defined in RFC 1448 for: <CODE>authorizationError</CODE>.
276      */

277     final public static int snmpRspAuthorizationError = 16;
278
279     /**
280      * Error code as defined in RFC 1448 for: <CODE>notWritable</CODE>.
281      */

282     final public static int snmpRspNotWritable = 17;
283
284     /**
285      * Error code as defined in RFC 1448 for: <CODE>inconsistentName</CODE>.
286      */

287     final public static int snmpRspInconsistentName = 18;
288
289     /**
290      * Error that is returned by VACM.
291      *
292      * @since 1.5
293      */

294     final public static int noSuchView = 19;
295
296     /**
297      * Error that is returned by VACM.
298      *
299      * @since 1.5
300      */

301     final public static int noSuchContext = 20;
302
303     /**
304      * Error that is returned by VACM.
305      *
306      * @since 1.5
307      */

308     final public static int noGroupName = 21;
309
310     /**
311      * Error that is returned by VACM.
312      *
313      * @since 1.5
314      */

315     final public static int notInView = 22;
316
317     // API error status enumeration.
318
//------------------------------
319
/**
320      * Error code specific to the API.
321      * <P>Used if the request PDU exceeds the <CODE>maxTries</CODE> limit
322      * defined in the {@link com.sun.jmx.snmp.SnmpPeer SnmpPeer} object.
323      */

324     final public static int snmpReqTimeout = (0xE0) ;
325
326     /**
327      * Error code specific to the API.
328      * <P>Used if the pending request PDU is cancelled.
329      */

330     final public static int snmpReqAborted = (0xE1) ;
331
332     /**
333      * Error code specific to the API.
334      * <P>Used if the response to the request PDU fails at decoding time.
335      */

336     final public static int snmpRspDecodingError = (0xE2) ;
337
338     /**
339      * Error code specific to the API.
340      * <P>Used if the request PDU does not retreive the community string at
341      * authentication encoding time.
342      */

343     final public static int snmpReqEncodingError = (0xE3) ;
344
345     /**
346      * Error code specific to the API.
347      * <P>Used if the request PDU does not fit in the <CODE>maxSnmpPktSize</CODE> limit
348      * defined in the {@link com.sun.jmx.snmp.SnmpPeer SnmpPeer} object.
349      */

350     final public static int snmpReqPacketOverflow = (0xE4) ;
351
352     /**
353      * Error code specific to the API.
354      * <P>Used for the last variable returned by a <CODE>Walk</CODE> request PDU.
355      */

356     final public static int snmpRspEndOfTable = (0xE5) ;
357
358     /**
359      * Error code specific to the API.
360      * <P>Used if the request PDU is retried after a <CODE>noSuchName</CODE> error fixed.
361      * This is an internal temporary status.
362      */

363     final public static int snmpReqRefireAfterVbFix = (0xE6) ;
364
365     /**
366      * Error code specific to the API.
367      * <P>Used if the size of the request PDU <CODE>varBindList</CODE> exceeds
368      * the <CODE>maxVarBindLimit</CODE> limit defined in the
369      * {@link com.sun.jmx.snmp.SnmpPeer SnmpPeer} object.
370      */

371     final public static int snmpReqHandleTooBig = (0xE7) ;
372
373     /**
374      * Error code specific to the API.
375      * <P>Used if the request PDU fails with a <CODE>tooBig</CODE> error status
376      * but its <CODE>varBindList</CODE> contains just one element.
377      */

378     final public static int snmpReqTooBigImpossible = (0xE8) ;
379
380     /**
381      * Error code specific to the API.
382      * <P>Used if an internal error occurs when processing the request PDU.
383      */

384     final public static int snmpReqInternalError = (0xF0) ;
385
386     /**
387      * Error code specific to the API.
388      * <P>Used if an I/O error occurs when sending the request PDU.
389      */

390     final public static int snmpReqSocketIOError = (0xF1) ;
391
392     /**
393      * Error code specific to the API.
394      * <P>Used if the request PDU fails at encoding time or sending time for a reason
395      * not covered by the previous error codes.
396      */

397     final public static int snmpReqUnknownError = (0xF2) ;
398
399     /**
400      * Error code specific to the API.
401      * <P>
402      */

403     final public static int snmpWrongSnmpVersion = (0xF3) ;
404
405     /**
406      * SNMP V3 Error code specific to the API.
407      * <P>Used if the used principal is unknown.
408      *
409      * @since 1.5
410      */

411     final public static int snmpUnknownPrincipal = (0xF4);
412
413     /**
414      * SNMP V3 Error code specific to the API.
415      * <P>Used if authentication is not supported for the current user.
416      *
417      * @since 1.5
418      */

419     final public static int snmpAuthNotSupported = (0xF5);
420
421     /**
422      * SNMP V3 Error code specific to the API.
423      * <P>Used if privacy is not supported for the current user.
424      *
425      * @since 1.5
426      */

427     final public static int snmpPrivNotSupported = (0xF6);
428
429     /**
430      * SNMP V3 Error code specific to the API.
431      * <P>Used if privacy is not supported for the current user.
432      *
433      * @since 1.5
434      */

435     final public static int snmpBadSecurityLevel = (0xF9);
436
437     /**
438      * SNMP Usm V3 Error code specific to the API.
439      * <P>Used if the authoritative engine Id is not associated to the current user.
440      *
441      * @since 1.5
442      */

443     final public static int snmpUsmBadEngineId = (0xF7);
444
445     /**
446      * SNMP Usm V3 Error code specific to the API.
447      * <P>Used if the timeliness params are invalid.
448      *
449      * @since 1.5
450      */

451     final public static int snmpUsmInvalidTimeliness = (0xF8);
452
453
454     /**
455      * Snmp V1 security model id (1).
456      *
457      * @since 1.5
458      */

459     final public static int snmpV1SecurityModel = 1;
460     /**
461      * Snmp V2 security model id (2).
462      *
463      * @since 1.5
464      */

465     final public static int snmpV2SecurityModel = 2;
466     /**
467      * Snmp V3 security model id (3).
468      *
469      * @since 1.5
470      */

471     final public static int snmpUsmSecurityModel = 3;
472     /**
473      * Snmp V1 msg processing model id (0).
474      *
475      * @since 1.5
476      */

477     final public static int snmpV1MsgProcessingModel = snmpVersionOne;
478     /**
479      * Snmp V2 msg processing model id (1).
480      *
481      * @since 1.5
482      */

483     final public static int snmpV2MsgProcessingModel = snmpVersionTwo;
484     /**
485      * Snmp V3 msg processing model id (3).
486      *
487      * @since 1.5
488      */

489     final public static int snmpV3MsgProcessingModel = snmpVersionThree;
490
491     /**
492      * Snmp V1 access control model id (0).
493      *
494      * @since 1.5
495      */

496     final public static int snmpV1AccessControlModel = snmpVersionOne;
497
498     /**
499      * Snmp V2 access control model id (1).
500      *
501      * @since 1.5
502      */

503     final public static int snmpV2AccessControlModel = snmpVersionTwo;
504
505     /**
506      * Snmp V3 access control model id (3).
507      *
508      * @since 1.5
509      */

510     final public static int snmpV3AccessControlModel = snmpVersionThree;
511 }
512
Popular Tags