1 /*_############################################################################
6 _## -----------------------------------------------
7 _## Copyright (c) 2001-2010 Jochen Katz, Frank Fock
9 _## This software is based on SNMP++2.6 from Hewlett Packard:
11 _## Copyright (c) 1996
12 _## Hewlett-Packard Company
14 _## ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
15 _## Permission to use, copy, modify, distribute and/or sell this software
16 _## and/or its documentation is hereby granted without fee. User agrees
17 _## to display the above copyright notice and this license notice in all
18 _## copies of the software and any documentation of the software. User
19 _## agrees to assume all liability for the use of the software;
20 _## Hewlett-Packard and Jochen Katz make no representations about the
21 _## suitability of this software for any purpose. It is provided
22 _## "AS-IS" without warranty of any kind, either express or implied. User
23 _## hereby grants a royalty-free license to any and all derivatives based
24 _## upon this software code base.
26 _## Stuttgart, Germany, Thu Sep 2 00:07:47 CEST 2010
28 _##########################################################################*/
29 /*===================================================================
32 Hewlett-Packard Company
34 ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
35 Permission to use, copy, modify, distribute and/or sell this software
36 and/or its documentation is hereby granted without fee. User agrees
37 to display the above copyright notice and this license notice in all
38 copies of the software and any documentation of the software. User
39 agrees to assume all liability for the use of the software; Hewlett-Packard
40 makes no representations about the suitability of this software for any
41 purpose. It is provided "AS-IS without warranty of any kind,either express
42 or implied. User hereby grants a royalty-free license to any and all
43 derivatives based upon this software code base.
50 AUTHOR: Peter E Mellquist
51 =====================================================================*/
52 // $Id: smi.h 1541 2009-05-29 11:29:22Z katz $
57 // make sure configuration is included first
58 #include "snmp_pp/config_snmp_pp.h"
60 #ifdef SNMP_PP_NAMESPACE
80 //----------[ ASN/BER Base Types ]-----------------------------------------
81 /** @name ASN/BER Base Types
83 * Basic Encoding Rules (BER) (used in forming SYNTAXes and certain
87 #define aSN_UNIVERSAL (0x00)
88 #define aSN_APPLICATION (0x40)
89 #define aSN_CONTEXT (0x80)
90 #define aSN_PRIVATE (0xC0)
91 #define aSN_PRIMITIVE (0x00)
92 #define aSN_CONSTRUCTOR (0x20)
95 //------[ SNMP ObjectSyntax Values ]---------------------------------------
96 #define sNMP_SYNTAX_SEQUENCE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x10)
98 /** @name Syntax Types
100 * These values are used in the "syntax" member of the smiVALUE
101 * structure which follows.
103 * The get_syntax() method of any class derived from SnmpSyntax returns
104 * one of these values.
106 * @note UInt32 is indistinguishable from Gauge32 per SNMPv2 Draft Standard
107 * @note NsapAddr is obsoleted as unique SMI type per SNMPv2 Draft Standard
110 #define sNMP_SYNTAX_INT (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x02)
111 #define sNMP_SYNTAX_BITS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x03)
112 #define sNMP_SYNTAX_OCTETS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x04)
113 #define sNMP_SYNTAX_NULL (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x05)
114 #define sNMP_SYNTAX_OID (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x06)
115 #define sNMP_SYNTAX_INT32 sNMP_SYNTAX_INT
116 #define sNMP_SYNTAX_IPADDR (aSN_APPLICATION | aSN_PRIMITIVE | 0x00)
117 #define sNMP_SYNTAX_CNTR32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x01)
118 #define sNMP_SYNTAX_GAUGE32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x02)
119 #define sNMP_SYNTAX_TIMETICKS (aSN_APPLICATION | aSN_PRIMITIVE | 0x03)
120 #define sNMP_SYNTAX_OPAQUE (aSN_APPLICATION | aSN_PRIMITIVE | 0x04)
121 #define sNMP_SYNTAX_CNTR64 (aSN_APPLICATION | aSN_PRIMITIVE | 0x06)
122 #define sNMP_SYNTAX_UINT32 sNMP_SYNTAX_GAUGE32
125 //-------------------------------------------------------------------------
127 //---------------[ Exception conditions for SNMPv2 ]-----------------------
128 /** @name Exception conditions for SNMPv2 */
130 #define sNMP_SYNTAX_NOSUCHOBJECT (aSN_CONTEXT | aSN_PRIMITIVE | 0x00)
131 #define sNMP_SYNTAX_NOSUCHINSTANCE (aSN_CONTEXT | aSN_PRIMITIVE | 0x01)
132 #define sNMP_SYNTAX_ENDOFMIBVIEW (aSN_CONTEXT | aSN_PRIMITIVE | 0x02)
135 //--------------[ different types of PDU's ]-------------------------------
136 /** @name Pdu types */
138 #define sNMP_PDU_GET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x0)
139 #define sNMP_PDU_GETNEXT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x1)
140 #define sNMP_PDU_RESPONSE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x2)
141 #define sNMP_PDU_SET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x3)
142 #define sNMP_PDU_V1TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x4)
143 #define sNMP_PDU_GETBULK (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x5)
144 #define sNMP_PDU_INFORM (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x6)
145 #define sNMP_PDU_TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x7)
146 #define sNMP_PDU_REPORT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x8)
150 //------[ smi typedefs ]---------------------------------------------------
151 /** @name SMI typedefs
153 * SNMP-related types from RFC1442 (SMI).
158 typedef unsigned char SmiBYTE, WINFAR *SmiLPBYTE;
161 typedef long SmiINT, WINFAR *SmiLPINT;
164 typedef SmiINT SmiINT32, WINFAR *SmiLPINT32;
167 typedef unsigned long SmiUINT32, WINFAR *SmiLPUINT32;
172 SmiLPBYTE ptr;} SmiOCTETS, WINFAR *SmiLPOCTETS;
175 typedef SmiOCTETS SmiBITS, WINFAR *SmiLPBITS;
180 SmiLPUINT32 ptr;} SmiOID, WINFAR *SmiLPOID;
183 typedef SmiOCTETS SmiIPADDR, WINFAR *SmiLPIPADDR;
186 typedef SmiUINT32 SmiCNTR32, WINFAR *SmiLPCNTR32;
189 typedef SmiUINT32 SmiGAUGE32, WINFAR *SmiLPGAUGE32;
192 typedef SmiUINT32 SmiTIMETICKS, WINFAR *SmiLPTIMETICKS;
195 typedef SmiOCTETS SmiOPAQUE, WINFAR *SmiLPOPAQUE;
198 typedef SmiOCTETS SmiNSAPADDR, WINFAR *SmiLPNSAPADDR;
203 SmiUINT32 lopart;} SmiCNTR64, WINFAR *SmiLPCNTR64;
206 #ifdef SNMP_PP_NAMESPACE
207 } // end of namespace Snmp_pp