OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

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: 22023 $
30 * $Author: rjongbloed $
31 * $Date: 2009-02-07 23:56:02 -0600 (Sat, 07 Feb 2009) $
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/buildopts.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
54 typedef OpalListener H323Listener;
55 typedef PList<H323Listener> H323ListenerList;
56 typedef OpalTransport H323Transport;
57 typedef OpalTransportUDP H323TransportUDP;
58
59
61
66 class H323TransportAddress : public OpalTransportAddress
67 {
68 PCLASSINFO(H323TransportAddress, OpalTransportAddress);
69 public:
70 H323TransportAddress()
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) { }
76 H323TransportAddress(const OpalTransportAddress & addr)
77 : OpalTransportAddress(addr) { }
78 H323TransportAddress(PIPSocket::Address ip, WORD port, const char * proto = NULL)
79 : OpalTransportAddress(ip, port, proto) { }
80
81 H323TransportAddress(
82 const H225_TransportAddress & pdu,
83 const char * proto = NULL
84 );
85 H323TransportAddress(
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 PDECLARE_ARRAY(H323TransportAddressArray, H323TransportAddress)
96 public:
97 H323TransportAddressArray(
98 const OpalTransportAddress & address
99 ) { AppendAddress(address); }
100 H323TransportAddressArray(
101 const H323TransportAddress & address
102 ) { AppendAddress(address); }
103 H323TransportAddressArray(
104 const H225_ArrayOf_TransportAddress & addresses
105 );
106 H323TransportAddressArray(
107 const OpalTransportAddressArray & array
108 ) { AppendStringCollection(array); }
109 H323TransportAddressArray(
110 const PStringArray & array
111 ) { AppendStringCollection(array); }
112 H323TransportAddressArray(
113 const PStringList & list
114 ) { AppendStringCollection(list); }
115 H323TransportAddressArray(
116 const PSortedStringList & list
117 ) { AppendStringCollection(list); }
118
119 void AppendString(
120 const char * address
121 );
122 void AppendString(
123 const PString & address
124 );
125 void AppendAddress(
126 const H323TransportAddress & address
127 );
128
129 protected:
130 void AppendStringCollection(
131 const PCollection & coll
132 );
133 };
134
135
138 void H323SetTransportAddresses(
139 const H323Transport & associatedTransport,
140 const H323TransportAddressArray & addresses,
141 H225_ArrayOf_TransportAddress & pdu
142 );
143
144
145 #endif // OPAL_H323
146
147 #endif // OPAL_H323_TRANSADDR_H
148
149