|
reSIProcate/stack
9694
|
The base class for Transport classes. More...
#include <Transport.hxx>


Classes | |
| class | Exception |
| General exception class for Transport. More... | |
Public Member Functions | |
| Transport (Fifo< TransactionMessage > &rxFifo, const GenericIPAddress &address, const Data &tlsDomain=Data::Empty, AfterSocketCreationFuncPtr socketFunc=0, Compression &compression=Compression::Disabled) | |
| Transport (Fifo< TransactionMessage > &rxFifo, int portNum, IpVersion version, const Data &interfaceObj, const Data &tlsDomain=Data::Empty, AfterSocketCreationFuncPtr socketFunc=0, Compression &compression=Compression::Disabled, unsigned transportFlags=0) | |
| virtual | ~Transport () |
| virtual bool | isFinished () const =0 |
| std::auto_ptr< SendData > | makeSendData (const Tuple &tuple, const Data &data, const Data &tid, const Data &sigcompId=Data::Empty) |
| virtual void | send (std::auto_ptr< SendData > data)=0 |
| virtual void | poke () |
| Called when a writer is done adding messages to the TxFifo; this is used to interrupt the select call if the Transport is running in its own thread. | |
| virtual void | process (FdSet &fdset)=0 |
| If there is work to do, this is the method that does it. | |
| virtual void | buildFdSet (FdSet &fdset)=0 |
| Adds the Transport's socket FD to the appropriate read or write sets as applicable. | |
| virtual unsigned int | getTimeTillNextProcessMS () |
| virtual void | process ()=0 |
| Version of process to be invoked periodically when using callback-based IO (via FdPollGrp). | |
| virtual void | setPollGrp (FdPollGrp *grp)=0 |
| void | flowTerminated (const Tuple &flow) |
| Posts a ConnectionTerminated message to TransactionMessage Fifo. | |
| void | keepAlivePong (const Tuple &flow) |
| void | fail (const Data &tid, TransportFailure::FailureReason reason=TransportFailure::Failure, int subCode=0) |
| Posts a TransportFailure to the TransactionMessage Fifo. | |
| const Data & | interfaceName () const |
| int | port () const |
| bool | isV4 () const |
| IpVersion | ipVersion () const |
| const Data & | tlsDomain () const |
| const sockaddr & | boundInterface () const |
| const Tuple & | getTuple () const |
| virtual TransportType | transport () const =0 |
| virtual bool | isReliable () const =0 |
| virtual bool | isDatagram () const =0 |
| virtual bool | hasSpecificContact () const |
| bool | basicCheck (const SipMessage &msg) |
| Perform basic sanity checks on message. | |
| void | makeFailedResponse (const SipMessage &msg, int responseCode=400, const char *warning=0) |
| std::auto_ptr< SendData > | make503 (SipMessage &msg, UInt16 retryAfter) |
| std::auto_ptr< SendData > | make100 (SipMessage &msg) |
| void | setRemoteSigcompId (SipMessage &msg, Data &id) |
| virtual bool | shareStackProcessAndSelect () const =0 |
| Returns true if this Transport should be included in the FdSet processing loop, false if the Transport will provide its own cycles. | |
| virtual void | startOwnProcessing ()=0 |
| transports that returned false to shareStackProcessAndSelect() shouldn't put messages into the fifo until this is called | |
| virtual bool | hasDataToSend () const =0 |
| only applies to transports that shareStackProcessAndSelect | |
| virtual void | shutdown () |
| This starts shutting-down procedures for this Transport. | |
| bool | operator== (const Transport &rhs) const |
| virtual unsigned int | getFifoSize () const =0 |
| void | callSocketFunc (Socket sock) |
| virtual void | setCongestionManager (CongestionManager *manager) |
| CongestionManager::RejectionBehavior | getRejectionBehaviorForIncoming () const |
| UInt32 | getExpectedWaitForIncoming () const |
| virtual void | pushRxMsgUp (TransactionMessage *msg) |
| virtual void | setRcvBufLen (int buflen) |
| virtual void | setRecordRoute (const NameAddr &recordRoute) |
| virtual bool | hasRecordRoute () const |
| virtual const NameAddr & | getRecordRoute () const |
| unsigned int | getKey () const |
Static Public Member Functions | |
| static void | error (int e) |
| Generates a generic log for the platform specific socket error number. | |
| static void | stampReceived (SipMessage *request) |
Protected Member Functions | |
| void | setKey (unsigned int pKey) |
| void | setTlsDomain (const Data &domain) |
Protected Attributes | |
| Data | mInterface |
| Tuple | mTuple |
| NameAddr | mRecordRoute |
| bool | mHasRecordRoute |
| unsigned int | mKey |
| CongestionManager * | mCongestionManager |
| ProducerFifoBuffer < TransactionMessage > | mStateMachineFifo |
| bool | mShuttingDown |
| AfterSocketCreationFuncPtr | mSocketFunc |
| Compression & | mCompression |
| unsigned | mTransportFlags |
Private Attributes | |
| Data | mTlsDomain |
Static Private Attributes | |
| static const Data | transportNames [MAX_TRANSPORT] |
Friends | |
| class | TransportSelector |
| EncodeStream & | operator<< (EncodeStream &strm, const Transport &rhs) |
The base class for Transport classes.
A Transport presents layer 4 of the OSI model, the transport layer. For IP-based protocols, this means that a Transport object has an IP address (v4 or v6), a transport layer protocol (UDP or TCP/TLS), and a port number. These are managed through the Transport's Tuple member.
Definition at line 72 of file Transport.hxx.
| Transport::Transport | ( | Fifo< TransactionMessage > & | rxFifo, |
| const GenericIPAddress & | address, | ||
| const Data & | tlsDomain = Data::Empty, |
||
| AfterSocketCreationFuncPtr | socketFunc = 0, |
||
| Compression & | compression = Compression::Disabled |
||
| ) |
| rxFifo | the TransactionMessage Fifo that will receive any ConnectionTerminated or TransportFailure messages. |
| tlsDomain | the domain name of the Transport |
| socketFunc | subclassers can call this function after the socket is created. This is not currently used by Transport. |
Definition at line 35 of file Transport.cxx.
References resip::Tuple::inet_ntop(), mInterface, and mTuple.
: mTuple(address), mHasRecordRoute(false), mKey(0), mCongestionManager(0), mStateMachineFifo(rxFifo, 8), mShuttingDown(false), mTlsDomain(tlsDomain), mSocketFunc(socketFunc), mCompression(compression), mTransportFlags(0) { mInterface = Tuple::inet_ntop(mTuple); }

