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

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

#ifndef InsocksHPP
#define InsocksHPP

#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 <Inassignednumbers.hpp>	// Pascal unit
#include <Incomponent.hpp>	// Pascal unit
#include <Incustomtransparentproxy.hpp>	// Pascal unit
#include <Inglobal.hpp>	// Pascal unit
#include <Iniohandler.hpp>	// Pascal unit
#include <Inbasecomponent.hpp>	// Pascal unit

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

namespace Insocks
{
//-- type declarations -------------------------------------------------------
#pragma option push -b-
enum TSocksVersion { svNoSocks, svSocks4, svSocks4A, svSocks5 };
#pragma option pop

#pragma option push -b-
enum TSocksAuthentication { saNoAuthentication, saUsernamePassword };
#pragma option pop

class DELPHICLASS TInSocksInfo;
class PASCALIMPLEMENTATION TInSocksInfo : public Incustomtransparentproxy::TInCustomTransparentProxy 
{
	typedef Incustomtransparentproxy::TInCustomTransparentProxy inherited;
	
protected:
	TSocksAuthentication FAuthentication;
	TSocksVersion FVersion;
	virtual void __fastcall AssignTo(Classes::TPersistent* ASource);
	virtual bool __fastcall GetEnabled(void);
	virtual void __fastcall InitComponent(void);
	void __fastcall AuthenticateSocks5Connection(Iniohandler::TInIOHandler* AIOHandler);
	void __fastcall MakeSocks4Request(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const Word APort, const Byte ARequest);
	void __fastcall MakeSocks5Request(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const Word APort, const Byte ARequest, Inglobal::TBytes &VBuf, int &VLen);
	void __fastcall MakeSocks4Connection(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort);
	void __fastcall MakeSocks4Bind(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort);
	void __fastcall MakeSocks5Connection(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort);
	void __fastcall MakeSocks5Bind(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort);
	virtual void __fastcall MakeConnection(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort);
	bool __fastcall MakeSocks4Listen(Iniohandler::TInIOHandler* AIOHandler, const int ATimeOut);
	bool __fastcall MakeSocks5Listen(Iniohandler::TInIOHandler* AIOHandler, const int ATimeOut);
	
public:
	virtual void __fastcall Bind(Iniohandler::TInIOHandler* AIOHandler, const AnsiString AHost, const int APort)/* overload */;
	virtual bool __fastcall Listen(Iniohandler::TInIOHandler* AIOHandler, const int ATimeOut);
	
__published:
	__property TSocksAuthentication Authentication = {read=FAuthentication, write=FAuthentication, default=0};
	__property Host ;
	__property Password ;
	__property Port  = {default=1080};
	__property Username ;
	__property TSocksVersion Version = {read=FVersion, write=FVersion, default=0};
	__property ChainedProxy ;
public:
	#pragma option push -w-inl
	/* TInComponent.Destroy */ inline __fastcall virtual ~TInSocksInfo(void) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TInBaseComponent.Create */ inline __fastcall TInSocksInfo(Classes::TComponent* AOwner)/* overload */ : Incustomtransparentproxy::TInCustomTransparentProxy(AOwner) { }
	#pragma option pop
	
	
/* Hoisted overloads: */
	
public:
	inline void __fastcall  Bind(Iniohandler::TInIOHandler* AIOHandler, const int APort){ TInCustomTransparentProxy::Bind(AIOHandler, APort); }
	
};


//-- var, const, procedure ---------------------------------------------------
#define ID_SOCKS_AUTH (TSocksAuthentication)(0)
#define ID_SOCKS_VER (TSocksVersion)(0)

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

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