blob: 323a334a09aebdf290ec8fb325e417c773069c67 [file] [log] [blame]
Alex Perryb3b50792020-01-18 16:13:45 -08001load("//aos/seasocks:gen_embedded.bzl", "gen_embedded")
Austin Schuhe84c3ed2019-12-14 15:29:48 -08002load("//aos:config.bzl", "aos_config")
Austin Schuh0de30f32020-12-06 12:44:28 -08003load("//aos:flatbuffers.bzl", "cc_static_flatbuffer")
4load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library", "flatbuffer_ts_library")
Austin Schuhe84c3ed2019-12-14 15:29:48 -08005
Brian Silverman7a7c24d2018-09-01 17:49:09 -07006package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04007
Austin Schuhe84c3ed2019-12-14 15:29:48 -08008flatbuffer_cc_library(
Austin Schuh0de30f32020-12-06 12:44:28 -08009 name = "remote_message_fbs",
10 srcs = ["remote_message.fbs"],
11 gen_reflections = 1,
12)
13
14cc_static_flatbuffer(
15 name = "remote_message_schema",
16 function = "aos::message_bridge::RemoteMessageSchema",
17 target = ":remote_message_fbs_reflection_out",
18)
19
20flatbuffer_cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -080021 name = "connect_fbs",
22 srcs = ["connect.fbs"],
23 gen_reflections = 1,
24 includes = [
25 "//aos:configuration_fbs_includes",
26 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080027 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080028)
29
Alex Perryd5e13572020-02-22 15:15:08 -080030flatbuffer_ts_library(
31 name = "connect_ts_fbs",
32 srcs = ["connect.fbs"],
33 includes = [
34 "//aos:configuration_fbs_includes",
35 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080036 target_compatible_with = ["@platforms//os:linux"],
Alex Perryd5e13572020-02-22 15:15:08 -080037)
38
Austin Schuhe84c3ed2019-12-14 15:29:48 -080039flatbuffer_cc_library(
Austin Schuhf068dca2021-03-14 21:38:40 -070040 name = "remote_data_fbs",
41 srcs = ["remote_data.fbs"],
42 gen_reflections = 1,
43 target_compatible_with = ["@platforms//os:linux"],
44)
45
46flatbuffer_cc_library(
Austin Schuh7bc59052020-02-16 23:48:33 -080047 name = "timestamp_fbs",
48 srcs = ["timestamp.fbs"],
49 gen_reflections = 1,
50 includes = [
51 "//aos:configuration_fbs_includes",
52 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080053 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh7bc59052020-02-16 23:48:33 -080054)
55
Austin Schuha9df9ad2021-06-16 14:49:39 -070056cc_static_flatbuffer(
57 name = "timestamp_schema",
58 function = "aos::message_bridge::TimestampSchema",
59 target = ":timestamp_fbs_reflection_out",
60 visibility = ["//visibility:public"],
61)
62
Austin Schuh7bc59052020-02-16 23:48:33 -080063flatbuffer_cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -080064 name = "message_bridge_client_fbs",
65 srcs = ["message_bridge_client.fbs"],
66 gen_reflections = 1,
67 includes = [
68 ":message_bridge_server_fbs_includes",
69 "//aos:configuration_fbs_includes",
70 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080071 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080072)
73
Austin Schuha9df9ad2021-06-16 14:49:39 -070074cc_static_flatbuffer(
75 name = "message_bridge_client_schema",
76 function = "aos::message_bridge::ClientStatisticsSchema",
77 target = ":message_bridge_client_fbs_reflection_out",
78 visibility = ["//visibility:public"],
79)
80
Austin Schuhe84c3ed2019-12-14 15:29:48 -080081flatbuffer_cc_library(
82 name = "message_bridge_server_fbs",
83 srcs = ["message_bridge_server.fbs"],
84 gen_reflections = 1,
85 includes = [
86 "//aos:configuration_fbs_includes",
87 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080088 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080089)
90
Austin Schuha9df9ad2021-06-16 14:49:39 -070091cc_static_flatbuffer(
92 name = "message_bridge_server_schema",
93 function = "aos::message_bridge::ServerStatisticsSchema",
94 target = ":message_bridge_server_fbs_reflection_out",
95 visibility = ["//visibility:public"],
96)
97
Brian Silverman100534c2015-09-07 15:51:23 -040098cc_library(
Brian Silverman7a7c24d2018-09-01 17:49:09 -070099 name = "team_number",
100 srcs = [
101 "team_number.cc",
102 ],
103 hdrs = [
104 "team_number.h",
105 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800106 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700107 deps = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800108 "@com_github_google_glog//:glog",
Austin Schuh4c84abb2021-06-20 18:16:32 -0700109 "@com_google_absl//absl/strings",
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700110 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400111)
112
Austin Schuhdf5591e2015-12-19 22:36:50 -0800113cc_test(
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700114 name = "team_number_test",
115 srcs = [
116 "team_number_test.cc",
117 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800118 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700119 deps = [
120 ":team_number",
Jim Ostrowski8565b402020-02-29 20:26:53 -0800121 "//aos:configuration",
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700122 "//aos/testing:googletest",
123 ],
Austin Schuhdf5591e2015-12-19 22:36:50 -0800124)
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800125
126cc_library(
127 name = "sctp_lib",
128 srcs = [
129 "sctp_lib.cc",
130 ],
131 hdrs = [
132 "sctp_lib.h",
133 ],
134 copts = [
135 # The casts required to read datastructures from sockets trip -Wcast-align.
136 "-Wno-cast-align",
137 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800138 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800139 deps = [
140 "//aos:unique_malloc_ptr",
Austin Schuh2fe4b712020-03-15 14:21:45 -0700141 "//aos/util:file",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800142 "//third_party/lksctp-tools:sctp",
143 "@com_github_google_glog//:glog",
144 ],
145)
146
147cc_library(
148 name = "sctp_server",
149 srcs = [
150 "sctp_server.cc",
151 ],
152 hdrs = [
153 "sctp_server.h",
154 ],
155 copts = [
156 "-Wno-cast-align",
157 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800158 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800159 deps = [
160 ":sctp_lib",
161 "//third_party/lksctp-tools:sctp",
162 ],
163)
164
165cc_library(
166 name = "message_bridge_protocol",
Austin Schuh7bc59052020-02-16 23:48:33 -0800167 srcs = [
168 "message_bridge_protocol.cc",
169 ],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800170 hdrs = [
171 "message_bridge_protocol.h",
172 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800173 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh7bc59052020-02-16 23:48:33 -0800174 deps = [
175 ":connect_fbs",
176 "//aos:configuration",
177 "//aos:flatbuffer_merge",
178 "//aos:flatbuffers",
Austin Schuh4385b142021-03-14 21:31:13 -0700179 "//aos:uuid",
Austin Schuh7bc59052020-02-16 23:48:33 -0800180 "@com_github_google_flatbuffers//:flatbuffers",
181 ],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800182)
183
184cc_library(
Austin Schuhe19b6752020-08-27 23:20:19 -0700185 name = "message_bridge_server_status",
186 srcs = [
187 "message_bridge_server_status.cc",
188 ],
189 hdrs = [
190 "message_bridge_server_status.h",
191 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800192 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe19b6752020-08-27 23:20:19 -0700193 deps = [
194 ":message_bridge_client_fbs",
195 ":message_bridge_server_fbs",
196 ":timestamp_fbs",
197 ":timestamp_filter",
198 "//aos:flatbuffer_merge",
199 "//aos:flatbuffers",
200 "//aos/events:event_loop",
201 "//aos/time",
202 ],
203)
204
205cc_library(
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800206 name = "timestamp_channel",
207 srcs = ["timestamp_channel.cc"],
208 hdrs = ["timestamp_channel.h"],
209 deps = [
210 ":remote_message_fbs",
211 "//aos:configuration",
212 "//aos/events:event_loop",
213 "@com_github_google_glog//:glog",
214 "@com_google_absl//absl/container:btree",
215 "@com_google_absl//absl/strings",
216 ],
217)
218
219cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800220 name = "message_bridge_server_lib",
221 srcs = [
222 "message_bridge_server_lib.cc",
223 ],
224 hdrs = [
225 "message_bridge_server_lib.h",
226 ],
227 copts = [
228 "-Wno-cast-align",
229 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800230 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800231 deps = [
232 ":connect_fbs",
Austin Schuh7bc59052020-02-16 23:48:33 -0800233 ":message_bridge_client_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800234 ":message_bridge_protocol",
235 ":message_bridge_server_fbs",
Austin Schuhe19b6752020-08-27 23:20:19 -0700236 ":message_bridge_server_status",
Austin Schuhf068dca2021-03-14 21:38:40 -0700237 ":remote_data_fbs",
Austin Schuh0de30f32020-12-06 12:44:28 -0800238 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800239 ":sctp_lib",
240 ":sctp_server",
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800241 ":timestamp_channel",
Austin Schuh7bc59052020-02-16 23:48:33 -0800242 ":timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800243 "//aos:unique_malloc_ptr",
244 "//aos/events:shm_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800245 "//aos/events/logging:log_reader",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800246 "//third_party/lksctp-tools:sctp",
247 ],
248)
249
250cc_binary(
251 name = "message_bridge_server",
252 srcs = [
253 "message_bridge_server.cc",
254 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800255 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800256 deps = [
257 ":message_bridge_server_lib",
258 "//aos:init",
259 "//aos:json_to_flatbuffer",
260 "//aos/events:shm_event_loop",
261 ],
262)
263
264cc_library(
265 name = "sctp_client",
266 srcs = [
267 "sctp_client.cc",
268 ],
269 hdrs = [
270 "sctp_client.h",
271 ],
272 copts = [
273 "-Wno-cast-align",
274 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800275 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800276 deps = [
277 ":sctp_lib",
278 "//third_party/lksctp-tools:sctp",
279 ],
280)
281
282cc_library(
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700283 name = "message_bridge_client_status",
284 srcs = [
285 "message_bridge_client_status.cc",
286 ],
287 hdrs = [
288 "message_bridge_client_status.h",
289 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800290 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700291 deps = [
292 ":message_bridge_client_fbs",
293 ":message_bridge_server_fbs",
294 ":timestamp_filter",
295 "//aos:flatbuffers",
296 "//aos/events:event_loop",
297 "//aos/time",
298 ],
299)
300
301cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800302 name = "message_bridge_client_lib",
303 srcs = [
304 "message_bridge_client_lib.cc",
305 ],
306 hdrs = [
307 "message_bridge_client_lib.h",
308 ],
309 copts = [
310 "-Wno-cast-align",
311 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800312 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800313 deps = [
314 ":connect_fbs",
315 ":message_bridge_client_fbs",
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700316 ":message_bridge_client_status",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800317 ":message_bridge_protocol",
318 ":message_bridge_server_fbs",
Austin Schuhf068dca2021-03-14 21:38:40 -0700319 ":remote_data_fbs",
Austin Schuh0de30f32020-12-06 12:44:28 -0800320 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800321 ":sctp_client",
Austin Schuh7bc59052020-02-16 23:48:33 -0800322 ":timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800323 "//aos/events:shm_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800324 "//aos/events/logging:log_reader",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800325 ],
326)
327
328cc_binary(
329 name = "message_bridge_client",
330 srcs = [
331 "message_bridge_client.cc",
332 ],
333 copts = [
334 "-Wno-cast-align",
335 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800336 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800337 deps = [
338 ":message_bridge_client_lib",
339 "//aos:init",
340 "//aos:json_to_flatbuffer",
341 "//aos/events:shm_event_loop",
342 ],
343)
344
345aos_config(
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800346 name = "message_bridge_test_combined_timestamps_common_config",
347 src = "message_bridge_test_combined_timestamps_common.json",
348 flatbuffers = [
349 ":remote_message_fbs",
350 "//aos/events:ping_fbs",
351 "//aos/events:pong_fbs",
352 "//aos/network:message_bridge_client_fbs",
353 "//aos/network:message_bridge_server_fbs",
354 "//aos/network:timestamp_fbs",
355 ],
356 target_compatible_with = ["@platforms//os:linux"],
357 deps = ["//aos/events:config"],
358)
359
360aos_config(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800361 name = "message_bridge_test_common_config",
362 src = "message_bridge_test_common.json",
363 flatbuffers = [
Austin Schuh0de30f32020-12-06 12:44:28 -0800364 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800365 "//aos/events:ping_fbs",
366 "//aos/events:pong_fbs",
367 "//aos/network:message_bridge_client_fbs",
368 "//aos/network:message_bridge_server_fbs",
Austin Schuh7bc59052020-02-16 23:48:33 -0800369 "//aos/network:timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800370 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800371 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800372 deps = ["//aos/events:config"],
373)
374
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800375cc_test(
376 name = "message_bridge_test",
377 srcs = [
378 "message_bridge_test.cc",
379 ],
380 data = [
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800381 ":message_bridge_test_combined_timestamps_common_config",
Austin Schuhf466ab52021-02-16 22:00:38 -0800382 ":message_bridge_test_common_config",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800383 ],
Austin Schuh025ff512021-02-07 23:06:48 -0800384 flaky = True,
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800385 shard_count = 10,
Philipp Schraderdada1072020-11-24 11:34:46 -0800386 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800387 deps = [
388 ":message_bridge_client_lib",
389 ":message_bridge_server_lib",
390 "//aos:json_to_flatbuffer",
391 "//aos/events:ping_fbs",
392 "//aos/events:pong_fbs",
393 "//aos/events:shm_event_loop",
Brian Silverman7b266d92021-02-17 21:24:02 -0800394 "//aos/ipc_lib:event",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800395 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700396 "//aos/testing:path",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800397 ],
398)
Alex Perryb3b50792020-01-18 16:13:45 -0800399
400flatbuffer_cc_library(
401 name = "web_proxy_fbs",
402 srcs = ["web_proxy.fbs"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800403 gen_reflections = True,
Alex Perry5f474f22020-02-01 12:14:24 -0800404 includes = [
405 ":connect_fbs_includes",
406 "//aos:configuration_fbs_includes",
407 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800408 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800409)
410
411flatbuffer_ts_library(
412 name = "web_proxy_ts_fbs",
413 srcs = ["web_proxy.fbs"],
Alex Perry5f474f22020-02-01 12:14:24 -0800414 includes = [
415 ":connect_fbs_includes",
416 "//aos:configuration_fbs_includes",
417 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800418 target_compatible_with = ["@platforms//os:linux"],
Alex Perry5f474f22020-02-01 12:14:24 -0800419)
420
421cc_library(
422 name = "web_proxy_utils",
Alex Perry5f474f22020-02-01 12:14:24 -0800423 srcs = ["web_proxy_utils.cc"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800424 hdrs = ["web_proxy_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800425 target_compatible_with = ["@platforms//os:linux"],
Alex Perry5f474f22020-02-01 12:14:24 -0800426 deps = [
427 ":connect_fbs",
428 ":web_proxy_fbs",
429 "//aos:configuration_fbs",
430 "//aos/events:event_loop",
431 "@com_github_google_flatbuffers//:flatbuffers",
432 ],
Alex Perryb3b50792020-01-18 16:13:45 -0800433)
434
435cc_library(
436 name = "web_proxy",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700437 srcs = [
438 "rawrtc.cc",
439 "web_proxy.cc",
440 ],
441 hdrs = [
442 "rawrtc.h",
443 "web_proxy.h",
444 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800445 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800446 deps = [
Alex Perry5f474f22020-02-01 12:14:24 -0800447 ":connect_fbs",
James Kuszmaul48671362020-12-24 13:54:16 -0800448 ":gen_embedded",
Alex Perryb3b50792020-01-18 16:13:45 -0800449 ":web_proxy_fbs",
Alex Perry5f474f22020-02-01 12:14:24 -0800450 ":web_proxy_utils",
451 "//aos/events:shm_event_loop",
James Kuszmaul8d928d02020-12-25 17:47:49 -0800452 "//aos/mutex",
Alex Perryb3b50792020-01-18 16:13:45 -0800453 "//aos/seasocks:seasocks_logger",
Austin Schuh8bd96322020-02-13 21:18:22 -0800454 "//third_party/seasocks",
Alex Perryb3b50792020-01-18 16:13:45 -0800455 "@com_github_google_glog//:glog",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700456 "@com_github_rawrtc_rawrtc//:rawrtc",
Alex Perryb3b50792020-01-18 16:13:45 -0800457 ],
458)
459
460gen_embedded(
461 name = "gen_embedded",
462 srcs = glob(
463 include = ["www_defaults/**/*"],
464 exclude = ["www/**/*"],
465 ),
Philipp Schraderdada1072020-11-24 11:34:46 -0800466 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800467)
468
469cc_binary(
470 name = "web_proxy_main",
471 srcs = ["web_proxy_main.cc"],
Alex Perryb3b50792020-01-18 16:13:45 -0800472 data = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800473 "//aos/network/www:files",
Austin Schuhda9d0602019-09-15 17:29:38 -0700474 "//aos/network/www:main_bundle.min.js",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800475 "@com_github_google_flatbuffers//:flatjs",
476 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800477 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800478 deps = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800479 ":web_proxy",
480 "//aos:init",
481 "//aos/events:shm_event_loop",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800482 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perryb3b50792020-01-18 16:13:45 -0800483 ],
484)
Austin Schuh8bd96322020-02-13 21:18:22 -0800485
James Kuszmaul71a81932020-12-15 21:08:01 -0800486cc_binary(
487 name = "log_web_proxy_main",
488 srcs = ["log_web_proxy_main.cc"],
489 args = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800490 "--data_dir=aos/network/www",
491 ],
James Kuszmaul71a81932020-12-15 21:08:01 -0800492 deps = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800493 ":web_proxy",
494 "//aos:init",
495 "//aos/events:simulated_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800496 "//aos/events/logging:log_reader",
James Kuszmaul71a81932020-12-15 21:08:01 -0800497 "@com_github_google_flatbuffers//:flatbuffers",
498 ],
499)
500
Austin Schuh8bd96322020-02-13 21:18:22 -0800501cc_library(
502 name = "timestamp_filter",
Austin Schuh7ee6f722020-08-24 16:19:36 -0700503 srcs = ["timestamp_filter.cc"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800504 hdrs = ["timestamp_filter.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800505 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800506 deps = [
Austin Schuh04eccfc2020-08-26 21:08:27 -0700507 "//aos:configuration",
Austin Schuh66168842021-08-17 19:42:21 -0700508 "//aos/events/logging:boot_timestamp",
Austin Schuh8bd96322020-02-13 21:18:22 -0800509 "//aos/time",
Austin Schuh85357ee2020-08-24 16:41:42 -0700510 "@com_google_absl//absl/strings",
Austin Schuh8bd96322020-02-13 21:18:22 -0800511 ],
512)
513
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800514cc_library(
515 name = "multinode_timestamp_filter",
516 srcs = ["multinode_timestamp_filter.cc"],
517 hdrs = ["multinode_timestamp_filter.h"],
518 target_compatible_with = ["@platforms//os:linux"],
519 deps = [
520 ":timestamp_filter",
521 "//aos:configuration",
522 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700523 "//aos/events/logging:boot_timestamp",
Austin Schuhe639ea12021-01-25 13:00:22 -0800524 "//aos/events/logging:logfile_utils",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800525 "//aos/time",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800526 "@org_tuxfamily_eigen//:eigen",
527 ],
528)
529
Austin Schuh8bd96322020-02-13 21:18:22 -0800530cc_test(
531 name = "timestamp_filter_test",
532 srcs = [
533 "timestamp_filter_test.cc",
534 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800535 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800536 deps = [
537 ":timestamp_filter",
Austin Schuh04eccfc2020-08-26 21:08:27 -0700538 "//aos:json_to_flatbuffer",
Austin Schuh8bd96322020-02-13 21:18:22 -0800539 "//aos/testing:googletest",
540 ],
541)
Austin Schuh7466fe12020-12-29 23:01:47 -0800542
Austin Schuha9abc032021-01-01 16:46:19 -0800543cc_library(
544 name = "testing_time_converter",
545 testonly = True,
546 srcs = ["testing_time_converter.cc"],
547 hdrs = ["testing_time_converter.h"],
548 deps = [
549 ":multinode_timestamp_filter",
550 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700551 "//aos/events/logging:boot_timestamp",
Austin Schuha9abc032021-01-01 16:46:19 -0800552 "//aos/time",
553 ],
554)
555
Austin Schuh0a0a8272021-12-08 13:19:32 -0800556cc_binary(
557 name = "sctp_lib_shim.so",
558 testonly = True,
559 srcs = [
560 "sctp_lib_shim.c",
561 ],
562 linkopts = [
563 "-ldl",
564 ],
565 linkshared = True,
566 target_compatible_with = ["@platforms//os:linux"],
567)
568
569cc_binary(
570 name = "sctp_lib_test_binary",
571 testonly = True,
572 srcs = [
573 "sctp_lib_test.cc",
574 ],
575 linkstatic = False,
576 target_compatible_with = ["@platforms//os:linux"],
577 deps = [
578 ":sctp_lib",
579 "//aos:init",
580 ],
581)
582
583sh_test(
584 name = "sctp_lib_test",
585 srcs = [
586 "sctp_lib_test.sh",
587 ],
588 args = [
589 "$(location :sctp_lib_test_binary)",
590 "$(location :sctp_lib_shim.so)",
591 ],
592 data = [
593 ":sctp_lib_shim.so",
594 ":sctp_lib_test_binary",
595 ],
596 target_compatible_with = ["@platforms//os:linux"],
597 deps = [
598 "@bazel_tools//tools/bash/runfiles",
599 ],
600)
601
Austin Schuh7466fe12020-12-29 23:01:47 -0800602cc_test(
603 name = "multinode_timestamp_filter_test",
604 srcs = [
605 "multinode_timestamp_filter_test.cc",
606 ],
607 target_compatible_with = ["@platforms//os:linux"],
608 deps = [
609 ":multinode_timestamp_filter",
Austin Schuha9abc032021-01-01 16:46:19 -0800610 ":testing_time_converter",
Austin Schuh7466fe12020-12-29 23:01:47 -0800611 ":timestamp_filter",
612 "//aos/testing:googletest",
Austin Schuh7466fe12020-12-29 23:01:47 -0800613 ],
614)