📄 snmp.h
字号:
AsnInteger32 * pErrorStatus, AsnInteger32 * pErrorIndex );typedef BOOL (SNMP_FUNC_TYPE * PFNSNMPEXTENSIONQUERYEX)( UINT nRequestType, UINT nTransactionId, SnmpVarBindList * pVarBindList, AsnOctetString * pContextInfo, AsnInteger32 * pErrorStatus, AsnInteger32 * pErrorIndex );typedef BOOL (SNMP_FUNC_TYPE * PFNSNMPEXTENSIONTRAP)( AsnObjectIdentifier * pEnterpriseOid, AsnInteger32 * pGenericTrapId, AsnInteger32 * pSpecificTrapId, AsnTimeticks * pTimeStamp, SnmpVarBindList * pVarBindList );typedef VOID (SNMP_FUNC_TYPE * PFNSNMPEXTENSIONCLOSE)( );///////////////////////////////////////////////////////////////////////////////// //// SNMP API Prototypes //// /////////////////////////////////////////////////////////////////////////////////SNMPAPISNMP_FUNC_TYPESnmpUtilOidCpy( AsnObjectIdentifier * pOidDst, AsnObjectIdentifier * pOidSrc );SNMPAPISNMP_FUNC_TYPESnmpUtilOidAppend( AsnObjectIdentifier * pOidDst, AsnObjectIdentifier * pOidSrc );SNMPAPISNMP_FUNC_TYPESnmpUtilOidNCmp( AsnObjectIdentifier * pOid1, AsnObjectIdentifier * pOid2, UINT nSubIds );SNMPAPISNMP_FUNC_TYPESnmpUtilOidCmp( AsnObjectIdentifier * pOid1, AsnObjectIdentifier * pOid2 );VOIDSNMP_FUNC_TYPESnmpUtilOidFree( AsnObjectIdentifier * pOid );SNMPAPISNMP_FUNC_TYPESnmpUtilOctetsCmp( AsnOctetString * pOctets1, AsnOctetString * pOctets2 );SNMPAPISNMP_FUNC_TYPESnmpUtilOctetsNCmp( AsnOctetString * pOctets1, AsnOctetString * pOctets2, UINT nChars );SNMPAPISNMP_FUNC_TYPESnmpUtilOctetsCpy( AsnOctetString * pOctetsDst, AsnOctetString * pOctetsSrc );VOIDSNMP_FUNC_TYPESnmpUtilOctetsFree( AsnOctetString * pOctets );SNMPAPISNMP_FUNC_TYPESnmpUtilAsnAnyCpy( AsnAny * pAnyDst, AsnAny * pAnySrc );VOIDSNMP_FUNC_TYPESnmpUtilAsnAnyFree( AsnAny * pAny );SNMPAPISNMP_FUNC_TYPESnmpUtilVarBindCpy( SnmpVarBind * pVbDst, SnmpVarBind * pVbSrc );VOIDSNMP_FUNC_TYPESnmpUtilVarBindFree( SnmpVarBind * pVb );SNMPAPISNMP_FUNC_TYPESnmpUtilVarBindListCpy( SnmpVarBindList * pVblDst, SnmpVarBindList * pVblSrc );VOIDSNMP_FUNC_TYPESnmpUtilVarBindListFree( SnmpVarBindList * pVbl );VOIDSNMP_FUNC_TYPESnmpUtilMemFree( LPVOID pMem );LPVOIDSNMP_FUNC_TYPESnmpUtilMemAlloc( UINT nBytes );LPVOIDSNMP_FUNC_TYPESnmpUtilMemReAlloc( LPVOID pMem, UINT nBytes );LPSTRSNMP_FUNC_TYPESnmpUtilOidToA( IN AsnObjectIdentifier *Oid );LPSTR SNMP_FUNC_TYPESnmpUtilIdsToA( IN UINT *Ids, IN UINT IdLength );VOID SNMP_FUNC_TYPESnmpUtilPrintOid( IN AsnObjectIdentifier *Oid );VOIDSNMP_FUNC_TYPESnmpUtilPrintAsnAny( AsnAny * pAny );DWORDSNMP_FUNC_TYPE SnmpSvcGetUptime( );VOIDSNMP_FUNC_TYPESnmpSvcSetLogLevel( INT nLogLevel );VOIDSNMP_FUNC_TYPESnmpSvcSetLogType( INT nLogType );///////////////////////////////////////////////////////////////////////////////// //// SNMP Debugging Definitions //// /////////////////////////////////////////////////////////////////////////////////#define SNMP_LOG_SILENT 0x0#define SNMP_LOG_FATAL 0x1#define SNMP_LOG_ERROR 0x2#define SNMP_LOG_WARNING 0x3#define SNMP_LOG_TRACE 0x4#define SNMP_LOG_VERBOSE 0x5#define SNMP_OUTPUT_TO_CONSOLE 0x1#define SNMP_OUTPUT_TO_LOGFILE 0x2#define SNMP_OUTPUT_TO_EVENTLOG 0x4 // no longer supported#define SNMP_OUTPUT_TO_DEBUGGER 0x8///////////////////////////////////////////////////////////////////////////////// //// SNMP Debugging Prototypes //// /////////////////////////////////////////////////////////////////////////////////VOIDSNMP_FUNC_TYPESnmpUtilDbgPrint( IN INT nLogLevel, // see log levels above... IN LPSTR szFormat, IN ... );#if DBG#define SNMPDBG(_x_) SnmpUtilDbgPrint _x_#else#define SNMPDBG(_x_)#endif///////////////////////////////////////////////////////////////////////////////// //// Miscellaneous definitions //// /////////////////////////////////////////////////////////////////////////////////#define DEFINE_SIZEOF(Array) (sizeof(Array)/sizeof((Array)[0]))#define DEFINE_OID(SubIdArray) {DEFINE_SIZEOF(SubIdArray),(SubIdArray)}#define DEFINE_NULLOID() {0,NULL} #define DEFINE_NULLOCTETS() {NULL,0,FALSE}#define DEFAULT_SNMP_PORT_UDP 161#define DEFAULT_SNMP_PORT_IPX 36879#define DEFAULT_SNMPTRAP_PORT_UDP 162#define DEFAULT_SNMPTRAP_PORT_IPX 36880#define SNMP_MAX_OID_LEN 128///////////////////////////////////////////////////////////////////////////////// //// API Error Code Definitions //// ///////////////////////////////////////////////////////////////////////////////// #define SNMP_MEM_ALLOC_ERROR 1#define SNMP_BERAPI_INVALID_LENGTH 10#define SNMP_BERAPI_INVALID_TAG 11#define SNMP_BERAPI_OVERFLOW 12#define SNMP_BERAPI_SHORT_BUFFER 13#define SNMP_BERAPI_INVALID_OBJELEM 14#define SNMP_PDUAPI_UNRECOGNIZED_PDU 20#define SNMP_PDUAPI_INVALID_ES 21#define SNMP_PDUAPI_INVALID_GT 22#define SNMP_AUTHAPI_INVALID_VERSION 30#define SNMP_AUTHAPI_INVALID_MSG_TYPE 31#define SNMP_AUTHAPI_TRIV_AUTH_FAILED 32///////////////////////////////////////////////////////////////////////////////// //// Support for old definitions (support disabled via SNMPSTRICT) //// /////////////////////////////////////////////////////////////////////////////////#ifndef SNMPSTRICT#define SNMP_oidcpy SnmpUtilOidCpy#define SNMP_oidappend SnmpUtilOidAppend#define SNMP_oidncmp SnmpUtilOidNCmp#define SNMP_oidcmp SnmpUtilOidCmp#define SNMP_oidfree SnmpUtilOidFree#define SNMP_CopyVarBindList SnmpUtilVarBindListCpy#define SNMP_FreeVarBindList SnmpUtilVarBindListFree#define SNMP_CopyVarBind SnmpUtilVarBindCpy#define SNMP_FreeVarBind SnmpUtilVarBindFree#define SNMP_printany SnmpUtilPrintAsnAny#define SNMP_free SnmpUtilMemFree#define SNMP_malloc SnmpUtilMemAlloc#define SNMP_realloc SnmpUtilMemReAlloc#define SNMP_DBG_free SnmpUtilMemFree#define SNMP_DBG_malloc SnmpUtilMemAlloc#define SNMP_DBG_realloc SnmpUtilMemReAlloc#define ASN_RFC1155_IPADDRESS ASN_IPADDRESS#define ASN_RFC1155_COUNTER ASN_COUNTER32#define ASN_RFC1155_GAUGE ASN_GAUGE32#define ASN_RFC1155_TIMETICKS ASN_TIMETICKS#define ASN_RFC1155_OPAQUE ASN_OPAQUE#define ASN_RFC1213_DISPSTRING ASN_OCTETSTRING#define ASN_RFC1157_GETREQUEST SNMP_PDU_GET #define ASN_RFC1157_GETNEXTREQUEST SNMP_PDU_GETNEXT #define ASN_RFC1157_GETRESPONSE SNMP_PDU_RESPONSE#define ASN_RFC1157_SETREQUEST SNMP_PDU_SET #define ASN_RFC1157_TRAP SNMP_PDU_V1TRAP #define ASN_CONTEXTSPECIFIC ASN_CONTEXT#define ASN_PRIMATIVE ASN_PRIMITIVE#define RFC1157VarBindList SnmpVarBindList#define RFC1157VarBind SnmpVarBind#define AsnInteger AsnInteger32 #define AsnCounter AsnCounter32 #define AsnGauge AsnGauge32 #endif // SNMPSTRICT#ifdef __cplusplus}#endif#endif // _INC_SNMP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -