blob: 549964e285d8f375d0328f5b5e0ccc4e9ac5b996 [file] [log] [blame]
deadbeef1dcb1642017-03-30 04:08:161/*
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
Steve Anton10542f22019-01-11 17:11:0011#ifndef PC_ICE_SERVER_PARSING_H_
12#define PC_ICE_SERVER_PARSING_H_
deadbeef1dcb1642017-03-30 04:08:1613
14#include <vector>
15
Steve Anton10542f22019-01-11 17:11:0016#include "api/peer_connection_interface.h"
17#include "api/rtc_error.h"
Yves Gerey3e707812018-11-28 15:47:4918#include "p2p/base/port.h"
Steve Anton10542f22019-01-11 17:11:0019#include "p2p/base/port_allocator.h"
Mirko Bonadei66e76792019-04-02 09:33:5920#include "rtc_base/system/rtc_export.h"
deadbeef1dcb1642017-03-30 04:08:1621
22namespace webrtc {
23
Artem Titov880fa812021-07-30 20:30:2324// Parses the URLs for each server in `servers` to build `stun_servers` and
25// `turn_servers`. Can return SYNTAX_ERROR if the URL is malformed, or
26// INVALID_PARAMETER if a TURN server is missing `username` or `password`.
deadbeef1dcb1642017-03-30 04:08:1627//
28// Intended to be used to convert/validate the servers passed into a
29// PeerConnection through RTCConfiguration.
Philipp Hancke633dc2f2022-10-12 08:16:1430RTC_EXPORT RTCError
31ParseIceServersOrError(const PeerConnectionInterface::IceServers& servers,
32 cricket::ServerAddresses* stun_servers,
33 std::vector<cricket::RelayServerConfig>* turn_servers);
34
35[[deprecated("use ParseIceServersOrError")]] RTC_EXPORT RTCErrorType
Mirko Bonadei66e76792019-04-02 09:33:5936ParseIceServers(const PeerConnectionInterface::IceServers& servers,
37 cricket::ServerAddresses* stun_servers,
38 std::vector<cricket::RelayServerConfig>* turn_servers);
deadbeef1dcb1642017-03-30 04:08:1639
40} // namespace webrtc
41
Steve Anton10542f22019-01-11 17:11:0042#endif // PC_ICE_SERVER_PARSING_H_