transaddr.h

Go to the documentation of this file.
00001 /*
00002  * transport.h
00003  *
00004  * H.323 protocol handler
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open H323 Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions of this code were written with the assisance of funding from
00025  * Vovida Networks, Inc. http://www.vovida.com.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: transaddr.h,v $
00030  * Revision 2.8  2006/08/21 05:29:25  csoutheren
00031  * Messy but relatively simple change to add support for secure (SSL/TLS) TCP transport
00032  * and secure H.323 signalling via the sh323 URL scheme
00033  *
00034  * Revision 2.7  2005/11/30 13:35:26  csoutheren
00035  * Changed tags for Doxygen
00036  *
00037  * Revision 2.6  2004/02/19 10:46:44  rjongbloed
00038  * Merged OpenH323 version 1.13.1 changes.
00039  *
00040  * Revision 2.5  2002/11/10 11:33:17  robertj
00041  * Updated to OpenH323 v1.10.3
00042  *
00043  * Revision 2.4  2002/09/16 02:52:34  robertj
00044  * Added #define so can select if #pragma interface/implementation is used on
00045  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00046  *
00047  * Revision 2.3  2002/09/12 06:58:17  robertj
00048  * Removed protocol prefix strings as static members as has problems with
00049  *   use in DLL environment.
00050  *
00051  * Revision 2.2  2002/07/01 04:56:30  robertj
00052  * Updated to OpenH323 v1.9.1
00053  *
00054  * Revision 2.1  2001/11/09 05:49:47  robertj
00055  * Abstracted UDP connection algorithm
00056  *
00057  * Revision 2.0  2001/07/27 15:48:24  robertj
00058  * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL)
00059  *
00060  */
00061 
00062 #ifndef __H323_TRANSADDR_H
00063 #define __H323_TRANSADDR_H
00064 
00065 #ifdef P_USE_PRAGMA
00066 #pragma interface
00067 #endif
00068 
00069 
00070 #include <ptlib/sockets.h>
00071 #include <opal/transports.h>
00072 
00073 
00074 class H225_TransportAddress;
00075 class H245_TransportAddress;
00076 class H225_ArrayOf_TransportAddress;
00077 
00078 
00079 typedef OpalListener  H323Listener;
00080 typedef PList<H323Listener> H323ListenerList;
00081 typedef OpalTransport H323Transport;
00082 typedef OpalTransportUDP H323TransportUDP;
00083 
00084 
00086 
00091 class H323TransportAddress : public OpalTransportAddress
00092 {
00093     PCLASSINFO(H323TransportAddress, OpalTransportAddress);
00094   public:
00095     H323TransportAddress()
00096       { }
00097     H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
00098       : OpalTransportAddress(addr, port, proto) { }
00099     H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
00100       : OpalTransportAddress(addr, port, proto) { }
00101     H323TransportAddress(const OpalTransportAddress & addr)
00102       : OpalTransportAddress(addr) { }
00103     H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
00104       : OpalTransportAddress(ip, port, proto) { }
00105 
00106     H323TransportAddress(
00107       const H225_TransportAddress & pdu,
00108       const char * proto = NULL 
00109     );
00110     H323TransportAddress(
00111       const H245_TransportAddress & pdu,
00112       const char * proto = NULL 
00113     );
00114 
00115     BOOL SetPDU(
00116       H225_ArrayOf_TransportAddress & pdu,  
00117       const OpalTransport & associatedTransport 
00118     );
00119     BOOL SetPDU(H225_TransportAddress & pdu, WORD defPort = 0) const;
00120     BOOL SetPDU(H245_TransportAddress & pdu, WORD defPort = 0) const;
00121 };
00122 
00123 
00124 PDECLARE_ARRAY(H323TransportAddressArray, H323TransportAddress)
00125   public:
00126     H323TransportAddressArray(
00127       const OpalTransportAddress & address
00128     ) { AppendAddress(address); }
00129     H323TransportAddressArray(
00130       const H323TransportAddress & address
00131     ) { AppendAddress(address); }
00132     H323TransportAddressArray(
00133       const H225_ArrayOf_TransportAddress & addresses
00134     );
00135     H323TransportAddressArray(
00136       const OpalTransportAddressArray & array
00137     ) { AppendStringCollection(array); }
00138     H323TransportAddressArray(
00139       const PStringArray & array
00140     ) { AppendStringCollection(array); }
00141     H323TransportAddressArray(
00142       const PStringList & list
00143     ) { AppendStringCollection(list); }
00144     H323TransportAddressArray(
00145       const PSortedStringList & list
00146     ) { AppendStringCollection(list); }
00147 
00148     void AppendString(
00149       const char * address
00150     );
00151     void AppendString(
00152       const PString & address
00153     );
00154     void AppendAddress(
00155       const H323TransportAddress & address
00156     );
00157 
00158   protected:
00159     void AppendStringCollection(
00160       const PCollection & coll
00161     );
00162 };
00163 
00164 
00167 void H323SetTransportAddresses(
00168   const H323Transport & associatedTransport,   
00169   const H323TransportAddressArray & addresses, 
00170   H225_ArrayOf_TransportAddress & pdu          
00171 );
00172 
00173 
00174 #endif 
00175 
00176 

Generated on Fri Mar 7 06:33:41 2008 for OPAL by  doxygen 1.5.1