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