PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PSTUN Class Reference

#include <pstun.h>

Inheritance diagram for PSTUN:
Collaboration diagram for PSTUN:

Public Types

enum  { DefaultPort = 3478 }
 
enum  { MinChannelNumber = 0x4000, MaxChannelNumber = 0x7ffe }
 
enum  IceRole { NoIceRole, IceLite, IceControlled, IceControlling }
 

Public Member Functions

 PSTUN ()
 
virtual ~PSTUN ()
 
void DoRFC3489Discovery (PNatMethod::NatTypes &natType, PSTUNUDPSocket *socket, const PIPSocketAddressAndPort &serverAddress, PIPSocketAddressAndPort &baseAddressAndPort, PIPSocket::Address &externalAddress, bool externalAddressOnly)
 Determine the NAT type using RFC3489 discovery method. More...
 
void FinishRFC3489Discovery (PNatMethod::NatTypes &natType, PSTUNMessage &responseI, PSTUNUDPSocket *socket, PIPSocket::Address &externalAddress, bool externalAddressOnly)
 
virtual bool GetFromBindingResponse (const PSTUNMessage &response, PIPSocketAddressAndPort &externalAddress)
 
virtual void SetCredentials (const PString &username, const PString &password, const PString &realm)
 
virtual const PTimeInterval GetTimeout () const
 Get the timeout for responses from STUN server. More...
 
virtual void SetTimeout (const PTimeInterval &timeout)
 Set the timeout for responses from STUN server. More...
 
virtual PINDEX GetRetries () const
 Get the number of retries for responses from STUN server. More...
 
virtual void SetRetries (PINDEX retries)
 Set the number of retries for responses from STUN server. More...
 
virtual void SetIceRole (IceRole role)
 

Protected Attributes

PINDEX m_pollRetries
 
PSASLString m_userName
 
PSASLString m_realm
 
PSASLString m_nonce
 
PBYTEArray m_password
 
PIPSocket::Address m_interface
 
PIPSocketAddressAndPort m_serverAddress
 
PTimeInterval m_replyTimeout
 
IceRole m_iceRole
 
uint64_t m_iceTieBreak
 

Member Enumeration Documentation

anonymous enum
Enumerator
DefaultPort 
anonymous enum
Enumerator
MinChannelNumber 
MaxChannelNumber 
Enumerator
NoIceRole 
IceLite 
IceControlled 
IceControlling 

Constructor & Destructor Documentation

PSTUN::PSTUN ( )
virtual PSTUN::~PSTUN ( )
inlinevirtual

Member Function Documentation

void PSTUN::DoRFC3489Discovery ( PNatMethod::NatTypes &  natType,
PSTUNUDPSocket socket,
const PIPSocketAddressAndPort serverAddress,
PIPSocketAddressAndPort baseAddressAndPort,
PIPSocket::Address externalAddress,
bool  externalAddressOnly 
)

Determine the NAT type using RFC3489 discovery method.

void PSTUN::FinishRFC3489Discovery ( PNatMethod::NatTypes &  natType,
PSTUNMessage responseI,
PSTUNUDPSocket socket,
PIPSocket::Address externalAddress,
bool  externalAddressOnly 
)
virtual bool PSTUN::GetFromBindingResponse ( const PSTUNMessage response,
PIPSocketAddressAndPort externalAddress 
)
virtual
virtual PINDEX PSTUN::GetRetries ( ) const
inlinevirtual

Get the number of retries for responses from STUN server.

References m_pollRetries.

virtual const PTimeInterval PSTUN::GetTimeout ( ) const
inlinevirtual

Get the timeout for responses from STUN server.

References m_replyTimeout.

virtual void PSTUN::SetCredentials ( const PString username,
const PString password,
const PString realm 
)
virtual
Parameters
realmIf empty the using short term credentials

Reimplemented in PSTUNClient.

virtual void PSTUN::SetIceRole ( IceRole  role)
virtual
virtual void PSTUN::SetRetries ( PINDEX  retries)
inlinevirtual

Set the number of retries for responses from STUN server.

Parameters
retriesNumber of retries

References m_pollRetries.

virtual void PSTUN::SetTimeout ( const PTimeInterval timeout)
inlinevirtual

Set the timeout for responses from STUN server.

Parameters
timeoutNew timeout in milliseconds

References m_replyTimeout.

Member Data Documentation

IceRole PSTUN::m_iceRole
protected
uint64_t PSTUN::m_iceTieBreak
protected
PIPSocket::Address PSTUN::m_interface
protected
PSASLString PSTUN::m_nonce
protected
PBYTEArray PSTUN::m_password
protected
PINDEX PSTUN::m_pollRetries
protected

Referenced by GetRetries(), and SetRetries().

PSASLString PSTUN::m_realm
protected
PTimeInterval PSTUN::m_replyTimeout
protected

Referenced by GetTimeout(), and SetTimeout().

PIPSocketAddressAndPort PSTUN::m_serverAddress
protected
PSASLString PSTUN::m_userName
protected

The documentation for this class was generated from the following file: