|
| PSTUNClient () |
|
| ~PSTUNClient () |
|
virtual PString | GetName () const |
|
bool | SetServer (const PString &server) |
| Set the STUN server to use. More...
|
|
virtual PString | GetServer () const |
| Get the current server address name. More...
|
|
virtual bool | GetServerAddress (PIPSocketAddressAndPort &serverAddressAndPort) const |
|
virtual bool | GetExternalAddress (PIPSocket::Address &externalAddress, const PTimeInterval &maxAge=1000) |
|
virtual bool | GetInterfaceAddress (PIPSocket::Address &internalAddress) const |
|
virtual bool | Open (const PIPSocket::Address &ifaceAddr) |
|
bool | IsAvailable (const PIPSocket::Address &binding) |
|
virtual void | Close () |
|
NatTypes | FindNatType (const PIPSocket::Address &binding) |
|
bool | CreateSocket (Component component, PUDPSocket *&socket, const PIPSocket::Address &=PIPSocket::GetDefaultIpAny(), WORD port=0) |
| Create a single socket. More...
|
|
virtual bool | CreateSocketPair (PUDPSocket *&socket1, PUDPSocket *&socket2, const PIPSocket::Address &=PIPSocket::GetDefaultIpAny()) |
| Create a socket pair. More...
|
|
bool | InternalOpenSocket (Component component, const PIPSocket::Address &binding, PSTUNUDPSocket &socket, PortInfo &portInfo) |
|
| 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...
|
|
Create a socket pair.
The STUN protocol is used to create a pair of sockets with adjacent port numbers for which the external IP address and port numbers are known. PUDPSocket descendants are returned which will, in response to GetLocalAddress() return the externally visible IP and port rather than the local machines IP and socket.
The will create new socket pointers. It is up to the caller to make sure the sockets are deleted to avoid memory leaks.
The socket pointers are set to NULL if the function fails and returns false.
Reimplemented in PTURNClient.