| Transport::Transport | ( | Fifo< TransactionMessage > & | rxFifo, |
| int | portNum, | ||
| IpVersion | version, | ||
| const Data & | interfaceObj, | ||
| const Data & | tlsDomain = Data::Empty, |
||
| AfterSocketCreationFuncPtr | socketFunc = 0, |
||
| Compression & | compression = Compression::Disabled, |
||
| unsigned | transportFlags = 0 |
||
| ) |
| rxFifo | the TransactionMessage Fifo that will receive any ConnectionTerminated or TransportFailure messages. |
| interfaceObj | a "presentation format" representation of the IP address of this transport |
| portNum | is the port to receive and/or send on |
| tlsDomain | the domain name of the Transport |
| socketFunc | subclassers can call this function after the socket is created. This is not currently used by Transport. |
Definition at line 54 of file Transport.cxx.
: mInterface(intfc), mTuple(intfc, portNum, version), mHasRecordRoute(false), mKey(0), mCongestionManager(0), mStateMachineFifo(rxFifo,8), mShuttingDown(false), mTlsDomain(tlsDomain), mSocketFunc(socketFunc), mCompression(compression), mTransportFlags(transportFlags) { }
| Transport::~Transport | ( | ) | [virtual] |
Definition at line 76 of file Transport.cxx.
{
}
| bool Transport::basicCheck | ( | const SipMessage & | msg | ) |
Perform basic sanity checks on message.
Return false if there is a problem eg) no Vias.
Definition at line 388 of file Transport.cxx.
References resip::Message::brief(), resip::Data::c_str(), InfoLog, resip::SipMessage::isExternal(), resip::SipMessage::isRequest(), makeFailedResponse(), resip::SipMessage::method(), mShuttingDown, and resip::Helper::validateMessage().
Referenced by resip::UdpTransport::processRxParse().
{
resip::Data reason;
if (msg.isExternal())
{
try
{
if (!Helper::validateMessage(msg,&reason))
{
InfoLog(<<"Message Failed basicCheck :" << msg.brief());
if (msg.isRequest() && msg.method()!=ACK )
{
// this is VERY low-level b/c we don't have a transaction...
// here we make a response to warn the offending party.
makeFailedResponse(msg,400,reason.c_str());
}
return false;
}
else if (mShuttingDown && msg.isRequest() && msg.method() != ACK)
{
InfoLog (<< "Server has been shutdown, reject message with 503");
// this is VERY low-level b/c we don't have a transaction...
// here we make a response to warn the offending party.
makeFailedResponse(msg, 503, "Server has been shutdown");
return false;
}
}
catch (BaseException& e)
{
InfoLog (<< "Cannot make failure response to badly constructed message: " << e);
return false;
}
}
return true;
}

