#include <transports.h>
Inheritance diagram for H323Transport:
Operations | |
enum | { UseLocalTSAP = 0x10001, UseRemoteTSAP } |
enum | PromisciousModes { AcceptFromRemoteOnly, AcceptFromAnyAutoSet, AcceptFromAny, 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) 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 | WritePDU (const PBYTEArray &pdu)=0 |
Public Member Functions | |
Overrides from PObject | |
virtual void | PrintOn (ostream &strm) const |
Signalling Channel | |
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. |
H323Transport::H323Transport | ( | H323EndPoint & | endpoint | ) |
Create a new transport channel.
H323Transport::~H323Transport | ( | ) |
H323Transport::H323Transport | ( | H323EndPoint & | endpoint | ) |
Create a new transport channel.
H323Transport::~H323Transport | ( | ) |
virtual void H323Transport::PrintOn | ( | ostream & | strm | ) | const [virtual] |
virtual H323TransportAddress H323Transport::GetLocalAddress | ( | ) | const [pure virtual] |
Get the transport address of the local endpoint.
Implemented in H323TransportIP, and H323TransportUDP.
virtual H323TransportAddress H323Transport::GetRemoteAddress | ( | ) | const [pure virtual] |
Get the transport address of the remote endpoint.
Implemented in H323TransportIP.
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.
virtual BOOL H323Transport::Connect | ( | ) | [pure virtual] |
Connect to the remote address.
Implemented in H323TransportTCP, and H323TransportUDP.
BOOL H323Transport::ConnectTo | ( | const H323TransportAddress & | address | ) | [inline] |
Connect to the specified address.
virtual BOOL H323Transport::Close | ( | ) | [virtual] |
Close the channel.
Reimplemented in H323TransportTCP.
virtual BOOL H323Transport::IsCompatibleTransport | ( | const H225_TransportAddress & | pdu | ) | const [virtual] |
Check that the transport address PDU is compatible with transport.
Reimplemented in H323TransportIP.
virtual void H323Transport::SetUpTransportPDU | ( | H225_TransportAddress & | pdu, | |
BOOL | localTsap | |||
) | const [virtual] |
Set up a transport address PDU for RAS channel.
Reimplemented in H323TransportIP.
virtual 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.
virtual 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.
virtual H323TransportAddress H323Transport::GetLastReceivedAddress | ( | ) | const [virtual] |
Get the transport address of the last received PDU.
Default behaviour returns GetRemoteAddress().
Reimplemented in H323TransportUDP.
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.
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.
BOOL H323Transport::HandleFirstSignallingChannelPDU | ( | ) |
Wait for first PDU and find/create connection object. If returns FALSE, then the transport is deleted by the calling thread.
virtual 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.
virtual 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.
virtual void H323Transport::StartControlChannel | ( | H323Connection & | connection | ) | [virtual] |
Connect the control channel.
virtual 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.
H323EndPoint& H323Transport::GetEndPoint | ( | ) | const [inline] |
Get the associated endpoint to this transport.
void H323Transport::AttachThread | ( | PThread * | thread | ) |
Attach a thread to the transport.
void H323Transport::CleanUpOnTermination | ( | ) |
Wait for associated thread to terminate.
H323EndPoint& H323Transport::endpoint [protected] |
PThread* H323Transport::thread [protected] |
Endpoint that owns the listener.
BOOL H323Transport::canGetInterface [protected] |
Thread handling the transport.