VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/Wine/include/snmp.h@ 33876

Last change on this file since 33876 was 33656, checked in by vboxsync, 14 years ago

*: rebrand Sun (L)GPL disclaimers

  • Property svn:eol-style set to native
File size: 11.2 KB
Line 
1/*
2 * Copyright (C) 2005 Juan Lang
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19/*
20 * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
21 * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
22 * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
23 * a choice of LGPL license versions is made available with the language indicating
24 * that LGPLv2 or any later version may be used, or where a choice of which version
25 * of the LGPL is applied is otherwise unspecified.
26 */
27
28#ifndef _WINE_SNMP_H
29#define _WINE_SNMP_H
30
31#ifndef __WINESRC__
32# include <windows.h>
33#else
34# include <windef.h>
35#endif
36
37#include <pshpack4.h>
38
39typedef struct {
40 BYTE *stream;
41 UINT length;
42 BOOL dynamic;
43} AsnOctetString;
44
45typedef struct {
46 UINT idLength;
47 UINT *ids;
48} AsnObjectIdentifier;
49
50typedef LONG AsnInteger32;
51typedef ULONG AsnUnsigned32;
52typedef ULARGE_INTEGER AsnCounter64;
53typedef AsnUnsigned32 AsnCounter32;
54typedef AsnUnsigned32 AsnGauge32;
55typedef AsnUnsigned32 AsnTimeticks;
56typedef AsnOctetString AsnBits;
57typedef AsnOctetString AsnSequence;
58typedef AsnOctetString AsnImplicitSequence;
59typedef AsnOctetString AsnIPAddress;
60typedef AsnOctetString AsnNetworkAddress;
61typedef AsnOctetString AsnDisplayString;
62typedef AsnOctetString AsnOpaque;
63
64typedef struct {
65 BYTE asnType;
66 union {
67 AsnInteger32 number;
68 AsnUnsigned32 unsigned32;
69 AsnCounter64 counter64;
70 AsnOctetString string;
71 AsnBits bits;
72 AsnObjectIdentifier object;
73 AsnSequence sequence;
74 AsnIPAddress address;
75 AsnCounter32 counter;
76 AsnGauge32 gauge;
77 AsnTimeticks ticks;
78 AsnOpaque arbitrary;
79 } asnValue;
80} AsnAny;
81
82typedef AsnObjectIdentifier AsnObjectName;
83typedef AsnAny AsnObjectSyntax;
84
85typedef struct {
86 AsnObjectName name;
87 AsnObjectSyntax value;
88} SnmpVarBind;
89
90typedef struct {
91 SnmpVarBind *list;
92 UINT len;
93} SnmpVarBindList;
94
95#include <poppack.h>
96
97#define ASN_UNIVERSAL 0x00
98#define ASN_APPLICATION 0x40
99#define ASN_CONTEXT 0x80
100#define ASN_PRIVATE 0xc0
101#define ASN_PRIMITIVE 0x00
102#define ASN_CONSTRUCTOR 0x20
103
104#define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x00)
105#define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x01)
106#define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x02)
107#define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x03)
108#define SNMP_PDU_V1TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x04)
109#define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x05)
110#define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x06)
111#define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x07)
112
113#define ASN_INTEGER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x02)
114#define ASN_BITS (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
115#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
116#define ASN_NULL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x05)
117#define ASN_OBJECTIDENTIFIER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x06)
118#define ASN_INTEGER32 ASN_INTEGER
119
120#define ASN_SEQUENCE (ASN_UNIVERSAL | ASN_CONSTRUCTOR | 0x10)
121#define ASN_SEQUENCEOF ASN_SEQUENCE
122
123#define ASN_IPADDRESS (ASN_APPLICATION | ASN_PRIMITIVE | 0x00)
124#define ASN_COUNTER32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x01)
125#define ASN_GAUGE32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x02)
126#define ASN_TIMETICKS (ASN_APPLICATION | ASN_PRIMITIVE | 0x03)
127#define ASN_OPAQUE (ASN_APPLICATION | ASN_PRIMITIVE | 0x04)
128#define ASN_COUNTER64 (ASN_APPLICATION | ASN_PRIMITIVE | 0x06)
129#define ASN_UNSIGNED32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x07)
130
131#define SNMP_EXCEPTION_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x00)
132#define SNMP_EXCEPTION_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x01)
133#define SNMP_EXCEPTION_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x02)
134
135#define SNMP_EXTENSION_GET SNMP_PDU_GET
136#define SNMP_EXTENSION_GET_NEXT SNMP_PDU_GETNEXT
137#define SNMP_EXTENSION_GET_BULK SNMP_PDU_GETBULK
138#define SNMP_EXTENSION_SET_TEST (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x0)
139#define SNMP_EXTENSION_SET_COMMIT SNMP_PDU_SET
140#define SNMP_EXTENSION_SET_UNDO (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x1)
141#define SNMP_EXTENSION_SET_CLEANUP (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x2)
142
143#define SNMP_ERRORSTATUS_NOERROR 0
144#define SNMP_ERRORSTATUS_TOOBIG 1
145#define SNMP_ERRORSTATUS_NOSUCHNAME 2
146#define SNMP_ERRORSTATUS_BADVALUE 3
147#define SNMP_ERRORSTATUS_READONLY 4
148#define SNMP_ERRORSTATUS_GENERR 5
149#define SNMP_ERRORSTATUS_NOACCESS 6
150#define SNMP_ERRORSTATUS_WRONGTYPE 7
151#define SNMP_ERRORSTATUS_WRONGLENGTH 8
152#define SNMP_ERRORSTATUS_WRONGENCODING 9
153#define SNMP_ERRORSTATUS_WRONGVALUE 10
154#define SNMP_ERRORSTATUS_NOCREATION 11
155#define SNMP_ERRORSTATUS_INCONSISTENTVALUE 12
156#define SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE 13
157#define SNMP_ERRORSTATUS_COMMITFAILED 14
158#define SNMP_ERRORSTATUS_UNDOFAILED 15
159#define SNMP_ERRORSTATUS_AUTHORIZATIONERROR 16
160#define SNMP_ERRORSTATUS_NOTWRITABLE 17
161#define SNMP_ERRORSTATUS_INCONSISTENTNAME 18
162
163#define SNMP_GENERICTRAP_COLDSTART 0
164#define SNMP_GENERICTRAP_WARMSTART 1
165#define SNMP_GENERICTRAP_LINKDOWN 2
166#define SNMP_GENERICTRAP_LINKUP 3
167#define SNMP_GENERICTRAP_AUTHFAILURE 4
168#define SNMP_GENERICTRAP_EGPNEIGHLOSS 5
169#define SNMP_GENERICTRAP_ENTERSPECIFIC 6
170
171#define SNMP_ACCESS_NONE 0
172#define SNMP_ACCESS_NOTIFY 1
173#define SNMP_ACCESS_READ_ONLY 2
174#define SNMP_ACCESS_READ_WRITE 3
175#define SNMP_ACCESS_READ_CREATE 4
176
177#define SNMP_LOG_SILENT 0
178#define SNMP_LOG_FATAL 1
179#define SNMP_LOG_ERROR 2
180#define SNMP_LOG_WARNING 3
181#define SNMP_LOG_TRACE 4
182#define SNMP_LOG_VERBOSE 5
183
184#define SNMP_OUTPUT_TO_CONSOLE 1
185#define SNMP_OUTPUT_TO_LOGFILE 2
186#define SNMP_OUTPUT_TO_EVENTLOG 4
187#define SNMP_OUTPUT_TO_DEBUGGER 8
188
189#define DEFINE_SIZEOF(x) (sizeof(x)/sizeof((x)[0]))
190#define DEFINE_OID(x) { DEFINE_SIZEOF(x),(x) }
191#define DEFINE_NULLOID() { 0, NULL }
192#define DEFINE_NULLOCTENTS() { NULL, 0, FALSE }
193
194#define DEFAULT_SNMP_PORT_UDP 161
195#define DEFAULT_SNMP_PORT_IPX 36879
196#define DEFAULT_SNMPTRAP_PORT_UDP 162
197#define DEFAULT_SNMPTRAP_PORT_IPX 36880
198
199#define SNMP_MAX_OID_LEN 128
200
201#define SNMP_MEM_ALLOC_ERROR 0
202#define SNMP_BERAPI_INVALID_LENGTH 10
203#define SNMP_BERAPI_INVALID_TAG 11
204#define SNMP_BERAPI_OVERFLOW 12
205#define SNMP_BERAPI_SHORT_BUFFER 13
206#define SNMP_BERAPI_INVALID_OBJELEM 14
207#define SNMP_PDUAPI_UNRECOGNIZED_PDU 20
208#define SNMP_PDUAPI_INVALID_ES 21
209#define SNMP_PDUAPI_INVALID_GT 22
210#define SNMP_AUTHAPI_INVALID_VERSION 30
211#define SNMP_AUTHAPI_INVALID_MSG_TYPE 31
212#define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32
213
214#define SNMPAPI_NOERROR TRUE
215#define SNMPAPI_ERROR FALSE
216
217#ifdef __cplusplus
218extern "C" {
219#endif
220
221BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
222 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion);
223BOOL WINAPI SnmpExtensionInitEx(AsnObjectIdentifier *pNextSupportedRegion);
224
225BOOL WINAPI SnmpExtensionMonitor(LPVOID pAgentMgmtData);
226
227BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList,
228 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex);
229BOOL WINAPI SnmpExtensionQueryEx(UINT nRequestType, UINT nTransactionId,
230 SnmpVarBindList *pVarBindList, AsnOctetString *pContextInfo,
231 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex);
232
233BOOL WINAPI SnmpExtensionTrap(AsnObjectIdentifier *pEnterpriseOid,
234 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId,
235 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList);
236
237VOID WINAPI SnmpExtensionClose(VOID);
238
239typedef BOOL (WINAPI *PFNSNMPEXTENSIONINIT)(DWORD dwUptimeReference,
240 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion);
241typedef BOOL (WINAPI *PFNSNMPEXTENSIONINITEX)(
242 AsnObjectIdentifier *pNextSupportedRegion);
243
244typedef BOOL (WINAPI *PFNSNMPEXTENSIONMONITOR)(LPVOID pAgentMgmtData);
245
246typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERY)(BYTE bPduType,
247 SnmpVarBindList *pVarBindList, AsnInteger32 *pErrorStatus,
248 AsnInteger32 *pErrorIndex);
249typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERYEX)(UINT nRequestType,
250 UINT nTransactionId, SnmpVarBindList *pVarBindList,
251 AsnOctetString *pContextInfo, AsnInteger32 *pErrorStatus,
252 AsnInteger32 *pErrorIndex);
253
254typedef BOOL (WINAPI *PFNSNMPEXTENSIONTRAP)(AsnObjectIdentifier *pEnterpriseOid,
255 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId,
256 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList);
257
258typedef VOID (WINAPI *PFNSNMPEXTENSIONCLOSE)(VOID);
259
260INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *pOidDst,
261 AsnObjectIdentifier *pOidSrc);
262INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *pOidDst,
263 AsnObjectIdentifier *pOidSrc);
264INT WINAPI SnmpUtilOidCmp(AsnObjectIdentifier *pOid1,
265 AsnObjectIdentifier *pOid2);
266INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *pOid1,
267 AsnObjectIdentifier *pOid2, UINT nSubIds);
268VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *pOid);
269
270INT WINAPI SnmpUtilOctetsCmp(AsnOctetString *pOctets1,
271 AsnOctetString *pOctets2);
272INT WINAPI SnmpUtilOctetsNCmp(AsnOctetString *pOctets1,
273 AsnOctetString *pOctets2, UINT nChars);
274INT WINAPI SnmpUtilOctetsCpy(AsnOctetString *pOctetsDst,
275 AsnOctetString *pOctetsSrc);
276VOID WINAPI SnmpUtilOctetsFree(AsnOctetString *pOctets);
277
278INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *pAnyDst, AsnAny *pAnySrc);
279VOID WINAPI SnmpUtilAsnAnyFree(AsnAny *pAny);
280
281INT WINAPI SnmpUtilVarBindCpy(SnmpVarBind *pVbDst, SnmpVarBind *pVbSrc);
282VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *pVb);
283
284INT WINAPI SnmpUtilVarBindListCpy(SnmpVarBindList *pVblDst,
285 SnmpVarBindList *pVblSrc);
286VOID WINAPI SnmpUtilVarBindListFree(SnmpVarBindList *pVbl);
287
288LPVOID WINAPI SnmpUtilMemAlloc(UINT nBytes) __WINE_ALLOC_SIZE(1);
289LPVOID WINAPI SnmpUtilMemReAlloc(LPVOID pMem, UINT nBytes) __WINE_ALLOC_SIZE(2);
290VOID WINAPI SnmpUtilMemFree(LPVOID pMem);
291
292LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *Oid);
293LPSTR WINAPI SnmpUtilIdsToA(UINT *Ids, UINT IdLength);
294
295VOID WINAPI SnmpUtilPrintOid(AsnObjectIdentifier *Oid);
296VOID WINAPI SnmpUtilPrintAsnAny(AsnAny *pAny);
297
298DWORD WINAPI SnmpSvcGetUptime(VOID);
299VOID WINAPI SnmpSvcSetLogLevel(INT nLogLevel);
300VOID WINAPI SnmpSvcSetLogType(INT nLogType);
301
302VOID WINAPIV SnmpUtilDbgPrint(INT nLogLevel, LPSTR szFormat, ...);
303
304#ifdef __cplusplus
305}
306#endif
307
308#endif /* _WINE_SNMP_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette