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 #include <opal/buildopts.h>
00042
00043 #include <ptlib/sockets.h>
00044 #include <opal/transports.h>
00045
00046
00047 class H225_TransportAddress;
00048 class H245_TransportAddress;
00049 class H225_ArrayOf_TransportAddress;
00050
00051
00052 typedef OpalListener H323Listener;
00053 typedef PList<H323Listener> H323ListenerList;
00054 typedef OpalTransport H323Transport;
00055 typedef OpalTransportUDP H323TransportUDP;
00056
00057
00059
00064 class H323TransportAddress : public OpalTransportAddress
00065 {
00066 PCLASSINFO(H323TransportAddress, OpalTransportAddress);
00067 public:
00068 H323TransportAddress()
00069 { }
00070 H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
00071 : OpalTransportAddress(addr, port, proto) { }
00072 H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
00073 : OpalTransportAddress(addr, port, proto) { }
00074 H323TransportAddress(const OpalTransportAddress & addr)
00075 : OpalTransportAddress(addr) { }
00076 H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
00077 : OpalTransportAddress(ip, port, proto) { }
00078
00079 H323TransportAddress(
00080 const H225_TransportAddress & pdu,
00081 const char * proto = NULL
00082 );
00083 H323TransportAddress(
00084 const H245_TransportAddress & pdu,
00085 const char * proto = NULL
00086 );
00087
00088 PBoolean SetPDU(
00089 H225_ArrayOf_TransportAddress & pdu,
00090 const OpalTransport & associatedTransport
00091 );
00092 PBoolean SetPDU(H225_TransportAddress & pdu, WORD defPort = 0) const;
00093 PBoolean SetPDU(H245_TransportAddress & pdu, WORD defPort = 0) const;
00094 };
00095
00096
00097 PDECLARE_ARRAY(H323TransportAddressArray, H323TransportAddress)
00098 public:
00099 H323TransportAddressArray(
00100 const OpalTransportAddress & address
00101 ) { AppendAddress(address); }
00102 H323TransportAddressArray(
00103 const H323TransportAddress & address
00104 ) { AppendAddress(address); }
00105 H323TransportAddressArray(
00106 const H225_ArrayOf_TransportAddress & addresses
00107 );
00108 H323TransportAddressArray(
00109 const OpalTransportAddressArray & array
00110 ) { AppendStringCollection(array); }
00111 H323TransportAddressArray(
00112 const PStringArray & array
00113 ) { AppendStringCollection(array); }
00114 H323TransportAddressArray(
00115 const PStringList & list
00116 ) { AppendStringCollection(list); }
00117 H323TransportAddressArray(
00118 const PSortedStringList & list
00119 ) { AppendStringCollection(list); }
00120
00121 void AppendString(
00122 const char * address
00123 );
00124 void AppendString(
00125 const PString & address
00126 );
00127 void AppendAddress(
00128 const H323TransportAddress & address
00129 );
00130
00131 protected:
00132 void AppendStringCollection(
00133 const PCollection & coll
00134 );
00135 };
00136
00137
00140 void H323SetTransportAddresses(
00141 const H323Transport & associatedTransport,
00142 const H323TransportAddressArray & addresses,
00143 H225_ArrayOf_TransportAddress & pdu
00144 );
00145
00146
00147 #endif
00148
00149