reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
WssTransport.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
5#ifdef USE_SSL
6
7#include "rutil/compat.hxx"
8#include "rutil/Data.hxx"
9#include "rutil/Socket.hxx"
10#include "rutil/Logger.hxx"
15
16#include <utility>
17
18#define RESIPROCATE_SUBSYSTEM Subsystem::TRANSPORT
19
20using namespace std;
21using namespace resip;
22
24 int portNum,
25 IpVersion version,
26 const Data& interfaceObj,
27 Security& security,
28 const Data& sipDomain,
31 Compression &compression,
32 unsigned transportFlags,
34 bool useEmailAsSIP,
35 std::shared_ptr<WsConnectionValidator> connectionValidator,
36 std::shared_ptr<WsCookieContextFactory> cookieContextFactory,
37 const Data& certificateFilename,
38 const Data& privateKeyFilename,
39 const Data& privateKeyPassPhrase):
40 TlsBaseTransport(fifo, portNum, version, interfaceObj, security, sipDomain, sslType, WSS, socketFunc,
41 compression, transportFlags, cvm, useEmailAsSIP, certificateFilename, privateKeyFilename,
42 privateKeyPassPhrase),
43 WsBaseTransport(connectionValidator, cookieContextFactory)
44{
45 InfoLog (<< "Creating WSS transport for domain "
46 << sipDomain << " interface=" << interfaceObj
47 << " port=" << mTuple.getPort());
48
49 mTxFifo.setDescription("WssTransport::mTxFifo");
50}
51
53WssTransport::createConnection(const Tuple& who, Socket fd, bool server)
54{
56 Connection* conn = new WssConnection(this,who, fd, mSecurity, server,
59 return conn;
60}
61
62
63#endif /* USE_SSL */
64
65/* ====================================================================
66 * The Vovida Software License, Version 1.0
67 *
68 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
69 *
70 * Redistribution and use in source and binary forms, with or without
71 * modification, are permitted provided that the following conditions
72 * are met:
73 *
74 * 1. Redistributions of source code must retain the above copyright
75 * notice, this list of conditions and the following disclaimer.
76 *
77 * 2. Redistributions in binary form must reproduce the above copyright
78 * notice, this list of conditions and the following disclaimer in
79 * the documentation and/or other materials provided with the
80 * distribution.
81 *
82 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
83 * and "Vovida Open Communication Application Library (VOCAL)" must
84 * not be used to endorse or promote products derived from this
85 * software without prior written permission. For written
86 * permission, please contact vocal@vovida.org.
87 *
88 * 4. Products derived from this software may not be called "VOCAL", nor
89 * may "VOCAL" appear in their name, without prior written
90 * permission of Vovida Networks, Inc.
91 *
92 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
93 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
94 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
95 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
96 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
97 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
98 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
99 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
100 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
101 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
102 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
103 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
104 * DAMAGE.
105 *
106 * ====================================================================
107 *
108 * This software consists of voluntary contributions made by Vovida
109 * Networks, Inc. and many individuals on behalf of Vovida Networks,
110 * Inc. For more information on Vovida Networks, Inc., please see
111 * <http://www.vovida.org/>.
112 *
113 */
#define InfoLog(args_)
Definition Logger.hxx:131
#define resip_assert_not_null(x)
Handles cross-platform sockets compatibility.
Connection implements, via sockets, ConnectionBase for managed connections.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
A templated, threadsafe message-queue class.
Definition Fifo.hxx:16
SecurityTypes::SSLType mSslType
Compression & mCompression
const Data & tlsDomain() const
Represents a network address.
Definition Tuple.hxx:59
int getPort() const
Definition Tuple.cxx:466
std::shared_ptr< WsConnectionValidator > mConnectionValidator
WssTransport(Fifo< TransactionMessage > &fifo, int portNum, IpVersion version, const Data &interfaceObj, Security &security, const Data &sipDomain, SecurityTypes::SSLType sslType, AfterSocketCreationFuncPtr socketFunc=nullptr, Compression &compression=Compression::Disabled, unsigned transportFlags=0, SecurityTypes::TlsClientVerificationMode cvm=SecurityTypes::None, bool useEmailAsSIP=false, std::shared_ptr< WsConnectionValidator >=nullptr, std::shared_ptr< WsCookieContextFactory >=std::make_shared< BasicWsCookieContextFactory >(), const Data &certificateFilename="", const Data &privateKeyFilename="", const Data &privateKeyPassPhrase="")
Connection * createConnection(const Tuple &who, Socket fd, bool server=false) override
Makes new Connection using provided socket.
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
SSLType
Note: Before adding to the SSLType enum, please see the comments about mTlsCtx in resip/stack/ssl/Sec...
dcm! – add UnusedChecking(_enum) below;
void(* AfterSocketCreationFuncPtr)(Socket s, int transportType, const char *file, int line)
Definition Socket.hxx:107
int Socket
Definition Socket.hxx:94
IpVersion
An enumeration of IP versions.