/[resiprocate]/main/reflow/FlowManager.hxx
ViewVC logotype

Contents of /main/reflow/FlowManager.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10439 - (show annotations) (download)
Tue Sep 10 14:39:32 2013 UTC (6 years, 4 months ago) by Dpocock
File MIME type: text/plain
File size: 3974 byte(s)
reflow: remove conditional pre-processor logic for USE_SSL from headers
1 #if !defined(FlowManager_hxx)
2 #define FlowManager_hxx
3
4 #ifdef HAVE_CONFIG_H
5 #include "config.h"
6 #endif
7
8 #include "MediaStream.hxx"
9 #include "FlowManagerException.hxx"
10
11 #include "dtls_wrapper/DtlsFactory.hxx"
12 #include <openssl/crypto.h>
13 #include <openssl/ssl.h>
14
15 #include <map>
16
17 using namespace reTurn;
18
19 namespace flowmanager
20 {
21
22 /**
23 This class represents the Flow Manager. It is responsible for sending/receiving
24 media and performing the necessary NAT traversal.
25
26 Threading Notes: This class implements a thread
27 to manage the asyncrouns reTurn client library calls. Essentially all
28 asyncrounous operations for all Flows will be called from this one thread.
29
30 Author: Scott Godin (sgodin AT SipSpectrum DOT com)
31 */
32 class IOServiceThread;
33
34 class FlowManager
35 {
36 public:
37 FlowManager(); // throws FlowManagerException
38 virtual ~FlowManager();
39
40 // This API assumes that RTCP localBinding is always the same as RTP binding but add one to the port number
41 // We can add a new API in the future to accomodate, custom RTCP bindings as required
42 MediaStream* createMediaStream(MediaStreamHandler& mediaStreamHandler,
43 const StunTuple& localBinding,
44 bool rtcpEnabled = true,
45 MediaStream::NatTraversalMode natTraversalMode = MediaStream::NoNatTraversal,
46 const char* natTraversalServerHostname = 0,
47 unsigned short natTraversalServerPort = 0,
48 const char* stunUsername = 0,
49 const char* stunPassword = 0);
50
51 void initializeDtlsFactory(const char* certAor);
52 dtls::DtlsFactory* getDtlsFactory() { return mDtlsFactory; }
53
54 protected:
55
56 private:
57 static void srtpEventHandler(srtp_event_data_t *data);
58
59 // Member variables used to manager asio io service thread
60 asio::io_service mIOService;
61 IOServiceThread* mIOServiceThread;
62 asio::io_service::work* mIOServiceWork;
63 static int createCert (const resip::Data& pAor, int expireDays, int keyLen, X509*& outCert, EVP_PKEY*& outKey );
64 asio::ssl::context mSslContext;
65
66 X509* mClientCert;
67 EVP_PKEY* mClientKey;
68 dtls::DtlsFactory* mDtlsFactory;
69 };
70
71 }
72
73 #endif
74
75
76 /* ====================================================================
77
78 Copyright (c) 2007-2008, Plantronics, Inc.
79 All rights reserved.
80
81 Redistribution and use in source and binary forms, with or without
82 modification, are permitted provided that the following conditions are
83 met:
84
85 1. Redistributions of source code must retain the above copyright
86 notice, this list of conditions and the following disclaimer.
87
88 2. Redistributions in binary form must reproduce the above copyright
89 notice, this list of conditions and the following disclaimer in the
90 documentation and/or other materials provided with the distribution.
91
92 3. Neither the name of Plantronics nor the names of its contributors
93 may be used to endorse or promote products derived from this
94 software without specific prior written permission.
95
96 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
97 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
98 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
99 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
100 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
101 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
102 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
103 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
104 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
105 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
106 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
107
108 ==================================================================== */

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