OPAL  Version 3.14.3
transaddr.h
Go to the documentation of this file.
1 /*
2  * transport.h
3  *
4  * H.323 protocol handler
5  *
6  * Open H323 Library
7  *
8  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Portions of this code were written with the assisance of funding from
25  * Vovida Networks, Inc. http://www.vovida.com.
26  *
27  * Contributor(s): ______________________________________.
28  *
29  * $Revision: 29536 $
30  * $Author: rjongbloed $
31  * $Date: 2013-04-19 18:55:15 +1000 (Fri, 19 Apr 2013) $
32  */
33 
34 #ifndef OPAL_H323_TRANSADDR_H
35 #define OPAL_H323_TRANSADDR_H
36 
37 #ifdef P_USE_PRAGMA
38 #pragma interface
39 #endif
40 
41 #include <opal_config.h>
42 
43 #if OPAL_H323
44 
45 #include <ptlib/sockets.h>
46 #include <opal/transports.h>
47 
48 
49 class H225_TransportAddress;
50 class H245_TransportAddress;
51 class H225_ArrayOf_TransportAddress;
52 
53 
55 typedef PList<H323Listener> H323ListenerList;
58 
59 
61 
67 {
69  public:
71  { }
72  H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
73  : OpalTransportAddress(addr, port, proto) { }
74  H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
75  : OpalTransportAddress(addr, port, proto) { }
77  : OpalTransportAddress(addr) { }
78  H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
79  : OpalTransportAddress(ip, port, proto) { }
80 
82  const H225_TransportAddress & pdu,
83  const char * proto = NULL
84  );
86  const H245_TransportAddress & pdu,
87  const char * proto = NULL
88  );
89 
90  PBoolean SetPDU(H225_TransportAddress & pdu, WORD defPort = 0) const;
91  PBoolean SetPDU(H245_TransportAddress & pdu, WORD defPort = 0) const;
92 };
93 
94 
95 class H323TransportAddressArray : public PArray<H323TransportAddress>
96 {
97  typedef PArray<H323TransportAddress> ParentClass;
98  PCLASSINFO(H323TransportAddressArray, ParentClass);
99 
100  protected:
102  : ParentClass(dummy, c) { }
103 
104  public:
105  H323TransportAddressArray(PINDEX initialSize = 0)
106  : ParentClass(initialSize) { }
108  const OpalTransportAddress & address
109  ) { AppendAddress(address); }
111  const H323TransportAddress & address
112  ) { AppendAddress(address); }
114  const H225_ArrayOf_TransportAddress & addresses
115  );
117  const OpalTransportAddressArray & array
118  ) { AppendStringCollection(array); }
120  const PStringArray & array
121  ) { AppendStringCollection(array); }
123  const PStringList & list
124  ) { AppendStringCollection(list); }
126  const PSortedStringList & list
127  ) { AppendStringCollection(list); }
128 
129  void AppendString(
130  const char * address
131  );
132  void AppendString(
133  const PString & address
134  );
135  void AppendAddress(
136  const H323TransportAddress & address
137  );
138 
139  virtual PObject * Clone() const
140  {
141  return new H323TransportAddressArray(0, this);
142  }
143 
144  protected:
146  const PCollection & coll
147  );
148 };
149 
150 
154  const H323Transport & associatedTransport,
155  const H323TransportAddressArray & addresses,
156  H225_ArrayOf_TransportAddress & pdu
157 );
158 
159 
160 #endif // OPAL_H323
161 
162 #endif // OPAL_H323_TRANSADDR_H
163 
164