This reverts commit b395f5bd5c5be7a3b54fc85ca482759a56a0cd6e. Reason for revert: Breaks downstream project. Jonas will help to reland this CL. Original change's description: > move relay server priority assignment to port_allocator > > which knows more about the internals of ICE. > Remove the relay server config priority field which was used to > specify the relative priority of TURN servers. This is now handled > internally by CreateRelayPortArgs without being exposed. > > Also rename BasicPortAllocator::AddTurnServer to > BasicPortAllocator::AddTurnServerForTesting since it is a test-only > method. > > BUG=webrtc:13195,webrtc:14539 > > Change-Id: Id36cbf0187b7a84d1a9b53860f31994f3c7589f0 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/280224 > Commit-Queue: Philipp Hancke <phancke@microsoft.com> > Reviewed-by: Harald Alvestrand <hta@webrtc.org> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#38520} Bug: webrtc:13195,webrtc:14539 Change-Id: I7ca087a272793908f003cea6c32efe6214e54028 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281340 Owners-Override: Artem Titov <titovartem@webrtc.org> Commit-Queue: Artem Titov <titovartem@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#38524}
69 lines
2.0 KiB
C++
69 lines
2.0 KiB
C++
/*
|
|
* Copyright 2017 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef P2P_CLIENT_RELAY_PORT_FACTORY_INTERFACE_H_
|
|
#define P2P_CLIENT_RELAY_PORT_FACTORY_INTERFACE_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "p2p/base/port_interface.h"
|
|
#include "rtc_base/ref_count.h"
|
|
|
|
namespace rtc {
|
|
class AsyncPacketSocket;
|
|
class Network;
|
|
class PacketSocketFactory;
|
|
class Thread;
|
|
} // namespace rtc
|
|
|
|
namespace webrtc {
|
|
class TurnCustomizer;
|
|
class FieldTrialsView;
|
|
} // namespace webrtc
|
|
|
|
namespace cricket {
|
|
class Port;
|
|
struct ProtocolAddress;
|
|
struct RelayServerConfig;
|
|
|
|
// A struct containing arguments to RelayPortFactory::Create()
|
|
struct CreateRelayPortArgs {
|
|
rtc::Thread* network_thread;
|
|
rtc::PacketSocketFactory* socket_factory;
|
|
const rtc::Network* network;
|
|
const ProtocolAddress* server_address;
|
|
const RelayServerConfig* config;
|
|
std::string username;
|
|
std::string password;
|
|
webrtc::TurnCustomizer* turn_customizer = nullptr;
|
|
const webrtc::FieldTrialsView* field_trials = nullptr;
|
|
};
|
|
|
|
// A factory for creating RelayPort's.
|
|
class RelayPortFactoryInterface {
|
|
public:
|
|
virtual ~RelayPortFactoryInterface() {}
|
|
|
|
// This variant is used for UDP connection to the relay server
|
|
// using a already existing shared socket.
|
|
virtual std::unique_ptr<Port> Create(const CreateRelayPortArgs& args,
|
|
rtc::AsyncPacketSocket* udp_socket) = 0;
|
|
|
|
// This variant is used for the other cases.
|
|
virtual std::unique_ptr<Port> Create(const CreateRelayPortArgs& args,
|
|
int min_port,
|
|
int max_port) = 0;
|
|
};
|
|
|
|
} // namespace cricket
|
|
|
|
#endif // P2P_CLIENT_RELAY_PORT_FACTORY_INTERFACE_H_
|