diff --git a/CMakeLists.txt b/CMakeLists.txt index 31c3947427a277fcb563790d474c61696bb3a26f..7086126295718477b481805a4a3be6fb2a45f18f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,7 @@ list (APPEND dhtnet_HEADERS include/tls_session.h include/certstore.h include/ice_options.h + include/ice_transport.h include/fileutils.h include/string_utils.h include/ip_utils.h diff --git a/src/ice_transport.h b/include/ice_transport.h similarity index 88% rename from src/ice_transport.h rename to include/ice_transport.h index 0bf6432f2953c1fa7874e4230c49cfc262970f96..2615939b149516c0d53e024df3406d3f7459e4de 100644 --- a/src/ice_transport.h +++ b/include/ice_transport.h @@ -21,18 +21,17 @@ #pragma once #include "ice_options.h" -#include "ice_socket.h" #include "ip_utils.h" -#include <pjnath.h> -#include <pjlib.h> -#include <pjlib-util.h> - #include <functional> #include <memory> #include <msgpack.hpp> #include <vector> +extern "C" { +struct pj_ice_sess_cand; +} + namespace dht { namespace log { class Logger; @@ -194,26 +193,4 @@ private: std::unique_ptr<Impl> pimpl_; }; -class IceTransportFactory -{ -public: - IceTransportFactory(); - ~IceTransportFactory(); - - std::shared_ptr<IceTransport> createTransport(std::string_view name); - - std::unique_ptr<IceTransport> createUTransport(std::string_view name); - - /** - * PJSIP specifics - */ - pj_ice_strans_cfg getIceCfg() const { return ice_cfg_; } - pj_pool_factory* getPoolFactory() { return &cp_->factory; } - std::shared_ptr<pj_caching_pool> getPoolCaching() { return cp_; } - -private: - std::shared_ptr<pj_caching_pool> cp_; - pj_ice_strans_cfg ice_cfg_; -}; - }; // namespace jami diff --git a/src/connectionmanager.cpp b/src/connectionmanager.cpp index 531309684b612d9ddeff37f63c39dfda7ef9b07d..f60b7d2e0087cc95e6d933d1f70fbafab758c64e 100644 --- a/src/connectionmanager.cpp +++ b/src/connectionmanager.cpp @@ -17,6 +17,7 @@ */ #include "connectionmanager.h" #include "peer_connection.h" +#include "ice_transport_factory.h" #include "upnp/upnp_control.h" #include "certstore.h" #include "fileutils.h" diff --git a/src/ice_transport.cpp b/src/ice_transport.cpp index ff0b51f64216e4e1c1bd95b618bc25b54ff1d54f..1271649eb7b5a7d402d859d9ac5b31179bcb9d79 100644 --- a/src/ice_transport.cpp +++ b/src/ice_transport.cpp @@ -19,6 +19,7 @@ */ #include "ice_transport.h" +#include "ice_transport_factory.h" #include "ice_socket.h" #include "sip_utils.h" #include "string_utils.h" diff --git a/src/ice_transport_factory.h b/src/ice_transport_factory.h new file mode 100644 index 0000000000000000000000000000000000000000..97a219466ae7cc8d02534107e5273fdfa0fbe2c5 --- /dev/null +++ b/src/ice_transport_factory.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2004-2023 Savoir-faire Linux Inc. + * + * Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#pragma once + +#include "ice_options.h" +#include "ip_utils.h" + +#include <pjnath.h> +#include <pjlib.h> +#include <pjlib-util.h> + +#include <functional> +#include <memory> +#include <vector> + +namespace jami { + +class IceTransportFactory +{ +public: + IceTransportFactory(); + ~IceTransportFactory(); + + std::shared_ptr<IceTransport> createTransport(std::string_view name); + + std::unique_ptr<IceTransport> createUTransport(std::string_view name); + + /** + * PJSIP specifics + */ + pj_ice_strans_cfg getIceCfg() const { return ice_cfg_; } + pj_pool_factory* getPoolFactory() { return &cp_->factory; } + std::shared_ptr<pj_caching_pool> getPoolCaching() { return cp_; } + +private: + std::shared_ptr<pj_caching_pool> cp_; + pj_ice_strans_cfg ice_cfg_; +}; + +}; // namespace jami diff --git a/src/security/tls_session.cpp b/src/security/tls_session.cpp index 43f623d694f10f97b64a6d114329fef5cde75171..e84d277e6d16f28b3be0af869507a66a4474068d 100644 --- a/src/security/tls_session.cpp +++ b/src/security/tls_session.cpp @@ -1269,7 +1269,7 @@ TlsSession::TlsSessionImpl::handleStateHandshake(TlsSessionState state) } else if (cred != GNUTLS_CRD_CERTIFICATE) { if (params_.logger) - params_.logger->error("[TLS] spurious session credential ({})", cred); + params_.logger->error("[TLS] spurious session credential ({})", (int)cred); return TlsSessionState::SHUTDOWN; }