reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
reTurn::TurnSocket Class Referenceabstract

#include <TurnSocket.hxx>

Inheritance diagram for reTurn::TurnSocket:
[legend]

Public Member Functions

 TurnSocket (const asio::ip::address &address=UnspecifiedIpAddress, unsigned short port=0)
 
virtual ~TurnSocket ()
 
virtual unsigned int getSocketDescriptor ()=0
 
virtual asio::error_code connect (const std::string &address, unsigned short port)=0
 
asio::error_code requestSharedSecret (char *username, unsigned int usernameSize, char *password, unsigned int passwordSize)
 
void setUsernameAndPassword (const char *username, const char *password, bool shortTermAuth=false)
 
void setSoftware (const char *software)
 
asio::error_code bindRequest ()
 
asio::error_code createAllocation (unsigned int lifetime=UnspecifiedLifetime, unsigned int bandwidth=UnspecifiedBandwidth, unsigned char requestedProps=StunMessage::PropsNone, uint64_t reservationToken=UnspecifiedToken, StunTuple::TransportType requestedTransportType=StunTuple::None)
 
asio::error_code refreshAllocation ()
 
asio::error_code destroyAllocation ()
 
StunTuple & getRelayTuple ()
 
StunTuple & getReflexiveTuple ()
 
unsigned int getLifetime ()
 
unsigned int getBandwidth ()
 
asio::error_code setActiveDestination (const asio::ip::address &address, unsigned short port)
 
asio::error_code clearActiveDestination ()
 
asio::error_code send (const char *buffer, unsigned int size)
 
asio::error_code sendTo (const asio::ip::address &address, unsigned short port, const char *buffer, unsigned int size)
 
asio::error_code receive (char *buffer, unsigned int &size, unsigned int timeout, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0)
 
asio::error_code receiveFrom (const asio::ip::address &address, unsigned short port, char *buffer, unsigned int &size, unsigned int timeout)
 

Static Public Attributes

static unsigned int UnspecifiedLifetime = 0xFFFFFFFF
 
static unsigned int UnspecifiedBandwidth = 0xFFFFFFFF
 
static unsigned short UnspecifiedToken = 0
 
static asio::ip::address UnspecifiedIpAddress = asio::ip::make_address("0.0.0.0")
 

Protected Types

typedef std::map< unsigned short, time_t > ChannelBindingRefreshTimeMap
 

Protected Member Functions

virtual asio::error_code rawWrite (const char *buffer, unsigned int size)=0
 
virtual asio::error_code rawWrite (const std::vector< asio::const_buffer > &buffers)=0
 
virtual asio::error_code rawRead (unsigned int timeout, unsigned int *bytesRead, asio::ip::address *sourceAddress=0, unsigned short *sourcePort=0)=0
 
virtual void cancelSocket ()=0
 
void startReadTimer (unsigned int timeout)
 
void handleRawRead (const asio::error_code &errorCode, size_t bytesRead)
 
void handleRawReadTimeout (const asio::error_code &errorCode)
 
void queueReceived (unsigned int size)
 

Protected Attributes

StunTuple mLocalBinding
 
StunTuple mConnectedTuple
 
resip::Data mUsername
 
resip::Data mPassword
 
resip::Data mHmacKey
 
resip::Data mRealm
 
resip::Data mNonce
 
resip::Data mSoftware
 
unsigned int mRequestedLifetime
 
unsigned int mRequestedBandwidth
 
unsigned char mRequestedProps
 
uint64_t mReservationToken
 
StunTuple::TransportType mRequestedTransportType
 
bool mHaveAllocation
 
time_t mAllocationRefreshTime
 
StunTuple mRelayTuple
 
StunTuple mReflexiveTuple
 
unsigned int mLifetime
 
unsigned int mBandwidth
 
ChannelManager mChannelManager
 
ChannelBindingRefreshTimeMap mChannelBindingRefreshTimes
 
RemotePeer * mActiveDestination
 
asio::io_context mIOService
 
asio::steady_timer mReadTimer
 
