2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Windows Sockets 2 Simple Network Management Protocol API DLL
4 * FILE: include/snmpapi.h
5 * PURPOSE: Simple Network Management Protocol API DLL
20 #define EXPORT STDCALL
21 #define SNMP_FUNC_TYPE STDCALL
23 #define EXPORT CALLBACK
24 #define SNMP_FUNC_TYPE CALLBACK
27 #ifndef SNMP_FUNC_TYPE
28 #define SNMP_FUNC_TYPE WINAPI
32 #define SNMPAPI_NOERROR TRUE
33 #define SNMPAPI_ERROR FALSE
35 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
37 ////////////////////////////////////////////////////////////////////////////////
48 } AsnObjectIdentifier
;
50 typedef LONG AsnInteger32
;
51 typedef ULONG AsnUnsigned32
;
52 typedef ULARGE_INTEGER AsnCounter64
;
53 typedef AsnUnsigned32 AsnCounter32
;
54 typedef AsnUnsigned32 AsnGauge32
;
55 typedef AsnUnsigned32 AsnTimeticks
;
56 typedef AsnOctetString AsnBits
;
57 typedef AsnOctetString AsnSequence
;
58 typedef AsnOctetString AsnImplicitSequence
;
59 typedef AsnOctetString AsnIPAddress
;
60 typedef AsnOctetString AsnNetworkAddress
;
61 typedef AsnOctetString AsnDisplayString
;
62 typedef AsnOctetString AsnOpaque
;
67 AsnInteger32 number
; // ASN_INTEGER
69 AsnUnsigned32 unsigned32
; // ASN_UNSIGNED32
70 AsnCounter64 counter64
; // ASN_COUNTER64
71 AsnOctetString string
; // ASN_OCTETSTRING
72 AsnBits bits
; // ASN_BITS
73 AsnObjectIdentifier object
; // ASN_OBJECTIDENTIFIER
74 AsnSequence sequence
; // ASN_SEQUENCE
75 AsnIPAddress address
; // ASN_IPADDRESS
76 AsnCounter32 counter
; // ASN_COUNTER32
77 AsnGauge32 gauge
; // ASN_GAUGE32
78 AsnTimeticks ticks
; // ASN_TIMETICKS
79 AsnOpaque arbitrary
; // ASN_OPAQUE
83 typedef AsnObjectIdentifier AsnObjectName
;
84 typedef AsnAny AsnObjectSyntax
;
88 AsnObjectSyntax value
;
97 LPVOID SNMP_FUNC_TYPE
SnmpUtilMemAlloc(
98 UINT nBytes
// bytes to allocate for object
101 VOID SNMP_FUNC_TYPE
SnmpUtilMemFree(
102 LPVOID pMem
// pointer to memory object to release
105 LPVOID SNMP_FUNC_TYPE
SnmpUtilMemReAlloc(
106 LPVOID pMem
, // pointer to memory object
107 UINT nBytes
// bytes to allocate
110 VOID SNMP_FUNC_TYPE
SnmpSvcInitUptime();
112 DWORD SNMP_FUNC_TYPE
SnmpSvcGetUptime();
114 VOID SNMP_FUNC_TYPE
SnmpSvcSetLogLevel(
115 INT nLogLevel
// level of severity of the event
118 VOID SNMP_FUNC_TYPE
SnmpSvcSetLogType(
119 INT nLogType
// destination for debug output
122 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilAsnAnyCpy(
123 AsnAny
*pAnyDst
, // destination structure
124 AsnAny
*pAnySrc
// source structure
127 VOID SNMP_FUNC_TYPE
SnmpUtilAsnAnyFree(
128 AsnAny
*pAny
// pointer to structure to free
131 //VOID SNMP_FUNC_TYPE SnmpUtilDbgPrint(
132 // INT nLogLevel, // level of severity of event
133 // LPSTR szFormat // pointer to a format string
136 LPSTR SNMP_FUNC_TYPE
SnmpUtilIdsToA(
137 UINT
*Ids
, // object identifier to convert
138 UINT IdLength
// number of elements
141 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOctetsCmp(
142 AsnOctetString
*pOctets1
, // first octet string
143 AsnOctetString
*pOctets2
// second octet string
146 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOctetsCpy(
147 AsnOctetString
*pOctetsDst
, // destination octet string
148 AsnOctetString
*pOctetsSrc
// source octet string
151 VOID SNMP_FUNC_TYPE
SnmpUtilOctetsFree(
152 AsnOctetString
*pOctets
// octet string to free
155 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOctetsNCmp(
156 AsnOctetString
*pOctets1
, // first octet string
157 AsnOctetString
*pOctets2
, // second octet string
158 UINT nChars
// maximum length to compare
161 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOidAppend(
162 AsnObjectIdentifier
*pOidDst
, // destination object identifier
163 AsnObjectIdentifier
*pOidSrc
// source object identifier
166 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOidCmp(
167 AsnObjectIdentifier
*pOid1
, // first object identifier
168 AsnObjectIdentifier
*pOid2
// second object identifier
171 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOidCpy(
172 AsnObjectIdentifier
*pOidDst
, // destination object identifier
173 AsnObjectIdentifier
*pOidSrc
// source object identifier
176 VOID SNMP_FUNC_TYPE
SnmpUtilOidFree(
177 AsnObjectIdentifier
*pOid
// object identifier to free
180 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilOidNCmp(
181 AsnObjectIdentifier
*pOid1
, // first object identifier
182 AsnObjectIdentifier
*pOid2
, // second object identifier
183 UINT nSubIds
// maximum length to compare
186 LPSTR SNMP_FUNC_TYPE
SnmpUtilOidToA(
187 AsnObjectIdentifier
*Oid
// object identifier to convert
190 VOID SNMP_FUNC_TYPE
SnmpUtilPrintAsnAny(
191 AsnAny
*pAny
// pointer to value to print
194 VOID SNMP_FUNC_TYPE
SnmpUtilPrintOid(
195 AsnObjectIdentifier
*Oid
// object identifier to print
198 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilVarBindCpy(
199 SnmpVarBind
*pVbDst
, // destination variable bindings
200 SnmpVarBind
*pVbSrc
// source variable bindings
203 VOID SNMP_FUNC_TYPE
SnmpUtilVarBindFree(
204 SnmpVarBind
*pVb
// variable binding to free
207 SNMPAPI SNMP_FUNC_TYPE
SnmpUtilVarBindListCpy(
208 SnmpVarBindList
*pVblDst
, // destination variable bindings list
209 SnmpVarBindList
*pVblSrc
// source variable bindings list
212 VOID SNMP_FUNC_TYPE
SnmpUtilVarBindListFree(
213 SnmpVarBindList
*pVbl
// variable bindings list to free
218 ////////////////////////////////////////////////////////////////////////////////
219 // SNMP Debugging Definitions
222 #define SNMP_LOG_SILENT 0x0
223 #define SNMP_LOG_FATAL 0x1
224 #define SNMP_LOG_ERROR 0x2
225 #define SNMP_LOG_WARNING 0x3
226 #define SNMP_LOG_TRACE 0x4
227 #define SNMP_LOG_VERBOSE 0x5
229 #define SNMP_OUTPUT_TO_CONSOLE 0x1
230 #define SNMP_OUTPUT_TO_LOGFILE 0x2
231 //#define SNMP_OUTPUT_TO_EVENTLOG 0x4 // no longer supported
232 #define SNMP_OUTPUT_TO_DEBUGGER 0x8
234 ////////////////////////////////////////////////////////////////////////////////
235 // SNMP Debugging Prototypes
241 IN INT nLogLevel
, // see log levels above...
247 #define SNMPDBG(_x_) SnmpUtilDbgPrint _x_
253 ////////////////////////////////////////////////////////////////////////////////
255 #endif /* __SNMPAPI_H */