| const sockaddr& resip::Transport::boundInterface | ( | ) | const [inline] |
Definition at line 239 of file Transport.hxx.
References resip::Tuple::getSockaddr(), and mTuple.
Referenced by operator==(), and resip::UdpTransport::processRxParse().
{ return mTuple.getSockaddr(); }

| virtual void resip::Transport::buildFdSet | ( | FdSet & | fdset | ) | [pure virtual] |
Adds the Transport's socket FD to the appropriate read or write sets as applicable.
Implements resip::FdSetIOObserver.
Implemented in resip::UdpTransport, FakeTransport, and resip::TcpBaseTransport.
| void Transport::callSocketFunc | ( | Socket | sock | ) |
Definition at line 425 of file Transport.cxx.
References mSocketFunc, and transport().
Referenced by resip::Connection::performWrite().
{
if (mSocketFunc)
{
mSocketFunc(sock, transport(), __FILE__, __LINE__);
}
}

| void Transport::error | ( | int | e | ) | [static] |
Generates a generic log for the platform specific socket error number.
| e | the socket error number |
Definition at line 81 of file Transport.cxx.
References DebugLog, InfoLog, strerror(), and WSANOTINITIALISED.
Referenced by resip::InternalTransport::bind(), resip::TlsConnection::checkState(), resip::DateCategory::DateCategory(), resip::TransportSelector::determineSourceInterface(), resip::TransportSelector::getFirstInterface(), resip::TcpBaseTransport::init(), resip::TcpBaseTransport::makeOutgoingConnection(), resip::TcpBaseTransport::processListen(), resip::UdpTransport::processRxRecv(), resip::UdpTransport::processTxOne(), and resip::DateCategory::setDatetime().
{
switch (e)
{
case EAGAIN:
//InfoLog (<< "No data ready to read" << strerror(e));
break;
case EINTR:
InfoLog (<< "The call was interrupted by a signal before any data was read : " << strerror(e));
break;
case EIO:
InfoLog (<< "I/O error : " << strerror(e));
break;
case EBADF:
InfoLog (<< "fd is not a valid file descriptor or is not open for reading : " << strerror(e));
break;
case EINVAL:
InfoLog (<< "fd is attached to an object which is unsuitable for reading : " << strerror(e));
break;
case EFAULT:
InfoLog (<< "buf is outside your accessible address space : " << strerror(e));
break;
#if defined(WIN32)
case WSAENETDOWN:
InfoLog (<<" The network subsystem has failed. ");
break;
case WSAEFAULT:
InfoLog (<<" The buf or from parameters are not part of the user address space, "
"or the fromlen parameter is too small to accommodate the peer address. ");
break;
case WSAEINTR:
InfoLog (<<" The (blocking) call was canceled through WSACancelBlockingCall. ");
break;
case WSAEINPROGRESS:
InfoLog (<<" A blocking Windows Sockets 1.1 call is in progress, or the "
"service provider is still processing a callback function. ");
break;
case WSAEINVAL:
InfoLog (<<" The socket has not been bound with bind, or an unknown flag was specified, "
"or MSG_OOB was specified for a socket with SO_OOBINLINE enabled, "
"or (for byte stream-style sockets only) len was zero or negative. ");
break;
case WSAEISCONN :
InfoLog (<<"The socket is connected. This function is not permitted with a connected socket, "
"whether the socket is connection-oriented or connectionless. ");
break;
case WSAENETRESET:
InfoLog (<<" The connection has been broken due to the keep-alive activity "
"detecting a failure while the operation was in progress. ");
break;
case WSAENOTSOCK :
InfoLog (<<"The descriptor is not a socket. ");
break;
case WSAEOPNOTSUPP:
InfoLog (<<" MSG_OOB was specified, but the socket is not stream-style such as type "
"SOCK_STREAM, OOB data is not supported in the communication domain associated with this socket, "
"or the socket is unidirectional and supports only send operations. ");
break;
case WSAESHUTDOWN:
InfoLog (<<"The socket has been shut down; it is not possible to recvfrom on a socket after "
"shutdown has been invoked with how set to SD_RECEIVE or SD_BOTH. ");
break;
case WSAEMSGSIZE:
InfoLog (<<" The message was too large to fit into the specified buffer and was truncated. ");
break;
case WSAETIMEDOUT:
InfoLog (<<" The connection has been dropped, because of a network failure or because the "
"system on the other end went down without notice. ");
break;
case WSAECONNRESET :
InfoLog (<<"Connection reset ");
break;
case WSAEWOULDBLOCK:
DebugLog (<<"Would Block ");
break;
case WSAEHOSTUNREACH:
InfoLog (<<"A socket operation was attempted to an unreachable host ");
break;
case WSANOTINITIALISED:
InfoLog (<<"Either the application has not called WSAStartup or WSAStartup failed. "
"The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks),"
"or WSACleanup has been called too many times. ");
break;
case WSAEACCES:
InfoLog (<<"An attempt was made to access a socket in a way forbidden by its access permissions ");
break;
case WSAENOBUFS:
InfoLog (<<"An operation on a socket could not be performed because the system lacked sufficient "
"buffer space or because a queue was full");
break;
case WSAENOTCONN:
InfoLog (<<"A request to send or receive data was disallowed because the socket is not connected "
"and (when sending on a datagram socket using sendto) no address was supplied");
break;
case WSAECONNABORTED:
InfoLog (<<"An established connection was aborted by the software in your host computer, possibly "
"due to a data transmission time-out or protocol error");
break;
case WSAEADDRNOTAVAIL:
InfoLog (<<"The requested address is not valid in its context. This normally results from an attempt to "
"bind to an address that is not valid for the local computer");
break;
case WSAEAFNOSUPPORT:
InfoLog (<<"An address incompatible with the requested protocol was used");
break;
case WSAEDESTADDRREQ:
InfoLog (<<"A required address was omitted from an operation on a socket");
break;
case WSAENETUNREACH:
InfoLog (<<"A socket operation was attempted to an unreachable network");
break;
#endif
default:
InfoLog (<< "Some other error (" << e << "): " << strerror(e));
break;
}
}