size_t mBytesRead
 
asio::error_code mReadErrorCode
 
char mReadBuffer [8192]
 
char mWriteBuffer [8192]
 
bool mConnected
 
std::deque< std::vector< char > > mReceivedWhileWaiting
 

Static Protected Attributes

static const size_t MaxReceivedWhileWaiting = 100
 

Detailed Description

Definition at line 28 of file TurnSocket.hxx.

Member Typedef Documentation

◆ ChannelBindingRefreshTimeMap

Constructor & Destructor Documentation

◆ TurnSocket()

reTurn::TurnSocket::TurnSocket ( const asio::ip::address &  address = UnspecifiedIpAddress,
unsigned short  port = 0 
)
explicit

Definition at line 41 of file TurnSocket.cxx.

◆ ~TurnSocket()

reTurn::TurnSocket::~TurnSocket ( )
virtual

Definition at line 51 of file TurnSocket.cxx.

Member Function Documentation

◆ bindRequest()

asio::error_code reTurn::TurnSocket::bindRequest ( )

Definition at line 145 of file TurnSocket.cxx.

◆ cancelSocket()

virtual void reTurn::TurnSocket::cancelSocket ( )
protectedpure virtual

◆ clearActiveDestination()

asio::error_code reTurn::TurnSocket::clearActiveDestination ( )

Definition at line 486 of file TurnSocket.cxx.

◆ connect()

virtual asio::error_code reTurn::TurnSocket::connect ( const std::string &  address,
unsigned short  port 
)
pure virtual

◆ createAllocation()

asio::error_code reTurn::TurnSocket::createAllocation ( unsigned int  lifetime = UnspecifiedLifetime,
unsigned int  bandwidth = UnspecifiedBandwidth,
unsigned char  requestedProps = StunMessage::PropsNone,
uint64_t  reservationToken = UnspecifiedToken,
StunTuple::TransportType  requestedTransportType = StunTuple::None 
)

Definition at line 187 of file TurnSocket.cxx.

◆ destroyAllocation()

asio::error_code reTurn::TurnSocket::destroyAllocation ( )

Definition at line 365 of file TurnSocket.cxx.

◆ getBandwidth()

unsigned int reTurn::TurnSocket::getBandwidth ( )

Definition at line 403 of file TurnSocket.cxx.

◆ getLifetime()

unsigned int reTurn::TurnSocket::getLifetime ( )

Definition at line 397 of file TurnSocket.cxx.

◆ getReflexiveTuple()

StunTuple & reTurn::TurnSocket::getReflexiveTuple ( )

Definition at line 391 of file TurnSocket.cxx.

◆ getRelayTuple()

StunTuple & reTurn::TurnSocket::getRelayTuple ( )

Definition at line 385 of file TurnSocket.cxx.

◆ getSocketDescriptor()

virtual unsigned int reTurn::TurnSocket::getSocketDescriptor ( )
pure virtual

◆ handleRawRead()

void reTurn::TurnSocket::handleRawRead ( const asio::error_code &  errorCode,
size_t  bytesRead 
)
protected

Definition at line 924 of file TurnSocket.cxx.

◆ handleRawReadTimeout()

void reTurn::TurnSocket::handleRawReadTimeout ( const asio::error_code &  errorCode)
protected

Definition at line 932 of file TurnSocket.cxx.

◆ queueReceived()

void reTurn::TurnSocket::queueReceived ( unsigned int  size)
protected

Definition at line 619 of file TurnSocket.cxx.

◆ rawRead()

virtual asio::error_code reTurn::TurnSocket::rawRead ( unsigned int  timeout,
unsigned int *  bytesRead,
asio::ip::address *  sourceAddress = 0,
unsigned short *  sourcePort = 0 
)
protectedpure virtual

◆ rawWrite() [1/2]

virtual asio::error_code reTurn::TurnSocket::rawWrite ( const char *  buffer,
unsigned int  size 
)
protectedpure virtual

◆ rawWrite() [2/2]

