VirtualBox

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

最後變更 在這個檔案從25949是 16477,由 vboxsync 提交於 16 年 前

LGPL disclaimer by filemuncher

  • 屬性 svn:eol-style 設為 native
檔案大小: 11.2 KB
 
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 * Sun 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, Sun 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#ifndef _WINE_SNMP_H
28#define _WINE_SNMP_H
29
30#ifndef __WINESRC__
31# include <windows.h>
32#else
33# include <windef.h>
34#endif
35
36#include <pshpack4.h>
37
38typedef struct {
39 BYTE *stream;
40 UINT length;
41 BOOL dynamic;
42} AsnOctetString;
43
44typedef struct {
45 UINT idLength;
46 UINT *ids;
47} AsnObjectIdentifier;
48
49typedef LONG AsnInteger32;
50typedef ULONG AsnUnsigned32;
51typedef ULARGE_INTEGER AsnCounter64;
52typedef AsnUnsigned32 AsnCounter32;
53typedef AsnUnsigned32 AsnGauge32;
54typedef AsnUnsigned32 AsnTimeticks;
55typedef AsnOctetString AsnBits;
56typedef AsnOctetString AsnSequence;
57typedef AsnOctetString AsnImplicitSequence;
58typedef AsnOctetString AsnIPAddress;
59typedef AsnOctetString AsnNetworkAddress;
60typedef AsnOctetString AsnDisplayString;
61typedef AsnOctetString AsnOpaque;
62
63typedef struct {
64 BYTE asnType;
65 union {
66 AsnInteger32 number;
67 AsnUnsigned32 unsigned32;
68 AsnCounter64 counter64;
69 AsnOctetString string;
70 AsnBits bits;
71 AsnObjectIdentifier object;
72 AsnSequence sequence;
73 AsnIPAddress address;
74 AsnCounter32 counter;
75 AsnGauge32 gauge;
76 AsnTimeticks ticks;
77 AsnOpaque arbitrary;
78 } asnValue;
79} AsnAny;
80
81typedef AsnObjectIdentifier AsnObjectName;
82typedef AsnAny AsnObjectSyntax;
83
84typedef struct {
85 AsnObjectName name;
86 AsnObjectSyntax value;
87} SnmpVarBind;
88
89typedef struct {
90 SnmpVarBind *list;
91 UINT len;
92} SnmpVarBindList;
93
94#include <poppack.h>
95
96#define ASN_UNIVERSAL 0x00
97#define ASN_APPLICATION 0x40
98#define ASN_CONTEXT 0x80
99#define ASN_PRIVATE 0xc0
100#define ASN_PRIMITIVE 0x00
101#define ASN_CONSTRUCTOR 0x20
102
103#define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x00)
104#define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x01)
105#define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x02)
106#define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x03)
107#define SNMP_PDU_V1TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x04)
108#define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x05)
109#define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x06)
110#define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x07)
111
112#define ASN_INTEGER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x02)
113#define ASN_BITS (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
114#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
115#define ASN_NULL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x05)
116#define ASN_OBJECTIDENTIFIER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x06)
117#define ASN_INTEGER32 ASN_INTEGER
118
119#define ASN_SEQUENCE (ASN_UNIVERSAL | ASN_CONSTRUCTOR | 0x10)
120#define ASN_SEQUENCEOF ASN_SEQUENCE
121
122#define ASN_IPADDRESS (ASN_APPLICATION | ASN_PRIMITIVE | 0x00)
123#define ASN_COUNTER32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x01)
124#define ASN_GAUGE32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x02)
125#define ASN_TIMETICKS (ASN_APPLICATION | ASN_PRIMITIVE | 0x03)
126#define ASN_OPAQUE (ASN_APPLICATION | ASN_PRIMITIVE | 0x04)
127#define ASN_COUNTER64 (ASN_APPLICATION | ASN_PRIMITIVE | 0x06)
128#define ASN_UNSIGNED32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x07)
129
130#define SNMP_EXCEPTION_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x00)
131#define SNMP_EXCEPTION_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x01)
132#define SNMP_EXCEPTION_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x02)
133
134#define SNMP_EXTENSION_GET SNMP_PDU_GET
135#define SNMP_EXTENSION_GET_NEXT SNMP_PDU_GETNEXT
136#define SNMP_EXTENSION_GET_BULK SNMP_PDU_GETBULK
137#define SNMP_EXTENSION_SET_TEST (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x0)
138#define SNMP_EXTENSION_SET_COMMIT SNMP_PDU_SET
139#define SNMP_EXTENSION_SET_UNDO (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x1)
140#define SNMP_EXTENSION_SET_CLEANUP (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x2)
141
142#define SNMP_ERRORSTATUS_NOERROR 0
143#define SNMP_ERRORSTATUS_TOOBIG 1
144#define SNMP_ERRORSTATUS_NOSUCHNAME 2
145#define SNMP_ERRORSTATUS_BADVALUE 3
146#define SNMP_ERRORSTATUS_READONLY 4
147#define SNMP_ERRORSTATUS_GENERR 5
148#define SNMP_ERRORSTATUS_NOACCESS 6
149#define SNMP_ERRORSTATUS_WRONGTYPE 7
150#define SNMP_ERRORSTATUS_WRONGLENGTH 8
151#define SNMP_ERRORSTATUS_WRONGENCODING 9
152#define SNMP_ERRORSTATUS_WRONGVALUE 10
153#define SNMP_ERRORSTATUS_NOCREATION 11
154#define SNMP_ERRORSTATUS_INCONSISTENTVALUE 12
155#define SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE 13
156#define SNMP_ERRORSTATUS_COMMITFAILED 14
157#define SNMP_ERRORSTATUS_UNDOFAILED 15
158#define SNMP_ERRORSTATUS_AUTHORIZATIONERROR 16
159#define SNMP_ERRORSTATUS_NOTWRITABLE 17
160#define SNMP_ERRORSTATUS_INCONSISTENTNAME 18
161
162#define SNMP_GENERICTRAP_COLDSTART 0
163#define SNMP_GENERICTRAP_WARMSTART 1
164#define SNMP_GENERICTRAP_LINKDOWN 2
165#define SNMP_GENERICTRAP_LINKUP 3
166#define SNMP_GENERICTRAP_AUTHFAILURE 4
167#define SNMP_GENERICTRAP_EGPNEIGHLOSS 5
168#define SNMP_GENERICTRAP_ENTERSPECIFIC 6
169
170#define SNMP_ACCESS_NONE 0
171#define SNMP_ACCESS_NOTIFY 1
172#define SNMP_ACCESS_READ_ONLY 2
173#define SNMP_ACCESS_READ_WRITE 3
174#define SNMP_ACCESS_READ_CREATE 4
175
176#define SNMP_LOG_SILENT 0
177#define SNMP_LOG_FATAL 1
178#define SNMP_LOG_ERROR 2
179#define SNMP_LOG_WARNING 3
180#define SNMP_LOG_TRACE 4
181#define SNMP_LOG_VERBOSE 5
182
183#define SNMP_OUTPUT_TO_CONSOLE 1
184#define SNMP_OUTPUT_TO_LOGFILE 2
185#define SNMP_OUTPUT_TO_EVENTLOG 4
186#define SNMP_OUTPUT_TO_DEBUGGER 8
187
188#define DEFINE_SIZEOF(x) (sizeof(x)/sizeof((x)[0]))
189#define DEFINE_OID(x) { DEFINE_SIZEOF(x),(x) }
190#define DEFINE_NULLOID() { 0, NULL }
191#define DEFINE_NULLOCTENTS() { NULL, 0, FALSE }
192
193#define DEFAULT_SNMP_PORT_UDP 161
194#define DEFAULT_SNMP_PORT_IPX 36879
195#define DEFAULT_SNMPTRAP_PORT_UDP 162
196#define DEFAULT_SNMPTRAP_PORT_IPX 36880
197
198#define SNMP_MAX_OID_LEN 128
199
200#define SNMP_MEM_ALLOC_ERROR 0
201#define SNMP_BERAPI_INVALID_LENGTH 10
202#define SNMP_BERAPI_INVALID_TAG 11
203#define SNMP_BERAPI_OVERFLOW 12
204#define SNMP_BERAPI_SHORT_BUFFER 13
205#define SNMP_BERAPI_INVALID_OBJELEM 14
206#define SNMP_PDUAPI_UNRECOGNIZED_PDU 20
207#define SNMP_PDUAPI_INVALID_ES 21
208#define SNMP_PDUAPI_INVALID_GT 22
209#define SNMP_AUTHAPI_INVALID_VERSION 30
210#define SNMP_AUTHAPI_INVALID_MSG_TYPE 31
211#define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32
212
213#define SNMPAPI_NOERROR TRUE
214#define SNMPAPI_ERROR FALSE
215
216#ifdef __cplusplus
217extern "C" {
218#endif
219
220BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference,
221 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion);
222BOOL WINAPI SnmpExtensionInitEx(AsnObjectIdentifier *pNextSupportedRegion);
223
224BOOL WINAPI SnmpExtensionMonitor(LPVOID pAgentMgmtData);
225
226BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList,
227 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex);
228BOOL WINAPI SnmpExtensionQueryEx(UINT nRequestType, UINT nTransactionId,
229 SnmpVarBindList *pVarBindList, AsnOctetString *pContextInfo,
230 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex);
231
232BOOL WINAPI SnmpExtensionTrap(AsnObjectIdentifier *pEnterpriseOid,
233 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId,
234 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList);
235
236VOID WINAPI SnmpExtensionClose(VOID);
237
238typedef BOOL (WINAPI *PFNSNMPEXTENSIONINIT)(DWORD dwUptimeReference,
239 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion);
240typedef BOOL (WINAPI *PFNSNMPEXTENSIONINITEX)(
241 AsnObjectIdentifier *pNextSupportedRegion);
242
243typedef BOOL (WINAPI *PFNSNMPEXTENSIONMONITOR)(LPVOID pAgentMgmtData);
244
245typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERY)(BYTE bPduType,
246 SnmpVarBindList *pVarBindList, AsnInteger32 *pErrorStatus,
247 AsnInteger32 *pErrorIndex);
248typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERYEX)(UINT nRequestType,
249 UINT nTransactionId, SnmpVarBindList *pVarBindList,
250 AsnOctetString *pContextInfo, AsnInteger32 *pErrorStatus,
251 AsnInteger32 *pErrorIndex);
252
253typedef BOOL (WINAPI *PFNSNMPEXTENSIONTRAP)(AsnObjectIdentifier *pEnterpriseOid,
254 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId,
255 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList);
256
257typedef VOID (WINAPI *PFNSNMPEXTENSIONCLOSE)(VOID);
258
259INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *pOidDst,
260 AsnObjectIdentifier *pOidSrc);
261INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *pOidDst,
262 AsnObjectIdentifier *pOidSrc);
263INT WINAPI SnmpUtilOidCmp(AsnObjectIdentifier *pOid1,
264 AsnObjectIdentifier *pOid2);
265INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *pOid1,
266 AsnObjectIdentifier *pOid2, UINT nSubIds);
267VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *pOid);
268
269INT WINAPI SnmpUtilOctetsCmp(AsnOctetString *pOctets1,
270 AsnOctetString *pOctets2);
271INT WINAPI SnmpUtilOctetsNCmp(AsnOctetString *pOctets1,
272 AsnOctetString *pOctets2, UINT nChars);
273INT WINAPI SnmpUtilOctetsCpy(AsnOctetString *pOctetsDst,
274 AsnOctetString *pOctetsSrc);
275VOID WINAPI SnmpUtilOctetsFree(AsnOctetString *pOctets);
276
277INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *pAnyDst, AsnAny *pAnySrc);
278VOID WINAPI SnmpUtilAsnAnyFree(AsnAny *pAny);
279
280INT WINAPI SnmpUtilVarBindCpy(SnmpVarBind *pVbDst, SnmpVarBind *pVbSrc);
281VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *pVb);
282
283INT WINAPI SnmpUtilVarBindListCpy(SnmpVarBindList *pVblDst,
284 SnmpVarBindList *pVblSrc);
285VOID WINAPI SnmpUtilVarBindListFree(SnmpVarBindList *pVbl);
286
287LPVOID WINAPI SnmpUtilMemAlloc(UINT nBytes) __WINE_ALLOC_SIZE(1);
288LPVOID WINAPI SnmpUtilMemReAlloc(LPVOID pMem, UINT nBytes) __WINE_ALLOC_SIZE(2);
289VOID WINAPI SnmpUtilMemFree(LPVOID pMem);
290
291LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *Oid);
292LPSTR WINAPI SnmpUtilIdsToA(UINT *Ids, UINT IdLength);
293
294VOID WINAPI SnmpUtilPrintOid(AsnObjectIdentifier *Oid);
295VOID WINAPI SnmpUtilPrintAsnAny(AsnAny *pAny);
296
297DWORD WINAPI SnmpSvcGetUptime(VOID);
298VOID WINAPI SnmpSvcSetLogLevel(INT nLogLevel);
299VOID WINAPI SnmpSvcSetLogType(INT nLogType);
300
301VOID WINAPIV SnmpUtilDbgPrint(INT nLogLevel, LPSTR szFormat, ...);
302
303#ifdef __cplusplus
304}
305#endif
306
307#endif /* _WINE_SNMP_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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