Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ASNMP / asnmp / smi.h
bloba7207312554def68fc43d9b6034993b905905464
1 /* -*-C++-*- */
2 #ifndef SMIDEF_
3 #define SMIDEF_
4 //=============================================================================
5 /**
6 * @file smi.h
8 * Address class definition. Encapsulates various network
9 * addresses into easy to use, safe and portable classes.
11 //=============================================================================
13 /*===================================================================
14 Copyright (c) 1996
15 Hewlett-Packard Company
17 ATTENTION: USE OF THIS SOFTWARE IS SUBJECT TO THE FOLLOWING TERMS.
18 Permission to use, copy, modify, distribute and/or sell this software
19 and/or its documentation is hereby granted without fee. User agrees
20 to display the above copyright notice and this license notice in all
21 copies of the software and any documentation of the software. User
22 agrees to assume all liability for the use of the software; Hewlett-Packard
23 makes no representations about the suitability of this software for any
24 purpose. It is provided "AS-IS without warranty of any kind,either express
25 or implied. User hereby grants a royalty-free license to any and all
26 derivatives based upon this software code base.
28 =====================================================================*/
30 #include "ace/config-all.h"
32 #if !defined (ACE_LACKS_PRAGMA_ONCE)
33 # pragma once
34 #endif /* ACE_LACKS_PRAGMA_ONCE */
36 //----------[ ASN/BER Base Types ]-----------------------------------------
37 // Basic Encoding Rules (BER)
38 // (used in forming SYNTAXes and certain SNMP types/values)
39 #define aSN_UNIVERSAL (0x00)
40 #define aSN_APPLICATION (0x40)
41 #define aSN_CONTEXT (0x80)
42 #define aSN_PRIVATE (0xC0)
43 #define aSN_PRIMITIVE (0x00)
44 #define aSN_CONSTRUCTOR (0x20)
46 //------[ SNMP ObjectSyntax Values ]---------------------------------------
47 #define sNMP_SYNTAX_SEQUENCE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x10)
50 //-------------------------------------------------------------------------
51 // These values are used in the "syntax" member
52 // of the smiVALUE structure which follows.
53 // Note: UInt32 is indistinguishable from Gauge32 per SNMPv2 Draft Standard
54 // NsapAddr is obsoleted as unique SMI type per SNMPv2 Draft Standard
55 #define sNMP_SYNTAX_INT (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x02)
56 #define sNMP_SYNTAX_BITS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x03)
57 #define sNMP_SYNTAX_OCTETS (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x04)
58 #define sNMP_SYNTAX_NULL (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x05)
59 #define sNMP_SYNTAX_OID (aSN_UNIVERSAL | aSN_PRIMITIVE | 0x06)
60 #define sNMP_SYNTAX_INT32 sNMP_SYNTAX_INT
61 #define sNMP_SYNTAX_IPADDR (aSN_APPLICATION | aSN_PRIMITIVE | 0x00)
62 #define sNMP_SYNTAX_CNTR32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x01)
63 #define sNMP_SYNTAX_GAUGE32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x02)
64 #define sNMP_SYNTAX_TIMETICKS (aSN_APPLICATION | aSN_PRIMITIVE | 0x03)
65 #define sNMP_SYNTAX_OPAQUE (aSN_APPLICATION | aSN_PRIMITIVE | 0x04)
66 #define sNMP_SYNTAX_CNTR64 (aSN_APPLICATION | aSN_PRIMITIVE | 0x06)
67 #define sNMP_SYNTAX_UINT32 (aSN_APPLICATION | aSN_PRIMITIVE | 0x07)
69 //-------------------------------------------------------------------------
71 //---------------[ Exception conditions for SNMPv2 ]-----------------------
72 // support SNMP v2
73 #define sNMP_SYNTAX_NOSUCHOBJECT (aSN_CONTEXT | aSN_PRIMITIVE | 0x00)
74 #define sNMP_SYNTAX_NOSUCHINSTANCE (aSN_CONTEXT | aSN_PRIMITIVE | 0x01)
75 #define sNMP_SYNTAX_ENDOFMIBVIEW (aSN_CONTEXT | aSN_PRIMITIVE | 0x02)
78 //--------------[ different types of PDU's ]-------------------------------
79 #define sNMP_PDU_GET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x0)
80 #define sNMP_PDU_GETNEXT (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x1)
81 #define sNMP_PDU_RESPONSE (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x2)
82 #define sNMP_PDU_SET (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x3)
83 #define sNMP_PDU_V1TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x4)
84 #define sNMP_PDU_GETBULK (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x5)
85 #define sNMP_PDU_INFORM (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x6)
86 #define sNMP_PDU_TRAP (aSN_CONTEXT | aSN_CONSTRUCTOR | 0x7)
89 //------[ smi typedefs ]---------------------------------------------------
90 // SNMP-related types from RFC1442 (SMI)
92 typedef unsigned char SmiBYTE, *SmiLPBYTE;
94 //-------------------------------------------------------------------------
95 // SNMP-related types from RFC1442 (SMI)
97 // int
98 typedef long SmiINT, *SmiLPINT;
100 // int 32
101 typedef SmiINT SmiINT32, *SmiLPINT32;
103 // unit32
104 typedef unsigned long SmiUINT32, *SmiLPUINT32;
106 // octet struct
107 typedef struct {
108 SmiUINT32 len;
109 SmiLPBYTE ptr;} SmiOCTETS, *SmiLPOCTETS;
111 // bits
112 typedef SmiOCTETS SmiBITS, *SmiLPBITS;
114 // SMI oid struct
115 typedef struct {
116 SmiUINT32 len;
117 SmiLPUINT32 ptr;} SmiOID, *SmiLPOID;
119 // ipaddr
120 typedef SmiOCTETS SmiIPADDR, *SmiLPIPADDR;
122 // 32bit counter
123 typedef SmiUINT32 SmiCNTR32, *SmiLPCNTR32;
125 // gauge
126 typedef SmiUINT32 SmiGAUGE32, *SmiLPGAUGE32;
128 // timeticks
129 typedef SmiUINT32 SmiTIMETICKS, *SmiLPTIMETICKS;
131 // opaque
132 typedef SmiOCTETS SmiOPAQUE, *SmiLPOPAQUE;
134 // nsapaddr
135 typedef SmiOCTETS SmiNSAPADDR, *SmiLPNSAPADDR;
137 // 64 bit counter
138 typedef struct {
139 SmiUINT32 hipart;
140 SmiUINT32 lopart;
141 } SmiCNTR64, *SmiLPCNTR64;
143 #endif // SMIDEF_