ice_server_parsing.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #ifndef PC_ICE_SERVER_PARSING_H_
  11. #define PC_ICE_SERVER_PARSING_H_
  12. #include <vector>
  13. #include "api/peer_connection_interface.h"
  14. #include "api/rtc_error.h"
  15. #include "p2p/base/port.h"
  16. #include "p2p/base/port_allocator.h"
  17. #include "rtc_base/system/rtc_export.h"
  18. namespace webrtc {
  19. // Parses the URLs for each server in |servers| to build |stun_servers| and
  20. // |turn_servers|. Can return SYNTAX_ERROR if the URL is malformed, or
  21. // INVALID_PARAMETER if a TURN server is missing |username| or |password|.
  22. //
  23. // Intended to be used to convert/validate the servers passed into a
  24. // PeerConnection through RTCConfiguration.
  25. RTC_EXPORT RTCErrorType
  26. ParseIceServers(const PeerConnectionInterface::IceServers& servers,
  27. cricket::ServerAddresses* stun_servers,
  28. std::vector<cricket::RelayServerConfig>* turn_servers);
  29. } // namespace webrtc
  30. #endif // PC_ICE_SERVER_PARSING_H_