Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygensnmp.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2005 Juan Lang 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 00017 */ 00018 #ifndef _WINE_SNMP_H 00019 #define _WINE_SNMP_H 00020 00021 #ifndef __WINESRC__ 00022 # include <windows.h> 00023 #else 00024 # include <windef.h> 00025 #endif 00026 00027 #include <pshpack4.h> 00028 00029 typedef struct { 00030 BYTE *stream; 00031 UINT length; 00032 BOOL dynamic; 00033 } AsnOctetString; 00034 00035 typedef struct { 00036 UINT idLength; 00037 UINT *ids; 00038 } AsnObjectIdentifier; 00039 00040 typedef LONG AsnInteger32; 00041 typedef ULONG AsnUnsigned32; 00042 typedef ULARGE_INTEGER AsnCounter64; 00043 typedef AsnUnsigned32 AsnCounter32; 00044 typedef AsnUnsigned32 AsnGauge32; 00045 typedef AsnUnsigned32 AsnTimeticks; 00046 typedef AsnOctetString AsnBits; 00047 typedef AsnOctetString AsnSequence; 00048 typedef AsnOctetString AsnImplicitSequence; 00049 typedef AsnOctetString AsnIPAddress; 00050 typedef AsnOctetString AsnNetworkAddress; 00051 typedef AsnOctetString AsnDisplayString; 00052 typedef AsnOctetString AsnOpaque; 00053 00054 typedef struct { 00055 BYTE asnType; 00056 union { 00057 AsnInteger32 number; 00058 AsnUnsigned32 unsigned32; 00059 AsnCounter64 counter64; 00060 AsnOctetString string; 00061 AsnBits bits; 00062 AsnObjectIdentifier object; 00063 AsnSequence sequence; 00064 AsnIPAddress address; 00065 AsnCounter32 counter; 00066 AsnGauge32 gauge; 00067 AsnTimeticks ticks; 00068 AsnOpaque arbitrary; 00069 } asnValue; 00070 } AsnAny; 00071 00072 typedef AsnObjectIdentifier AsnObjectName; 00073 typedef AsnAny AsnObjectSyntax; 00074 00075 typedef struct { 00076 AsnObjectName name; 00077 AsnObjectSyntax value; 00078 } SnmpVarBind; 00079 00080 typedef struct { 00081 SnmpVarBind *list; 00082 UINT len; 00083 } SnmpVarBindList; 00084 00085 #include <poppack.h> 00086 00087 #define ASN_UNIVERSAL 0x00 00088 #define ASN_APPLICATION 0x40 00089 #define ASN_CONTEXT 0x80 00090 #define ASN_PRIVATE 0xc0 00091 #define ASN_PRIMITIVE 0x00 00092 #define ASN_CONSTRUCTOR 0x20 00093 00094 #define SNMP_PDU_GET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x00) 00095 #define SNMP_PDU_GETNEXT (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x01) 00096 #define SNMP_PDU_RESPONSE (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x02) 00097 #define SNMP_PDU_SET (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x03) 00098 #define SNMP_PDU_V1TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x04) 00099 #define SNMP_PDU_GETBULK (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x05) 00100 #define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x06) 00101 #define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x07) 00102 00103 #define ASN_INTEGER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x02) 00104 #define ASN_BITS (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03) 00105 #define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04) 00106 #define ASN_NULL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x05) 00107 #define ASN_OBJECTIDENTIFIER (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x06) 00108 #define ASN_INTEGER32 ASN_INTEGER 00109 00110 #define ASN_SEQUENCE (ASN_UNIVERSAL | ASN_CONSTRUCTOR | 0x10) 00111 #define ASN_SEQUENCEOF ASN_SEQUENCE 00112 00113 #define ASN_IPADDRESS (ASN_APPLICATION | ASN_PRIMITIVE | 0x00) 00114 #define ASN_COUNTER32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x01) 00115 #define ASN_GAUGE32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x02) 00116 #define ASN_TIMETICKS (ASN_APPLICATION | ASN_PRIMITIVE | 0x03) 00117 #define ASN_OPAQUE (ASN_APPLICATION | ASN_PRIMITIVE | 0x04) 00118 #define ASN_COUNTER64 (ASN_APPLICATION | ASN_PRIMITIVE | 0x06) 00119 #define ASN_UNSIGNED32 (ASN_APPLICATION | ASN_PRIMITIVE | 0x07) 00120 00121 #define SNMP_EXCEPTION_NOSUCHOBJECT (ASN_CONTEXT | ASN_PRIMITIVE | 0x00) 00122 #define SNMP_EXCEPTION_NOSUCHINSTANCE (ASN_CONTEXT | ASN_PRIMITIVE | 0x01) 00123 #define SNMP_EXCEPTION_ENDOFMIBVIEW (ASN_CONTEXT | ASN_PRIMITIVE | 0x02) 00124 00125 #define SNMP_EXTENSION_GET SNMP_PDU_GET 00126 #define SNMP_EXTENSION_GET_NEXT SNMP_PDU_GETNEXT 00127 #define SNMP_EXTENSION_GET_BULK SNMP_PDU_GETBULK 00128 #define SNMP_EXTENSION_SET_TEST (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x0) 00129 #define SNMP_EXTENSION_SET_COMMIT SNMP_PDU_SET 00130 #define SNMP_EXTENSION_SET_UNDO (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x1) 00131 #define SNMP_EXTENSION_SET_CLEANUP (ASN_PRIVATE | ASN_CONSTRUCTOR | 0x2) 00132 00133 #define SNMP_ERRORSTATUS_NOERROR 0 00134 #define SNMP_ERRORSTATUS_TOOBIG 1 00135 #define SNMP_ERRORSTATUS_NOSUCHNAME 2 00136 #define SNMP_ERRORSTATUS_BADVALUE 3 00137 #define SNMP_ERRORSTATUS_READONLY 4 00138 #define SNMP_ERRORSTATUS_GENERR 5 00139 #define SNMP_ERRORSTATUS_NOACCESS 6 00140 #define SNMP_ERRORSTATUS_WRONGTYPE 7 00141 #define SNMP_ERRORSTATUS_WRONGLENGTH 8 00142 #define SNMP_ERRORSTATUS_WRONGENCODING 9 00143 #define SNMP_ERRORSTATUS_WRONGVALUE 10 00144 #define SNMP_ERRORSTATUS_NOCREATION 11 00145 #define SNMP_ERRORSTATUS_INCONSISTENTVALUE 12 00146 #define SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE 13 00147 #define SNMP_ERRORSTATUS_COMMITFAILED 14 00148 #define SNMP_ERRORSTATUS_UNDOFAILED 15 00149 #define SNMP_ERRORSTATUS_AUTHORIZATIONERROR 16 00150 #define SNMP_ERRORSTATUS_NOTWRITABLE 17 00151 #define SNMP_ERRORSTATUS_INCONSISTENTNAME 18 00152 00153 #define SNMP_GENERICTRAP_COLDSTART 0 00154 #define SNMP_GENERICTRAP_WARMSTART 1 00155 #define SNMP_GENERICTRAP_LINKDOWN 2 00156 #define SNMP_GENERICTRAP_LINKUP 3 00157 #define SNMP_GENERICTRAP_AUTHFAILURE 4 00158 #define SNMP_GENERICTRAP_EGPNEIGHLOSS 5 00159 #define SNMP_GENERICTRAP_ENTERSPECIFIC 6 00160 00161 #define SNMP_ACCESS_NONE 0 00162 #define SNMP_ACCESS_NOTIFY 1 00163 #define SNMP_ACCESS_READ_ONLY 2 00164 #define SNMP_ACCESS_READ_WRITE 3 00165 #define SNMP_ACCESS_READ_CREATE 4 00166 00167 #define SNMP_LOG_SILENT 0 00168 #define SNMP_LOG_FATAL 1 00169 #define SNMP_LOG_ERROR 2 00170 #define SNMP_LOG_WARNING 3 00171 #define SNMP_LOG_TRACE 4 00172 #define SNMP_LOG_VERBOSE 5 00173 00174 #define SNMP_OUTPUT_TO_CONSOLE 1 00175 #define SNMP_OUTPUT_TO_LOGFILE 2 00176 #define SNMP_OUTPUT_TO_EVENTLOG 4 00177 #define SNMP_OUTPUT_TO_DEBUGGER 8 00178 00179 #define DEFINE_SIZEOF(x) (sizeof(x)/sizeof((x)[0])) 00180 #define DEFINE_OID(x) { DEFINE_SIZEOF(x),(x) } 00181 #define DEFINE_NULLOID() { 0, NULL } 00182 #define DEFINE_NULLOCTENTS() { NULL, 0, FALSE } 00183 00184 #define DEFAULT_SNMP_PORT_UDP 161 00185 #define DEFAULT_SNMP_PORT_IPX 36879 00186 #define DEFAULT_SNMPTRAP_PORT_UDP 162 00187 #define DEFAULT_SNMPTRAP_PORT_IPX 36880 00188 00189 #define SNMP_MAX_OID_LEN 128 00190 00191 #define SNMP_MEM_ALLOC_ERROR 0 00192 #define SNMP_BERAPI_INVALID_LENGTH 10 00193 #define SNMP_BERAPI_INVALID_TAG 11 00194 #define SNMP_BERAPI_OVERFLOW 12 00195 #define SNMP_BERAPI_SHORT_BUFFER 13 00196 #define SNMP_BERAPI_INVALID_OBJELEM 14 00197 #define SNMP_PDUAPI_UNRECOGNIZED_PDU 20 00198 #define SNMP_PDUAPI_INVALID_ES 21 00199 #define SNMP_PDUAPI_INVALID_GT 22 00200 #define SNMP_AUTHAPI_INVALID_VERSION 30 00201 #define SNMP_AUTHAPI_INVALID_MSG_TYPE 31 00202 #define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32 00203 00204 #define SNMPAPI_NOERROR TRUE 00205 #define SNMPAPI_ERROR FALSE 00206 00207 #ifdef __cplusplus 00208 extern "C" { 00209 #endif 00210 00211 BOOL WINAPI SnmpExtensionInit(DWORD dwUptimeReference, 00212 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion); 00213 BOOL WINAPI SnmpExtensionInitEx(AsnObjectIdentifier *pNextSupportedRegion); 00214 00215 BOOL WINAPI SnmpExtensionMonitor(LPVOID pAgentMgmtData); 00216 00217 BOOL WINAPI SnmpExtensionQuery(BYTE bPduType, SnmpVarBindList *pVarBindList, 00218 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex); 00219 BOOL WINAPI SnmpExtensionQueryEx(UINT nRequestType, UINT nTransactionId, 00220 SnmpVarBindList *pVarBindList, AsnOctetString *pContextInfo, 00221 AsnInteger32 *pErrorStatus, AsnInteger32 *pErrorIndex); 00222 00223 BOOL WINAPI SnmpExtensionTrap(AsnObjectIdentifier *pEnterpriseOid, 00224 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId, 00225 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList); 00226 00227 VOID WINAPI SnmpExtensionClose(VOID); 00228 00229 typedef BOOL (WINAPI *PFNSNMPEXTENSIONINIT)(DWORD dwUptimeReference, 00230 HANDLE *phSubagentTrapEvent, AsnObjectIdentifier *pFirstSupportedRegion); 00231 typedef BOOL (WINAPI *PFNSNMPEXTENSIONINITEX)( 00232 AsnObjectIdentifier *pNextSupportedRegion); 00233 00234 typedef BOOL (WINAPI *PFNSNMPEXTENSIONMONITOR)(LPVOID pAgentMgmtData); 00235 00236 typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERY)(BYTE bPduType, 00237 SnmpVarBindList *pVarBindList, AsnInteger32 *pErrorStatus, 00238 AsnInteger32 *pErrorIndex); 00239 typedef BOOL (WINAPI *PFNSNMPEXTENSIONQUERYEX)(UINT nRequestType, 00240 UINT nTransactionId, SnmpVarBindList *pVarBindList, 00241 AsnOctetString *pContextInfo, AsnInteger32 *pErrorStatus, 00242 AsnInteger32 *pErrorIndex); 00243 00244 typedef BOOL (WINAPI *PFNSNMPEXTENSIONTRAP)(AsnObjectIdentifier *pEnterpriseOid, 00245 AsnInteger32 *pGenericTrapId, AsnInteger32 *pSpecificTrapId, 00246 AsnTimeticks *pTimeStamp, SnmpVarBindList *pVarBindList); 00247 00248 typedef VOID (WINAPI *PFNSNMPEXTENSIONCLOSE)(VOID); 00249 00250 INT WINAPI SnmpUtilOidCpy(AsnObjectIdentifier *pOidDst, 00251 AsnObjectIdentifier *pOidSrc); 00252 INT WINAPI SnmpUtilOidAppend(AsnObjectIdentifier *pOidDst, 00253 AsnObjectIdentifier *pOidSrc); 00254 INT WINAPI SnmpUtilOidCmp(AsnObjectIdentifier *pOid1, 00255 AsnObjectIdentifier *pOid2); 00256 INT WINAPI SnmpUtilOidNCmp(AsnObjectIdentifier *pOid1, 00257 AsnObjectIdentifier *pOid2, UINT nSubIds); 00258 VOID WINAPI SnmpUtilOidFree(AsnObjectIdentifier *pOid); 00259 00260 INT WINAPI SnmpUtilOctetsCmp(AsnOctetString *pOctets1, 00261 AsnOctetString *pOctets2); 00262 INT WINAPI SnmpUtilOctetsNCmp(AsnOctetString *pOctets1, 00263 AsnOctetString *pOctets2, UINT nChars); 00264 INT WINAPI SnmpUtilOctetsCpy(AsnOctetString *pOctetsDst, 00265 AsnOctetString *pOctetsSrc); 00266 VOID WINAPI SnmpUtilOctetsFree(AsnOctetString *pOctets); 00267 00268 INT WINAPI SnmpUtilAsnAnyCpy(AsnAny *pAnyDst, AsnAny *pAnySrc); 00269 VOID WINAPI SnmpUtilAsnAnyFree(AsnAny *pAny); 00270 00271 INT WINAPI SnmpUtilVarBindCpy(SnmpVarBind *pVbDst, SnmpVarBind *pVbSrc); 00272 VOID WINAPI SnmpUtilVarBindFree(SnmpVarBind *pVb); 00273 00274 INT WINAPI SnmpUtilVarBindListCpy(SnmpVarBindList *pVblDst, 00275 SnmpVarBindList *pVblSrc); 00276 VOID WINAPI SnmpUtilVarBindListFree(SnmpVarBindList *pVbl); 00277 00278 LPVOID WINAPI SnmpUtilMemAlloc(UINT nBytes) __WINE_ALLOC_SIZE(1); 00279 LPVOID WINAPI SnmpUtilMemReAlloc(LPVOID pMem, UINT nBytes) __WINE_ALLOC_SIZE(2); 00280 VOID WINAPI SnmpUtilMemFree(LPVOID pMem); 00281 00282 LPSTR WINAPI SnmpUtilOidToA(AsnObjectIdentifier *Oid); 00283 LPSTR WINAPI SnmpUtilIdsToA(UINT *Ids, UINT IdLength); 00284 00285 VOID WINAPI SnmpUtilPrintOid(AsnObjectIdentifier *Oid); 00286 VOID WINAPI SnmpUtilPrintAsnAny(AsnAny *pAny); 00287 00288 DWORD WINAPI SnmpSvcGetUptime(VOID); 00289 VOID WINAPI SnmpSvcSetLogLevel(INT nLogLevel); 00290 VOID WINAPI SnmpSvcSetLogType(INT nLogType); 00291 00292 VOID WINAPIV SnmpUtilDbgPrint(INT nLogLevel, LPSTR szFormat, ...); 00293 00294 #ifdef __cplusplus 00295 } 00296 #endif 00297 00298 #endif /* _WINE_SNMP_H */ Generated on Fri May 25 2012 04:30:54 for ReactOS by
1.7.6.1
|