blob: e28fd89c8c1fe0cf79cadc7bfc44a77f7228eb93 [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"],
Philipp Schraderdada1072020-11-24 11:34:46 -080033 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -070034 deps = [
35 "//aos:configuration_ts_fbs",
36 ],
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",
Sarah Newman45a64df2022-04-11 19:33:46 -0700261 "//aos/logging:dynamic_logging",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800262 ],
263)
264
265cc_library(
266 name = "sctp_client",
267 srcs = [
268 "sctp_client.cc",
269 ],
270 hdrs = [
271 "sctp_client.h",
272 ],
273 copts = [
274 "-Wno-cast-align",
275 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800276 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800277 deps = [
278 ":sctp_lib",
279 "//third_party/lksctp-tools:sctp",
280 ],
281)
282
283cc_library(
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700284 name = "message_bridge_client_status",
285 srcs = [
286 "message_bridge_client_status.cc",
287 ],
288 hdrs = [
289 "message_bridge_client_status.h",
290 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800291 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700292 deps = [
293 ":message_bridge_client_fbs",
294 ":message_bridge_server_fbs",
295 ":timestamp_filter",
296 "//aos:flatbuffers",
297 "//aos/events:event_loop",
298 "//aos/time",
299 ],
300)
301
302cc_library(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800303 name = "message_bridge_client_lib",
304 srcs = [
305 "message_bridge_client_lib.cc",
306 ],
307 hdrs = [
308 "message_bridge_client_lib.h",
309 ],
310 copts = [
311 "-Wno-cast-align",
312 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800313 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800314 deps = [
315 ":connect_fbs",
316 ":message_bridge_client_fbs",
Austin Schuhae2e7bf2020-08-27 23:42:56 -0700317 ":message_bridge_client_status",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800318 ":message_bridge_protocol",
319 ":message_bridge_server_fbs",
Austin Schuhf068dca2021-03-14 21:38:40 -0700320 ":remote_data_fbs",
Austin Schuh0de30f32020-12-06 12:44:28 -0800321 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800322 ":sctp_client",
Austin Schuh7bc59052020-02-16 23:48:33 -0800323 ":timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800324 "//aos/events:shm_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800325 "//aos/events/logging:log_reader",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800326 ],
327)
328
329cc_binary(
330 name = "message_bridge_client",
331 srcs = [
332 "message_bridge_client.cc",
333 ],
334 copts = [
335 "-Wno-cast-align",
336 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800337 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800338 deps = [
339 ":message_bridge_client_lib",
340 "//aos:init",
341 "//aos:json_to_flatbuffer",
342 "//aos/events:shm_event_loop",
Sarah Newman45a64df2022-04-11 19:33:46 -0700343 "//aos/logging:dynamic_logging",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800344 ],
345)
346
347aos_config(
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800348 name = "message_bridge_test_combined_timestamps_common_config",
349 src = "message_bridge_test_combined_timestamps_common.json",
350 flatbuffers = [
351 ":remote_message_fbs",
352 "//aos/events:ping_fbs",
353 "//aos/events:pong_fbs",
354 "//aos/network:message_bridge_client_fbs",
355 "//aos/network:message_bridge_server_fbs",
356 "//aos/network:timestamp_fbs",
357 ],
358 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800359 deps = ["//aos/events:aos_config"],
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800360)
361
362aos_config(
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800363 name = "message_bridge_test_common_config",
364 src = "message_bridge_test_common.json",
365 flatbuffers = [
Austin Schuh0de30f32020-12-06 12:44:28 -0800366 ":remote_message_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800367 "//aos/events:ping_fbs",
368 "//aos/events:pong_fbs",
369 "//aos/network:message_bridge_client_fbs",
370 "//aos/network:message_bridge_server_fbs",
Austin Schuh7bc59052020-02-16 23:48:33 -0800371 "//aos/network:timestamp_fbs",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800372 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800373 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhc5fa6d92022-02-25 14:36:28 -0800374 deps = ["//aos/events:aos_config"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800375)
376
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800377cc_test(
378 name = "message_bridge_test",
379 srcs = [
380 "message_bridge_test.cc",
381 ],
382 data = [
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800383 ":message_bridge_test_combined_timestamps_common_config",
Austin Schuhf466ab52021-02-16 22:00:38 -0800384 ":message_bridge_test_common_config",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800385 ],
Austin Schuh025ff512021-02-07 23:06:48 -0800386 flaky = True,
Austin Schuh36a2c3e2021-02-18 22:28:38 -0800387 shard_count = 10,
Philipp Schraderdada1072020-11-24 11:34:46 -0800388 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800389 deps = [
390 ":message_bridge_client_lib",
391 ":message_bridge_server_lib",
392 "//aos:json_to_flatbuffer",
393 "//aos/events:ping_fbs",
394 "//aos/events:pong_fbs",
395 "//aos/events:shm_event_loop",
Brian Silverman7b266d92021-02-17 21:24:02 -0800396 "//aos/ipc_lib:event",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800397 "//aos/testing:googletest",
Austin Schuh373f1762021-06-02 21:07:09 -0700398 "//aos/testing:path",
Austin Schuhe84c3ed2019-12-14 15:29:48 -0800399 ],
400)
Alex Perryb3b50792020-01-18 16:13:45 -0800401
402flatbuffer_cc_library(
403 name = "web_proxy_fbs",
404 srcs = ["web_proxy.fbs"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800405 gen_reflections = True,
Alex Perry5f474f22020-02-01 12:14:24 -0800406 includes = [
407 ":connect_fbs_includes",
408 "//aos:configuration_fbs_includes",
409 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800410 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800411)
412
413flatbuffer_ts_library(
414 name = "web_proxy_ts_fbs",
415 srcs = ["web_proxy.fbs"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800416 target_compatible_with = ["@platforms//os:linux"],
James Kuszmauldac091f2022-03-22 09:35:06 -0700417 deps = [
418 ":connect_ts_fbs",
419 "//aos:configuration_ts_fbs",
420 ],
Alex Perry5f474f22020-02-01 12:14:24 -0800421)
422
423cc_library(
424 name = "web_proxy_utils",
Alex Perry5f474f22020-02-01 12:14:24 -0800425 srcs = ["web_proxy_utils.cc"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800426 hdrs = ["web_proxy_utils.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800427 target_compatible_with = ["@platforms//os:linux"],
Alex Perry5f474f22020-02-01 12:14:24 -0800428 deps = [
429 ":connect_fbs",
430 ":web_proxy_fbs",
431 "//aos:configuration_fbs",
432 "//aos/events:event_loop",
433 "@com_github_google_flatbuffers//:flatbuffers",
434 ],
Alex Perryb3b50792020-01-18 16:13:45 -0800435)
436
437cc_library(
438 name = "web_proxy",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700439 srcs = [
440 "rawrtc.cc",
441 "web_proxy.cc",
442 ],
443 hdrs = [
444 "rawrtc.h",
445 "web_proxy.h",
446 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800447 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800448 deps = [
Alex Perry5f474f22020-02-01 12:14:24 -0800449 ":connect_fbs",
James Kuszmaul48671362020-12-24 13:54:16 -0800450 ":gen_embedded",
Alex Perryb3b50792020-01-18 16:13:45 -0800451 ":web_proxy_fbs",
Alex Perry5f474f22020-02-01 12:14:24 -0800452 ":web_proxy_utils",
453 "//aos/events:shm_event_loop",
James Kuszmaul8d928d02020-12-25 17:47:49 -0800454 "//aos/mutex",
Alex Perryb3b50792020-01-18 16:13:45 -0800455 "//aos/seasocks:seasocks_logger",
Austin Schuh8bd96322020-02-13 21:18:22 -0800456 "//third_party/seasocks",
Alex Perryb3b50792020-01-18 16:13:45 -0800457 "@com_github_google_glog//:glog",
Austin Schuh52e5e3a2021-04-24 22:30:02 -0700458 "@com_github_rawrtc_rawrtc//:rawrtc",
Alex Perryb3b50792020-01-18 16:13:45 -0800459 ],
460)
461
462gen_embedded(
463 name = "gen_embedded",
464 srcs = glob(
465 include = ["www_defaults/**/*"],
466 exclude = ["www/**/*"],
467 ),
Philipp Schraderdada1072020-11-24 11:34:46 -0800468 target_compatible_with = ["@platforms//os:linux"],
Alex Perryb3b50792020-01-18 16:13:45 -0800469)
470
471cc_binary(
472 name = "web_proxy_main",
473 srcs = ["web_proxy_main.cc"],
Alex Perryb3b50792020-01-18 16:13:45 -0800474 data = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800475 "//aos/network/www:files",
Austin Schuhda9d0602019-09-15 17:29:38 -0700476 "//aos/network/www:main_bundle.min.js",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800477 "@com_github_google_flatbuffers//:flatjs",
478 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800479 target_compatible_with = ["@platforms//os:linux"],
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800480 deps = [
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800481 ":web_proxy",
482 "//aos:init",
483 "//aos/events:shm_event_loop",
Brian Silverman3dfbfb12020-02-17 20:35:18 -0800484 "@com_github_google_flatbuffers//:flatbuffers",
Alex Perryb3b50792020-01-18 16:13:45 -0800485 ],
486)
Austin Schuh8bd96322020-02-13 21:18:22 -0800487
James Kuszmaul71a81932020-12-15 21:08:01 -0800488cc_binary(
489 name = "log_web_proxy_main",
490 srcs = ["log_web_proxy_main.cc"],
491 args = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800492 "--data_dir=aos/network/www",
493 ],
James Kuszmaul71a81932020-12-15 21:08:01 -0800494 deps = [
James Kuszmaul71a81932020-12-15 21:08:01 -0800495 ":web_proxy",
496 "//aos:init",
497 "//aos/events:simulated_event_loop",
Austin Schuhb06f03b2021-02-17 22:00:37 -0800498 "//aos/events/logging:log_reader",
James Kuszmaul71a81932020-12-15 21:08:01 -0800499 "@com_github_google_flatbuffers//:flatbuffers",
500 ],
501)
502
Austin Schuh8bd96322020-02-13 21:18:22 -0800503cc_library(
504 name = "timestamp_filter",
Austin Schuh7ee6f722020-08-24 16:19:36 -0700505 srcs = ["timestamp_filter.cc"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800506 hdrs = ["timestamp_filter.h"],
Philipp Schraderdada1072020-11-24 11:34:46 -0800507 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800508 deps = [
Austin Schuh04eccfc2020-08-26 21:08:27 -0700509 "//aos:configuration",
Austin Schuh66168842021-08-17 19:42:21 -0700510 "//aos/events/logging:boot_timestamp",
Austin Schuh8bd96322020-02-13 21:18:22 -0800511 "//aos/time",
Austin Schuh5c770fa2022-03-11 06:57:22 -0800512 "@com_google_absl//absl/numeric:int128",
Austin Schuh85357ee2020-08-24 16:41:42 -0700513 "@com_google_absl//absl/strings",
Austin Schuh8bd96322020-02-13 21:18:22 -0800514 ],
515)
516
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800517cc_library(
518 name = "multinode_timestamp_filter",
519 srcs = ["multinode_timestamp_filter.cc"],
520 hdrs = ["multinode_timestamp_filter.h"],
521 target_compatible_with = ["@platforms//os:linux"],
522 deps = [
523 ":timestamp_filter",
524 "//aos:configuration",
525 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700526 "//aos/events/logging:boot_timestamp",
Austin Schuhe639ea12021-01-25 13:00:22 -0800527 "//aos/events/logging:logfile_utils",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800528 "//aos/time",
Austin Schuh0ca1fd32020-12-18 22:53:05 -0800529 "@org_tuxfamily_eigen//:eigen",
530 ],
531)
532
Austin Schuh8bd96322020-02-13 21:18:22 -0800533cc_test(
534 name = "timestamp_filter_test",
535 srcs = [
536 "timestamp_filter_test.cc",
537 ],
Philipp Schraderdada1072020-11-24 11:34:46 -0800538 target_compatible_with = ["@platforms//os:linux"],
Austin Schuh8bd96322020-02-13 21:18:22 -0800539 deps = [
540 ":timestamp_filter",
Austin Schuh04eccfc2020-08-26 21:08:27 -0700541 "//aos:json_to_flatbuffer",
Austin Schuh8bd96322020-02-13 21:18:22 -0800542 "//aos/testing:googletest",
543 ],
544)
Austin Schuh7466fe12020-12-29 23:01:47 -0800545
Austin Schuha9abc032021-01-01 16:46:19 -0800546cc_library(
547 name = "testing_time_converter",
548 testonly = True,
549 srcs = ["testing_time_converter.cc"],
550 hdrs = ["testing_time_converter.h"],
551 deps = [
552 ":multinode_timestamp_filter",
553 "//aos/events:simulated_event_loop",
Austin Schuh58646e22021-08-23 23:51:46 -0700554 "//aos/events/logging:boot_timestamp",
Austin Schuha9abc032021-01-01 16:46:19 -0800555 "//aos/time",
556 ],
557)
558
Austin Schuh0a0a8272021-12-08 13:19:32 -0800559cc_binary(
560 name = "sctp_lib_shim.so",
561 testonly = True,
562 srcs = [
563 "sctp_lib_shim.c",
564 ],
565 linkopts = [
566 "-ldl",
567 ],
568 linkshared = True,
569 target_compatible_with = ["@platforms//os:linux"],
570)
571
572cc_binary(
573 name = "sctp_lib_test_binary",
574 testonly = True,
575 srcs = [
576 "sctp_lib_test.cc",
577 ],
578 linkstatic = False,
579 target_compatible_with = ["@platforms//os:linux"],
580 deps = [
581 ":sctp_lib",
582 "//aos:init",
583 ],
584)
585
586sh_test(
587 name = "sctp_lib_test",
588 srcs = [
589 "sctp_lib_test.sh",
590 ],
591 args = [
592 "$(location :sctp_lib_test_binary)",
593 "$(location :sctp_lib_shim.so)",
594 ],
595 data = [
596 ":sctp_lib_shim.so",
597 ":sctp_lib_test_binary",
598 ],
599 target_compatible_with = ["@platforms//os:linux"],
600 deps = [
601 "@bazel_tools//tools/bash/runfiles",
602 ],
603)
604
Austin Schuh7466fe12020-12-29 23:01:47 -0800605cc_test(
606 name = "multinode_timestamp_filter_test",
607 srcs = [
608 "multinode_timestamp_filter_test.cc",
609 ],
610 target_compatible_with = ["@platforms//os:linux"],
611 deps = [
612 ":multinode_timestamp_filter",
Austin Schuha9abc032021-01-01 16:46:19 -0800613 ":testing_time_converter",
Austin Schuh7466fe12020-12-29 23:01:47 -0800614 ":timestamp_filter",
615 "//aos/testing:googletest",
Austin Schuh7466fe12020-12-29 23:01:47 -0800616 ],
617)