]> git.stg.codes - ssmd.git/blob - 3rdparty/snmp++/include/snmp_pp/smi.h
Initial adding
[ssmd.git] / 3rdparty / snmp++ / include / snmp_pp / smi.h
1 /*_############################################################################
2   _## 
3   _##  smi.h  
4   _##
5   _##  SNMP++v3.2.25
6   _##  -----------------------------------------------
7   _##  Copyright (c) 2001-2010 Jochen Katz, Frank Fock
8   _##
9   _##  This software is based on SNMP++2.6 from Hewlett Packard:
10   _##  
11   _##    Copyright (c) 1996
12   _##    Hewlett-Packard Company
13   _##  
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. 
25   _##  
26   _##  Stuttgart, Germany, Thu Sep  2 00:07:47 CEST 2010 
27   _##  
28   _##########################################################################*/
29 /*===================================================================
30
31   Copyright (c) 1999
32   Hewlett-Packard Company
33
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.
44
45
46   SNMP++ S M I . H
47
48   SMI DEFINITIONS
49
50   AUTHOR:           Peter E Mellquist
51 =====================================================================*/
52 // $Id: smi.h 1541 2009-05-29 11:29:22Z katz $
53
54 #ifndef _SMIDEF
55 #define _SMIDEF
56
57 // make sure configuration is included first
58 #include "snmp_pp/config_snmp_pp.h"
59
60 #ifdef SNMP_PP_NAMESPACE
61 namespace Snmp_pp {
62 #endif
63
64 #define WINFAR
65 #define STRCAT strcat
66 #define STRLEN strlen
67 #define MEMCPY memcpy
68 #define STRCPY strcpy
69 #define MEMCMP memcmp
70 #define XPORT
71
72 #ifndef TRUE
73 #define TRUE 1
74 #endif
75
76 #ifndef FALSE
77 #define FALSE 0
78 #endif
79
80 //----------[ ASN/BER Base Types ]-----------------------------------------
81 /** @name ASN/BER Base Types
82  *
83  * Basic Encoding Rules (BER) (used in forming SYNTAXes and certain
84  * SNMP types/values).
85  */
86 //@{
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)
93 //@}
94
95 //------[ SNMP ObjectSyntax Values ]---------------------------------------
96 #define sNMP_SYNTAX_SEQUENCE  (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x10)
97
98 /** @name Syntax Types
99  *
100  * These values are used in the "syntax" member of the smiVALUE
101  * structure which follows.
102  *
103  * The get_syntax() method of any class derived from SnmpSyntax returns
104  * one of these values.
105  *
106  * @note UInt32 is indistinguishable from Gauge32 per SNMPv2 Draft Standard
107  * @note NsapAddr is obsoleted as unique SMI type per SNMPv2 Draft Standard
108  */
109 //@{
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
123 //@}
124
125 //-------------------------------------------------------------------------
126
127 //---------------[ Exception conditions for SNMPv2 ]-----------------------
128 /** @name Exception conditions for SNMPv2 */
129 //@{
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)
133 //@}
134
135 //--------------[ different types of PDU's ]-------------------------------
136 /** @name Pdu types */
137 //@{
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)
147 //@}
148
149
150 //------[ smi typedefs ]---------------------------------------------------
151 /** @name SMI typedefs
152  *
153  * SNMP-related types from RFC1442 (SMI).
154  */
155 //@{
156
157 // byte
158 typedef unsigned char    SmiBYTE,       WINFAR *SmiLPBYTE;
159
160 // int
161 typedef long             SmiINT,        WINFAR *SmiLPINT;
162
163 // int 32
164 typedef SmiINT           SmiINT32,      WINFAR *SmiLPINT32;
165
166 // unit32
167 typedef unsigned long    SmiUINT32,     WINFAR *SmiLPUINT32;
168
169 // octet struct
170 typedef struct {
171      SmiUINT32 len;
172      SmiLPBYTE ptr;}     SmiOCTETS,     WINFAR *SmiLPOCTETS;
173
174 // bits
175 typedef SmiOCTETS        SmiBITS,       WINFAR *SmiLPBITS;
176
177 // SMI oid struct
178 typedef struct {
179      SmiUINT32   len;
180      SmiLPUINT32 ptr;}   SmiOID,        WINFAR *SmiLPOID;
181
182 // ipaddr
183 typedef SmiOCTETS        SmiIPADDR,     WINFAR *SmiLPIPADDR;
184
185 // 32bit counter
186 typedef SmiUINT32        SmiCNTR32,     WINFAR *SmiLPCNTR32;
187
188 // gauge
189 typedef SmiUINT32        SmiGAUGE32,    WINFAR *SmiLPGAUGE32;
190
191 // timeticks
192 typedef SmiUINT32        SmiTIMETICKS,  WINFAR *SmiLPTIMETICKS;
193
194 // opaque
195 typedef SmiOCTETS        SmiOPAQUE,     WINFAR *SmiLPOPAQUE;
196
197 // nsapaddr
198 typedef SmiOCTETS        SmiNSAPADDR,   WINFAR *SmiLPNSAPADDR;
199
200 // 64 bit counter
201 typedef struct {
202         SmiUINT32 hipart;
203         SmiUINT32 lopart;} SmiCNTR64,   WINFAR *SmiLPCNTR64;
204 //@}
205
206 #ifdef SNMP_PP_NAMESPACE
207 } // end of namespace Snmp_pp
208 #endif 
209
210 #endif
211
212