virtual asio::error_code reTurn::TurnSocket::rawWrite ( const std::vector< asio::const_buffer > &  buffers)
protectedpure virtual

◆ receive()

asio::error_code reTurn::TurnSocket::receive ( char *  buffer,
unsigned int &  size,
unsigned int  timeout,
asio::ip::address *  sourceAddress = 0,
unsigned short *  sourcePort = 0 
)

Definition at line 630 of file TurnSocket.cxx.

◆ receiveFrom()

asio::error_code reTurn::TurnSocket::receiveFrom ( const asio::ip::address &  address,
unsigned short  port,
char *  buffer,
unsigned int &  size,
unsigned int  timeout 
)

Definition at line 747 of file TurnSocket.cxx.

◆ refreshAllocation()

asio::error_code reTurn::TurnSocket::refreshAllocation ( )

Definition at line 311 of file TurnSocket.cxx.

◆ requestSharedSecret()

asio::error_code reTurn::TurnSocket::requestSharedSecret ( char *  username,
unsigned int  usernameSize,
char *  password,
unsigned int  passwordSize 
)

Definition at line 56 of file TurnSocket.cxx.

◆ send()

asio::error_code reTurn::TurnSocket::send ( const char *  buffer,
unsigned int  size 
)

Definition at line 503 of file TurnSocket.cxx.

◆ sendTo()

asio::error_code reTurn::TurnSocket::sendTo ( const asio::ip::address &  address,
unsigned short  port,
const char *  buffer,
unsigned int  size 
)

Definition at line 520 of file TurnSocket.cxx.

◆ setActiveDestination()

asio::error_code reTurn::TurnSocket::setActiveDestination ( const asio::ip::address &  address,
unsigned short  port 
)

Definition at line 409 of file TurnSocket.cxx.

◆ setSoftware()

void reTurn::TurnSocket::setSoftware ( const char *  software)

Definition at line 128 of file TurnSocket.cxx.

◆ setUsernameAndPassword()

void reTurn::TurnSocket::setUsernameAndPassword ( const char *  username,
const char *  password,
bool  shortTermAuth = false 
)

Definition at line 116 of file TurnSocket.cxx.

◆ startReadTimer()

void reTurn::TurnSocket::startReadTimer ( unsigned int  timeout)
protected

Definition at line 914 of file TurnSocket.cxx.

Member Data Documentation

◆ mActiveDestination

RemotePeer* reTurn::TurnSocket::mActiveDestination
protected

Definition at line 122 of file TurnSocket.hxx.

◆ mAllocationRefreshTime

time_t reTurn::TurnSocket::mAllocationRefreshTime
protected

Definition at line 113 of file TurnSocket.hxx.

◆ MaxReceivedWhileWaiting

const size_t reTurn::TurnSocket::MaxReceivedWhileWaiting = 100
staticprotected

Definition at line 142 of file TurnSocket.hxx.

◆ mBandwidth

unsigned int reTurn::TurnSocket::mBandwidth
protected

Definition at line 117 of file TurnSocket.hxx.

◆ mBytesRead

size_t reTurn::TurnSocket::mBytesRead
protected

Definition at line 128 of file TurnSocket.hxx.

◆ mChannelBindingRefreshTimes

ChannelBindingRefreshTimeMap reTurn::TurnSocket::mChannelBindingRefreshTimes
protected

Definition at line 121 of file TurnSocket.hxx.

◆ mChannelManager

ChannelManager reTurn::TurnSocket::mChannelManager
protected

Definition at line 119 of file TurnSocket.hxx.

◆ mConnected

bool reTurn::TurnSocket::mConnected
protected

Definition at line 137 of file TurnSocket.hxx.

◆ mConnectedTuple

StunTuple reTurn::TurnSocket::mConnectedTuple
protected

Definition at line 92 of file TurnSocket.hxx.

◆ mHaveAllocation

bool reTurn::TurnSocket::mHaveAllocation
protected

Definition at line 112 of file TurnSocket.hxx.

◆ mHmacKey

