VirtualBox

source: vbox/trunk/src/VBox/Devices/Graphics/shaderlib/wine/include/snmp.h@ 53201

最後變更 在這個檔案從53201是 53201,由 vboxsync 提交於 10 年 前

Devices/Main: vmsvga updates

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

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