#include <transports.h>
Inheritance diagram for H323Transport:

Operations | |
| enum | { UseLocalTSAP = 0x10001, UseRemoteTSAP } |
| enum | PromisciousModes { AcceptFromRemoteOnly, AcceptFromAnyAutoSet, AcceptFromAny, AcceptFromLastReceivedOnly, NumPromisciousModes } |
| Promiscious modes for transport. More... | |
| virtual H323TransportAddress | GetLocalAddress () const=0 |
| virtual H323TransportAddress | GetRemoteAddress () const=0 |
| virtual BOOL | SetRemoteAddress (const H323TransportAddress &address)=0 |
| virtual BOOL | Connect ()=0 |
| BOOL | ConnectTo (const H323TransportAddress &address) |
| virtual BOOL | Close () |
| virtual BOOL | IsCompatibleTransport (const H225_TransportAddress &pdu) const |
| virtual void | SetUpTransportPDU (H225_TransportAddress &pdu, BOOL localTsap, H323Connection *connection=NULL) const |
| virtual void | SetUpTransportPDU (H245_TransportAddress &pdu, unsigned tsap) const |
| virtual void | SetPromiscuous (PromisciousModes promiscuous) |
| virtual H323TransportAddress | GetLastReceivedAddress () const |
| virtual BOOL | ReadPDU (PBYTEArray &pdu)=0 |
| virtual BOOL | ExtractPDU (const PBYTEArray &pdu, PINDEX &len)=0 |
| virtual BOOL | WritePDU (const PBYTEArray &pdu)=0 |
Public Member Functions | |
Construction | |
| H323Transport (H323EndPoint &endpoint) | |
| ~H323Transport () | |
Overrides from PObject | |
| virtual void | PrintOn (ostream &strm) const |
Signalling Channel | |
| BOOL | HandleSignallingSocket (H323SignalPDU &pdu) |
| BOOL | HandleFirstSignallingChannelPDU () |
Control Channel | |
| virtual H323Transport * | CreateControlChannel (H323Connection &connection) |
| virtual BOOL | AcceptControlChannel (H323Connection &connection) |
| virtual void | StartControlChannel (H323Connection &connection) |
RAS Channel | |
| virtual BOOL | DiscoverGatekeeper (H323Gatekeeper &gk, H323RasPDU &pdu, const H323TransportAddress &address) |
Member variable access | |
| H323EndPoint & | GetEndPoint () const |
| void | AttachThread (PThread *thread) |
| void | CleanUpOnTermination () |
Protected Attributes | |
| H323EndPoint & | endpoint |
| PThread * | thread |
| Endpoint that owns the listener. | |
| BOOL | canGetInterface |
| Thread handling the transport. | |
Definition at line 454 of file transports.h.
| anonymous enum |
Promiscious modes for transport.
| AcceptFromRemoteOnly | |
| AcceptFromAnyAutoSet | |
| AcceptFromAny | |
| AcceptFromLastReceivedOnly | |
| NumPromisciousModes |
Definition at line 536 of file transports.h.
| H323Transport::H323Transport | ( | H323EndPoint & | endpoint | ) |
Create a new transport channel.
Definition at line 1188 of file transports.cxx.
References canGetInterface, and thread.
| virtual H323TransportAddress H323Transport::GetLocalAddress | ( | ) | const [pure virtual] |
Get the transport address of the local endpoint.
Implemented in H323TransportIP, and H323TransportUDP.
Referenced by H323DataChannel::CreateListener(), H323_T38Channel::CreateTransport(), H323DataChannel::CreateTransport(), H323Transactor::GetInterfaceAddresses(), H323_RTP_UDP::H323_RTP_UDP(), H323Connection::HandleControlData(), H323Gatekeeper::MakeRequest(), H323GatekeeperListener::OnDiscovery(), H4502Handler::OnReceivedCallTransferIdentify(), H323Connection::OnReceivedFacility(), H323_T120Channel::OnReceivedPDU(), PrintOn(), H323SignalPDU::ProcessReadData(), H323TransactionPDU::Read(), H323Transactor::SetTransport(), H323ListenerTCP::SetUpTransportPDU(), H323EndPoint::UseGatekeeper(), H323TransactionPDU::Write(), H323SignalPDU::Write(), and H323Connection::WriteControlPDU().
| virtual H323TransportAddress H323Transport::GetRemoteAddress | ( | ) | const [pure virtual] |
Get the transport address of the remote endpoint.
Implemented in H323TransportIP.
Referenced by H323EndPoint::BuildConnectionToken(), GetLastReceivedAddress(), H323SignalPDU::GetSourceAliases(), H323_RTP_UDP::H323_RTP_UDP(), H323Connection::HandleControlData(), H323EndPoint::InternalMakeCall(), H323Gatekeeper::MakeRequest(), H323_T120Channel::OnReceivedPDU(), H323Connection::OnReceivedSignalSetup(), H323Gatekeeper::OnReceiveInfoRequest(), PrintOn(), H323Transactor::PrintOn(), H323SignalPDU::ProcessReadData(), H323Gatekeeper::RegistrationRequest(), H323Transactor::Response::SendCachedResponse(), H323Gatekeeper::SetAlternates(), H323Connection::SetRemotePartyInfo(), H323EndPoint::UseGatekeeper(), H323TransactionPDU::Write(), H323SignalPDU::Write(), H323Connection::WriteControlPDU(), and H323Transactor::WriteTo().
| virtual BOOL H323Transport::SetRemoteAddress | ( | const H323TransportAddress & | address | ) | [pure virtual] |
Set remote address to connect to. Note that this does not necessarily initiate a transport level connection, but only indicates where to connect to. The actual connection is made by the Connect() function.
Implemented in H323TransportTCP, and H323TransportUDP.
Referenced by H323Gatekeeper::Connect(), ConnectTo(), H323Gatekeeper::MakeRequest(), H323Gatekeeper::OnReceiveGatekeeperConfirm(), H323Gatekeeper::RegistrationRequest(), H323Connection::SendSignalSetup(), H323Connection::StartControlChannel(), and H323Gatekeeper::StartDiscovery().
| virtual BOOL H323Transport::Connect | ( | ) | [pure virtual] |
Connect to the remote address.
Implemented in H323TransportTCP, and H323TransportUDP.
Referenced by H323Gatekeeper::Connect(), ConnectTo(), H323Gatekeeper::MakeRequest(), H323Connection::SendSignalSetup(), H323Connection::StartControlChannel(), and H323Gatekeeper::StartDiscovery().
| BOOL H323Transport::ConnectTo | ( | const H323TransportAddress & | address | ) | [inline] |
Connect to the specified address.
Definition at line 499 of file transports.h.
References Connect(), and SetRemoteAddress().
Referenced by H323DataChannel::OnReceivedAckPDU(), H323_T120Channel::OnReceivedPDU(), H323Gatekeeper::OnReceiveInfoRequest(), H323Transactor::Response::SendCachedResponse(), and H323Transactor::WriteTo().
| BOOL H323Transport::Close | ( | ) | [virtual] |
Close the channel.
Reimplemented in H323TransportTCP.
Definition at line 1212 of file transports.cxx.
Referenced by CleanUpOnTermination(), OpalT38Protocol::CleanUpOnTermination(), H323DataChannel::CleanUpOnTermination(), H323TransportTCP::Close(), H323Connection::HandleReceivedSignalPDU(), and H323TransportUDP::~H323TransportUDP().
| BOOL H323Transport::IsCompatibleTransport | ( | const H225_TransportAddress & | pdu | ) | const [virtual] |
Check that the transport address PDU is compatible with transport.
Reimplemented in H323TransportIP.
Definition at line 1359 of file transports.cxx.
Referenced by H323GatekeeperGRQ::H323GatekeeperGRQ(), H323GatekeeperLRQ::H323GatekeeperLRQ(), and H323GatekeeperRRQ::H323GatekeeperRRQ().
| void H323Transport::SetUpTransportPDU | ( | H225_TransportAddress & | pdu, | |
| BOOL | localTsap, | |||
| H323Connection * | connection = NULL | |||
| ) | const [virtual] |
Set up a transport address PDU for RAS channel.
Reimplemented in H323TransportIP.
Definition at line 1366 of file transports.cxx.
Referenced by H323Gatekeeper::AdmissionRequest(), H323Connection::AnsweringCall(), H323Gatekeeper::BuildInfoRequestResponse(), H323Connection::CreateRealTimeLogicalChannel(), H323Gatekeeper::LocationRequest(), H323GatekeeperListener::OnLocation(), H323Connection::OnReceivedSignalConnect(), H323_T120Channel::OnSendOpenAck(), H323DataChannel::OnSendOpenAck(), H323_RTP_UDP::OnSendRasInfo(), H323Gatekeeper::RegistrationRequest(), H323Connection::SendSignalSetup(), H323Transactor::SetUpCallSignalAddresses(), H323Gatekeeper::SetupGatekeeperRequest(), and H323Gatekeeper::UnregistrationRequest().
| void H323Transport::SetUpTransportPDU | ( | H245_TransportAddress & | pdu, | |
| unsigned | tsap | |||
| ) | const [virtual] |
Set up a transport address PDU for logical channel. If tsap is UseLocalTSAP or UseRemoteTSAP then the local or remote port of the transport is used, otherwise the explicit port number is used.
Reimplemented in H323TransportIP.
Definition at line 1375 of file transports.cxx.
| void H323Transport::SetPromiscuous | ( | PromisciousModes | promiscuous | ) | [virtual] |
Set read to promiscuous mode. Normally only reads from the specifed remote address are accepted. This flag allows packets to be accepted from any remote, provided the underlying protocol can do so. For example TCP will do nothing.
The Read() call may optionally set the remote address automatically to whatever the sender host of the last received message was.
Default behaviour does nothing.
Reimplemented in H323TransportUDP.
Definition at line 1382 of file transports.cxx.
Referenced by OpalT38Protocol::Answer(), H323PeerElement::Construct(), H323GatekeeperListener::H323GatekeeperListener(), H323Transactor::SetTransport(), and H323Gatekeeper::StartDiscovery().
| H323TransportAddress H323Transport::GetLastReceivedAddress | ( | ) | const [virtual] |
Get the transport address of the last received PDU.
Default behaviour returns GetRemoteAddress().
Reimplemented in H323TransportUDP.
Definition at line 1387 of file transports.cxx.
References GetRemoteAddress().
Referenced by H323PeerElement::AccessRequest(), OpalT38Protocol::Answer(), H323TransportUDP::GetLastReceivedAddress(), H323PeerElement::HandleServiceRequest(), H323TransactionPDU::Read(), H323Transactor::SendCachedResponse(), H323PeerElement::SendUpdateDescriptorByAddr(), H323PeerElement::SendUpdateDescriptorByID(), H323PeerElement::ServiceRequestByID(), and H323Transactor::WritePDU().
| virtual BOOL H323Transport::ReadPDU | ( | PBYTEArray & | pdu | ) | [pure virtual] |
Read a protocol data unit from the transport. This will read using the transports mechanism for PDU boundaries, for example UDP is a single Read() call, while for TCP there is a TPKT header that indicates the size of the PDU.
| pdu | PDU read from transport |
Implemented in H323TransportTCP, and H323TransportUDP.
Referenced by OpalT38Protocol::Answer(), H323Connection::HandleControlChannel(), T120_X224::Read(), H323TransactionPDU::Read(), and H323SignalPDU::Read().
| virtual BOOL H323Transport::ExtractPDU | ( | const PBYTEArray & | pdu, | |
| PINDEX & | len | |||
| ) | [pure virtual] |
Extract a protocol data unit from the transport This is used by the aggregator to deblock the incoming data stream into valid PDUs.
Implemented in H323TransportTCP, and H323TransportUDP.
| virtual BOOL H323Transport::WritePDU | ( | const PBYTEArray & | pdu | ) | [pure virtual] |
Write a protocol data unit from the transport. This will write using the transports mechanism for PDU boundaries, for example UDP is a single Write() call, while for TCP there is a TPKT header that indicates the size of the PDU.
| pdu | PDU to write |
Implemented in H323TransportTCP, and H323TransportUDP.
Referenced by T120_X224::Write(), H323TransactionPDU::Write(), H323SignalPDU::Write(), H323Connection::WriteControlPDU(), and OpalT38Protocol::WritePacket().
| BOOL H323Transport::HandleSignallingSocket | ( | H323SignalPDU & | pdu | ) |
Handle the PDU Reading for the first connection object
Definition at line 1229 of file transports.cxx.
References endpoint, Q931::InformationMsg, and H323EndPoint::OnUnsolicitedInformation().
Referenced by HandleFirstSignallingChannelPDU().
| BOOL H323Transport::HandleFirstSignallingChannelPDU | ( | ) |
Wait for first PDU and find/create connection object. If returns FALSE, then the transport is deleted by the calling thread.
Definition at line 1251 of file transports.cxx.
References AttachThread(), Q931::BuildReleaseComplete(), H323Connection::ClearCall(), H225_Setup_UUIE::e_callIdentifier, H225_H323_UU_PDU_h323_message_body::e_releaseComplete, H323Connection::EndedByTransportFail, endpoint, Q931::GetCallReference(), H323SignalPDU::GetQ931(), H323Connection::HandleSignallingChannel(), HandleSignallingSocket(), H323Connection::HandleSignalPDU(), H323Connection::Lock(), H225_Setup_UUIE::m_callIdentifier, H225_ReleaseComplete_UUIE::m_callIdentifier, H225_H323_UU_PDU::m_h323_message_body, H225_H323_UserInformation::m_h323_uu_pdu, H225_ReleaseComplete_UUIE::m_protocolIdentifier, H323EndPoint::OnIncomingConnection(), Q931::SetCause(), Q931::TemporaryFailure, thread, H323Connection::Unlock(), and H323SignalPDU::Write().
Referenced by H225TransportThread::Main().
| H323Transport * H323Transport::CreateControlChannel | ( | H323Connection & | connection | ) | [virtual] |
Begin the opening of a control channel. This sets up the channel so that the remote endpoint can connect back to this endpoint. This would be called on the signalling channel instance of a H323Transport.
Reimplemented in H323TransportTCP.
Definition at line 1393 of file transports.cxx.
Referenced by H323Connection::StartControlChannel().
| BOOL H323Transport::AcceptControlChannel | ( | H323Connection & | connection | ) | [virtual] |
Finish the opening of a control channel. This waits for the connect backfrom the remote endpoint, completing the control channel open sequence.
Reimplemented in H323TransportTCP.
Definition at line 1400 of file transports.cxx.
Referenced by H245TransportThread::Main().
| void H323Transport::StartControlChannel | ( | H323Connection & | connection | ) | [virtual] |
Connect the control channel.
Definition at line 1333 of file transports.cxx.
References endpoint.
Referenced by H323Connection::StartControlChannel().
| BOOL H323Transport::DiscoverGatekeeper | ( | H323Gatekeeper & | gk, | |
| H323RasPDU & | pdu, | |||
| const H323TransportAddress & | address | |||
| ) | [virtual] |
Discover a Gatekeeper on the network. This locates a gatekeeper on the network and associates this transport object with packet exchange with that gatekeeper.
| gk | Gatekeeper to set on discovery. |
| pdu | GatekeeperRequest PDU |
| address | Address of gatekeeper (if present) |
Reimplemented in H323TransportUDP.
Definition at line 1407 of file transports.cxx.
Referenced by H323Gatekeeper::StartDiscovery().
| H323EndPoint& H323Transport::GetEndPoint | ( | ) | const [inline] |
Get the associated endpoint to this transport.
Definition at line 648 of file transports.h.
References endpoint.
| void H323Transport::AttachThread | ( | PThread * | thread | ) |
Attach a thread to the transport.
Definition at line 1339 of file transports.cxx.
References thread.
Referenced by H225CallThread::H225CallThread(), H245TransportThread::H245TransportThread(), HandleFirstSignallingChannelPDU(), and H323Transactor::StartChannel().
| void H323Transport::CleanUpOnTermination | ( | ) |
Wait for associated thread to terminate.
Definition at line 1346 of file transports.cxx.
References Close(), and thread.
Referenced by H323Connection::CleanUpOnCallEnd(), H323Gatekeeper::MakeRequest(), H323Connection::OnReceivedFacility(), H323Transactor::SetTransport(), and H323Transactor::StopChannel().
1.5.2