blob: 5b34e9f9ee3e77e10e9789edf2a0d1db178814c7 [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"
Adrien Béraud5c93b5a2023-07-09 19:39:35 -040024#include "ice_transport.h"
Adrien Béraud6de3f882023-07-06 12:56:29 -040025#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éraud1ae60aa2023-07-07 09:55:09 -040035namespace dhtnet {
Adrien Béraud6de3f882023-07-06 12:56:29 -040036
37class IceTransportFactory
38{
39public:
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
54private:
55 std::shared_ptr<pj_caching_pool> cp_;
56 pj_ice_strans_cfg ice_cfg_;
57};
58
59}; // namespace jami