1 /* 2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "p2p/client/turn_port_factory.h" 12 13 #include <memory> 14 #include <utility> 15 16 #include "p2p/base/port_allocator.h" 17 #include "p2p/base/turn_port.h" 18 19 namespace cricket { 20 ~TurnPortFactory()21TurnPortFactory::~TurnPortFactory() {} 22 Create(const CreateRelayPortArgs & args,rtc::AsyncPacketSocket * udp_socket)23std::unique_ptr<Port> TurnPortFactory::Create( 24 const CreateRelayPortArgs& args, 25 rtc::AsyncPacketSocket* udp_socket) { 26 auto port = TurnPort::Create(args, udp_socket); 27 if (!port) 28 return nullptr; 29 port->SetTlsCertPolicy(args.config->tls_cert_policy); 30 port->SetTurnLoggingId(args.config->turn_logging_id); 31 return std::move(port); 32 } 33 Create(const CreateRelayPortArgs & args,int min_port,int max_port)34std::unique_ptr<Port> TurnPortFactory::Create(const CreateRelayPortArgs& args, 35 int min_port, 36 int max_port) { 37 auto port = TurnPort::Create(args, min_port, max_port); 38 if (!port) 39 return nullptr; 40 port->SetTlsCertPolicy(args.config->tls_cert_policy); 41 port->SetTurnLoggingId(args.config->turn_logging_id); 42 return std::move(port); 43 } 44 45 } // namespace cricket 46