| void Transport::fail | ( | const Data & | tid, |
| TransportFailure::FailureReason | reason = TransportFailure::Failure, |
||
| int | subCode = 0 |
||
| ) |
Posts a TransportFailure to the TransactionMessage Fifo.
Definition at line 217 of file Transport.cxx.
References resip::ProducerFifoBuffer< class >::add(), resip::Data::empty(), and mStateMachineFifo.
Referenced by resip::TcpBaseTransport::processAllWriteRequests(), resip::UdpTransport::processTxOne(), resip::ConnectionBase::~ConnectionBase(), and resip::TcpBaseTransport::~TcpBaseTransport().
{
if (!tid.empty())
{
mStateMachineFifo.add(new TransportFailure(tid, reason, subCode));
}
}

| void Transport::flowTerminated | ( | const Tuple & | flow | ) |
Posts a ConnectionTerminated message to TransactionMessage Fifo.
Definition at line 205 of file Transport.cxx.
References resip::ProducerFifoBuffer< class >::add(), and mStateMachineFifo.
Referenced by resip::ConnectionBase::~ConnectionBase().
{
mStateMachineFifo.add(new ConnectionTerminated(flow));
}

| UInt32 resip::Transport::getExpectedWaitForIncoming | ( | ) | const [inline] |
Definition at line 339 of file Transport.hxx.
References resip::AbstractFifo< T >::expectedWaitTimeMilliSec(), resip::ProducerFifoBuffer< class >::getFifo(), and mStateMachineFifo.
Referenced by resip::ConnectionBase::preparseNewBytes(), and resip::UdpTransport::processRxParse().
{
return (UInt32)mStateMachineFifo.getFifo().expectedWaitTimeMilliSec()/1000;
}

| virtual unsigned int resip::Transport::getFifoSize | ( | ) | const [pure virtual] |
Implemented in resip::InternalTransport, and FakeTransport.
| unsigned int resip::Transport::getKey | ( | ) | const [inline] |
Definition at line 355 of file Transport.hxx.
References mKey.
Referenced by resip::ConnectionBase::ConnectionBase(), resip::UdpTransport::processRxParse(), and resip::TransportSelector::transmit().
{return mKey;}
| virtual const NameAddr& resip::Transport::getRecordRoute | ( | ) | const [inline, virtual] |
Definition at line 353 of file Transport.hxx.
References mHasRecordRoute, and mRecordRoute.
{ assert(mHasRecordRoute); return mRecordRoute; }
| CongestionManager::RejectionBehavior resip::Transport::getRejectionBehaviorForIncoming | ( | ) | const [inline] |
Definition at line 330 of file Transport.hxx.
References resip::ProducerFifoBuffer< class >::getFifo(), resip::CongestionManager::getRejectionBehavior(), mCongestionManager, mStateMachineFifo, and resip::CongestionManager::NORMAL.
Referenced by resip::ConnectionBase::preparseNewBytes(), and resip::UdpTransport::processRxParse().
{
if(mCongestionManager)
{
return mCongestionManager->getRejectionBehavior(&mStateMachineFifo.getFifo());
}
return CongestionManager::NORMAL;
}

