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.7  2005/11/30 13:35:26  csoutheren
00031  * Changed tags for Doxygen
00032  *
00033  * Revision 2.6  2004/02/19 10:46:44  rjongbloed
00034  * Merged OpenH323 version 1.13.1 changes.
00035  *
00036  * Revision 2.5  2002/11/10 11:33:17  robertj
00037  * Updated to OpenH323 v1.10.3
00038  *
00039  * Revision 2.4  2002/09/16 02:52:34  robertj
00040  * Added #define so can select if #pragma interface/implementation is used on
00041  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00042  *
00043  * Revision 2.3  2002/09/12 06:58:17  robertj
00044  * Removed protocol prefix strings as static members as has problems with
00045  *   use in DLL environment.
00046  *
00047  * Revision 2.2  2002/07/01 04:56:30  robertj
00048  * Updated to OpenH323 v1.9.1
00049  *
00050  * Revision 2.1  2001/11/09 05:49:47  robertj
00051  * Abstracted UDP connection algorithm
00052  *
00053  * Revision 2.0  2001/07/27 15:48:24  robertj
00054  * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL)
00055  *
00056  */
00057 
00058 #ifndef __H323_TRANSADDR_H
00059 #define __H323_TRANSADDR_H
00060 
00061 #ifdef P_USE_PRAGMA
00062 #pragma interface
00063 #endif
00064 
00065 
00066 #include <ptlib/sockets.h>
00067 #include <opal/transports.h>
00068 
00069 
00070 class H225_TransportAddress;
00071 class H245_TransportAddress;
00072 class H225_ArrayOf_TransportAddress;
00073 
00074 
00075 typedef OpalListener  H323Listener;
00076 typedef PList<H323Listener> H323ListenerList;
00077 typedef OpalTransport H323Transport;
00078 typedef OpalTransportUDP H323TransportUDP;
00079 
00080 
00082 
00087 class H323TransportAddress : public OpalTransportAddress
00088 {
00089     PCLASSINFO(H323TransportAddress, OpalTransportAddress);
00090   public:
00091     H323TransportAddress()
00092       { }
00093     H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
00094       : OpalTransportAddress(addr, port, proto) { }
00095     H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
00096       : OpalTransportAddress(addr, port, proto) { }
00097     H323TransportAddress(const OpalTransportAddress & addr)
00098       : OpalTransportAddress(addr) { }
00099     H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
00100       : OpalTransportAddress(ip, port, proto) { }
00101 
00102     H323TransportAddress(
00103       const H225_TransportAddress & pdu,
00104       const char * proto = NULL 
00105     );
00106     H323TransportAddress(
00107       const H245_TransportAddress & pdu,
00108       const char * proto = NULL 
00109     );
00110 
00111     BOOL SetPDU(
00112       H225_ArrayOf_TransportAddress & pdu,  
00113       const OpalTransport & associatedTransport 
00114     );
00115     BOOL SetPDU(H225_TransportAddress & pdu) const;
00116     BOOL SetPDU(H245_TransportAddress & pdu) const;
00117 };
00118 
00119 
00120 PDECLARE_ARRAY(H323TransportAddressArray, H323TransportAddress)
00121   public:
00122     H323TransportAddressArray(
00123       const OpalTransportAddress & address
00124     ) { AppendAddress(address); }
00125     H323TransportAddressArray(
00126       const H323TransportAddress & address
00127     ) { AppendAddress(address); }
00128     H323TransportAddressArray(
00129       const H225_ArrayOf_TransportAddress & addresses
00130     );
00131     H323TransportAddressArray(
00132       const OpalTransportAddressArray & array
00133     ) { AppendStringCollection(array); }
00134     H323TransportAddressArray(
00135       const PStringArray & array
00136     ) { AppendStringCollection(array); }
00137     H323TransportAddressArray(
00138       const PStringList & list
00139     ) { AppendStringCollection(list); }
00140     H323TransportAddressArray(
00141       const PSortedStringList & list
00142     ) { AppendStringCollection(list); }
00143 
00144     void AppendString(
00145       const char * address
00146     );
00147     void AppendString(
00148       const PString & address
00149     );
00150     void AppendAddress(
00151       const H323TransportAddress & address
00152     );
00153 
00154   protected:
00155     void AppendStringCollection(
00156       const PCollection & coll
00157     );
00158 };
00159 
00160 
00163 void H323SetTransportAddresses(
00164   const H323Transport & associatedTransport,   
00165   const H323TransportAddressArray & addresses, 
00166   H225_ArrayOf_TransportAddress & pdu          
00167 );
00168 
00169 
00170 #endif 
00171 
00172 

Generated on Mon Sep 25 16:20:11 2006 for OPAL by  doxygen 1.4.7