Blame win32/Snmp-winExtDLL.h

Packit Service b38f0b
/*
Packit Service b38f0b
 * This file is a copy of the header file <snmp.h> from the MinGW project.
Packit Service b38f0b
 * The licensing for the Win32 API is defined in the
Packit Service b38f0b
 * MinGW file README.w32api, which states:
Packit Service b38f0b
Packit Service b38f0b
   "Unless otherwise stated in individual source files,
Packit Service b38f0b
Packit Service b38f0b
    THIS SOFTWARE IS NOT COPYRIGHTED
Packit Service b38f0b
Packit Service b38f0b
    This source code is offered for use in the public domain.  You may use,
Packit Service b38f0b
    modify or distribute it freely.
Packit Service b38f0b
Packit Service b38f0b
    This source code is distributed in the hope that it will be useful but
Packit Service b38f0b
    WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
Packit Service b38f0b
    DISCLAIMED.  This includes but is not limited to warranties of
Packit Service b38f0b
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
Packit Service b38f0b
Packit Service b38f0b
 */
Packit Service b38f0b
Packit Service b38f0b
/*
Packit Service b38f0b
  snmp.h - Header file for the Windows SNMP API
Packit Service b38f0b
Packit Service b38f0b
  Written by Filip Navara <xnavara@volny.cz>
Packit Service b38f0b
Packit Service b38f0b
  References (2003-08-25):
Packit Service b38f0b
    http://msdn.microsoft.com/library/en-us/snmp/snmp/snmp_reference.asp
Packit Service b38f0b
Packit Service b38f0b
  This library is distributed in the hope that it will be useful,
Packit Service b38f0b
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service b38f0b
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Packit Service b38f0b
*/
Packit Service b38f0b
Packit Service b38f0b
#ifndef _SNMP_H
Packit Service b38f0b
#define _SNMP_H
Packit Service b38f0b
#if __GNUC__ >= 3
Packit Service b38f0b
#pragma GCC system_header
Packit Service b38f0b
#endif
Packit Service b38f0b
Packit Service b38f0b
#ifndef _WINDOWS_H
Packit Service b38f0b
#include <windows.h>
Packit Service b38f0b
#endif
Packit Service b38f0b
Packit Service b38f0b
#include <pshpack4.h>
Packit Service b38f0b
Packit Service b38f0b
#ifndef WINSNMPAPI
Packit Service b38f0b
#define WINSNMPAPI WINAPI
Packit Service b38f0b
#endif
Packit Service b38f0b
Packit Service b38f0b
#ifdef __cplusplus
Packit Service b38f0b
extern "C" {
Packit Service b38f0b
#endif
Packit Service b38f0b
Packit Service b38f0b
#define DEFAULT_SNMP_PORT_UDP	161
Packit Service b38f0b
#define DEFAULT_SNMP_PORT_IPX	36879
Packit Service b38f0b
#define DEFAULT_SNMPTRAP_PORT_UDP	162
Packit Service b38f0b
#define DEFAULT_SNMPTRAP_PORT_IPX	36880
Packit Service b38f0b
#ifndef _SNMP_ASN_DEFINED
Packit Service b38f0b
#define _SNMP_ASN_DEFINED
Packit Service b38f0b
#define MS_ASN_UNIVERSAL	0x00
Packit Service b38f0b
#define MS_ASN_PRIMITIVE	0x00
Packit Service b38f0b
#define MS_ASN_CONSTRUCTOR	0x20
Packit Service b38f0b
#define MS_ASN_APPLICATION	0x40
Packit Service b38f0b
#define MS_ASN_CONTEXT	0x80
Packit Service b38f0b
#define MS_ASN_PRIVATE	0xC0
Packit Service b38f0b
#define SNMP_PDU_GET	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 0)
Packit Service b38f0b
#define SNMP_PDU_GETNEXT	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 1)
Packit Service b38f0b
#define SNMP_PDU_RESPONSE	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 2)
Packit Service b38f0b
#define SNMP_PDU_SET	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 3)
Packit Service b38f0b
#define SNMP_PDU_GETBULK	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 4)
Packit Service b38f0b
#define SNMP_PDU_V1TRAP	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 4)
Packit Service b38f0b
#define SNMP_PDU_INFORM	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 6)
Packit Service b38f0b
#define SNMP_PDU_TRAP	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 7) 
Packit Service b38f0b
#define SNMP_PDU_REPORT	(ASN_CONTEXT | MS_ASN_CONSTRUCTOR | 8)
Packit Service b38f0b
#endif /* _SNMP_ASN_DEFINED */
Packit Service b38f0b
#define MS_ASN_INTEGER	(ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 2)
Packit Service b38f0b
#define MS_ASN_BITS	(ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 3)
Packit Service b38f0b
#define MS_ASN_OCTETSTRING	(ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 4)
Packit Service b38f0b
#define MS_ASN_NULL	(ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 5)
Packit Service b38f0b
#define MS_ASN_OBJECTIDENTIFIER	(ASN_UNIVERSAL | MS_ASN_PRIMITIVE | 6)
Packit Service b38f0b
#define MS_ASN_INTEGER32	ASN_INTEGER
Packit Service b38f0b
#define MS_ASN_SEQUENCE	(ASN_UNIVERSAL | MS_ASN_CONSTRUCTOR | 0x10)
Packit Service b38f0b
#define MS_ASN_SEQUENCEOF	ASN_SEQUENCE
Packit Service b38f0b
#define MS_ASN_IPADDRESS	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x00)
Packit Service b38f0b
#define MS_ASN_COUNTER32	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x01)
Packit Service b38f0b
#define MS_ASN_GAUGE32	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x02)
Packit Service b38f0b
#define MS_ASN_TIMETICKS	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x03)
Packit Service b38f0b
#define MS_ASN_OPAQUE	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x04)
Packit Service b38f0b
#define MS_ASN_COUNTER64	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x06)
Packit Service b38f0b
#define MS_ASN_UNSIGNED32	(ASN_APPLICATION | MS_ASN_PRIMITIVE | 0x07)
Packit Service b38f0b
#define SNMP_EXCEPTION_NOSUCHOBJECT	(ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x00)
Packit Service b38f0b
#define SNMP_EXCEPTION_NOSUCHINSTANCE	(ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x01)
Packit Service b38f0b
#define SNMP_EXCEPTION_ENDOFMIBVIEW	(ASN_CONTEXT | MS_ASN_PRIMITIVE | 0x02)
Packit Service b38f0b
#define SNMP_EXTENSION_GET	SNMP_PDU_GET
Packit Service b38f0b
#define SNMP_EXTENSION_GET_NEXT	SNMP_PDU_GETNEXT
Packit Service b38f0b
#define SNMP_EXTENSION_GET_BULK	SNMP_PDU_GETBULK
Packit Service b38f0b
#define SNMP_EXTENSION_SET_TEST	(ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x0)
Packit Service b38f0b
#define SNMP_EXTENSION_SET_COMMIT	SNMP_PDU_SET
Packit Service b38f0b
#define SNMP_EXTENSION_SET_UNDO	(ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x1)
Packit Service b38f0b
#define SNMP_EXTENSION_SET_CLEANUP	(ASN_PRIVATE | MS_ASN_CONSTRUCTOR | 0x2)
Packit Service b38f0b
#define SNMP_ERRORSTATUS_NOERROR	0
Packit Service b38f0b
#define SNMP_ERRORSTATUS_TOOBIG	1
Packit Service b38f0b
#define SNMP_ERRORSTATUS_NOSUCHNAME	2
Packit Service b38f0b
#define SNMP_ERRORSTATUS_BADVALUE	3
Packit Service b38f0b
#define SNMP_ERRORSTATUS_READONLY	4
Packit Service b38f0b
#define SNMP_ERRORSTATUS_GENERR	5
Packit Service b38f0b
#define SNMP_ERRORSTATUS_NOACCESS	6
Packit Service b38f0b
#define SNMP_ERRORSTATUS_WRONGTYPE	7
Packit Service b38f0b
#define SNMP_ERRORSTATUS_WRONGLENGTH	8
Packit Service b38f0b
#define SNMP_ERRORSTATUS_WRONGENCODING	9
Packit Service b38f0b
#define SNMP_ERRORSTATUS_WRONGVALUE	10
Packit Service b38f0b
#define SNMP_ERRORSTATUS_NOCREATION	11
Packit Service b38f0b
#define SNMP_ERRORSTATUS_INCONSISTENTVALUE	12
Packit Service b38f0b
#define SNMP_ERRORSTATUS_RESOURCEUNAVAILABLE	13
Packit Service b38f0b
#define SNMP_ERRORSTATUS_COMMITFAILED	14
Packit Service b38f0b
#define SNMP_ERRORSTATUS_UNDOFAILED	15
Packit Service b38f0b
#define SNMP_ERRORSTATUS_AUTHORIZATIONERROR	16
Packit Service b38f0b
#define SNMP_ERRORSTATUS_NOTWRITABLE	17
Packit Service b38f0b
#define SNMP_ERRORSTATUS_INCONSISTENTNAME	18
Packit Service b38f0b
#define SNMP_GENERICTRAP_COLDSTART	0
Packit Service b38f0b
#define SNMP_GENERICTRAP_WARMSTART	1
Packit Service b38f0b
#define SNMP_GENERICTRAP_LINKDOWN	2
Packit Service b38f0b
#define SNMP_GENERICTRAP_LINKUP	3
Packit Service b38f0b
#define SNMP_GENERICTRAP_AUTHFAILURE	4
Packit Service b38f0b
#define SNMP_GENERICTRAP_EGPNEIGHLOSS	5
Packit Service b38f0b
#define SNMP_GENERICTRAP_ENTERSPECIFIC	6
Packit Service b38f0b
#define SNMP_ACCESS_NONE	0
Packit Service b38f0b
#define SNMP_ACCESS_NOTIFY	1
Packit Service b38f0b
#define SNMP_ACCESS_READ_ONLY	2
Packit Service b38f0b
#define SNMP_ACCESS_READ_WRITE	3
Packit Service b38f0b
#define SNMP_ACCESS_READ_CREATE	4
Packit Service b38f0b
#define SNMPAPI_ERROR	FALSE
Packit Service b38f0b
#define SNMPAPI_NOERROR	TRUE
Packit Service b38f0b
#define SNMP_LOG_SILENT	0
Packit Service b38f0b
#define SNMP_LOG_FATAL	1
Packit Service b38f0b
#define SNMP_LOG_ERROR	2
Packit Service b38f0b
#define SNMP_LOG_WARNING	3
Packit Service b38f0b
#define SNMP_LOG_TRACE	4
Packit Service b38f0b
#define SNMP_LOG_VERBOSE	5
Packit Service b38f0b
#define SNMP_OUTPUT_TO_CONSOLE	1
Packit Service b38f0b
#define SNMP_OUTPUT_TO_LOGFILE	2
Packit Service b38f0b
#define SNMP_OUTPUT_TO_EVENTLOG	4 
Packit Service b38f0b
#define SNMP_OUTPUT_TO_DEBUGGER	8
Packit Service b38f0b
#define SNMP_MAX_OID_LEN	128
Packit Service b38f0b
#define SNMP_MEM_ALLOC_ERROR	1
Packit Service b38f0b
#define SNMP_BERAPI_INVALID_LENGTH	10
Packit Service b38f0b
#define SNMP_BERAPI_INVALID_TAG	11
Packit Service b38f0b
#define SNMP_BERAPI_OVERFLOW	12
Packit Service b38f0b
#define SNMP_BERAPI_SHORT_BUFFER	13
Packit Service b38f0b
#define SNMP_BERAPI_INVALID_OBJELEM	14
Packit Service b38f0b
#define SNMP_PDUAPI_UNRECOGNIZED_PDU	20
Packit Service b38f0b
#define SNMP_PDUAPI_INVALID_ES	21
Packit Service b38f0b
#define SNMP_PDUAPI_INVALID_GT	22
Packit Service b38f0b
#define SNMP_AUTHAPI_INVALID_VERSION	30
Packit Service b38f0b
#define SNMP_AUTHAPI_INVALID_MSG_TYPE	31
Packit Service b38f0b
#define SNMP_AUTHAPI_TRIV_AUTH_FAILED	32
Packit Service b38f0b
Packit Service b38f0b
#ifndef RC_INVOKED
Packit Service b38f0b
Packit Service b38f0b
typedef INT SNMPAPI;
Packit Service b38f0b
typedef LONG AsnInteger32;
Packit Service b38f0b
typedef ULONG AsnUnsigned32;
Packit Service b38f0b
typedef ULARGE_INTEGER AsnCounter64;
Packit Service b38f0b
typedef AsnUnsigned32 AsnCounter32;
Packit Service b38f0b
typedef AsnUnsigned32 AsnGauge32;
Packit Service b38f0b
typedef AsnUnsigned32 AsnTimeticks;
Packit Service b38f0b
typedef struct {
Packit Service b38f0b
	BYTE *stream;
Packit Service b38f0b
	UINT length;
Packit Service b38f0b
	BOOL dynamic;
Packit Service b38f0b
} AsnOctetString, AsnBits, AsnSequence, AsnImplicitSequence, AsnIPAddress, AsnNetworkAddress, AsnDisplayString, AsnOpaque;
Packit Service b38f0b
typedef struct {
Packit Service b38f0b
	UINT idLength;
Packit Service b38f0b
	UINT *ids;
Packit Service b38f0b
} AsnObjectIdentifier, AsnObjectName;
Packit Service b38f0b
typedef struct {
Packit Service b38f0b
	BYTE asnType;
Packit Service b38f0b
	union {
Packit Service b38f0b
		AsnInteger32 number; 
Packit Service b38f0b
		AsnUnsigned32 unsigned32; 
Packit Service b38f0b
		AsnCounter64 counter64; 
Packit Service b38f0b
		AsnOctetString string; 
Packit Service b38f0b
		AsnBits bits; 
Packit Service b38f0b
		AsnObjectIdentifier object; 
Packit Service b38f0b
		AsnSequence sequence; 
Packit Service b38f0b
		AsnIPAddress address; 
Packit Service b38f0b
		AsnCounter32 counter; 
Packit Service b38f0b
		AsnGauge32 gauge; 
Packit Service b38f0b
		AsnTimeticks ticks; 
Packit Service b38f0b
		AsnOpaque arbitrary; 
Packit Service b38f0b
	} asnValue;
Packit Service b38f0b
} AsnAny, AsnObjectSyntax;
Packit Service b38f0b
typedef struct {
Packit Service b38f0b
	AsnObjectName name;
Packit Service b38f0b
	AsnObjectSyntax value;
Packit Service b38f0b
} SnmpVarBind;
Packit Service b38f0b
typedef struct {
Packit Service b38f0b
	SnmpVarBind *list;
Packit Service b38f0b
	UINT len;
Packit Service b38f0b
} SnmpVarBindList;
Packit Service b38f0b
Packit Service b38f0b
VOID WINSNMPAPI SnmpExtensionClose(void);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionInit(DWORD,HANDLE*,AsnObjectIdentifier*);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionInitEx(AsnObjectIdentifier*);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionMonitor(LPVOID);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionQuery(BYTE,SnmpVarBindList*,AsnInteger32*,AsnInteger32*);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionQueryEx(DWORD,DWORD,SnmpVarBindList*,AsnOctetString*,AsnInteger32*,AsnInteger32*);
Packit Service b38f0b
BOOL WINSNMPAPI SnmpExtensionTrap(AsnObjectIdentifier*,AsnInteger32*,AsnInteger32*,AsnTimeticks*,SnmpVarBindList*);
Packit Service b38f0b
DWORD WINSNMPAPI SnmpSvcGetUptime(void);
Packit Service b38f0b
VOID WINSNMPAPI SnmpSvcSetLogLevel(INT);
Packit Service b38f0b
VOID WINSNMPAPI SnmpSvcSetLogType(INT);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilAsnAnyCpy(AsnAny*,AsnAny*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilAsnAnyFree(AsnAny*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilDbgPrint(INT,LPSTR,...);
Packit Service b38f0b
LPSTR WINSNMPAPI SnmpUtilIdsToA(UINT*,UINT);
Packit Service b38f0b
LPVOID WINSNMPAPI SnmpUtilMemAlloc(UINT);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilMemFree(LPVOID);
Packit Service b38f0b
LPVOID WINSNMPAPI SnmpUtilMemReAlloc(LPVOID,UINT);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOctetsCmp(AsnOctetString*,AsnOctetString*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOctetsCpy(AsnOctetString*,AsnOctetString*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilOctetsFree(AsnOctetString*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOctetsNCmp(AsnOctetString*,AsnOctetString*,UINT);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOidAppend(AsnObjectIdentifier*,AsnObjectIdentifier*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOidCmp(AsnObjectIdentifier*,AsnObjectIdentifier*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOidCpy(AsnObjectIdentifier*,AsnObjectIdentifier*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilOidFree(AsnObjectIdentifier*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilOidNCmp(AsnObjectIdentifier*,AsnObjectIdentifier*,UINT);
Packit Service b38f0b
LPSTR WINSNMPAPI SnmpUtilOidToA(AsnObjectIdentifier*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilPrintAsnAny(AsnAny*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilPrintOid(AsnObjectIdentifier*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilVarBindCpy(  SnmpVarBind*,SnmpVarBind*);
Packit Service b38f0b
SNMPAPI WINSNMPAPI SnmpUtilVarBindListCpy(SnmpVarBindList*,SnmpVarBindList*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilVarBindFree(SnmpVarBind*);
Packit Service b38f0b
VOID WINSNMPAPI SnmpUtilVarBindListFree(SnmpVarBindList*);
Packit Service b38f0b
Packit Service b38f0b
#ifndef SNMPSTRICT
Packit Service b38f0b
#define SNMP_malloc SnmpUtilMemAlloc
Packit Service b38f0b
#define SNMP_free SnmpUtilMemFree
Packit Service b38f0b
#define SNMP_realloc SnmpUtilMemReAlloc
Packit Service b38f0b
#define SNMP_DBG_malloc SnmpUtilMemAlloc
Packit Service b38f0b
#define SNMP_DBG_free SnmpUtilMemFree
Packit Service b38f0b
#define SNMP_DBG_realloc SnmpUtilMemReAlloc
Packit Service b38f0b
#define SNMP_oidappend SnmpUtilOidAppend
Packit Service b38f0b
#define SNMP_oidcmp SnmpUtilOidCmp
Packit Service b38f0b
#define SNMP_oidcpy SnmpUtilOidCpy
Packit Service b38f0b
#define SNMP_oidfree SnmpUtilOidFree
Packit Service b38f0b
#define SNMP_oidncmp SnmpUtilOidNCmp
Packit Service b38f0b
#define SNMP_printany SnmpUtilPrintAsnAny
Packit Service b38f0b
#define SNMP_CopyVarBind SnmpUtilVarBindCpy
Packit Service b38f0b
#define SNMP_CopyVarBindList SnmpUtilVarBindListCpy
Packit Service b38f0b
#define SNMP_FreeVarBind SnmpUtilVarBindFree
Packit Service b38f0b
#define SNMP_FreeVarBindList SnmpUtilVarBindListFree
Packit Service b38f0b
#define MS_ASN_RFC1155_IPADDRESS MS_ASN_IPADDRESS
Packit Service b38f0b
#define MS_ASN_RFC1155_COUNTER MS_ASN_COUNTER32
Packit Service b38f0b
#define MS_ASN_RFC1155_GAUGE MS_ASN_GAUGE32
Packit Service b38f0b
#define MS_ASN_RFC1155_TIMETICKS MS_ASN_TIMETICKS
Packit Service b38f0b
#define MS_ASN_RFC1155_OPAQUE MS_ASN_OPAQUE
Packit Service b38f0b
#define MS_ASN_RFC1213_DISPSTRING MS_ASN_OCTETSTRING
Packit Service b38f0b
#define MS_ASN_RFC1157_GETREQUEST SNMP_PDU_GET
Packit Service b38f0b
#define MS_ASN_RFC1157_GETNEXTREQUEST SNMP_PDU_GETNEXT
Packit Service b38f0b
#define MS_ASN_RFC1157_GETRESPONSE SNMP_PDU_RESPONSE
Packit Service b38f0b
#define MS_ASN_RFC1157_SETREQUEST SNMP_PDU_SET
Packit Service b38f0b
#define MS_ASN_RFC1157_TRAP SNMP_PDU_V1TRAP
Packit Service b38f0b
#define MS_ASN_CONTEXTSPECIFIC MS_ASN_CONTEXT
Packit Service b38f0b
#define MS_ASN_PRIMATIVE MS_ASN_PRIMITIVE
Packit Service b38f0b
#define RFC1157VarBindList SnmpVarBindList
Packit Service b38f0b
#define RFC1157VarBind SnmpVarBind
Packit Service b38f0b
#define AsnInteger AsnInteger32
Packit Service b38f0b
#define AsnCounter AsnCounter32
Packit Service b38f0b
#define AsnGauge AsnGauge32
Packit Service b38f0b
#endif /* SNMPSTRICT */
Packit Service b38f0b
Packit Service b38f0b
#endif /* RC_INVOKED */
Packit Service b38f0b
Packit Service b38f0b
#ifdef __cplusplus
Packit Service b38f0b
}
Packit Service b38f0b
#endif
Packit Service b38f0b
#include <poppack.h>
Packit Service b38f0b
#endif