Adrien Béraud | 6de3f88 | 2023-07-06 12:56:29 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004-2023 Savoir-faire Linux Inc. |
| 3 | * |
| 4 | * Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; either version 3 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with this program; if not, write to the Free Software |
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 19 | */ |
| 20 | |
| 21 | #pragma once |
| 22 | |
| 23 | #include "ice_options.h" |
Adrien Béraud | 5c93b5a | 2023-07-09 19:39:35 -0400 | [diff] [blame] | 24 | #include "ice_transport.h" |
Adrien Béraud | 6de3f88 | 2023-07-06 12:56:29 -0400 | [diff] [blame] | 25 | #include "ip_utils.h" |
| 26 | |
| 27 | #include <pjnath.h> |
| 28 | #include <pjlib.h> |
| 29 | #include <pjlib-util.h> |
| 30 | |
| 31 | #include <functional> |
| 32 | #include <memory> |
| 33 | #include <vector> |
| 34 | |
Adrien Béraud | 1ae60aa | 2023-07-07 09:55:09 -0400 | [diff] [blame] | 35 | namespace dhtnet { |
Adrien Béraud | 6de3f88 | 2023-07-06 12:56:29 -0400 | [diff] [blame] | 36 | |
| 37 | class IceTransportFactory |
| 38 | { |
| 39 | public: |
| 40 | IceTransportFactory(); |
| 41 | ~IceTransportFactory(); |
| 42 | |
| 43 | std::shared_ptr<IceTransport> createTransport(std::string_view name); |
| 44 | |
| 45 | std::unique_ptr<IceTransport> createUTransport(std::string_view name); |
| 46 | |
| 47 | /** |
| 48 | * PJSIP specifics |
| 49 | */ |
| 50 | pj_ice_strans_cfg getIceCfg() const { return ice_cfg_; } |
| 51 | pj_pool_factory* getPoolFactory() { return &cp_->factory; } |
| 52 | std::shared_ptr<pj_caching_pool> getPoolCaching() { return cp_; } |
| 53 | |
| 54 | private: |
| 55 | std::shared_ptr<pj_caching_pool> cp_; |
| 56 | pj_ice_strans_cfg ice_cfg_; |
| 57 | }; |
| 58 | |
| 59 | }; // namespace jami |