SNMP++  3.3.4
smi.h
Go to the documentation of this file.
1 /*_############################################################################
2  _##
3  _## smi.h
4  _##
5  _## SNMP++ v3.3
6  _## -----------------------------------------------
7  _## Copyright (c) 2001-2013 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  _##########################################################################*/
27 /*===================================================================
28 
29  Copyright (c) 1999
30  Hewlett-Packard Company
31 
32  ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
33  Permission to use, copy, modify, distribute and/or sell this software
34  and/or its documentation is hereby granted without fee. User agrees
35  to display the above copyright notice and this license notice in all
36  copies of the software and any documentation of the software. User
37  agrees to assume all liability for the use of the software; Hewlett-Packard
38  makes no representations about the suitability of this software for any
39  purpose. It is provided "AS-IS without warranty of any kind,either express
40  or implied. User hereby grants a royalty-free license to any and all
41  derivatives based upon this software code base.
42 
43 
44  SNMP++ S M I . H
45 
46  SMI DEFINITIONS
47 
48  AUTHOR: Peter E Mellquist
49 =====================================================================*/
50 // $Id: smi.h 2359 2013-05-09 20:07:01Z fock $
51 
52 #ifndef _SMIDEF
53 #define _SMIDEF
54 
55 // make sure configuration is included first
56 #include "snmp_pp/config_snmp_pp.h"
57 
58 #ifdef SNMP_PP_NAMESPACE
59 namespace Snmp_pp {
60 #endif
61 
62 #define WINFAR
63 #define STRCAT strcat
64 #define STRLEN strlen
65 #define MEMCPY memcpy
66 #define STRCPY strcpy
67 #define MEMCMP memcmp
68 #define XPORT
69 
70 //----------[ ASN/BER Base Types ]-----------------------------------------
71 /** @name ASN/BER Base Types
72  *
73  * Basic Encoding Rules (BER) (used in forming SYNTAXes and certain
74  * SNMP types/values).
75  */
76 //@{
77 #define aSN_UNIVERSAL (0x00)
78 #define aSN_APPLICATION (0x40)
79 #define aSN_CONTEXT (0x80)
80 #define aSN_PRIVATE (0xC0)
81 #define aSN_PRIMITIVE (0x00)
82 #define aSN_CONSTRUCTOR (0x20)
83 //@}
84 
85 //------[ SNMP ObjectSyntax Values ]---------------------------------------
86 #define sNMP_SYNTAX_SEQUENCE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x10)
87 
88 /** @name Syntax Types
89  *
90  * These values are used in the "syntax" member of the smiVALUE
91  * structure which follows.
92  *
93  * The get_syntax() method of any class derived from SnmpSyntax returns
94  * one of these values.
95  *
96  * @note UInt32 is indistinguishable from Gauge32 per SNMPv2 Draft Standard
97  * @note NsapAddr is obsoleted as unique SMI type per SNMPv2 Draft Standard
98  */
99 //@{
100 #define sNMP_SYNTAX_INT (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x02)
101 #define sNMP_SYNTAX_BITS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x03)
102 #define sNMP_SYNTAX_OCTETS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x04)
103 #define sNMP_SYNTAX_NULL (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x05)
104 #define sNMP_SYNTAX_OID (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x06)
105 #define sNMP_SYNTAX_INT32 sNMP_SYNTAX_INT
106 #define sNMP_SYNTAX_IPADDR (aSN_APPLICATION | aSN_PRIMITIVE | 0x00)
107 #define sNMP_SYNTAX_CNTR32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x01)
108 #define sNMP_SYNTAX_GAUGE32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x02)
109 #define sNMP_SYNTAX_TIMETICKS (aSN_APPLICATION | aSN_PRIMITIVE | 0x03)
110 #define sNMP_SYNTAX_OPAQUE (aSN_APPLICATION | aSN_PRIMITIVE | 0x04)
111 #define sNMP_SYNTAX_CNTR64 (aSN_APPLICATION | aSN_PRIMITIVE | 0x06)
112 #define sNMP_SYNTAX_UINT32 sNMP_SYNTAX_GAUGE32
113 //@}
114 
115 //-------------------------------------------------------------------------
116 
117 //---------------[ Exception conditions for SNMPv2 ]-----------------------
118 /** @name Exception conditions for SNMPv2 */
119 //@{
120 #define sNMP_SYNTAX_NOSUCHOBJECT (aSN_CONTEXT | aSN_PRIMITIVE | 0x00)
121 #define sNMP_SYNTAX_NOSUCHINSTANCE (aSN_CONTEXT | aSN_PRIMITIVE | 0x01)
122 #define sNMP_SYNTAX_ENDOFMIBVIEW (aSN_CONTEXT | aSN_PRIMITIVE | 0x02)
123 //@}
124 
125 //--------------[ different types of PDU's ]-------------------------------
126 /** @name Pdu types */
127 //@{
128 #define sNMP_PDU_GET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x0)
129 #define sNMP_PDU_GETNEXT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x1)
130 #define sNMP_PDU_RESPONSE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x2)
131 #define sNMP_PDU_SET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x3)
132 #define sNMP_PDU_V1TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x4)
133 #define sNMP_PDU_GETBULK (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x5)
134 #define sNMP_PDU_INFORM (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x6)
135 #define sNMP_PDU_TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x7)
136 #define sNMP_PDU_REPORT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x8)
137 //@}
138 
139 
140 //------[ smi typedefs ]---------------------------------------------------
141 /** @name SMI typedefs
142  *
143  * SNMP-related types from RFC1442 (SMI).
144  */
145 //@{
146 
147 // byte
148 typedef unsigned char SmiBYTE, WINFAR *SmiLPBYTE;
149 
150 // int
151 typedef long SmiINT, WINFAR *SmiLPINT;
152 
153 // int 32
155 
156 // unit32
157 typedef unsigned long SmiUINT32, WINFAR *SmiLPUINT32;
158 
159 // octet struct
160 typedef struct {
163 
164 // bits
166 
167 // SMI oid struct
168 typedef struct {
171 
172 // ipaddr
174 
175 // 32bit counter
177 
178 // gauge
180 
181 // timeticks
183 
184 // opaque
186 
187 // nsapaddr
189 
190 // 64 bit counter
191 typedef struct {
194 //@}
195 
196 #ifdef SNMP_PP_NAMESPACE
197 } // end of namespace Snmp_pp
198 #endif
199 
200 #endif
201 
202 
unsigned long SmiUINT32
Definition: smi.h:157
SmiUINT32 SmiCNTR32
Definition: smi.h:176
SmiUINT32 lopart
Definition: smi.h:193
SmiOCTETS SmiOPAQUE
Definition: smi.h:185
SmiUINT32 len
Definition: smi.h:169
SmiOCTETS WINFAR * SmiLPBITS
Definition: smi.h:165
SmiLPBYTE ptr
Definition: smi.h:162
SmiLPUINT32 ptr
Definition: smi.h:170
SmiUINT32 SmiGAUGE32
Definition: smi.h:179
SmiUINT32 len
Definition: smi.h:161
SmiOCTETS SmiNSAPADDR
Definition: smi.h:188
struct SmiOCTETS * SmiLPOCTETS
SmiUINT32 WINFAR * SmiLPGAUGE32
Definition: smi.h:179
SmiOCTETS SmiBITS
Definition: smi.h:165
Definition: smi.h:160
SmiOCTETS SmiIPADDR
Definition: smi.h:173
SmiINT WINFAR * SmiLPINT32
Definition: smi.h:154
SmiUINT32 WINFAR * SmiLPCNTR32
Definition: smi.h:176
long SmiINT
Definition: smi.h:151
SmiUINT32 hipart
Definition: smi.h:192
struct SmiCNTR64 * SmiLPCNTR64
unsigned long WINFAR * SmiLPUINT32
Definition: smi.h:157
SmiOCTETS WINFAR * SmiLPIPADDR
Definition: smi.h:173
SmiUINT32 WINFAR * SmiLPTIMETICKS
Definition: smi.h:182
struct SmiOID * SmiLPOID
SmiUINT32 SmiTIMETICKS
Definition: smi.h:182
unsigned char SmiBYTE
Definition: smi.h:148
long WINFAR * SmiLPINT
Definition: smi.h:151
Definition: smi.h:191
unsigned char WINFAR * SmiLPBYTE
Definition: smi.h:148
#define WINFAR
Definition: smi.h:62
SmiINT SmiINT32
Definition: smi.h:154
SmiOCTETS WINFAR * SmiLPOPAQUE
Definition: smi.h:185
Definition: smi.h:168
SmiOCTETS WINFAR * SmiLPNSAPADDR
Definition: smi.h:188