mirror of
https://git.code.sf.net/p/mingw-w64/mingw-w64
synced 2024-11-23 09:54:39 +08:00
Ups ... last comment for checking was intended for this file.
Other was nearly the same but that it added missing/new W7 + W8 API. git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@6404 4407c894-4637-0410-b4f5-ada5f102cad1
This commit is contained in:
parent
b638e703a2
commit
f219e8bbf6
@ -1,11 +1,15 @@
|
||||
/**
|
||||
* This file has no copyright assigned and is placed in the Public Domain.
|
||||
* This file is part of the mingw-w64 runtime package.
|
||||
* No warranty is given; refer to the file DISCLAIMER.PD within this package.
|
||||
* No warranty is given; refer to the file DISCLAIMER within this package.
|
||||
*/
|
||||
|
||||
#ifndef _INC_WINSNMP
|
||||
#define _INC_WINSNMP
|
||||
|
||||
#include <winapifamily.h>
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
|
||||
|
||||
#ifndef _INC_WINDOWS
|
||||
#include <windows.h>
|
||||
#define _INC_WINDOWS
|
||||
@ -24,16 +28,16 @@ extern "C" {
|
||||
typedef HANDLE HSNMP_VBL,*LPHSNMP_VBL;
|
||||
typedef unsigned char smiBYTE,*smiLPBYTE;
|
||||
|
||||
#if ULONG_MAX==4294967295U
|
||||
#if ULONG_MAX == 4294967295U
|
||||
typedef signed __LONG32 smiINT,*smiLPINT;
|
||||
typedef smiINT smiINT32,*smiLPINT32;
|
||||
typedef unsigned __LONG32 smiUINT32,*smiLPUINT32;
|
||||
#elif UINT_MAX==4294967295U
|
||||
#elif UINT_MAX == 4294967295U
|
||||
typedef int smiINT,*smiLPINT;
|
||||
typedef smiINT smiINT32,*smiLPINT32;
|
||||
typedef unsigned int smiUINT32,*smiLPUINT32;
|
||||
#else
|
||||
#error Can not define smiINT and smiUINT
|
||||
#error can not define smiINT and smiUINT
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
@ -65,7 +69,7 @@ extern "C" {
|
||||
#define ASN_UNIVERSAL (0x00)
|
||||
#define ASN_APPLICATION (0x40)
|
||||
#define ASN_CONTEXT (0x80)
|
||||
#define ASN_PRIVATE (0xC0)
|
||||
#define ASN_PRIVATE (0xc0)
|
||||
#define ASN_PRIMITIVE (0x00)
|
||||
#define ASN_CONSTRUCTOR (0x20)
|
||||
|
||||
@ -115,6 +119,9 @@ extern "C" {
|
||||
#define SNMP_PDU_INFORM (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x6)
|
||||
#define SNMP_PDU_TRAP (ASN_CONTEXT | ASN_CONSTRUCTOR | 0x7)
|
||||
|
||||
#define SNMPLISTEN_USEENTITY_ADDR 0
|
||||
#define SNMPLISTEN_ALL_ADDR 1
|
||||
|
||||
#define SNMP_TRAP_COLDSTART 0
|
||||
#define SNMP_TRAP_WARMSTART 1
|
||||
#define SNMP_TRAP_LINKDOWN 2
|
||||
@ -157,6 +164,7 @@ extern "C" {
|
||||
#define SNMPAPI_ON 1
|
||||
|
||||
typedef smiUINT32 SNMPAPI_STATUS;
|
||||
|
||||
#define SNMPAPI_FAILURE 0
|
||||
#define SNMPAPI_SUCCESS 1
|
||||
|
||||
@ -204,73 +212,77 @@ extern "C" {
|
||||
#define SNMPAPI_CALL WINAPI
|
||||
|
||||
#define MAXVENDORINFO 32
|
||||
|
||||
typedef struct {
|
||||
char vendorName[MAXVENDORINFO*2];
|
||||
char vendorContact[MAXVENDORINFO*2];
|
||||
char vendorName[MAXVENDORINFO *2];
|
||||
char vendorContact[MAXVENDORINFO *2];
|
||||
char vendorVersionId[MAXVENDORINFO];
|
||||
char vendorVersionDate[MAXVENDORINFO];
|
||||
smiUINT32 vendorEnterprise;
|
||||
} smiVENDORINFO,*smiLPVENDORINFO;
|
||||
|
||||
typedef SNMPAPI_STATUS (CALLBACK *SNMPAPI_CALLBACK)(HSNMP_SESSION hSession,HWND hWnd,UINT wMsg,WPARAM wParam,LPARAM lParam,LPVOID lpClientData);
|
||||
typedef SNMPAPI_STATUS (CALLBACK *SNMPAPI_CALLBACK) (HSNMP_SESSION hSession, HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lParam, LPVOID lpClientData);
|
||||
|
||||
SNMPAPI_STATUS WINAPI SnmpGetTranslateMode(smiLPUINT32 nTranslateMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetTranslateMode(smiUINT32 nTranslateMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetRetransmitMode(smiLPUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetRetransmitMode(smiUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetTimeout(HSNMP_ENTITY hEntity,smiLPTIMETICKS nPolicyTimeout,smiLPTIMETICKS nActualTimeout);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetTimeout(HSNMP_ENTITY hEntity,smiTIMETICKS nPolicyTimeout);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetRetry(HSNMP_ENTITY hEntity,smiLPUINT32 nPolicyRetry,smiLPUINT32 nActualRetry);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetRetry(HSNMP_ENTITY hEntity,smiUINT32 nPolicyRetry);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetVendorInfo(smiLPVENDORINFO vendorInfo);
|
||||
SNMPAPI_STATUS WINAPI SnmpStartup(smiLPUINT32 nMajorVersion,smiLPUINT32 nMinorVersion,smiLPUINT32 nLevel,smiLPUINT32 nTranslateMode,smiLPUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpCleanup(void);
|
||||
HSNMP_SESSION WINAPI SnmpOpen(HWND hWnd,UINT wMsg);
|
||||
SNMPAPI_STATUS WINAPI SnmpClose(HSNMP_SESSION session);
|
||||
SNMPAPI_STATUS WINAPI SnmpSendMsg(HSNMP_SESSION session,HSNMP_ENTITY srcEntity,HSNMP_ENTITY dstEntity,HSNMP_CONTEXT context,HSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpRecvMsg(HSNMP_SESSION session,LPHSNMP_ENTITY srcEntity,LPHSNMP_ENTITY dstEntity,LPHSNMP_CONTEXT context,LPHSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpRegister(HSNMP_SESSION session,HSNMP_ENTITY srcEntity,HSNMP_ENTITY dstEntity,HSNMP_CONTEXT context,smiLPCOID notification,smiUINT32 state);
|
||||
HSNMP_SESSION WINAPI SnmpCreateSession(HWND hWnd,UINT wMsg,SNMPAPI_CALLBACK fCallBack,LPVOID lpClientData);
|
||||
SNMPAPI_STATUS WINAPI SnmpListen(HSNMP_ENTITY hEntity,SNMPAPI_STATUS lStatus);
|
||||
SNMPAPI_STATUS WINAPI SnmpCancelMsg(HSNMP_SESSION session,smiINT32 reqId);
|
||||
SNMPAPI_STATUS WINAPI SnmpStartupEx(smiLPUINT32 nMajorVersion,smiLPUINT32 nMinorVersion,smiLPUINT32 nLevel,smiLPUINT32 nTranslateMode,smiLPUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetTranslateMode (smiLPUINT32 nTranslateMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetTranslateMode (smiUINT32 nTranslateMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetRetransmitMode (smiLPUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetRetransmitMode (smiUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetTimeout (HSNMP_ENTITY hEntity, smiLPTIMETICKS nPolicyTimeout, smiLPTIMETICKS nActualTimeout);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetTimeout (HSNMP_ENTITY hEntity, smiTIMETICKS nPolicyTimeout);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetRetry (HSNMP_ENTITY hEntity, smiLPUINT32 nPolicyRetry, smiLPUINT32 nActualRetry);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetRetry (HSNMP_ENTITY hEntity, smiUINT32 nPolicyRetry);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetVendorInfo (smiLPVENDORINFO vendorInfo);
|
||||
SNMPAPI_STATUS WINAPI SnmpStartup (smiLPUINT32 nMajorVersion, smiLPUINT32 nMinorVersion, smiLPUINT32 nLevel, smiLPUINT32 nTranslateMode, smiLPUINT32 nRetransmitMode);
|
||||
SNMPAPI_STATUS WINAPI SnmpCleanup (void);
|
||||
HSNMP_SESSION WINAPI SnmpOpen (HWND hWnd, UINT wMsg);
|
||||
SNMPAPI_STATUS WINAPI SnmpClose (HSNMP_SESSION session);
|
||||
SNMPAPI_STATUS WINAPI SnmpSendMsg (HSNMP_SESSION session, HSNMP_ENTITY srcEntity, HSNMP_ENTITY dstEntity, HSNMP_CONTEXT context, HSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpRecvMsg (HSNMP_SESSION session, LPHSNMP_ENTITY srcEntity, LPHSNMP_ENTITY dstEntity, LPHSNMP_CONTEXT context, LPHSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpRegister (HSNMP_SESSION session, HSNMP_ENTITY srcEntity, HSNMP_ENTITY dstEntity, HSNMP_CONTEXT context, smiLPCOID notification, smiUINT32 state);
|
||||
HSNMP_SESSION WINAPI SnmpCreateSession (HWND hWnd, UINT wMsg, SNMPAPI_CALLBACK fCallBack, LPVOID lpClientData);
|
||||
SNMPAPI_STATUS WINAPI SnmpListen (HSNMP_ENTITY hEntity, SNMPAPI_STATUS lStatus);
|
||||
SNMPAPI_STATUS WINAPI SnmpListenEx (HSNMP_ENTITY hEntity, SNMPAPI_STATUS lStatus, smiUINT32 nUseEntityAddr);
|
||||
SNMPAPI_STATUS WINAPI SnmpCancelMsg (HSNMP_SESSION session, smiINT32 reqId);
|
||||
SNMPAPI_STATUS WINAPI SnmpStartupEx (smiLPUINT32 nMajorVersion, smiLPUINT32 nMinorVersion, smiLPUINT32 nLevel, smiLPUINT32 nTranslateMode, smiLPUINT32 nRetransmitMode);
|
||||
|
||||
typedef SNMPAPI_STATUS (WINAPI *PFNSNMPSTARTUPEX)(smiLPUINT32,smiLPUINT32,smiLPUINT32,smiLPUINT32,smiLPUINT32);
|
||||
typedef SNMPAPI_STATUS (WINAPI *PFNSNMPSTARTUPEX) (smiLPUINT32, smiLPUINT32, smiLPUINT32, smiLPUINT32, smiLPUINT32);
|
||||
|
||||
SNMPAPI_STATUS WINAPI SnmpCleanupEx(void);
|
||||
SNMPAPI_STATUS WINAPI SnmpCleanupEx (void);
|
||||
|
||||
typedef SNMPAPI_STATUS (WINAPI *PFNSNMPCLEANUPEX)(void);
|
||||
typedef SNMPAPI_STATUS (WINAPI *PFNSNMPCLEANUPEX) (void);
|
||||
|
||||
HSNMP_ENTITY WINAPI SnmpStrToEntity(HSNMP_SESSION session,LPCSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpEntityToStr(HSNMP_ENTITY entity,smiUINT32 size,LPSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeEntity(HSNMP_ENTITY entity);
|
||||
HSNMP_CONTEXT WINAPI SnmpStrToContext(HSNMP_SESSION session,smiLPCOCTETS string);
|
||||
SNMPAPI_STATUS WINAPI SnmpContextToStr(HSNMP_CONTEXT context,smiLPOCTETS string);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeContext(HSNMP_CONTEXT context);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetPort(HSNMP_ENTITY hEntity,UINT nPort);
|
||||
HSNMP_PDU WINAPI SnmpCreatePdu(HSNMP_SESSION session,smiINT PDU_type,smiINT32 request_id,smiINT error_status,smiINT error_index,HSNMP_VBL varbindlist);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetPduData(HSNMP_PDU PDU,smiLPINT PDU_type,smiLPINT32 request_id,smiLPINT error_status,smiLPINT error_index,LPHSNMP_VBL varbindlist);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetPduData(HSNMP_PDU PDU,const smiINT *PDU_type,const smiINT32 *request_id,const smiINT *non_repeaters,const smiINT *max_repetitions,const HSNMP_VBL *varbindlist);
|
||||
HSNMP_PDU WINAPI SnmpDuplicatePdu(HSNMP_SESSION session,HSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreePdu(HSNMP_PDU PDU);
|
||||
HSNMP_VBL WINAPI SnmpCreateVbl(HSNMP_SESSION session,smiLPCOID name,smiLPCVALUE value);
|
||||
HSNMP_VBL WINAPI SnmpDuplicateVbl(HSNMP_SESSION session,HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeVbl(HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpCountVbl(HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetVb(HSNMP_VBL vbl,smiUINT32 index,smiLPOID name,smiLPVALUE value);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetVb(HSNMP_VBL vbl,smiUINT32 index,smiLPCOID name,smiLPCVALUE value);
|
||||
SNMPAPI_STATUS WINAPI SnmpDeleteVb(HSNMP_VBL vbl,smiUINT32 index);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetLastError(HSNMP_SESSION session);
|
||||
SNMPAPI_STATUS WINAPI SnmpStrToOid(LPCSTR string,smiLPOID dstOID);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidToStr(smiLPCOID srcOID,smiUINT32 size,LPSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidCopy(smiLPCOID srcOID,smiLPOID dstOID);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidCompare(smiLPCOID xOID,smiLPCOID yOID,smiUINT32 maxlen,smiLPINT result);
|
||||
SNMPAPI_STATUS WINAPI SnmpEncodeMsg(HSNMP_SESSION session,HSNMP_ENTITY srcEntity,HSNMP_ENTITY dstEntity,HSNMP_CONTEXT context,HSNMP_PDU pdu,smiLPOCTETS msgBufDesc);
|
||||
SNMPAPI_STATUS WINAPI SnmpDecodeMsg(HSNMP_SESSION session,LPHSNMP_ENTITY srcEntity,LPHSNMP_ENTITY dstEntity,LPHSNMP_CONTEXT context,LPHSNMP_PDU pdu,smiLPCOCTETS msgBufDesc);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeDescriptor(smiUINT32 syntax,smiLPOPAQUE descriptor);
|
||||
HSNMP_ENTITY WINAPI SnmpStrToEntity (HSNMP_SESSION session, LPCSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpEntityToStr (HSNMP_ENTITY entity, smiUINT32 size, LPSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeEntity (HSNMP_ENTITY entity);
|
||||
HSNMP_CONTEXT WINAPI SnmpStrToContext (HSNMP_SESSION session, smiLPCOCTETS string);
|
||||
SNMPAPI_STATUS WINAPI SnmpContextToStr (HSNMP_CONTEXT context, smiLPOCTETS string);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeContext (HSNMP_CONTEXT context);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetPort (HSNMP_ENTITY hEntity, UINT nPort);
|
||||
HSNMP_PDU WINAPI SnmpCreatePdu (HSNMP_SESSION session, smiINT PDU_type, smiINT32 request_id, smiINT error_status, smiINT error_index, HSNMP_VBL varbindlist);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetPduData (HSNMP_PDU PDU, smiLPINT PDU_type, smiLPINT32 request_id, smiLPINT error_status, smiLPINT error_index, LPHSNMP_VBL varbindlist);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetPduData (HSNMP_PDU PDU, const smiINT *PDU_type, const smiINT32 *request_id, const smiINT *non_repeaters, const smiINT *max_repetitions, const HSNMP_VBL *varbindlist);
|
||||
HSNMP_PDU WINAPI SnmpDuplicatePdu (HSNMP_SESSION session, HSNMP_PDU PDU);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreePdu (HSNMP_PDU PDU);
|
||||
HSNMP_VBL WINAPI SnmpCreateVbl (HSNMP_SESSION session, smiLPCOID name, smiLPCVALUE value);
|
||||
HSNMP_VBL WINAPI SnmpDuplicateVbl (HSNMP_SESSION session, HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeVbl (HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpCountVbl (HSNMP_VBL vbl);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetVb (HSNMP_VBL vbl, smiUINT32 index, smiLPOID name, smiLPVALUE value);
|
||||
SNMPAPI_STATUS WINAPI SnmpSetVb (HSNMP_VBL vbl, smiUINT32 index, smiLPCOID name, smiLPCVALUE value);
|
||||
SNMPAPI_STATUS WINAPI SnmpDeleteVb (HSNMP_VBL vbl, smiUINT32 index);
|
||||
SNMPAPI_STATUS WINAPI SnmpGetLastError (HSNMP_SESSION session);
|
||||
SNMPAPI_STATUS WINAPI SnmpStrToOid (LPCSTR string, smiLPOID dstOID);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidToStr (smiLPCOID srcOID, smiUINT32 size, LPSTR string);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidCopy (smiLPCOID srcOID, smiLPOID dstOID);
|
||||
SNMPAPI_STATUS WINAPI SnmpOidCompare (smiLPCOID xOID, smiLPCOID yOID, smiUINT32 maxlen, smiLPINT result);
|
||||
SNMPAPI_STATUS WINAPI SnmpEncodeMsg (HSNMP_SESSION session, HSNMP_ENTITY srcEntity, HSNMP_ENTITY dstEntity, HSNMP_CONTEXT context, HSNMP_PDU pdu, smiLPOCTETS msgBufDesc);
|
||||
SNMPAPI_STATUS WINAPI SnmpDecodeMsg (HSNMP_SESSION session, LPHSNMP_ENTITY srcEntity, LPHSNMP_ENTITY dstEntity, LPHSNMP_CONTEXT context, LPHSNMP_PDU pdu, smiLPCOCTETS msgBufDesc);
|
||||
SNMPAPI_STATUS WINAPI SnmpFreeDescriptor (smiUINT32 syntax, smiLPOPAQUE descriptor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user