We now have two downstream users of stun.h, so it appears to be generally usable. I put this in a new dir networking/, but I'm open to suggestions here (maybe some things in api/ should move in there). I checked what our downstream users are actually using, and it's cricket::ComputeStunCredentialHash cricket::<constants> cricket::TurnMessage cricket::GetStunErrorResponseType cricket::StunAttribute::CreateAddress cricket::StunErrorCodeAttribute cricket::StunByteStringAttribute StunAttribute::CreateUnknownAttributes cricket::TurnErrorType cricket::StunMessage I reckoned that was pretty much everything in stun.h, so I didn't bother splitting it up. They don't use every function and constant in there, but all _types_ of functions and constants, so for the sake of coherence I don't think it makes sense to split it. There's some old stuff in there like GTURN which could arguably be split out, but it should likely go away soon anyway, so I don't think it's worth the effort. Steps: 1) land this 2) update downstream to point to the new header and target 3) remove p2p/base:stun_types. Bug: webrtc:11091 Change-Id: I1f05bf06055475d25601197ec6fefb8d3b55e8e3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159923 Commit-Queue: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29822}
305 lines
8.3 KiB
Plaintext
305 lines
8.3 KiB
Plaintext
# Copyright (c) 2016 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.
|
|
|
|
import("../webrtc.gni")
|
|
|
|
group("p2p") {
|
|
public_deps = [
|
|
":libstunprober",
|
|
":rtc_p2p",
|
|
]
|
|
}
|
|
|
|
# TODO(bugs.webrtc.org/11091): Remove this target when downstream is updated.
|
|
rtc_library("stun_types") {
|
|
sources = [
|
|
"base/empty.cc",
|
|
"base/stun.h",
|
|
]
|
|
deps = [
|
|
"../api/transport:stun_types",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
]
|
|
}
|
|
|
|
rtc_library("rtc_p2p") {
|
|
visibility = [ "*" ]
|
|
sources = [
|
|
"base/async_stun_tcp_socket.cc",
|
|
"base/async_stun_tcp_socket.h",
|
|
"base/basic_async_resolver_factory.cc",
|
|
"base/basic_async_resolver_factory.h",
|
|
"base/basic_packet_socket_factory.cc",
|
|
"base/basic_packet_socket_factory.h",
|
|
"base/candidate_pair_interface.h",
|
|
"base/connection.cc",
|
|
"base/connection.h",
|
|
"base/connection_info.cc",
|
|
"base/connection_info.h",
|
|
"base/default_ice_transport_factory.cc",
|
|
"base/default_ice_transport_factory.h",
|
|
"base/dtls_transport.cc",
|
|
"base/dtls_transport.h",
|
|
"base/dtls_transport_factory.h",
|
|
"base/dtls_transport_internal.cc",
|
|
"base/dtls_transport_internal.h",
|
|
"base/ice_credentials_iterator.cc",
|
|
"base/ice_credentials_iterator.h",
|
|
"base/ice_transport_internal.cc",
|
|
"base/ice_transport_internal.h",
|
|
"base/mdns_message.cc",
|
|
"base/mdns_message.h",
|
|
"base/no_op_dtls_transport.cc",
|
|
"base/no_op_dtls_transport.h",
|
|
"base/p2p_constants.cc",
|
|
"base/p2p_constants.h",
|
|
"base/p2p_transport_channel.cc",
|
|
"base/p2p_transport_channel.h",
|
|
"base/packet_transport_interface.h",
|
|
"base/packet_transport_internal.cc",
|
|
"base/packet_transport_internal.h",
|
|
"base/port.cc",
|
|
"base/port.h",
|
|
"base/port_allocator.cc",
|
|
"base/port_allocator.h",
|
|
"base/port_interface.cc",
|
|
"base/port_interface.h",
|
|
"base/pseudo_tcp.cc",
|
|
"base/pseudo_tcp.h",
|
|
"base/regathering_controller.cc",
|
|
"base/regathering_controller.h",
|
|
"base/stun_port.cc",
|
|
"base/stun_port.h",
|
|
"base/stun_request.cc",
|
|
"base/stun_request.h",
|
|
"base/tcp_port.cc",
|
|
"base/tcp_port.h",
|
|
"base/transport_description.cc",
|
|
"base/transport_description.h",
|
|
"base/transport_description_factory.cc",
|
|
"base/transport_description_factory.h",
|
|
"base/transport_info.h",
|
|
"base/turn_port.cc",
|
|
"base/turn_port.h",
|
|
"base/udp_port.h",
|
|
"client/basic_port_allocator.cc",
|
|
"client/basic_port_allocator.h",
|
|
"client/relay_port_factory_interface.h",
|
|
"client/turn_port_factory.cc",
|
|
"client/turn_port_factory.h",
|
|
]
|
|
|
|
deps = [
|
|
":stun_types",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:packet_socket_factory",
|
|
"../api:rtc_error",
|
|
"../api:scoped_refptr",
|
|
"../api/crypto:options",
|
|
"../api/rtc_event_log",
|
|
"../api/transport:enums",
|
|
"../api/transport:stun_types",
|
|
"../logging:ice_log",
|
|
"../rtc_base",
|
|
"../rtc_base:checks",
|
|
"../rtc_base/experiments:field_trial_parser",
|
|
"//third_party/abseil-cpp/absl/memory",
|
|
|
|
# Needed by pseudo_tcp, which should move to a separate target.
|
|
"../rtc_base:safe_minmax",
|
|
"../rtc_base:weak_ptr",
|
|
"../rtc_base/memory:fifo_buffer",
|
|
"../rtc_base/network:sent_packet",
|
|
"../rtc_base/system:rtc_export",
|
|
"../rtc_base/third_party/base64",
|
|
"../rtc_base/third_party/sigslot",
|
|
"../system_wrappers:field_trial",
|
|
"../system_wrappers:metrics",
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
"//third_party/abseil-cpp/absl/strings",
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
]
|
|
}
|
|
|
|
if (rtc_include_tests) {
|
|
rtc_library("fake_ice_transport") {
|
|
testonly = true
|
|
visibility = [ "*" ]
|
|
sources = [
|
|
"base/fake_ice_transport.h",
|
|
]
|
|
deps = [
|
|
":rtc_p2p",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../rtc_base",
|
|
"../rtc_base:rtc_base_approved",
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
]
|
|
}
|
|
|
|
rtc_library("fake_port_allocator") {
|
|
testonly = true
|
|
visibility = [ "*" ]
|
|
sources = [
|
|
"base/fake_port_allocator.h",
|
|
]
|
|
deps = [
|
|
":rtc_p2p",
|
|
"../rtc_base",
|
|
]
|
|
}
|
|
|
|
rtc_library("p2p_test_utils") {
|
|
testonly = true
|
|
sources = [
|
|
"base/fake_dtls_transport.h",
|
|
"base/fake_packet_transport.h",
|
|
"base/mock_async_resolver.h",
|
|
"base/mock_ice_transport.h",
|
|
"base/test_stun_server.cc",
|
|
"base/test_stun_server.h",
|
|
"base/test_turn_customizer.h",
|
|
"base/test_turn_server.h",
|
|
]
|
|
deps = [
|
|
":fake_ice_transport",
|
|
":fake_port_allocator",
|
|
":p2p_server_utils",
|
|
":rtc_p2p",
|
|
":stun_types",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:packet_socket_factory",
|
|
"../api/crypto:options",
|
|
"../api/transport:stun_types",
|
|
"../rtc_base",
|
|
"../rtc_base:gunit_helpers",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../rtc_base/third_party/sigslot",
|
|
"../test:test_support",
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
"//third_party/abseil-cpp/absl/types:optional",
|
|
]
|
|
}
|
|
|
|
rtc_library("rtc_p2p_unittests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"base/async_stun_tcp_socket_unittest.cc",
|
|
"base/basic_async_resolver_factory_unittest.cc",
|
|
"base/dtls_transport_unittest.cc",
|
|
"base/ice_credentials_iterator_unittest.cc",
|
|
"base/mdns_message_unittest.cc",
|
|
"base/p2p_transport_channel_unittest.cc",
|
|
"base/port_allocator_unittest.cc",
|
|
"base/port_unittest.cc",
|
|
"base/pseudo_tcp_unittest.cc",
|
|
"base/regathering_controller_unittest.cc",
|
|
"base/stun_port_unittest.cc",
|
|
"base/stun_request_unittest.cc",
|
|
"base/stun_server_unittest.cc",
|
|
"base/tcp_port_unittest.cc",
|
|
"base/transport_description_factory_unittest.cc",
|
|
"base/turn_port_unittest.cc",
|
|
"base/turn_server_unittest.cc",
|
|
"client/basic_port_allocator_unittest.cc",
|
|
]
|
|
deps = [
|
|
":fake_ice_transport",
|
|
":fake_port_allocator",
|
|
":p2p_server_utils",
|
|
":p2p_test_utils",
|
|
":rtc_p2p",
|
|
":stun_types",
|
|
"../api:libjingle_peerconnection_api",
|
|
"../api:packet_socket_factory",
|
|
"../api:scoped_refptr",
|
|
"../api/transport:stun_types",
|
|
"../api/units:time_delta",
|
|
"../rtc_base",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:gunit_helpers",
|
|
"../rtc_base:rtc_base_approved",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../rtc_base:testclient",
|
|
"../rtc_base/network:sent_packet",
|
|
"../rtc_base/third_party/sigslot",
|
|
"../system_wrappers:metrics",
|
|
"../test:field_trial",
|
|
"../test:test_support",
|
|
"//testing/gtest",
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
"//third_party/abseil-cpp/absl/memory",
|
|
]
|
|
}
|
|
}
|
|
|
|
rtc_library("p2p_server_utils") {
|
|
testonly = true
|
|
sources = [
|
|
"base/stun_server.cc",
|
|
"base/stun_server.h",
|
|
"base/turn_server.cc",
|
|
"base/turn_server.h",
|
|
]
|
|
deps = [
|
|
":rtc_p2p",
|
|
":stun_types",
|
|
"../api:packet_socket_factory",
|
|
"../api/transport:stun_types",
|
|
"../rtc_base",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../rtc_base/third_party/sigslot",
|
|
"//third_party/abseil-cpp/absl/algorithm:container",
|
|
]
|
|
}
|
|
|
|
rtc_library("libstunprober") {
|
|
visibility = [ "*" ]
|
|
sources = [
|
|
"stunprober/stun_prober.cc",
|
|
"stunprober/stun_prober.h",
|
|
]
|
|
|
|
deps = [
|
|
":rtc_p2p",
|
|
":stun_types",
|
|
"../api:packet_socket_factory",
|
|
"../api/transport:stun_types",
|
|
"../rtc_base",
|
|
"../rtc_base:checks",
|
|
"../rtc_base/system:rtc_export",
|
|
]
|
|
}
|
|
|
|
if (rtc_include_tests) {
|
|
rtc_library("libstunprober_unittests") {
|
|
testonly = true
|
|
|
|
sources = [
|
|
"stunprober/stun_prober_unittest.cc",
|
|
]
|
|
deps = [
|
|
":libstunprober",
|
|
":p2p_test_utils",
|
|
":rtc_p2p",
|
|
"../rtc_base",
|
|
"../rtc_base:checks",
|
|
"../rtc_base:gunit_helpers",
|
|
"../rtc_base:rtc_base_tests_utils",
|
|
"../test:test_support",
|
|
"//testing/gtest",
|
|
]
|
|
}
|
|
}
|