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

Contents of /main/reTurn/ChannelManager.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: 2632 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 CHANNELMANAGER_HXX
2 #define CHANNELMANAGER_HXX
3
4 #include <asio.hpp>
5 #ifdef USE_SSL
6 #include <asio/ssl.hpp>
7 #endif
8
9 #include "RemotePeer.hxx"
10
11 namespace reTurn {
12
13 #define MIN_CHANNEL_NUM 0x4000
14 #define MAX_CHANNEL_NUM 0x7FFF
15
16 class ChannelManager
17 {
18 public:
19 explicit ChannelManager();
20 ~ChannelManager();
21
22 RemotePeer* createChannelBinding(const StunTuple& peerTuple);
23 RemotePeer* createChannelBinding(const StunTuple& peerTuple, unsigned short channel);
24
25 RemotePeer* findRemotePeerByChannel(unsigned short channelNumber);
26 RemotePeer* findRemotePeerByPeerAddress(const StunTuple& peerAddress);
27
28 private:
29 typedef std::map<unsigned short,RemotePeer*> ChannelRemotePeerMap;
30 typedef std::map<StunTuple,RemotePeer*> TupleRemotePeerMap;
31 ChannelRemotePeerMap mChannelRemotePeerMap;
32 TupleRemotePeerMap mTupleRemotePeerMap;
33
34 unsigned short getNextChannelNumber();
35 unsigned short mNextChannelNumber;
36 };
37
38 }
39
40 #endif
41
42
43 /* ====================================================================
44
45 Copyright (c) 2007-2008, Plantronics, Inc.
46 All rights reserved.
47
48 Redistribution and use in source and binary forms, with or without
49 modification, are permitted provided that the following conditions are
50 met:
51
52 1. Redistributions of source code must retain the above copyright
53 notice, this list of conditions and the following disclaimer.
54
55 2. Redistributions in binary form must reproduce the above copyright
56 notice, this list of conditions and the following disclaimer in the
57 documentation and/or other materials provided with the distribution.
58
59 3. Neither the name of Plantronics nor the names of its contributors
60 may be used to endorse or promote products derived from this
61 software without specific prior written permission.
62
63 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
64 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
65 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
66 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
67 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
68 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
69 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
70 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
71 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
72 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
73 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
74
75 ==================================================================== */

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