blob: e7d2a612533d3bf80be7b47aad9c8ce0fc2103d3 [file] [log] [blame]
kjellanderc76dc952016-06-03 03:09:32 -07001# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
2#
3# Use of this source code is governed by a BSD-style license
4# that can be found in the LICENSE file in the root of the source
5# tree. An additional intellectual property rights grant can be found
6# in the file PATENTS. All contributing project authors may
7# be found in the AUTHORS file in the root of the source tree.
8
mbonadei9aa3f0a2017-01-24 06:58:22 -08009import("../webrtc.gni")
kjellanderc76dc952016-06-03 03:09:32 -070010
11group("p2p") {
kjellander705ecc52016-09-15 00:53:26 -070012 public_deps = [
kjellander6ceab082016-10-28 05:44:03 -070013 ":libstunprober",
kjellanderc76dc952016-06-03 03:09:32 -070014 ":rtc_p2p",
15 ]
16}
17
kjellanderb62dbbe2016-09-23 00:38:52 -070018rtc_static_library("rtc_p2p") {
Per Kjellandera7f2d842018-01-10 15:54:53 +000019 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -070020 sources = [
Steve Anton10542f22019-01-11 09:11:00 -080021 "base/async_stun_tcp_socket.cc",
22 "base/async_stun_tcp_socket.h",
23 "base/basic_async_resolver_factory.cc",
24 "base/basic_async_resolver_factory.h",
25 "base/basic_packet_socket_factory.cc",
26 "base/basic_packet_socket_factory.h",
27 "base/candidate_pair_interface.h",
28 "base/dtls_transport.cc",
29 "base/dtls_transport.h",
30 "base/dtls_transport_internal.cc",
31 "base/dtls_transport_internal.h",
32 "base/ice_credentials_iterator.cc",
33 "base/ice_credentials_iterator.h",
34 "base/ice_transport_internal.cc",
35 "base/ice_transport_internal.h",
Qingsi Wang558b93b2018-08-30 10:38:44 -070036 "base/mdns_message.cc",
37 "base/mdns_message.h",
Piotr (Peter) Slatala2b5baee2019-01-16 08:25:21 -080038 "base/no_op_dtls_transport.cc",
39 "base/no_op_dtls_transport.h",
Steve Anton10542f22019-01-11 09:11:00 -080040 "base/p2p_constants.cc",
41 "base/p2p_constants.h",
42 "base/p2p_transport_channel.cc",
43 "base/p2p_transport_channel.h",
Steve Anton10542f22019-01-11 09:11:00 -080044 "base/packet_socket_factory.cc",
45 "base/packet_socket_factory.h",
46 "base/packet_transport_interface.h",
47 "base/packet_transport_internal.cc",
48 "base/packet_transport_internal.h",
kjellanderc76dc952016-06-03 03:09:32 -070049 "base/port.cc",
50 "base/port.h",
Steve Anton10542f22019-01-11 09:11:00 -080051 "base/port_allocator.cc",
52 "base/port_allocator.h",
53 "base/port_interface.cc",
54 "base/port_interface.h",
55 "base/pseudo_tcp.cc",
56 "base/pseudo_tcp.h",
57 "base/regathering_controller.cc",
58 "base/regathering_controller.h",
59 "base/relay_port.cc",
60 "base/relay_port.h",
kjellanderc76dc952016-06-03 03:09:32 -070061 "base/stun.cc",
62 "base/stun.h",
Steve Anton10542f22019-01-11 09:11:00 -080063 "base/stun_port.cc",
64 "base/stun_port.h",
65 "base/stun_request.cc",
66 "base/stun_request.h",
67 "base/tcp_port.cc",
68 "base/tcp_port.h",
deadbeef57fd7262016-12-06 15:28:55 -080069 "base/transport.h",
Steve Anton10542f22019-01-11 09:11:00 -080070 "base/transport_description.cc",
71 "base/transport_description.h",
72 "base/transport_description_factory.cc",
73 "base/transport_description_factory.h",
74 "base/transport_factory_interface.h",
75 "base/transport_info.h",
76 "base/turn_port.cc",
77 "base/turn_port.h",
78 "base/udp_port.h",
79 "client/basic_port_allocator.cc",
80 "client/basic_port_allocator.h",
81 "client/relay_port_factory_interface.h",
82 "client/turn_port_factory.cc",
83 "client/turn_port_factory.h",
kjellanderc76dc952016-06-03 03:09:32 -070084 ]
85
kjellanderc76dc952016-06-03 03:09:32 -070086 deps = [
kjellander8a116632017-04-21 05:17:08 -070087 "../api:libjingle_peerconnection_api",
88 "../api:ortc_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +010089 "../api:scoped_refptr",
Jonas Olsson81125f02018-10-09 10:52:04 +020090 "../api/transport:enums",
Qingsi Wang93a84392018-01-30 17:13:09 -080091 "../logging:ice_log",
Zach Steinc64078f2018-11-27 15:53:01 -080092 "../logging:rtc_event_log_api",
Artem Titov94b57c02019-03-21 13:35:10 +010093 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +010094 "../rtc_base:checks",
Niels Möller13339482019-03-28 13:30:15 +010095
96 # Needed by pseudo_tcp, which should move to a separate target.
Karl Wiberg12edf4c2018-03-07 14:18:56 +010097 "../rtc_base:safe_minmax",
Qingsi Wang09619332018-09-12 22:51:55 -070098 "../rtc_base:weak_ptr",
Niels Möller13339482019-03-28 13:30:15 +010099 "../rtc_base/memory:fifo_buffer",
Yves Gerey3e707812018-11-28 16:47:49 +0100100 "../rtc_base/network:sent_packet",
Mirko Bonadei3b56ee72018-10-15 17:15:12 +0200101 "../rtc_base/system:rtc_export",
Artem Titova76af0c2018-07-23 17:38:12 +0200102 "../rtc_base/third_party/base64",
Artem Titove41c4332018-07-25 15:04:28 +0200103 "../rtc_base/third_party/sigslot",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200104 "../system_wrappers:field_trial",
105 "../system_wrappers:metrics",
Steve Antone76ca612019-01-25 12:49:14 -0800106 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200107 "//third_party/abseil-cpp/absl/memory",
Niels Möller3c7d5992018-10-19 15:29:54 +0200108 "//third_party/abseil-cpp/absl/strings",
Danil Chapovalov00c71832018-06-15 15:58:38 +0200109 "//third_party/abseil-cpp/absl/types:optional",
kjellanderc76dc952016-06-03 03:09:32 -0700110 ]
kjellanderc76dc952016-06-03 03:09:32 -0700111}
112
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800113if (rtc_include_tests) {
Piotr (Peter) Slatala4de17832019-01-29 13:35:05 -0800114 rtc_source_set("fake_ice_transport") {
115 testonly = true
116 visibility = [ "*" ]
117 sources = [
118 "base/fake_ice_transport.h",
119 ]
120 deps = [
121 ":rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100122 "../rtc_base",
Piotr (Peter) Slatala4de17832019-01-29 13:35:05 -0800123 "../rtc_base:rtc_base_approved",
Piotr (Peter) Slatala6fdb3f82019-01-29 15:54:55 -0800124 "//third_party/abseil-cpp/absl/algorithm:container",
Piotr (Peter) Slatala4de17832019-01-29 13:35:05 -0800125 "//third_party/abseil-cpp/absl/types:optional",
126 ]
127 }
128
deadbeef59edb922017-04-18 15:49:09 -0700129 rtc_source_set("p2p_test_utils") {
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800130 testonly = true
131 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800132 "base/fake_dtls_transport.h",
Steve Anton10542f22019-01-11 09:11:00 -0800133 "base/fake_packet_transport.h",
134 "base/fake_port_allocator.h",
135 "base/mock_async_resolver.h",
136 "base/mock_ice_transport.h",
137 "base/test_relay_server.h",
138 "base/test_stun_server.cc",
139 "base/test_stun_server.h",
140 "base/test_turn_customizer.h",
141 "base/test_turn_server.h",
deadbeef59edb922017-04-18 15:49:09 -0700142 ]
deadbeef59edb922017-04-18 15:49:09 -0700143 deps = [
Piotr (Peter) Slatala4de17832019-01-29 13:35:05 -0800144 ":fake_ice_transport",
Niels Möllera1342042018-11-08 16:47:14 +0100145 ":p2p_server_utils",
deadbeef59edb922017-04-18 15:49:09 -0700146 ":rtc_p2p",
Patrik Höglund7aee3d52017-11-15 13:15:17 +0100147 "../api:libjingle_peerconnection_api",
kjellander8a116632017-04-21 05:17:08 -0700148 "../api:ortc_api",
Artem Titov94b57c02019-03-21 13:35:10 +0100149 "../rtc_base",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100150 "../rtc_base:gunit_helpers",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700151 "../rtc_base:rtc_base_approved",
152 "../rtc_base:rtc_base_tests_utils",
Artem Titove41c4332018-07-25 15:04:28 +0200153 "../rtc_base/third_party/sigslot",
kjellander8a116632017-04-21 05:17:08 -0700154 "../test:test_support",
Steve Antonae226f62019-01-29 12:47:38 -0800155 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200156 "//third_party/abseil-cpp/absl/memory",
Jonas Olsson6a8727b2018-12-07 13:11:44 +0100157 "//third_party/abseil-cpp/absl/types:optional",
deadbeef59edb922017-04-18 15:49:09 -0700158 ]
deadbeef59edb922017-04-18 15:49:09 -0700159 }
160
161 rtc_source_set("rtc_p2p_unittests") {
162 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700163
deadbeef59edb922017-04-18 15:49:09 -0700164 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800165 "base/async_stun_tcp_socket_unittest.cc",
166 "base/basic_async_resolver_factory_unittest.cc",
167 "base/dtls_transport_unittest.cc",
168 "base/ice_credentials_iterator_unittest.cc",
Qingsi Wang558b93b2018-08-30 10:38:44 -0700169 "base/mdns_message_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -0800170 "base/p2p_transport_channel_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -0800171 "base/port_allocator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800172 "base/port_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -0800173 "base/pseudo_tcp_unittest.cc",
174 "base/regathering_controller_unittest.cc",
175 "base/relay_port_unittest.cc",
176 "base/relay_server_unittest.cc",
177 "base/stun_port_unittest.cc",
178 "base/stun_request_unittest.cc",
179 "base/stun_server_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800180 "base/stun_unittest.cc",
Steve Anton10542f22019-01-11 09:11:00 -0800181 "base/tcp_port_unittest.cc",
182 "base/transport_description_factory_unittest.cc",
183 "base/turn_port_unittest.cc",
184 "base/turn_server_unittest.cc",
185 "client/basic_port_allocator_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800186 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800187 deps = [
Piotr (Peter) Slatala4de17832019-01-29 13:35:05 -0800188 ":fake_ice_transport",
Niels Möllera1342042018-11-08 16:47:14 +0100189 ":p2p_server_utils",
deadbeef59edb922017-04-18 15:49:09 -0700190 ":p2p_test_utils",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800191 ":rtc_p2p",
Yves Gerey3e707812018-11-28 16:47:49 +0100192 "../api:libjingle_peerconnection_api",
kjellander8a116632017-04-21 05:17:08 -0700193 "../api:ortc_api",
Mirko Bonadeid9708072019-01-25 20:26:48 +0100194 "../api:scoped_refptr",
Yves Gerey3e707812018-11-28 16:47:49 +0100195 "../api/units:time_delta",
Artem Titov94b57c02019-03-21 13:35:10 +0100196 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100197 "../rtc_base:checks",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100198 "../rtc_base:gunit_helpers",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700199 "../rtc_base:rtc_base_approved",
200 "../rtc_base:rtc_base_tests_utils",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100201 "../rtc_base:testclient",
Yves Gerey3e707812018-11-28 16:47:49 +0100202 "../rtc_base/network:sent_packet",
Artem Titov94b57c02019-03-21 13:35:10 +0100203 "../rtc_base/third_party/sigslot",
Mirko Bonadei17f48782018-09-28 08:51:10 +0200204 "../system_wrappers:metrics",
Qingsi Wangc129c352019-04-18 10:41:58 -0700205 "../test:field_trial",
kjellander8a116632017-04-21 05:17:08 -0700206 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800207 "//testing/gtest",
Steve Antonae226f62019-01-29 12:47:38 -0800208 "//third_party/abseil-cpp/absl/algorithm:container",
Karl Wiberg918f50c2018-07-05 11:40:33 +0200209 "//third_party/abseil-cpp/absl/memory",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800210 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800211 }
212}
213
Niels Möllera1342042018-11-08 16:47:14 +0100214rtc_source_set("p2p_server_utils") {
215 testonly = true
216 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800217 "base/relay_server.cc",
218 "base/relay_server.h",
219 "base/stun_server.cc",
220 "base/stun_server.h",
221 "base/turn_server.cc",
222 "base/turn_server.h",
Niels Möllera1342042018-11-08 16:47:14 +0100223 ]
224 deps = [
225 ":rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100226 "../rtc_base",
Niels Möllera1342042018-11-08 16:47:14 +0100227 "../rtc_base:checks",
Niels Möller44153152018-12-17 14:04:05 +0100228 "../rtc_base:rtc_base_tests_utils",
Niels Möllera1342042018-11-08 16:47:14 +0100229 "../rtc_base/third_party/sigslot",
Steve Antonae226f62019-01-29 12:47:38 -0800230 "//third_party/abseil-cpp/absl/algorithm:container",
Niels Möllera1342042018-11-08 16:47:14 +0100231 "//third_party/abseil-cpp/absl/memory",
232 ]
233}
234
kjellanderb62dbbe2016-09-23 00:38:52 -0700235rtc_static_library("libstunprober") {
Per Kjellandera7f2d842018-01-10 15:54:53 +0000236 visibility = [ "*" ]
kjellanderc76dc952016-06-03 03:09:32 -0700237 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800238 "stunprober/stun_prober.cc",
239 "stunprober/stun_prober.h",
kjellanderc76dc952016-06-03 03:09:32 -0700240 ]
241
kjellanderc76dc952016-06-03 03:09:32 -0700242 deps = [
kjellander8a116632017-04-21 05:17:08 -0700243 ":rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100244 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100245 "../rtc_base:checks",
Mirko Bonadeid65d1792018-10-17 16:50:07 +0200246 "../rtc_base/system:rtc_export",
kjellanderc76dc952016-06-03 03:09:32 -0700247 ]
248}
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800249
250if (rtc_include_tests) {
251 rtc_source_set("libstunprober_unittests") {
252 testonly = true
kjellandere0629c02017-04-25 04:04:50 -0700253
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800254 sources = [
Steve Anton10542f22019-01-11 09:11:00 -0800255 "stunprober/stun_prober_unittest.cc",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800256 ]
257 deps = [
258 ":libstunprober",
kjellander8a116632017-04-21 05:17:08 -0700259 ":p2p_test_utils",
260 ":rtc_p2p",
Artem Titov94b57c02019-03-21 13:35:10 +0100261 "../rtc_base",
Patrik Höglunda8005cf2017-12-13 16:05:42 +0100262 "../rtc_base:checks",
Mirko Bonadeie3abb812018-11-23 13:15:08 +0100263 "../rtc_base:gunit_helpers",
ehmaldonadof6a861a2017-07-19 10:40:47 -0700264 "../rtc_base:rtc_base_tests_utils",
Yves Gerey3e707812018-11-28 16:47:49 +0100265 "../test:test_support",
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800266 "//testing/gtest",
267 ]
ehmaldonadoda8dcfb2017-01-04 07:11:23 -0800268 }
269}