82 WORD portPairBase = 0,
87 WORD serverPort = DefaultPort,
90 WORD portPairBase = 0,
99 WORD portPairBase = 0,
113 virtual bool GetServerAddress(
162 ) {
return GetNatTypeString(GetNatType(force)); }
166 static PString GetNatTypeString(
184 virtual PBoolean GetExternalAddress(
191 virtual bool GetInterfaceAddress(
199 void InvalidateCache();
246 ) { replyTimeout = timeout; }
256 ) { pollRetries = retries; }
272 ) { numSocketsForPairing = numSockets; }
281 virtual bool IsAvailable(
305 #endif // PTLIB_PSTUN_H
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
This class defines an absolute time and date.
Definition: ptime.h:53
static PStringList GetNatMethodName()
Get the NAT Method Name.
Definition: pstun.h:105
virtual PString GetName() const
Get the NAT traversal method name.
Definition: pstun.h:109
A socket channel that uses the UDP transport on the Internet Protocol.
Definition: udpsock.h:47
STUN client.
Definition: pstun.h:68
PINDEX numSocketsForPairing
Definition: pstun.h:290
virtual PString GetLocalAddress()
Get the Internet Protocol address and port for the local host.
void SetRetries(PINDEX retries)
Set the number of retries for responses from STUN server.
Definition: pstun.h:254
virtual PBoolean OpenSocket()
void SetSocketsForPairing(PINDEX numSockets)
Set the number of sockets to create in attempt to get a port pair.
Definition: pstun.h:270
void SetTimeout(const PTimeInterval &timeout)
Set the timeout for responses from STUN server.
Definition: pstun.h:244
PINDEX GetRetries() const
Get the number of retries for responses from STUN server.
Definition: pstun.h:250
WORD port
Port to be used by the socket when opening the channel.
Definition: socket.h:444
PIPSocket::Address cachedExternalAddress
Definition: pstun.h:296
BOOL PBoolean
Definition: object.h:102
static PString GetNatTypeString(NatTypes type)
Get NatTypes enumeration as an English string for the type.
PTimeInterval replyTimeout
Definition: pstun.h:288
NatTypes natType
Definition: pstun.h:294
PINDEX GetSocketsForPairing() const
Get the number of sockets to create in attempt to get a port pair.
Definition: pstun.h:263
RTPSupportTypes
Definition: pnat.h:195
PIPSocket::Address cachedServerAddress
Definition: pstun.h:295
WORD serverPort
Definition: pstun.h:287
PNatMethod Base Network Address Traversal Method class All NAT Traversal Methods are derived off this...
Definition: pnat.h:49
friend ostream & operator<<(ostream &strm, const PObject &obj)
Global function for using the standard << operator on objects descended from PObject.
Definition: object.h:1310
PINDEX pollRetries
Definition: pstun.h:289
PString serverHost
Definition: pstun.h:286
The character string class.
Definition: pstring.h:108
friend class PSTUNClient
Definition: pstun.h:62
PString GetNatTypeName(PBoolean force=false)
Determine via the STUN protocol the NAT type for the router.
Definition: pstun.h:160
This is a list collection class of PString objects.
Definition: pstring.h:2184
static PIPSocket::Address GetDefaultIpAny()
PIPSocket::Address interfaceAddress
Definition: pstun.h:297
A class describing an IP address.
Definition: ipsock.h:75
NatTypes
Definition: pstun.h:136
PTime timeAddressObtained
Definition: pstun.h:298
PIPSocket::Address externalIP
Definition: pstun.h:60
const PTimeInterval GetTimeout() const
Get the timeout for responses from STUN server.
Definition: pstun.h:240
UDP socket that has been created by the STUN client.
Definition: pstun.h:45