PTLib  Version 2.14.3
 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 }
 

Public Member Functions

 PSTUN ()
 
virtual ~PSTUN ()
 
virtual PNatMethod::NatTypes DoRFC3489Discovery (PSTUNUDPSocket *socket, const PIPSocketAddressAndPort &serverAddress, PIPSocketAddressAndPort &baseAddressAndPort, PIPSocketAddressAndPort &externalAddressAndPort)
 Determine the NAT type using RFC3489 discovery method. More...
 
virtual PNatMethod::NatTypes FinishRFC3489Discovery (PSTUNMessage &responseI, PSTUNUDPSocket *socket, PIPSocketAddressAndPort &externalAddressAndPort)
 
virtual int MakeAuthenticatedRequest (PSTUNUDPSocket *socket, PSTUNMessage &request, PSTUNMessage &response)
 
virtual bool GetFromBindingResponse (const PSTUNMessage &response, PIPSocketAddressAndPort &externalAddress)
 
virtual void AppendMessageIntegrity (PSTUNMessage &message)
 
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...
 

Public Attributes

PINDEX m_pollRetries
 
PSASLString m_userName
 
PSASLString m_realm
 
PSASLString m_nonce
 
PBYTEArray m_password
 
PIPSocket::Address m_interface
 
PIPSocketAddressAndPort m_serverAddress
 
PTimeInterval replyTimeout
 

Member Enumeration Documentation

anonymous enum
Enumerator
DefaultPort 
anonymous enum
Enumerator
MinChannelNumber 
MaxChannelNumber 

Constructor & Destructor Documentation

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

Member Function Documentation

virtual void PSTUN::AppendMessageIntegrity ( PSTUNMessage &  message)
virtual
virtual PNatMethod::NatTypes PSTUN::DoRFC3489Discovery ( PSTUNUDPSocket *  socket,
const PIPSocketAddressAndPort &  serverAddress,
PIPSocketAddressAndPort &  baseAddressAndPort,
PIPSocketAddressAndPort &  externalAddressAndPort 
)
virtual

Determine the NAT type using RFC3489 discovery method.

virtual PNatMethod::NatTypes PSTUN::FinishRFC3489Discovery ( PSTUNMessage &  responseI,
PSTUNUDPSocket *  socket,
PIPSocketAddressAndPort &  externalAddressAndPort 
)
virtual
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 replyTimeout.

virtual int PSTUN::MakeAuthenticatedRequest ( PSTUNUDPSocket *  socket,
PSTUNMessage &  request,
PSTUNMessage &  response 
)
virtual
virtual void PSTUN::SetCredentials ( const PString &  username,
const PString &  password,
const PString &  realm 
)
virtual
Parameters
realmIf empty the using short term credentials
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 replyTimeout.

Member Data Documentation

PIPSocket::Address PSTUN::m_interface
PSASLString PSTUN::m_nonce
PBYTEArray PSTUN::m_password
PINDEX PSTUN::m_pollRetries

Referenced by GetRetries(), and SetRetries().

PSASLString PSTUN::m_realm
PIPSocketAddressAndPort PSTUN::m_serverAddress
PSASLString PSTUN::m_userName
PTimeInterval PSTUN::replyTimeout

Referenced by GetTimeout(), and SetTimeout().


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