resip::Data reTurn::TurnSocket::mHmacKey
protected

Definition at line 97 of file TurnSocket.hxx.

◆ mIOService

asio::io_context reTurn::TurnSocket::mIOService
protected

Definition at line 124 of file TurnSocket.hxx.

◆ mLifetime

unsigned int reTurn::TurnSocket::mLifetime
protected

Definition at line 116 of file TurnSocket.hxx.

◆ mLocalBinding

StunTuple reTurn::TurnSocket::mLocalBinding
protected

Definition at line 91 of file TurnSocket.hxx.

◆ mNonce

resip::Data reTurn::TurnSocket::mNonce
protected

Definition at line 99 of file TurnSocket.hxx.

◆ mPassword

resip::Data reTurn::TurnSocket::mPassword
protected

Definition at line 96 of file TurnSocket.hxx.

◆ mReadBuffer

char reTurn::TurnSocket::mReadBuffer[8192]
protected

Definition at line 135 of file TurnSocket.hxx.

◆ mReadErrorCode

asio::error_code reTurn::TurnSocket::mReadErrorCode
protected

Definition at line 129 of file TurnSocket.hxx.

◆ mReadTimer

asio::steady_timer reTurn::TurnSocket::mReadTimer
protected

Definition at line 127 of file TurnSocket.hxx.

◆ mRealm

resip::Data reTurn::TurnSocket::mRealm
protected

Definition at line 98 of file TurnSocket.hxx.

◆ mReceivedWhileWaiting

std::deque<std::vector<char> > reTurn::TurnSocket::mReceivedWhileWaiting
protected

Definition at line 141 of file TurnSocket.hxx.

◆ mReflexiveTuple

StunTuple reTurn::TurnSocket::mReflexiveTuple
protected

Definition at line 115 of file TurnSocket.hxx.

◆ mRelayTuple

StunTuple reTurn::TurnSocket::mRelayTuple
protected

Definition at line 114 of file TurnSocket.hxx.

◆ mRequestedBandwidth

unsigned int reTurn::TurnSocket::mRequestedBandwidth
protected

Definition at line 106 of file TurnSocket.hxx.

◆ mRequestedLifetime

unsigned int reTurn::TurnSocket::mRequestedLifetime
protected

Definition at line 105 of file TurnSocket.hxx.

◆ mRequestedProps

unsigned char reTurn::TurnSocket::mRequestedProps
protected

Definition at line 107 of file TurnSocket.hxx.

◆ mRequestedTransportType

StunTuple::TransportType reTurn::TurnSocket::mRequestedTransportType
protected

Definition at line 109 of file TurnSocket.hxx.

◆ mReservationToken

uint64_t reTurn::TurnSocket::mReservationToken
protected

Definition at line 108 of file TurnSocket.hxx.

◆ mSoftware

resip::Data reTurn::TurnSocket::mSoftware
protected

Definition at line 102 of file TurnSocket.hxx.

◆ mUsername

resip::Data reTurn::TurnSocket::mUsername
protected

Definition at line 95 of file TurnSocket.hxx.

◆ mWriteBuffer

char reTurn::TurnSocket::mWriteBuffer[8192]
protected

Definition at line 136 of file TurnSocket.hxx.

◆ UnspecifiedBandwidth

unsigned int reTurn::TurnSocket::UnspecifiedBandwidth = 0xFFFFFFFF
static

Definition at line 32 of file TurnSocket.hxx.

◆ UnspecifiedIpAddress

asio::ip::address reTurn::TurnSocket::UnspecifiedIpAddress = asio::ip::make_address("0.0.0.0")
static

Definition at line 34 of file TurnSocket.hxx.

◆ UnspecifiedLifetime

unsigned int reTurn::TurnSocket::UnspecifiedLifetime = 0xFFFFFFFF
static

Definition at line 31 of file TurnSocket.hxx.

◆ UnspecifiedToken

unsigned short reTurn::TurnSocket::UnspecifiedToken = 0
static

Definition at line 33 of file TurnSocket.hxx.


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