| virtual unsigned int resip::Transport::getTimeTillNextProcessMS | ( | ) | [inline, virtual] |
| const Tuple& resip::Transport::getTuple | ( | ) | const [inline] |
Definition at line 240 of file Transport.hxx.
References mTuple.
Referenced by resip::TransportSelector::addTransportInternal(), main(), and resip::TransportSelector::transmit().
{ return mTuple; }
| virtual bool resip::Transport::hasDataToSend | ( | ) | const [pure virtual] |
only applies to transports that shareStackProcessAndSelect
Implemented in resip::UdpTransport, FakeTransport, and resip::InternalTransport.
| virtual bool resip::Transport::hasRecordRoute | ( | ) | const [inline, virtual] |
Definition at line 352 of file Transport.hxx.
References mHasRecordRoute.
{ return mHasRecordRoute; }
| virtual bool resip::Transport::hasSpecificContact | ( | ) | const [inline, virtual] |
Definition at line 251 of file Transport.hxx.
Referenced by resip::TransportSelector::addTransportInternal(), and resip::TransportSelector::transmit().
{ return false; }
| const Data& resip::Transport::interfaceName | ( | ) | const [inline] |
Definition at line 224 of file Transport.hxx.
References mInterface.
Referenced by resip::TransportSelector::addTransportInternal(), and resip::TransportSelector::transmit().
{ return mInterface; }
| IpVersion resip::Transport::ipVersion | ( | ) | const [inline] |
Definition at line 231 of file Transport.hxx.
References resip::Tuple::ipVersion(), and mTuple.
Referenced by resip::TransportSelector::addTransportInternal(), resip::TcpBaseTransport::makeOutgoingConnection(), and resip::UdpTransport::processRxParse().
{ return mTuple.ipVersion(); }

| virtual bool resip::Transport::isDatagram | ( | ) | const [pure virtual] |
Implemented in resip::UdpTransport, FakeTransport, and resip::TcpBaseTransport.
| virtual bool resip::Transport::isFinished | ( | ) | const [pure virtual] |
Implemented in resip::InternalTransport, and FakeTransport.
| virtual bool resip::Transport::isReliable | ( | ) | const [pure virtual] |
Implemented in resip::UdpTransport, FakeTransport, and resip::TcpBaseTransport.
| bool resip::Transport::isV4 | ( | ) | const [inline] |
Definition at line 229 of file Transport.hxx.
References resip::Tuple::isV4(), and mTuple.
Referenced by operator==().
{ return mTuple.isV4(); } // !dcm! -- deprecate ASAP

| void Transport::keepAlivePong | ( | const Tuple & | flow | ) |
Definition at line 211 of file Transport.cxx.
References resip::ProducerFifoBuffer< class >::add(), and mStateMachineFifo.
Referenced by resip::Connection::onSingleCRLF().
{
mStateMachineFifo.add(new KeepAlivePong(flow));
}

| std::auto_ptr< SendData > Transport::make100 | ( | SipMessage & | msg | ) |
Definition at line 298 of file Transport.cxx.
References dest, resip::Data::Empty, resip::SipMessage::getSource(), resip::SipMessage::isResponse(), resip::Helper::makeRawResponse(), makeSendData(), resip::SipMessage::method(), and setRemoteSigcompId().
{
std::auto_ptr<SendData> result;
if (msg.isResponse()) return result;
try
{
if(msg.method()==ACK)
{
return result;
}
}
catch(BaseException&)
{
// .bwc. Parse failed on the start-line. Stop.
return result;
}
const Tuple& dest = msg.getSource();
// Calculate compartment ID for outbound message
Data remoteSigcompId;
setRemoteSigcompId(msg,remoteSigcompId);
// .bwc. msg is completely unverified. Handle with caution.
result=makeSendData(dest, Data::Empty, Data::Empty, remoteSigcompId);
Helper::makeRawResponse(result->data, msg, 100);
return result;
}

| std::auto_ptr< SendData > Transport::make503 | ( | SipMessage & | msg, |
| UInt16 | retryAfter | ||
| ) |
Definition at line 264 of file Transport.cxx.
References dest, resip::Data::Empty, resip::SipMessage::getSource(), resip::SipMessage::isResponse(), resip::Helper::makeRawResponse(), makeSendData(), resip::SipMessage::method(), setRemoteSigcompId(), and value.
Referenced by resip::ConnectionBase::preparseNewBytes(), and resip::UdpTransport::processRxParse().
{
std::auto_ptr<SendData> result;
if (msg.isResponse()) return result;
try
{
if(msg.method()==ACK)
{
return result;
}
}
catch(BaseException&)
{
// .bwc. Parse failed on the start-line. Stop.
return result;
}
const Tuple& dest = msg.getSource();
// Calculate compartment ID for outbound message
Data remoteSigcompId;
setRemoteSigcompId(msg,remoteSigcompId);
// .bwc. msg is completely unverified. Handle with caution.
result=makeSendData(dest, Data::Empty, Data::Empty, remoteSigcompId);
static const Data retryAfterHeader("Retry-After: ");
Data value(retryAfter);
Helper::makeRawResponse(result->data, msg, 503, retryAfterHeader+value+"\r\n");
return result;
}

