blob: 0292192e78ce6875b233035d0c608e6bdded98eb [file] [log] [blame]
Adrien Béraud6de3f882023-07-06 12:56:29 -04001/*
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"
24#include "ip_utils.h"
25
26#include <pjnath.h>
27#include <pjlib.h>
28#include <pjlib-util.h>
29
30#include <functional>
31#include <memory>
32#include <vector>
33
Adrien Béraud1ae60aa2023-07-07 09:55:09 -040034namespace dhtnet {
Adrien Béraud6de3f882023-07-06 12:56:29 -040035
36class IceTransportFactory
37{
38public:
39 IceTransportFactory();
40 ~IceTransportFactory();
41
42 std::shared_ptr<IceTransport> createTransport(std::string_view name);
43
44 std::unique_ptr<IceTransport> createUTransport(std::string_view name);
45
46 /**
47 * PJSIP specifics
48 */
49 pj_ice_strans_cfg getIceCfg() const { return ice_cfg_; }
50 pj_pool_factory* getPoolFactory() { return &cp_->factory; }
51 std::shared_ptr<pj_caching_pool> getPoolCaching() { return cp_; }
52
53private:
54 std::shared_ptr<pj_caching_pool> cp_;
55 pj_ice_strans_cfg ice_cfg_;
56};
57
58}; // namespace jami