/[resiprocate]/main/reTurn/StunTuple.hxx
ViewVC logotype

Contents of /main/reTurn/StunTuple.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11159 - (show annotations) (download)
Fri Apr 25 14:03:32 2014 UTC (5 years, 6 months ago) by sgodin
File MIME type: text/plain
File size: 2894 byte(s)
-modified asio and boost include file ordering to avoid multiply defined symbol errors on linking
 -in preparation for upgrade of asio drop and support for latest boost 
 -include asio/ssh.hpp everywhere asio.hpp is included
 -include boost headers before others, to ensure we are not redefining stdint definitions in some includes
  and not others

1 #ifndef STUNTUPLE_HXX
2 #define STUNTUPLE_HXX
3
4 #include <asio.hpp>
5 #ifdef USE_SSL
6 #include <asio/ssl.hpp>
7 #endif
8 #include <rutil/resipfaststreams.hxx>
9
10 namespace reTurn {
11
12 class StunTuple
13 {
14 public:
15 typedef enum
16 {
17 None,
18 UDP,
19 TCP,
20 TLS
21 } TransportType;
22
23 explicit StunTuple();
24 explicit StunTuple(TransportType transport, const asio::ip::address& address, unsigned int port);
25
26 bool operator==(const StunTuple& rhs) const;
27 bool operator!=(const StunTuple& rhs) const;
28 bool operator<(const StunTuple& rhs) const;
29
30 TransportType getTransportType() const { return mTransport; }
31 void setTransportType(TransportType transport) { mTransport = transport; }
32
33 const asio::ip::address& getAddress() const { return mAddress; }
34 void setAddress(const asio::ip::address& address) { mAddress = address; }
35
36 unsigned int getPort() const { return mPort; }
37 void setPort(unsigned int port) { mPort = port; }
38
39 private:
40 TransportType mTransport;
41 asio::ip::address mAddress;
42 unsigned int mPort;
43
44 friend EncodeStream& operator<<(EncodeStream& strm, const StunTuple& tuple);
45 };
46
47 EncodeStream& operator<<(EncodeStream& strm, const StunTuple& tuple);
48
49 }
50
51 #endif
52
53
54 /* ====================================================================
55
56 Copyright (c) 2007-2008, Plantronics, Inc.
57 All rights reserved.
58
59 Redistribution and use in source and binary forms, with or without
60 modification, are permitted provided that the following conditions are
61 met:
62
63 1. Redistributions of source code must retain the above copyright
64 notice, this list of conditions and the following disclaimer.
65
66 2. Redistributions in binary form must reproduce the above copyright
67 notice, this list of conditions and the following disclaimer in the
68 documentation and/or other materials provided with the distribution.
69
70 3. Neither the name of Plantronics nor the names of its contributors
71 may be used to endorse or promote products derived from this
72 software without specific prior written permission.
73
74 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
75 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
76 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
77 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
78 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
79 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
80 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
81 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
82 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
83 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
84 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
85
86 ==================================================================== */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27