| void Transport::makeFailedResponse | ( | const SipMessage & | msg, |
| int | responseCode = 400, |
||
| const char * | warning = 0 |
||
| ) |
Definition at line 234 of file Transport.cxx.
References resip::Data::clear(), dest, resip::Data::Empty, resip::Data::empty(), resip::SipMessage::getSource(), InfoLog, resip::SipMessage::isResponse(), resip::Helper::makeResponse(), makeSendData(), send(), and setRemoteSigcompId().
Referenced by basicCheck().
{
if (msg.isResponse()) return;
const Tuple& dest = msg.getSource();
std::auto_ptr<SipMessage> errMsg(Helper::makeResponse(msg,
responseCode,
warning ? warning : "Original request had no Vias"));
// make send data here w/ blank tid and blast it out.
// encode message
Data encoded;
encoded.clear();
DataStream encodeStream(encoded);
errMsg->encode(encodeStream);
encodeStream.flush();
assert(!encoded.empty());
InfoLog(<<"Sending response directly to " << dest << " : " << errMsg->brief() );
// Calculate compartment ID for outbound message
Data remoteSigcompId;
setRemoteSigcompId(*errMsg,remoteSigcompId);
send(std::auto_ptr<SendData>(makeSendData(dest, encoded, Data::Empty, remoteSigcompId)));
}

| std::auto_ptr< SendData > Transport::makeSendData | ( | const Tuple & | tuple, |
| const Data & | data, | ||
| const Data & | tid, | ||
| const Data & | sigcompId = Data::Empty |
||
| ) |
Definition at line 226 of file Transport.cxx.
References resip::Tuple::getPort().
Referenced by main(), make100(), make503(), and makeFailedResponse().
{
assert(dest.getPort() != -1);
std::auto_ptr<SendData> data(new SendData(dest, d, tid, sigcompId));
return data;
}

| bool Transport::operator== | ( | const Transport & | rhs | ) | const |
Definition at line 441 of file Transport.cxx.
References boundInterface(), resip::Tuple::isV4(), isV4(), resip::Tuple::length(), mTuple, and port().
{
return ( ( mTuple.isV4() == rhs.isV4()) &&
( port() == rhs.port()) &&
( memcmp(&boundInterface(),&rhs.boundInterface(),mTuple.length()) == 0) );
}

| virtual void resip::Transport::poke | ( | ) | [inline, virtual] |
Called when a writer is done adding messages to the TxFifo; this is used to interrupt the select call if the Transport is running in its own thread.
This does nothing if select is not currently blocking, so don't bother calling this from the same thread that selects on this Transport's fds. Default impl is a no-op.
Reimplemented in resip::InternalTransport.
Definition at line 166 of file Transport.hxx.
{};
| int resip::Transport::port | ( | ) | const [inline] |
Definition at line 226 of file Transport.hxx.
References resip::Tuple::getPort(), and mTuple.
Referenced by resip::TransportSelector::addTransportInternal(), resip::InternalTransport::bind(), resip::TransportSelector::findTransportByVia(), main(), operator==(), Loadgen::Transceiver::send(), TestTransportSelector::testExact(), TestTransportSelector::testExact2(), TestTransportSelector::testExactAnyPort(), Loadgen::Transceiver::Transceiver(), and resip::TransportSelector::transmit().
{ return mTuple.getPort(); }

| virtual void resip::Transport::process | ( | FdSet & | fdset | ) | [pure virtual] |
If there is work to do, this is the method that does it.
If the socket is readable, it is read. If the socket is writable and there are outgoing messages to be sent, they are sent.
Incoming messages are parsed and dispatched to the relevant entity. SIP messages will be posted to the TransactionMessage Fifo.
| fdset | is the FdSet after select() has been called. |
Implements resip::FdSetIOObserver.
Implemented in resip::UdpTransport, FakeTransport, and resip::TcpBaseTransport.
Referenced by resip::TransportThread::thread().
| virtual void resip::Transport::process | ( | ) | [pure virtual] |
Version of process to be invoked periodically when using callback-based IO (via FdPollGrp).
Implemented in resip::UdpTransport, FakeTransport, and resip::TcpBaseTransport.
| void Transport::pushRxMsgUp | ( | TransactionMessage * | msg | ) | [virtual] |
Definition at line 434 of file Transport.cxx.
References resip::ProducerFifoBuffer< class >::add(), and mStateMachineFifo.
Referenced by resip::ConnectionBase::preparseNewBytes().
{
mStateMachineFifo.add(msg);
}

