blob: f05a75e2995ab2e3875c5906ec609da8df9a3d66 [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")
Austin Schuha1d006e2022-09-14 21:50:42 -07004load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
5load("@com_github_google_flatbuffers//:typescript.bzl", "flatbuffer_ts_library")
Austin Schuhe84c3ed2019-12-14 15:29:48 -08006
Brian Silverman7a7c24d2018-09-01 17:49:09 -07007package(default_visibility = ["//visibility:public"])
Brian Silverman100534c2015-09-07 15:51:23 -04008
Austin Schuhe84c3ed2019-12-14 15:29:48 -08009flatbuffer_cc_library(
Austin Schuh0de30f32020-12-06 12:44:28 -080010 name = "remote_message_fbs",
11 srcs = ["remote_message.fbs"],
12 gen_reflections = 1,
13)
14
15cc_static_flatbuffer(
16 name = "remote_message_schema",
17 function = "aos::message_bridge::RemoteMessageSchema",
18 target = ":remote_message_fbs_reflection_out",
19)
20
21flatbuffer_cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -080022 name = "connect_fbs",
23 srcs = ["connect.fbs"],
24 gen_reflections = 1,
25 includes = [
26 "//aos:configuration_fbs_includes",
27 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080028 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080029)
30
Alex Perryd5e13572020-02-22 15:15:08 -080031flatbuffer_ts_library(
32 name = "connect_ts_fbs",
33 srcs = ["connect.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -080034 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -070035 deps = [
36 "//aos:configuration_ts_fbs",
37 ],
Alex Perryd5e13572020-02-22 15:15:08 -080038)
39
Austin Schuhe84c3ed2019-12-14 15:29:48 -080040flatbuffer_cc_library(
Austin Schuhf068dca2021-03-14 21:38:40 -070041 name = "remote_data_fbs",
42 srcs = ["remote_data.fbs"],
43 gen_reflections = 1,
44 target_compatible_with = ["@platforms//os:linux"],
45)
46
47flatbuffer_cc_library(
Austin Schuh7bc59052020-02-16 23:48:33 -080048 name = "timestamp_fbs",
49 srcs = ["timestamp.fbs"],
50 gen_reflections = 1,
51 includes = [
52 "//aos:configuration_fbs_includes",
53 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080054 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh7bc59052020-02-16 23:48:33 -080055)
56
Austin Schuha9df9ad2021-06-16 14:49:39 -070057cc_static_flatbuffer(
58 name = "timestamp_schema",
59 function = "aos::message_bridge::TimestampSchema",
60 target = ":timestamp_fbs_reflection_out",
61 visibility = ["//visibility:public"],
62)
63
Austin Schuh7bc59052020-02-16 23:48:33 -080064flatbuffer_cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -080065 name = "message_bridge_client_fbs",
66 srcs = ["message_bridge_client.fbs"],
67 gen_reflections = 1,
68 includes = [
69 ":message_bridge_server_fbs_includes",
70 "//aos:configuration_fbs_includes",
71 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080072 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080073)
74
Austin Schuha9df9ad2021-06-16 14:49:39 -070075cc_static_flatbuffer(
76 name = "message_bridge_client_schema",
77 function = "aos::message_bridge::ClientStatisticsSchema",
78 target = ":message_bridge_client_fbs_reflection_out",
79 visibility = ["//visibility:public"],
80)
81
Austin Schuhe84c3ed2019-12-14 15:29:48 -080082flatbuffer_cc_library(
83 name = "message_bridge_server_fbs",
84 srcs = ["message_bridge_server.fbs"],
85 gen_reflections = 1,
86 includes = [
87 "//aos:configuration_fbs_includes",
88 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080089 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -080090)
91
Austin Schuha9df9ad2021-06-16 14:49:39 -070092cc_static_flatbuffer(
93 name = "message_bridge_server_schema",
94 function = "aos::message_bridge::ServerStatisticsSchema",
95 target = ":message_bridge_server_fbs_reflection_out",
96 visibility = ["//visibility:public"],
97)
98
Brian Silverman100534c2015-09-07 15:51:23 -040099cc_library(
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700100 name = "team_number",
101 srcs = [
102 "team_number.cc",
103 ],
104 hdrs = [
105 "team_number.h",
106 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800107 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700108 deps = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800109 "@com_github_google_glog//:glog",
Austin Schuh4c84abb2021-06-20 18:16:32 -0700110 "@com_google_absl//absl/strings",
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700111 ],
Brian Silverman100534c2015-09-07 15:51:23 -0400112)
113
Austin Schuhdf5591e2015-12-19 22:36:50 -0800114cc_test(
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700115 name = "team_number_test",
116 srcs = [
117 "team_number_test.cc",
118 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800119 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700120 deps = [
121 ":team_number",
Jim Ostrowski8565b402020-02-29 20:26:53 -0800122 "//aos:configuration",
Brian Silverman7a7c24d2018-09-01 17:49:09 -0700123 "//aos/testing:googletest",
124 ],
Austin Schuhdf5591e2015-12-19 22:36:50 -0800125)
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800126
127cc_library(
128 name = "sctp_lib",
129 srcs = [
130 "sctp_lib.cc",
131 ],
132 hdrs = [
133 "sctp_lib.h",
134 ],
135 copts = [
136 # The casts required to read datastructures from sockets trip -Wcast-align.
137 "-Wno-cast-align",
138 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800139 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800140 deps = [
141 "//aos:unique_malloc_ptr",
Austin Schuh2fe4b712020-03-15 14:21:45 -0700142 "//aos/util:file",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800143 "//third_party/lksctp-tools:sctp",
144 "@com_github_google_glog//:glog",
145 ],
146)
147
148cc_library(
149 name = "sctp_server",
150 srcs = [
151 "sctp_server.cc",
152 ],
153 hdrs = [
154 "sctp_server.h",
155 ],
156 copts = [
157 "-Wno-cast-align",
158 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800159 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800160 deps = [
161 ":sctp_lib",
162 "//third_party/lksctp-tools:sctp",
163 ],
164)
165
166cc_library(
167 name = "message_bridge_protocol",
Austin Schuh7bc59052020-02-16 23:48:33 -0800168 srcs = [
169 "message_bridge_protocol.cc",
170 ],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800171 hdrs = [
172 "message_bridge_protocol.h",
173 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800174 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh7bc59052020-02-16 23:48:33 -0800175 deps = [
176 ":connect_fbs",
177 "//aos:configuration",
178 "//aos:flatbuffer_merge",
179 "//aos:flatbuffers",
Austin Schuh4385b142021-03-14 21:31:13 -0700180 "//aos:uuid",
Austin Schuh7bc59052020-02-16 23:48:33 -0800181 "@com_github_google_flatbuffers//:flatbuffers",
182 ],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800183)
184
185cc_library(
Austin Schuhe19b6752020-08-27 23:20:19 -0700186 name = "message_bridge_server_status",
187 srcs = [
188 "message_bridge_server_status.cc",
189 ],
190 hdrs = [
191 "message_bridge_server_status.h",
192 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800193 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe19b6752020-08-27 23:20:19 -0700194 deps = [
195 ":message_bridge_client_fbs",
196 ":message_bridge_server_fbs",
197 ":timestamp_fbs",
198 ":timestamp_filter",
199 "//aos:flatbuffer_merge",
200 "//aos:flatbuffers",
201 "//aos/events:event_loop",
202 "//aos/time",
203 ],
204)
205
206cc_library(
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800207 name = "timestamp_channel",
208 srcs = ["timestamp_channel.cc"],
209 hdrs = ["timestamp_channel.h"],
210 deps = [
211 ":remote_message_fbs",
212 "//aos:configuration",
213 "//aos/events:event_loop",
214 "@com_github_google_glog//:glog",
215 "@com_google_absl//absl/container:btree",
216 "@com_google_absl//absl/strings",
217 ],
218)
219
220cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800221 name = "message_bridge_server_lib",
222 srcs = [
223 "message_bridge_server_lib.cc",
224 ],
225 hdrs = [
226 "message_bridge_server_lib.h",
227 ],
228 copts = [
229 "-Wno-cast-align",
230 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800231 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800232 deps = [
233 ":connect_fbs",
Austin Schuh7bc59052020-02-16 23:48:33 -0800234 ":message_bridge_client_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800235 ":message_bridge_protocol",
236 ":message_bridge_server_fbs",
Austin Schuhe19b6752020-08-27 23:20:19 -0700237 ":message_bridge_server_status",
Austin Schuhf068dca2021-03-14 21:38:40 -0700238 ":remote_data_fbs",
Austin Schuh0de30f32020-12-06 12:44:28 -0800239 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800240 ":sctp_lib",
241 ":sctp_server",
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800242 ":timestamp_channel",
Austin Schuh7bc59052020-02-16 23:48:33 -0800243 ":timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800244 "//aos:unique_malloc_ptr",
245 "//aos/events:shm_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800246 "//aos/events/logging:log_reader",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800247 "//third_party/lksctp-tools:sctp",
248 ],
249)
250
251cc_binary(
252 name = "message_bridge_server",
253 srcs = [
254 "message_bridge_server.cc",
255 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800256 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800257 deps = [
258 ":message_bridge_server_lib",
259 "//aos:init",
260 "//aos:json_to_flatbuffer",
261 "//aos/events:shm_event_loop",
Sarah Newman45a64df2022-04-11 19:33:46 -0700262 "//aos/logging:dynamic_logging",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800263 ],
264)
265
266cc_library(
267 name = "sctp_client",
268 srcs = [
269 "sctp_client.cc",
270 ],
271 hdrs = [
272 "sctp_client.h",
273 ],
274 copts = [
275 "-Wno-cast-align",
276 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800277 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800278 deps = [
279 ":sctp_lib",
280 "//third_party/lksctp-tools:sctp",
281 ],
282)
283
284cc_library(
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700285 name = "message_bridge_client_status",
286 srcs = [
287 "message_bridge_client_status.cc",
288 ],
289 hdrs = [
290 "message_bridge_client_status.h",
291 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800292 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700293 deps = [
294 ":message_bridge_client_fbs",
295 ":message_bridge_server_fbs",
296 ":timestamp_filter",
297 "//aos:flatbuffers",
298 "//aos/events:event_loop",
299 "//aos/time",
300 ],
301)
302
303cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800304 name = "message_bridge_client_lib",
305 srcs = [
306 "message_bridge_client_lib.cc",
307 ],
308 hdrs = [
309 "message_bridge_client_lib.h",
310 ],
311 copts = [
312 "-Wno-cast-align",
313 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800314 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800315 deps = [
316 ":connect_fbs",
317 ":message_bridge_client_fbs",
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700318 ":message_bridge_client_status",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800319 ":message_bridge_protocol",
320 ":message_bridge_server_fbs",
Austin Schuhf068dca2021-03-14 21:38:40 -0700321 ":remote_data_fbs",
Austin Schuh0de30f32020-12-06 12:44:28 -0800322 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800323 ":sctp_client",
Austin Schuh7bc59052020-02-16 23:48:33 -0800324 ":timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800325 "//aos/events:shm_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800326 "//aos/events/logging:log_reader",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800327 ],
328)
329
330cc_binary(
331 name = "message_bridge_client",
332 srcs = [
333 "message_bridge_client.cc",
334 ],
335 copts = [
336 "-Wno-cast-align",
337 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800338 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800339 deps = [
340 ":message_bridge_client_lib",
341 "//aos:init",
342 "//aos:json_to_flatbuffer",
343 "//aos/events:shm_event_loop",
Sarah Newman45a64df2022-04-11 19:33:46 -0700344 "//aos/logging:dynamic_logging",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800345 ],
346)
347
348aos_config(
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800349 name = "message_bridge_test_combined_timestamps_common_config",
350 src = "message_bridge_test_combined_timestamps_common.json",
351 flatbuffers = [
352 ":remote_message_fbs",
353 "//aos/events:ping_fbs",
354 "//aos/events:pong_fbs",
355 "//aos/network:message_bridge_client_fbs",
356 "//aos/network:message_bridge_server_fbs",
357 "//aos/network:timestamp_fbs",
358 ],
359 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800360 deps = ["//aos/events:aos_config"],
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800361)
362
363aos_config(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800364 name = "message_bridge_test_common_config",
365 src = "message_bridge_test_common.json",
366 flatbuffers = [
Austin Schuh0de30f32020-12-06 12:44:28 -0800367 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800368 "//aos/events:ping_fbs",
369 "//aos/events:pong_fbs",
370 "//aos/network:message_bridge_client_fbs",
371 "//aos/network:message_bridge_server_fbs",
Austin Schuh7bc59052020-02-16 23:48:33 -0800372 "//aos/network:timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800373 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800374 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800375 deps = ["//aos/events:aos_config"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800376)
377
James Kuszmaul839c8aa2023-01-10 15:27:57 -0800378aos_config(
379 name = "timestamp_channel_test_config",
380 src = "timestamp_channel_test.json",
381 flatbuffers = [
382 ":remote_message_fbs",
383 "//aos/events:ping_fbs",
384 "//aos/events:pong_fbs",
385 "//aos/network:message_bridge_client_fbs",
386 "//aos/network:message_bridge_server_fbs",
387 "//aos/network:timestamp_fbs",
388 ],
389 target_compatible_with = ["@platforms//os:linux"],
390 deps = ["//aos/events:aos_config"],
391)
392
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800393cc_test(
394 name = "message_bridge_test",
395 srcs = [
396 "message_bridge_test.cc",
397 ],
398 data = [
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800399 ":message_bridge_test_combined_timestamps_common_config",
Austin Schuhf466ab52021-02-16 22:00:38 -0800400 ":message_bridge_test_common_config",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800401 ],
Austin Schuh025ff512021-02-07 23:06:48 -0800402 flaky = True,
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800403 shard_count = 10,
Philipp Schraderdada1072020-11-24 11:34:46 -0800404 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800405 deps = [
406 ":message_bridge_client_lib",
407 ":message_bridge_server_lib",
408 "//aos:json_to_flatbuffer",
409 "//aos/events:ping_fbs",
410 "//aos/events:pong_fbs",
411 "//aos/events:shm_event_loop",
Brian Silverman7b266d92021-02-17 21:24:02 -0800412 "//aos/ipc_lib:event",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800413 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700414 "//aos/testing:path",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800415 ],
416)
Alex Perryb3b50792020-01-18 16:13:45 -0800417
418flatbuffer_cc_library(
419 name = "web_proxy_fbs",
420 srcs = ["web_proxy.fbs"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800421 gen_reflections = True,
Alex Perry5f474f22020-02-01 12:14:24 -0800422 includes = [
423 ":connect_fbs_includes",
424 "//aos:configuration_fbs_includes",
425 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800426 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800427)
428
429flatbuffer_ts_library(
430 name = "web_proxy_ts_fbs",
431 srcs = ["web_proxy.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800432 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -0700433 deps = [
434 ":connect_ts_fbs",
435 "//aos:configuration_ts_fbs",
436 ],
Alex Perry5f474f22020-02-01 12:14:24 -0800437)
438
439cc_library(
440 name = "web_proxy_utils",
Alex Perry5f474f22020-02-01 12:14:24 -0800441 srcs = ["web_proxy_utils.cc"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800442 hdrs = ["web_proxy_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800443 target_compatible_with = ["@platforms//os:linux"],
Alex Perry5f474f22020-02-01 12:14:24 -0800444 deps = [
445 ":connect_fbs",
446 ":web_proxy_fbs",
447 "//aos:configuration_fbs",
448 "//aos/events:event_loop",
449 "@com_github_google_flatbuffers//:flatbuffers",
450 ],
Alex Perryb3b50792020-01-18 16:13:45 -0800451)
452
453cc_library(
454 name = "web_proxy",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700455 srcs = [
456 "rawrtc.cc",
457 "web_proxy.cc",
458 ],
459 hdrs = [
460 "rawrtc.h",
461 "web_proxy.h",
462 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800463 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800464 deps = [
Alex Perry5f474f22020-02-01 12:14:24 -0800465 ":connect_fbs",
James Kuszmaul48671362020-12-24 13:54:16 -0800466 ":gen_embedded",
Alex Perryb3b50792020-01-18 16:13:45 -0800467 ":web_proxy_fbs",
Alex Perry5f474f22020-02-01 12:14:24 -0800468 ":web_proxy_utils",
469 "//aos/events:shm_event_loop",
James Kuszmaul8d928d02020-12-25 17:47:49 -0800470 "//aos/mutex",
Alex Perryb3b50792020-01-18 16:13:45 -0800471 "//aos/seasocks:seasocks_logger",
Austin Schuh8bd96322020-02-13 21:18:22 -0800472 "//third_party/seasocks",
Alex Perryb3b50792020-01-18 16:13:45 -0800473 "@com_github_google_glog//:glog",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700474 "@com_github_rawrtc_rawrtc//:rawrtc",
Alex Perryb3b50792020-01-18 16:13:45 -0800475 ],
476)
477
478gen_embedded(
479 name = "gen_embedded",
480 srcs = glob(
481 include = ["www_defaults/**/*"],
482 exclude = ["www/**/*"],
483 ),
Philipp Schraderdada1072020-11-24 11:34:46 -0800484 target_compatible_with = ["@platforms//os:linux"],
James Kuszmaul3398d0b2023-02-11 22:55:22 -0800485 visibility = ["//visibility:public"],
Alex Perryb3b50792020-01-18 16:13:45 -0800486)
487
488cc_binary(
489 name = "web_proxy_main",
490 srcs = ["web_proxy_main.cc"],
Alex Perryb3b50792020-01-18 16:13:45 -0800491 data = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800492 "//aos/network/www:files",
Austin Schuhda9d0602019-09-15 17:29:38 -0700493 "//aos/network/www:main_bundle.min.js",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800494 "@com_github_google_flatbuffers//:flatjs",
495 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800496 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800497 deps = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800498 ":web_proxy",
499 "//aos:init",
500 "//aos/events:shm_event_loop",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800501 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perryb3b50792020-01-18 16:13:45 -0800502 ],
503)
Austin Schuh8bd96322020-02-13 21:18:22 -0800504
James Kuszmaul71a81932020-12-15 21:08:01 -0800505cc_binary(
506 name = "log_web_proxy_main",
507 srcs = ["log_web_proxy_main.cc"],
508 args = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800509 "--data_dir=aos/network/www",
510 ],
James Kuszmaul71a81932020-12-15 21:08:01 -0800511 deps = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800512 ":web_proxy",
513 "//aos:init",
514 "//aos/events:simulated_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800515 "//aos/events/logging:log_reader",
James Kuszmaul71a81932020-12-15 21:08:01 -0800516 "@com_github_google_flatbuffers//:flatbuffers",
517 ],
518)
519
Austin Schuh8bd96322020-02-13 21:18:22 -0800520cc_library(
521 name = "timestamp_filter",
Austin Schuh7ee6f722020-08-24 16:19:36 -0700522 srcs = ["timestamp_filter.cc"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800523 hdrs = ["timestamp_filter.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800524 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800525 deps = [
Austin Schuh04eccfc2020-08-26 21:08:27 -0700526 "//aos:configuration",
Austin Schuh66168842021-08-17 19:42:21 -0700527 "//aos/events/logging:boot_timestamp",
Austin Schuh8bd96322020-02-13 21:18:22 -0800528 "//aos/time",
Austin Schuh5c770fa2022-03-11 06:57:22 -0800529 "@com_google_absl//absl/numeric:int128",
Austin Schuh85357ee2020-08-24 16:41:42 -0700530 "@com_google_absl//absl/strings",
Austin Schuh8bd96322020-02-13 21:18:22 -0800531 ],
532)
533
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800534cc_library(
535 name = "multinode_timestamp_filter",
536 srcs = ["multinode_timestamp_filter.cc"],
537 hdrs = ["multinode_timestamp_filter.h"],
538 target_compatible_with = ["@platforms//os:linux"],
539 deps = [
540 ":timestamp_filter",
541 "//aos:configuration",
542 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700543 "//aos/events/logging:boot_timestamp",
Austin Schuhe639ea12021-01-25 13:00:22 -0800544 "//aos/events/logging:logfile_utils",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800545 "//aos/time",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800546 "@org_tuxfamily_eigen//:eigen",
547 ],
548)
549
Austin Schuh8bd96322020-02-13 21:18:22 -0800550cc_test(
551 name = "timestamp_filter_test",
552 srcs = [
553 "timestamp_filter_test.cc",
554 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800555 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800556 deps = [
557 ":timestamp_filter",
Austin Schuh04eccfc2020-08-26 21:08:27 -0700558 "//aos:json_to_flatbuffer",
Austin Schuh8bd96322020-02-13 21:18:22 -0800559 "//aos/testing:googletest",
560 ],
561)
Austin Schuh7466fe12020-12-29 23:01:47 -0800562
Austin Schuha9abc032021-01-01 16:46:19 -0800563cc_library(
564 name = "testing_time_converter",
565 testonly = True,
566 srcs = ["testing_time_converter.cc"],
567 hdrs = ["testing_time_converter.h"],
568 deps = [
569 ":multinode_timestamp_filter",
570 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700571 "//aos/events/logging:boot_timestamp",
Austin Schuha9abc032021-01-01 16:46:19 -0800572 "//aos/time",
573 ],
574)
575
Austin Schuh0a0a8272021-12-08 13:19:32 -0800576cc_binary(
577 name = "sctp_lib_shim.so",
578 testonly = True,
579 srcs = [
580 "sctp_lib_shim.c",
581 ],
582 linkopts = [
583 "-ldl",
584 ],
585 linkshared = True,
586 target_compatible_with = ["@platforms//os:linux"],
587)
588
589cc_binary(
590 name = "sctp_lib_test_binary",
591 testonly = True,
592 srcs = [
593 "sctp_lib_test.cc",
594 ],
595 linkstatic = False,
596 target_compatible_with = ["@platforms//os:linux"],
597 deps = [
598 ":sctp_lib",
599 "//aos:init",
600 ],
601)
602
603sh_test(
604 name = "sctp_lib_test",
605 srcs = [
606 "sctp_lib_test.sh",
607 ],
608 args = [
609 "$(location :sctp_lib_test_binary)",
610 "$(location :sctp_lib_shim.so)",
611 ],
612 data = [
613 ":sctp_lib_shim.so",
614 ":sctp_lib_test_binary",
615 ],
616 target_compatible_with = ["@platforms//os:linux"],
617 deps = [
618 "@bazel_tools//tools/bash/runfiles",
619 ],
620)
621
Austin Schuh7466fe12020-12-29 23:01:47 -0800622cc_test(
623 name = "multinode_timestamp_filter_test",
624 srcs = [
625 "multinode_timestamp_filter_test.cc",
626 ],
627 target_compatible_with = ["@platforms//os:linux"],
628 deps = [
629 ":multinode_timestamp_filter",
Austin Schuha9abc032021-01-01 16:46:19 -0800630 ":testing_time_converter",
Austin Schuh7466fe12020-12-29 23:01:47 -0800631 ":timestamp_filter",
632 "//aos/testing:googletest",
Austin Schuh7466fe12020-12-29 23:01:47 -0800633 ],
634)
James Kuszmaul839c8aa2023-01-10 15:27:57 -0800635
636cc_test(
637 name = "timestamp_channel_test",
638 srcs = ["timestamp_channel_test.cc"],
639 data = [":timestamp_channel_test_config"],
640 deps = [
641 ":timestamp_channel",
642 "//aos:configuration",
643 "//aos/events:ping_fbs",
644 "//aos/events:shm_event_loop",
645 "//aos/events:simulated_event_loop",
646 "//aos/testing:googletest",
647 "//aos/testing:path",
648 "//aos/testing:tmpdir",
649 ],
650)