00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __H323_TRANSADDR_H
00035 #define __H323_TRANSADDR_H
00036
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040
00041
00042 #include <ptlib/sockets.h>
00043 #include <opal/transports.h>
00044
00045
00046 class H225_TransportAddress;
00047 class H245_TransportAddress;
00048 class H225_ArrayOf_TransportAddress;
00049
00050
00051 typedef OpalListener H323Listener;
00052 typedef PList<H323Listener> H323ListenerList;
00053 typedef OpalTransport H323Transport;
00054 typedef OpalTransportUDP H323TransportUDP;
00055
00056
00058
00063 class H323TransportAddress : public OpalTransportAddress
00064 {
00065 PCLASSINFO(H323TransportAddress, OpalTransportAddress);
00066 public:
00067 H323TransportAddress()
00068 { }
00069 H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
00070 : OpalTransportAddress(addr, port, proto) { }
00071 H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
00072 : OpalTransportAddress(addr, port, proto) { }
00073 H323TransportAddress(const OpalTransportAddress & addr)
00074 : OpalTransportAddress(addr) { }
00075 H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
00076 : OpalTransportAddress(ip, port, proto) { }
00077
00078 H323TransportAddress(
00079 const H225_TransportAddress & pdu,
00080 const char * proto = NULL
00081 );
00082 H323TransportAddress(
00083 const H245_TransportAddress & pdu,
00084 const char * proto = NULL
00085 );
00086
00087 PBoolean SetPDU(
00088 H225_ArrayOf_TransportAddress & pdu,
00089 const OpalTransport & associatedTransport
00090 );
00091 PBoolean SetPDU(H225_TransportAddress & pdu, WORD defPort = 0) const;
00092 PBoolean SetPDU(H245_TransportAddress & pdu, WORD defPort = 0) const;
00093 };
00094
00095
00096 PDECLARE_ARRAY(H323TransportAddressArray, H323TransportAddress)
00097 public:
00098 H323TransportAddressArray(
00099 const OpalTransportAddress & address
00100 ) { AppendAddress(address); }
00101 H323TransportAddressArray(
00102 const H323TransportAddress & address
00103 ) { AppendAddress(address); }
00104 H323TransportAddressArray(
00105 const H225_ArrayOf_TransportAddress & addresses
00106 );
00107 H323TransportAddressArray(
00108 const OpalTransportAddressArray & array
00109 ) { AppendStringCollection(array); }
00110 H323TransportAddressArray(
00111 const PStringArray & array
00112 ) { AppendStringCollection(array); }
00113 H323TransportAddressArray(
00114 const PStringList & list
00115 ) { AppendStringCollection(list); }
00116 H323TransportAddressArray(
00117 const PSortedStringList & list
00118 ) { AppendStringCollection(list); }
00119
00120 void AppendString(
00121 const char * address
00122 );
00123 void AppendString(
00124 const PString & address
00125 );
00126 void AppendAddress(
00127 const H323TransportAddress & address
00128 );
00129
00130 protected:
00131 void AppendStringCollection(
00132 const PCollection & coll
00133 );
00134 };
00135
00136
00139 void H323SetTransportAddresses(
00140 const H323Transport & associatedTransport,
00141 const H323TransportAddressArray & addresses,
00142 H225_ArrayOf_TransportAddress & pdu
00143 );
00144
00145
00146 #endif
00147
00148