| virtual void resip::Transport::send | ( | std::auto_ptr< SendData > | data | ) | [pure virtual] |
It might make a copy, or send synchronously, or convert to another type, etc.
Implemented in resip::InternalTransport, and FakeTransport.
Referenced by resip::TransportSelector::closeConnection(), resip::TransportSelector::enableFlowTimer(), makeFailedResponse(), resip::ConnectionBase::preparseNewBytes(), resip::TransportSelector::retransmit(), and resip::TransportSelector::transmit().
| virtual void resip::Transport::setCongestionManager | ( | CongestionManager * | manager | ) | [inline, virtual] |
Reimplemented in resip::InternalTransport.
Definition at line 325 of file Transport.hxx.
References mCongestionManager.
{
mCongestionManager=manager;
}
| void resip::Transport::setKey | ( | unsigned int | pKey | ) | [inline, protected] |
Definition at line 359 of file Transport.hxx.
References mKey.
Referenced by resip::TransportSelector::addTransportInternal().
{ mKey = pKey;}
| virtual void resip::Transport::setPollGrp | ( | FdPollGrp * | grp | ) | [pure virtual] |
| virtual void resip::Transport::setRcvBufLen | ( | int | buflen | ) | [inline, virtual] |
Reimplemented in resip::UdpTransport, and resip::TcpBaseTransport.
Definition at line 348 of file Transport.hxx.
{ }; // make pure?
| virtual void resip::Transport::setRecordRoute | ( | const NameAddr & | recordRoute | ) | [inline, virtual] |
Definition at line 351 of file Transport.hxx.
References mHasRecordRoute, and mRecordRoute.
{ mRecordRoute = recordRoute; mHasRecordRoute = true; }
| void Transport::setRemoteSigcompId | ( | SipMessage & | msg, |
| Data & | id | ||
| ) |
Definition at line 330 of file Transport.cxx.
References resip::SipMessage::const_header(), resip::Compression::isEnabled(), and mCompression.
Referenced by make100(), make503(), and makeFailedResponse().
{
if (mCompression.isEnabled())
{
try
{
const Via &topVia(msg.const_header(h_Vias).front());
if(topVia.exists(p_comp) && topVia.param(p_comp) == "sigcomp")
{
if (topVia.exists(p_sigcompId))
{
remoteSigcompId = topVia.param(p_sigcompId);
}
else
{
// XXX rohc-sigcomp-sip-03 says "sent-by",
// but this should probably be "received" if present,
// and "sent-by" otherwise.
// XXX Also, the spec is ambiguous about whether
// to include the port in this identifier.
remoteSigcompId = topVia.sentHost();
}
}
}
catch(BaseException&)
{
// ?bwc? Couldn't grab sigcomp compartment id. We don't even know if
// the initial request was using sigcomp or not.
// What should we do here?
}
}
}

| void resip::Transport::setTlsDomain | ( | const Data & | domain | ) | [inline, protected] |
| virtual bool resip::Transport::shareStackProcessAndSelect | ( | ) | const [pure virtual] |
Returns true if this Transport should be included in the FdSet processing loop, false if the Transport will provide its own cycles.
If the Transport is going to provide its own cycles, the startOwnProcessing() and shutdown() will be called to tell the Transport when to process.
| true | will run in the SipStack's processing context |
| false | provides own cycles, just puts messages in rxFifo |
Implemented in resip::InternalTransport, and FakeTransport.
Referenced by resip::TransportSelector::addTransportInternal().
| virtual void resip::Transport::shutdown | ( | ) | [inline, virtual] |
This starts shutting-down procedures for this Transport.
New requests may be denied while "mShuttingDown" is true.
Overriding implementations should chain through to this.
Definition at line 310 of file Transport.hxx.
References mShuttingDown.
{
// !jf! should use the fifo to pass this in
mShuttingDown = true;
}
| void Transport::stampReceived | ( | SipMessage * | request | ) | [static] |
Definition at line 365 of file Transport.cxx.
References resip::SipMessage::const_header(), DebugLog, resip::SipMessage::exists(), resip::Tuple::getPort(), resip::SipMessage::getSource(), resip::SipMessage::header(), resip::Tuple::inet_ntop(), resip::SipMessage::isRequest(), received, and StackLog.
Referenced by resip::ConnectionBase::preparseNewBytes(), and resip::UdpTransport::processRxParse().
{
// set the received= and rport= parameters in the message if necessary !jf!
if (message->isRequest() && message->exists(h_Vias) && !message->const_header(h_Vias).empty())
{
const Tuple& tuple = message->getSource();
Data received = Tuple::inet_ntop(tuple);
if(message->const_header(h_Vias).front().sentHost() != received) // only add if received address is different from sent-by in Via
{
message->header(h_Vias).front().param(p_received) = received;
}
//message->header(h_Vias).front().param(p_received) = Tuple::inet_ntop(tuple);
if (message->const_header(h_Vias).front().exists(p_rport))
{
message->header(h_Vias).front().param(p_rport).port() = tuple.getPort();
}
}
DebugLog (<< "incoming from: " << message->getSource());
StackLog (<< endl << endl << *message);
}

