sipxportlib  Version 3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OsNatSocketBaseImpl Class Referenceabstract

#include <OsNatSocketBaseImpl.h>

Inheritance diagram for OsNatSocketBaseImpl:
Inheritance graph
[legend]
Collaboration diagram for OsNatSocketBaseImpl:
Collaboration graph
[legend]

Public Member Functions

 OsNatSocketBaseImpl ()
 
virtual ~OsNatSocketBaseImpl ()
 
virtual void setReadNotification (OsNotification *pNotification)
 
- Public Member Functions inherited from IStunSocket
virtual ~IStunSocket ()
 
virtual int socketWrite (const char *buffer, int bufferLength, const char *ipAddress, int port, PacketType packetType=UNKNOWN_PACKET)=0
 
virtual UtlBoolean getRelayIp (UtlString *ip, int *port)=0
 
virtual UtlBoolean getMappedIp (UtlString *ip, int *port)=0
 
virtual void enableTransparentReads (bool bEnable)=0
 
virtual void enableStun (const char *szStunServer, int stunPort, int iKeepAlive, int stunOptions, bool bReadFromSocket)=0
 
virtual void setStunAddress (const UtlString &address, const int iPort)=0
 
virtual void setTurnAddress (const UtlString &address, const int iPort)=0
 
virtual void markStunFailure ()=0
 
virtual void markStunSuccess (bool bAddressChanged)=0
 
virtual void markTurnFailure ()=0
 
virtual void markTurnSuccess ()=0
 
virtual void evaluateDestinationAddress (const UtlString &address, int iPort, int priority)=0
 
virtual void enableTurn (const char *szTurnSever, int turnPort, int iKeepAlive, const char *username, const char *password, bool bReadFromSocket)=0
 
virtual void readyDestination (const char *szAddress, int iPort)=0
 
virtual UtlBoolean applyDestinationAddress (const char *szAddress, int iPort)=0
 
virtual UtlBoolean getBestDestinationAddress (UtlString &address, int &iPort)=0
 
virtual void addAlternateDestination (const char *szAddress, int iPort, int priority)=0
 
virtual void destroy ()=0
 

Protected Member Functions

void markReadTime ()
 
void markWriteTime ()
 
virtual bool getFirstReadTime (OsDateTime &time)
 
virtual bool getLastReadTime (OsDateTime &time)
 
virtual bool getFirstWriteTime (OsDateTime &time)
 
virtual bool getLastWriteTime (OsDateTime &time)
 
virtual void handleStunMessage (char *pBuf, int length, UtlString &fromAddress, int fromPort)
 
virtual void handleTurnMessage (char *pBuf, int length, UtlString &fromAddress, int fromPort)
 
virtual int handleTurnDataIndication (char *buffer, int bufferLength, UtlString *pRecvFromIp, int *pRecvFromPort)
 
virtual bool handleSturnData (char *buffer, int &bufferLength, UtlString &receivedIp, int &receivedPort)
 
virtual OsSocketgetSocket ()=0
 

Protected Attributes

unsigned int miRecordTimes
 
OsDateTime mFirstRead
 
OsDateTime mLastRead
 
OsDateTime mFirstWrite
 
OsDateTime mLastWrite
 
OsMutex mReadNotificationLock
 
OsNotificationmpReadNotification
 

Constructor & Destructor Documentation

~OsNatSocketBaseImpl ( )
virtual

Member Function Documentation

void setReadNotification ( OsNotification pNotification)
virtual

Set a notification object to be signaled when the first the data packet is received from the socket. Once this is signaled, the notification object is discarded.

Implements IStunSocket.

Reimplemented in OsNatDatagramSocket.

void markReadTime ( )
protected
void markWriteTime ( )
protected
bool getFirstReadTime ( OsDateTime &  time)
protectedvirtual

Get the timestamp of the first read data packet (excluding any STUN/TURN/NAT packets).

Implements IStunSocket.

bool getLastReadTime ( OsDateTime &  time)
protectedvirtual

Get the timestamp of the last read data packet (excluding any STUN/TURN/NAT packets).

Implements IStunSocket.

bool getFirstWriteTime ( OsDateTime &  time)
protectedvirtual

Get the timestamp of the first written data packet (excluding any STUN/TURN/NAT packets).

Implements IStunSocket.

bool getLastWriteTime ( OsDateTime &  time)
protectedvirtual

Get the timestamp of the last written data packet (excluding any STUN/TURN/NAT packets).

Implements IStunSocket.

void handleStunMessage ( char *  pBuf,
int  length,
UtlString fromAddress,
int  fromPort 
)
protectedvirtual

Handle/process an inbound STUN message.

void handleTurnMessage ( char *  pBuf,
int  length,
UtlString fromAddress,
int  fromPort 
)
protectedvirtual

Handle/process an inbound TURN message.

int handleTurnDataIndication ( char *  buffer,
int  bufferLength,
UtlString pRecvFromIp,
int *  pRecvFromPort 
)
protectedvirtual

Pull a data indication out of the buffer

bool handleSturnData ( char *  buffer,
int &  bufferLength,
UtlString receivedIp,
int &  receivedPort 
)
protectedvirtual

Handle/process an inbound STUN or TURN message.

virtual OsSocket* getSocket ( )
protectedpure virtual

Implements IStunSocket.

Implemented in OsNatDatagramSocket, and OsNatConnectionSocket.

Member Data Documentation

unsigned int miRecordTimes
protected
OsDateTime mFirstRead
protected
OsDateTime mLastRead
protected
OsDateTime mFirstWrite
protected
OsDateTime mLastWrite
protected
OsMutex mReadNotificationLock
protected
OsNotification* mpReadNotification
protected