PTLib Version 2.12.9

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
PSTUN Class Reference

`#include <pstun.h>`

Inheritance diagram for PSTUN:
[legend]
Collaboration diagram for PSTUN:
[legend]

## 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
PNatMethod::NatTypes | m_natType
PINDEX | m_pollRetries
PTime | m_timeAddressObtained
PString | m_userName
PString | m_realm
PString | m_nonce
PBYTEArray | m_credentialsHash
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 | ( |  | ) |
| inline virtual

## 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
| inline virtual

Get the number of retries for responses from STUN server.

References m_pollRetries.

virtual const PTimeInterval PSTUN::GetTimeout | ( |  | ) | const
| inline virtual

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

Reimplemented in PTURNClient.

virtual void PSTUN::SetRetries | ( | PINDEX | retries | ) |
| inline virtual

Set the number of retries for responses from STUN server.

Parameters

  retries | Number of retries

References m_pollRetries.

virtual void PSTUN::SetTimeout | ( | const PTimeInterval & | timeout | ) |
| inline virtual

Set the timeout for responses from STUN server.

Parameters

  timeout | New timeout in milliseconds

References replyTimeout.

## Member Data Documentation

PBYTEArray PSTUN::m_credentialsHash

PIPSocket::Address PSTUN::m_interface

PNatMethod::NatTypes PSTUN::m_natType

PString PSTUN::m_nonce

PINDEX PSTUN::m_pollRetries

Referenced by GetRetries(), and SetRetries().

PString PSTUN::m_realm

PIPSocketAddressAndPort PSTUN::m_serverAddress

PTime PSTUN::m_timeAddressObtained

PString PSTUN::m_userName

PTimeInterval PSTUN::replyTimeout

Referenced by GetTimeout(), and SetTimeout().

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

- pstun.h