192 void * userData = NULL
223 WORD portPairBase = 0,
320 WORD portPairBase = 0,
350 return (deviceName == GetDeviceNames(0)[0]);
354 #define PDECLARE_NAT_METHOD(method, cls) PFACTORY_CREATE(PFactory<PNatMethod>, cls, #method) 356 #define PCREATE_NAT_PLUGIN(name) \ 357 static PNatMethodServiceDescriptor<PNatMethod_##name> PNatMethod_##name##_descriptor; \ 358 PCREATE_PLUGIN_STATIC(name, PNatMethod, &PNatMethod_##name##_descriptor) 370 #endif // PTLIB_PNAT_H virtual bool GetInterfaceAddress(PIPSocket::Address &internalAddress) const =0
Return the interface NAT router is using.
virtual void SetPortRanges(WORD portBase, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
Set the port ranges to be used on local machine.
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
A socket channel that uses the UDP transport on the Internet Protocol.
Definition: udpsock.h:47
Definition: pluginmgr.h:57
STUN client.
Definition: pstun.h:68
virtual PString GetName() const =0
Get the NAT traversal method Name.
PMutex mutex
Definition: pnat.h:237
virtual bool ValidateDeviceName(const PString &deviceName, int) const
Definition: pnat.h:349
PNatStrategy The main container for all NAT traversal Strategies.
Definition: pnat.h:263
This is an array collection class of PString objects.
Definition: pstring.h:2024
virtual void Activate(bool active)
Acrivate Activate/DeActivate the NAT Method on a call by call basis Default does notthing.
BOOL PBoolean
Definition: object.h:102
virtual PBoolean CreateSocketPair(PUDPSocket *&socket1, PUDPSocket *&socket2, const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny())=0
Create a socket pair.
RTPSupportTypes
Definition: pnat.h:195
PNatMethod Base Network Address Traversal Method class All NAT Traversal Methods are derived off this...
Definition: pnat.h:49
virtual bool IsAvailable(const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny())=0
Returns whether the Nat Method is ready and available in assisting in NAT Traversal.
PLIST(PNatList, PNatMethod)
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
virtual PBoolean CreateSocket(PUDPSocket *&socket, const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny(), WORD localPort=0)=0
Create a single socket.
WORD RandomPortPair(unsigned int start, unsigned int end)
RandomPortPair This function returns a random port pair base number in the specified range for the cr...
virtual PObject * CreateInstance(int) const
Definition: pnat.h:347
WORD maxPort
Definition: pnat.h:239
The character string class.
Definition: pstring.h:108
virtual RTPSupportTypes GetRTPSupport(PBoolean force=false)=0
Return an indication if the current STUN type supports RTP Use the force variable to guarantee an up ...
virtual void SetAlternateAddresses(const PStringArray &addresses, void *userData=NULL)
Set Alternate Candidate (ICE) or probe (H.460.24A) addresses.
virtual PBoolean GetExternalAddress(PIPSocket::Address &externalAddress, const PTimeInterval &maxAge=1000)=0
Get the acquired External IP Address.
struct PNatMethod::PortInfo singlePortInfo
struct PNatMethod::PortInfo pairedPortInfo
virtual bool GetServerAddress(PIPSocket::Address &address, WORD &port) const =0
Get the current server address and port being used.
static PIPSocket::Address GetDefaultIpAny()
A class describing an IP address.
Definition: ipsock.h:75
PNatMethod()
Default Contructor.
PortInfo(WORD port=0)
Definition: pnat.h:230
virtual PStringArray GetDeviceNames(int) const
Definition: pnat.h:348
virtual PString GetServer() const
Get the current server address name.
~PNatMethod()
Deconstructor.
WORD basePort
Definition: pnat.h:238
WORD currentPort
Definition: pnat.h:240
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
static PNatMethod * Create(const PString &name, PPluginManager *pluginMgr=NULL)
Factory Create.
PFACTORY_LOAD(PSTUNClient)
PNatList & GetNATList()
Get Loaded NAT Method List.
Definition: pnat.h:326