82 WORD portPairBase = 0,
90 WORD portPairBase = 0,
99 WORD portPairBase = 0,
305 #endif // PTLIB_PSTUN_H
virtual bool IsAvailable(const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny())
Returns whether the Nat Method is ready and available in assisting in NAT Traversal.
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
PINDEX GetSocketsForPairing() const
Get the number of sockets to create in attempt to get a port pair.
Definition: pstun.h:263
virtual bool GetServerAddress(PIPSocket::Address &address, WORD &port) const
Get the current server address and port being used.
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 PBoolean CreateSocketPair(PUDPSocket *&socket1, PUDPSocket *&socket2, const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny())
Create a socket pair.
A socket channel that uses the UDP transport on the Internet Protocol.
Definition: udpsock.h:47
PBoolean CreateSocket(PUDPSocket *&socket, const PIPSocket::Address &binding=PIPSocket::GetDefaultIpAny(), WORD localPort=0)
Create a single socket.
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
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
PBoolean SetServer(const PString &server)
Set the STUN server to use.
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.
virtual PBoolean GetExternalAddress(PIPSocket::Address &externalAddress, const PTimeInterval &maxAge=1000)
Determine the external router address.
PTimeInterval replyTimeout
Definition: pstun.h:288
NatTypes natType
Definition: pstun.h:294
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
bool OpenSocket(PUDPSocket &socket, PortInfo &portInfo, const PIPSocket::Address &binding)
PINDEX pollRetries
Definition: pstun.h:289
virtual bool GetInterfaceAddress(PIPSocket::Address &internalAddress) const
Return the interface NAT router is using.
void Initialise(const PString &server, WORD portBase=0, WORD portMax=0, WORD portPairBase=0, WORD portPairMax=0)
PString serverHost
Definition: pstun.h:286
PINDEX GetRetries() const
Get the number of retries for responses from STUN server.
Definition: pstun.h:250
The character string class.
Definition: pstring.h:108
PString GetNatTypeName(PBoolean force=false)
Determine via the STUN protocol the NAT type for the router.
Definition: pstun.h:160
RTPSupportTypes GetRTPSupport(PBoolean force=false)
Return an indication if the current STUN type supports RTP Use the force variable to guarantee an up ...
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 GetNatType(PBoolean force=false)
Determine via the STUN protocol the NAT type for the router.
NatTypes
Definition: pstun.h:136
PTime timeAddressObtained
Definition: pstun.h:298
const PTimeInterval GetTimeout() const
Get the timeout for responses from STUN server.
Definition: pstun.h:240
ostream & operator<<(ostream &strm, PSTUNClient::NatTypes type)
Definition: pstun.h:302
void InvalidateCache()
Invalidates the cached addresses and modes.
virtual PString GetName() const
Get the NAT traversal method name.
Definition: pstun.h:109
PIPSocket::Address externalIP
Definition: pstun.h:60
UDP socket that has been created by the STUN client.
Definition: pstun.h:45