| virtual void resip::Transport::startOwnProcessing | ( | ) | [pure virtual] |
transports that returned false to shareStackProcessAndSelect() shouldn't put messages into the fifo until this is called
Implemented in resip::InternalTransport, and FakeTransport.
| const Data& resip::Transport::tlsDomain | ( | ) | const [inline] |
Definition at line 238 of file Transport.hxx.
References mTlsDomain.
Referenced by resip::TransportSelector::addTransportInternal(), and resip::ConnectionBase::preparseNewBytes().
{ return mTlsDomain; }
| virtual TransportType resip::Transport::transport | ( | ) | const [pure virtual] |
Implemented in resip::UdpTransport, resip::TlsTransport, FakeTransport, and resip::TcpTransport.
Referenced by resip::TransportSelector::addTransportInternal(), resip::InternalTransport::bind(), callSocketFunc(), resip::TcpBaseTransport::makeOutgoingConnection(), resip::TcpBaseTransport::processListen(), and resip::TransportSelector::transmit().
| EncodeStream& operator<< | ( | EncodeStream & | strm, |
| const Transport & | rhs | ||
| ) | [friend] |
friend class TransportSelector [friend] |
Definition at line 358 of file Transport.hxx.
Compression& resip::Transport::mCompression [protected] |
Definition at line 379 of file Transport.hxx.
Referenced by resip::TcpTransport::createConnection(), resip::UdpTransport::processRxParse(), setRemoteSigcompId(), and resip::UdpTransport::UdpTransport().
CongestionManager* resip::Transport::mCongestionManager [protected] |
Definition at line 367 of file Transport.hxx.
Referenced by getRejectionBehaviorForIncoming(), resip::InternalTransport::setCongestionManager(), and setCongestionManager().
bool resip::Transport::mHasRecordRoute [protected] |
Definition at line 364 of file Transport.hxx.
Referenced by getRecordRoute(), hasRecordRoute(), and setRecordRoute().
Data resip::Transport::mInterface [protected] |
Definition at line 361 of file Transport.hxx.
Referenced by interfaceName(), and Transport().
unsigned int resip::Transport::mKey [protected] |
Definition at line 365 of file Transport.hxx.
NameAddr resip::Transport::mRecordRoute [protected] |
Definition at line 363 of file Transport.hxx.
Referenced by getRecordRoute(), and setRecordRoute().
bool resip::Transport::mShuttingDown [protected] |
Definition at line 369 of file Transport.hxx.
Referenced by basicCheck(), and shutdown().
Definition at line 378 of file Transport.hxx.
Referenced by resip::InternalTransport::bind(), callSocketFunc(), resip::TcpBaseTransport::makeOutgoingConnection(), and resip::TcpBaseTransport::processListen().
Definition at line 368 of file Transport.hxx.
Referenced by fail(), flowTerminated(), getExpectedWaitForIncoming(), getRejectionBehaviorForIncoming(), keepAlivePong(), resip::TcpBaseTransport::process(), resip::UdpTransport::process(), resip::UdpTransport::processRxParse(), and pushRxMsgUp().
Data resip::Transport::mTlsDomain [private] |
Definition at line 376 of file Transport.hxx.
Referenced by setTlsDomain(), and tlsDomain().
unsigned resip::Transport::mTransportFlags [protected] |
Definition at line 380 of file Transport.hxx.
Referenced by resip::TcpBaseTransport::init(), resip::UdpTransport::process(), resip::UdpTransport::processRxAll(), resip::UdpTransport::processTxAll(), resip::InternalTransport::shareStackProcessAndSelect(), resip::TcpBaseTransport::TcpBaseTransport(), and resip::UdpTransport::~UdpTransport().
Tuple resip::Transport::mTuple [protected] |
Definition at line 362 of file Transport.hxx.
Referenced by resip::InternalTransport::bind(), boundInterface(), getTuple(), ipVersion(), isV4(), operator==(), port(), resip::TcpBaseTransport::processListen(), resip::UdpTransport::processRxAll(), resip::UdpTransport::processRxParse(), resip::TcpTransport::TcpTransport(), Transport(), resip::UdpTransport::UdpTransport(), resip::TcpBaseTransport::~TcpBaseTransport(), and resip::UdpTransport::~UdpTransport().
const Data resip::Transport::transportNames[MAX_TRANSPORT] [static, private] |
Definition at line 373 of file Transport.hxx.
1.7.5.1