PNatMethod Class Reference

#include <pnat.h>

Inheritance diagram for PNatMethod:

PObject PSTUNClient List of all members.

General Functions

virtual BOOL GetExternalAddress (PIPSocket::Address &externalAddress, const PTimeInterval &maxAge=1000)=0
virtual BOOL CreateSocketPair (PUDPSocket *&socket1, PUDPSocket *&socket2, const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny())=0
virtual BOOL IsAvailable ()
virtual void SetPortRanges (WORD portBase, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
virtual PStringList GetName () const
static PStringList GetNatMethodName ()

Static Public Member Functions

static PNatMethodCreate (const PString &name, PPluginManager *pluginMgr=NULL)

Protected Attributes

PNatMethod::PortInfo singlePortInfo
PNatMethod::PortInfo pairedPortInfo

Classes

struct  PortInfo

Detailed Description

PNatMethod Base Network Address Traversal Method class All NAT Traversal Methods are derived off this class. There are quite a few methods of NAT Traversal. The only purpose of this class is to provide a common interface. It is intentionally minimalistic.


Constructor & Destructor Documentation

PNatMethod::PNatMethod (  ) 

Default Contructor

PNatMethod::~PNatMethod (  ) 

Deconstructor

PNatMethod::PNatMethod (  ) 

Default Contructor

PNatMethod::~PNatMethod (  ) 

Deconstructor


Member Function Documentation

static PNatMethod* PNatMethod::Create ( const PString name,
PPluginManager pluginMgr = NULL 
) [static]

Factory Create

Parameters:
name  Feature Name Expression
pluginMgr  Plugin Manager

virtual BOOL PNatMethod::GetExternalAddress ( PIPSocket::Address externalAddress,
const PTimeInterval maxAge = 1000 
) [pure virtual]

GetExternalAddress Get the acquired External IP Address.

Parameters:
maxAge  External address of router Maximum age for caching

Implemented in PSTUNClient.

virtual BOOL PNatMethod::CreateSocketPair ( PUDPSocket *&  socket1,
PUDPSocket *&  socket2,
const PIPSocket::Address binding = PIPSocket::GetDefaultIpAny() 
) [pure virtual]

CreateSocketPair Create the UDP Socket pair

Implemented in PSTUNClient.

virtual BOOL PNatMethod::IsAvailable (  )  [inline, virtual]

Returns whether the Nat Method is ready and available in assisting in NAT Traversal. The principal is function is to allow the EP to detect various methods and if a method is detected then this method is available for NAT traversal The Order of adding to the PNstStrategy determines which method is used

Reimplemented in PSTUNClient.

virtual void PNatMethod::SetPortRanges ( WORD  portBase,
WORD  portMax = 0,
WORD  portPairBase = 0,
WORD  portPairMax = 0 
) [virtual]

Set the port ranges to be used on local machine. Note that the ports used on the NAT router may not be the same unless some form of port forwarding is present.

If the port base is zero then standard operating system port allocation method is used.

If the max port is zero then it will be automatically set to the port base + 99.

Parameters:
portMax  Single socket port number base
portPairBase  Single socket port number max
portPairMax  Socket pair port number base Socket pair port number max

static PStringList PNatMethod::GetNatMethodName (  )  [inline, static]

Get the Method String Name

Reimplemented in PSTUNClient.

virtual PStringList PNatMethod::GetName (  )  const [inline, virtual]

Reimplemented in PSTUNClient.


Member Data Documentation

struct PNatMethod::PortInfo PNatMethod::singlePortInfo [protected]

struct PNatMethod::PortInfo PNatMethod::pairedPortInfo [protected]


The documentation for this class was generated from the following file:
Generated on Fri Mar 7 06:25:06 2008 for PTLib by  doxygen 1.5.1