// Borland C++ Builder
// Copyright (c) 1995, 2005 by Borland Software Corporation
// All rights reserved

// (DO NOT EDIT: machine generated header) 'Idsnmp.pas' rev: 10.00

#ifndef IdsnmpHPP
#define IdsnmpHPP

#pragma delphiheader begin
#pragma option push
#pragma option -w-      // All warnings off
#pragma option -Vx      // Zero-length empty class member functions
#pragma pack(push,8)
#include <System.hpp>	// Pascal unit
#include <Sysinit.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Sysutils.hpp>	// Pascal unit
#include <Idudpbase.hpp>	// Pascal unit
#include <Idudpclient.hpp>	// Pascal unit
#include <Idexception.hpp>	// Pascal unit
#include <Idasn1util.hpp>	// Pascal unit
#include <Idcomponent.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Idsnmp
{
//-- type declarations -------------------------------------------------------
class DELPHICLASS TSNMPInfo;
class DELPHICLASS TIdSNMP;
class PASCALIMPLEMENTATION TIdSNMP : public Idudpclient::TIdUDPClient 
{
	typedef Idudpclient::TIdUDPClient inherited;
	
private:
	AnsiString fCommunity;
	int fTrapPort;
	void __fastcall SetCommunity(const AnsiString Value);
	
public:
	TSNMPInfo* Query;
	TSNMPInfo* Reply;
	TSNMPInfo* Trap;
	__fastcall virtual TIdSNMP(Classes::TComponent* aOwner);
	__fastcall virtual ~TIdSNMP(void);
	bool __fastcall SendQuery(void);
	bool __fastcall QuickSend(const AnsiString Mib, const AnsiString Community, const AnsiString Host, AnsiString &Value);
	int __fastcall QuickSendTrap(const AnsiString Dest, const AnsiString Enterprise, const AnsiString Community, int Port, int Generic, int Specific, Classes::TStringList* MIBName, Classes::TStringList* MIBValue);
	int __fastcall QuickReceiveTrap(AnsiString &Source, AnsiString &Enterprise, AnsiString &Community, int &Port, int &Generic, int &Specific, int &Seconds, Classes::TStringList* &MIBName, Classes::TStringList* &MIBValue);
	int __fastcall SendTrap(void);
	int __fastcall ReceiveTrap(void);
	
__published:
	__property Port  = {default=161};
	__property int TrapPort = {read=fTrapPort, write=fTrapPort, default=162};
	__property AnsiString Community = {read=fCommunity, write=SetCommunity};
};


class PASCALIMPLEMENTATION TSNMPInfo : public System::TObject 
{
	typedef System::TObject inherited;
	
private:
	TIdSNMP* fOwner;
	AnsiString fCommunity;
	AnsiString __fastcall GetValue(int idx);
	int __fastcall GetValueCount(void);
	int __fastcall GetValueType(int idx);
	AnsiString __fastcall GetValueOID(int idx);
	void __fastcall SetCommunity(const AnsiString Value);
	
protected:
	AnsiString Buffer;
	void __fastcall SyncMIB(void);
	
public:
	AnsiString Host;
	int Port;
	AnsiString Enterprise;
	int GenTrap;
	int SpecTrap;
	int Version;
	int PDUType;
	int TimeTicks;
	int ID;
	int ErrorStatus;
	int ErrorIndex;
	Classes::TStringList* MIBOID;
	Classes::TStringList* MIBValue;
	__fastcall TSNMPInfo(TIdSNMP* AOwner);
	__fastcall virtual ~TSNMPInfo(void);
	int __fastcall EncodeTrap(void);
	int __fastcall DecodeTrap(void);
	void __fastcall DecodeBuf(AnsiString Buffer);
	AnsiString __fastcall EncodeBuf();
	void __fastcall Clear(void);
	void __fastcall MIBAdd(AnsiString MIB, AnsiString Value, int valueType = 0x4);
	void __fastcall MIBDelete(int Index);
	AnsiString __fastcall MIBGet(AnsiString MIB);
	__property TIdSNMP* Owner = {read=fOwner};
	__property AnsiString Community = {read=fCommunity, write=SetCommunity};
	__property int ValueCount = {read=GetValueCount, nodefault};
	__property AnsiString Value[int idx] = {read=GetValue};
	__property AnsiString ValueOID[int idx] = {read=GetValueOID};
	__property int ValueType[int idx] = {read=GetValueType};
};


//-- var, const, procedure ---------------------------------------------------
static const Byte PDUGetRequest = 0xa0;
static const Byte PDUGetNextRequest = 0xa1;
static const Byte PDUGetResponse = 0xa2;
static const Byte PDUSetRequest = 0xa3;
static const Byte PDUTrap = 0xa4;
static const Shortint ENoError = 0x0;
static const Shortint ETooBig = 0x1;
static const Shortint ENoSuchName = 0x2;
static const Shortint EBadValue = 0x3;
static const Shortint EReadOnly = 0x4;
static const Shortint EGenErr = 0x5;

}	/* namespace Idsnmp */
using namespace Idsnmp;
#pragma pack(pop)
#pragma option pop

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// Idsnmp
