OPAL  Version 3.18.8
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 
30 #ifndef OPAL_H323_TRANSADDR_H
31 #define OPAL_H323_TRANSADDR_H
32 
33 #ifdef P_USE_PRAGMA
34 #pragma interface
35 #endif
36 
37 #include <opal_config.h>
38 
39 #if OPAL_H323
40 
41 #include <ptlib/sockets.h>
42 #include <opal/transports.h>
43 
44 
45 class H225_TransportAddress;
46 class H245_TransportAddress;
47 class H225_ArrayOf_TransportAddress;
48 
49 
51 typedef PList<H323Listener> H323ListenerList;
54 
55 
57 
63 {
65  public:
67  { }
68  H323TransportAddress(const char * addr, WORD port = 0, const char * proto = NULL)
69  : OpalTransportAddress(addr, port, proto) { }
70  H323TransportAddress(const PString & addr, WORD port = 0, const char * proto = NULL)
71  : OpalTransportAddress(addr, port, proto) { }
73  : OpalTransportAddress(addr) { }
74  H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
75  : OpalTransportAddress(ip, port, proto) { }
76 
78  const H225_TransportAddress & pdu,
79  const char * proto = NULL
80  );
82  const H245_TransportAddress & pdu,
83  const char * proto = NULL
84  );
85 
86  PBoolean SetPDU(H225_TransportAddress & pdu, WORD defPort = 0) const;
87  PBoolean SetPDU(H245_TransportAddress & pdu, WORD defPort = 0) const;
88 };
89 
90 
91 class H323TransportAddressArray : public PArray<H323TransportAddress>
92 {
93  typedef PArray<H323TransportAddress> ParentClass;
94  PCLASSINFO(H323TransportAddressArray, ParentClass);
95 
96  protected:
98  : ParentClass(dummy, c) { }
99 
100  public:
101  H323TransportAddressArray(PINDEX initialSize = 0)
102  : ParentClass(initialSize) { }
104  const OpalTransportAddress & address
105  ) { AppendAddress(address); }
107  const H323TransportAddress & address
108  ) { AppendAddress(address); }
110  const H225_ArrayOf_TransportAddress & addresses
111  );
113  const OpalTransportAddressArray & array
114  ) { AppendStringCollection(array); }
116  const PStringArray & array
117  ) { AppendStringCollection(array); }
119  const PStringList & list
120  ) { AppendStringCollection(list); }
122  const PSortedStringList & list
123  ) { AppendStringCollection(list); }
124 
125  void AppendString(
126  const char * address
127  );
128  void AppendString(
129  const PString & address
130  );
131  void AppendAddress(
132  const H323TransportAddress & address
133  );
134 
135  virtual PObject * Clone() const
136  {
137  return new H323TransportAddressArray(0, this);
138  }
139 
140  protected:
142  const PCollection & coll
143  );
144 };
145 
146 
150  const H323Transport & associatedTransport,
151  const H323TransportAddressArray & addresses,
152  H225_ArrayOf_TransportAddress & pdu
153 );
154 
155 
156 #endif // OPAL_H323
157 
158 #endif // OPAL_H323_TRANSADDR_H
159 
160 
OpalListener H323Listener
Definition: transaddr.h:47
void AppendStringCollection(const PCollection &coll)
void H323SetTransportAddresses(const H323Transport &associatedTransport, const H323TransportAddressArray &addresses, H225_ArrayOf_TransportAddress &pdu)
H323TransportAddress()
Definition: transaddr.h:66
H323TransportAddressArray(const OpalTransportAddress &address)
Definition: transaddr.h:103
H323TransportAddressArray(const OpalTransportAddressArray &array)
Definition: transaddr.h:112
Definition: transports.h:788
H323TransportAddress(const char *addr, WORD port=0, const char *proto=NULL)
Definition: transaddr.h:68
H323TransportAddressArray(const PStringArray &array)
Definition: transaddr.h:115
OpalTransport H323Transport
Definition: transaddr.h:52
H323TransportAddress(const PString &addr, WORD port=0, const char *proto=NULL)
Definition: transaddr.h:70
void AppendAddress(const H323TransportAddress &address)
Definition: transports.h:411
Definition: transaddr.h:91
OpalTransportUDP H323TransportUDP
Definition: transaddr.h:53
PList< H323Listener > H323ListenerList
Definition: transaddr.h:51
H323TransportAddressArray(const PSortedStringList &list)
Definition: transaddr.h:121
H323TransportAddress(const OpalTransportAddress &addr)
Definition: transaddr.h:72
void AppendString(const char *address)
H323TransportAddress(PIPSocket::Address ip, WORD port, const char *proto=NULL)
Definition: transaddr.h:74
Definition: transports.h:1197
PBoolean SetPDU(H225_TransportAddress &pdu, WORD defPort=0) const
H323TransportAddressArray(int dummy, const H323TransportAddressArray *c)
Definition: transaddr.h:97
H323TransportAddressArray(PINDEX initialSize=0)
Definition: transaddr.h:101
virtual PObject * Clone() const
Definition: transaddr.h:135
Definition: transports.h:151
Definition: transports.h:326
H323TransportAddressArray(const H323TransportAddress &address)
Definition: transaddr.h:106
H323TransportAddressArray(const PStringList &list)
Definition: transaddr.h:118
Definition: transaddr.h:62