Files
tomato-testing/toxcore/BUILD.bazel
Green Sky 565efa4f39 Squashed 'external/toxcore/c-toxcore/' changes from 1828c5356..c9cdae001
c9cdae001 fix(toxav): remove extra copy of video frame on encode
4f6d4546b test: Improve the fake network library.
a2581e700 refactor(toxcore): generate `Friend_Request` and `Dht_Nodes_Response`
2aaa11770 refactor(toxcore): use Tox_Memory in generated events
5c367452b test(toxcore): fix incorrect mutex in tox_scenario_get_time
8f92e710f perf: Add a timed limit of number of cookie requests.
695b6417a test: Add some more simulated network support.
815ae9ce9 test(toxcore): fix thread-safety in scenario framework
6d85c754e test(toxcore): add unit tests for net_crypto
9c22e79cc test(support): add SimulatedEnvironment for deterministic testing
f34fcb195 chore: Update windows Dockerfile to debian stable (trixie).
ece0e8980 fix(group_moderation): allow validating unsorted sanction list signatures
a4fa754d7 refactor: rename struct Packet to struct Net_Packet
d6f330f85 cleanup: Fix some warnings from coverity.
e206bffa2 fix(group_chats): fix sync packets reverting topics
0e4715598 test: Add new scenario testing framework.
668291f44 refactor(toxcore): decouple Network_Funcs from sockaddr via IP_Port
fc4396cef fix: potential division by zero in toxav and unsafe hex parsing
8e8b352ab refactor: Add nullable annotations to struct members.
7740bb421 refactor: decouple net_crypto from DHT
1936d4296 test: add benchmark for toxav audio and video
46bfdc2df fix: correct printf format specifiers for unsigned integers
REVERT: 1828c5356 fix(toxav): remove extra copy of video frame on encode

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: c9cdae001341e701fca980c9bb9febfeb95d2902
2026-01-11 14:42:31 +01:00

1454 lines
30 KiB
Python

load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
exports_files(
srcs = [
"tox.h",
"tox_dispatch.h",
"tox_events.h",
"tox_log_level.h",
"tox_options.h",
"tox_private.h",
],
visibility = ["//c-toxcore:__subpackages__"],
)
cc_library(
name = "test_util",
testonly = True,
srcs = ["test_util.cc"],
hdrs = ["test_util.hh"],
)
cc_test(
name = "test_util_test",
size = "small",
srcs = ["test_util_test.cc"],
deps = [
":crypto_core",
":test_util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "attributes",
hdrs = ["attributes.h"],
visibility = ["//c-toxcore:__subpackages__"],
)
cc_library(
name = "tox_attributes",
hdrs = ["tox_attributes.h"],
visibility = ["//c-toxcore:__subpackages__"],
)
cc_library(
name = "ccompat",
srcs = ["ccompat.c"],
hdrs = ["ccompat.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [":attributes"],
)
cc_library(
name = "tox_memory",
srcs = ["tox_memory.c"],
hdrs = [
"tox_memory.h",
"tox_memory_impl.h",
],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":ccompat",
":tox_attributes",
],
)
cc_library(
name = "os_memory",
srcs = ["os_memory.c"],
hdrs = ["os_memory.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":tox_memory",
],
)
cc_library(
name = "tox_random",
srcs = ["tox_random.c"],
hdrs = [
"tox_random.h",
"tox_random_impl.h",
],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":ccompat",
":tox_attributes",
":tox_memory",
],
)
cc_library(
name = "os_random",
srcs = ["os_random.c"],
hdrs = ["os_random.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":tox_random",
"@libsodium",
],
)
cc_library(
name = "mem",
srcs = ["mem.c"],
hdrs = ["mem.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":tox_memory",
],
)
cc_test(
name = "mem_test",
size = "small",
srcs = ["mem_test.cc"],
deps = [
":mem",
":os_memory",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "util",
srcs = ["util.c"],
hdrs = ["util.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing/fuzzing:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":attributes",
":ccompat",
":mem",
"@pthread",
],
)
cc_test(
name = "util_test",
size = "small",
srcs = ["util_test.cc"],
deps = [
":util",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "sort",
srcs = ["sort.c"],
hdrs = ["sort.h"],
deps = [
":attributes",
":ccompat",
":util",
],
)
cc_library(
name = "sort_test_util",
testonly = True,
srcs = ["sort_test_util.cc"],
hdrs = ["sort_test_util.hh"],
deps = [
":sort",
":util",
],
)
cc_test(
name = "sort_test",
size = "small",
srcs = ["sort_test.cc"],
deps = [
":sort",
":sort_test_util",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_binary(
name = "sort_bench",
testonly = True,
srcs = ["sort_bench.cc"],
deps = [
":mem",
":sort",
":sort_test_util",
"@benchmark",
],
)
cc_library(
name = "logger",
srcs = ["logger.c"],
hdrs = ["logger.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":attributes",
":ccompat",
":mem",
],
)
cc_library(
name = "bin_pack",
srcs = ["bin_pack.c"],
hdrs = ["bin_pack.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":logger",
"//c-toxcore/third_party:cmp",
],
)
cc_library(
name = "bin_unpack",
srcs = ["bin_unpack.c"],
hdrs = ["bin_unpack.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":mem",
"//c-toxcore/third_party:cmp",
],
)
cc_test(
name = "bin_pack_test",
size = "small",
srcs = ["bin_pack_test.cc"],
deps = [
":bin_pack",
":bin_unpack",
":logger",
":mem",
":os_memory",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "crypto_core",
srcs = ["crypto_core.c"],
hdrs = ["crypto_core.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":mem",
":tox_random",
":util",
"@libsodium",
],
)
cc_library(
name = "crypto_core_pack",
srcs = ["crypto_core_pack.c"],
hdrs = ["crypto_core_pack.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":bin_pack",
":bin_unpack",
":ccompat",
":crypto_core",
],
)
cc_library(
name = "crypto_core_test_util",
testonly = True,
srcs = ["crypto_core_test_util.cc"],
hdrs = ["crypto_core_test_util.hh"],
deps = [
":crypto_core",
":test_util",
":tox_random",
],
)
cc_test(
name = "crypto_core_test",
size = "small",
srcs = ["crypto_core_test.cc"],
flaky = True,
deps = [
":crypto_core",
":crypto_core_test_util",
":util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "list",
srcs = ["list.c"],
hdrs = ["list.h"],
deps = [
":attributes",
":ccompat",
":mem",
],
)
cc_test(
name = "list_test",
size = "small",
srcs = ["list_test.cc"],
deps = [
":list",
":mem",
":os_memory",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "state",
srcs = ["state.c"],
hdrs = ["state.h"],
deps = [
":attributes",
":ccompat",
":logger",
],
)
cc_library(
name = "mono_time",
srcs = ["mono_time.c"],
hdrs = ["mono_time.h"],
visibility = [
"//c-toxcore/auto_tests:__subpackages__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":attributes",
":ccompat",
":mem",
":util",
"@pthread",
],
)
cc_library(
name = "mono_time_test_util",
testonly = True,
srcs = ["mono_time_test_util.cc"],
hdrs = ["mono_time_test_util.hh"],
deps = [
":mono_time",
"//c-toxcore/testing/support",
],
)
cc_test(
name = "mono_time_test",
size = "small",
srcs = ["mono_time_test.cc"],
deps = [
":mono_time",
":mono_time_test_util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "shared_key_cache",
srcs = ["shared_key_cache.c"],
hdrs = ["shared_key_cache.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
],
)
cc_library(
name = "net_profile",
srcs = ["net_profile.c"],
hdrs = ["net_profile.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/testing/fuzzing:__pkg__",
],
deps = [
":attributes",
":ccompat",
":logger",
":mem",
],
)
cc_library(
name = "network",
srcs = [
"net_log.c",
"network.c",
],
hdrs = [
"net_log.h",
"network.h",
],
visibility = [
"//c-toxcore/auto_tests:__subpackages__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing/fuzzing:__pkg__",
"//c-toxcore/testing/support:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":attributes",
":bin_pack",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":net_profile",
":util",
"@libsodium",
"@psocket",
"@pthread",
],
)
cc_library(
name = "network_test_util",
testonly = True,
srcs = ["network_test_util.cc"],
hdrs = ["network_test_util.hh"],
deps = [
":crypto_core",
":mem",
":network",
":test_util",
],
)
cc_test(
name = "network_test",
size = "small",
srcs = ["network_test.cc"],
deps = [
":network",
":network_test_util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "timed_auth",
srcs = ["timed_auth.c"],
hdrs = ["timed_auth.h"],
deps = [
":attributes",
":ccompat",
":crypto_core",
":mono_time",
],
)
cc_library(
name = "ping_array",
srcs = ["ping_array.c"],
hdrs = ["ping_array.h"],
deps = [
":attributes",
":ccompat",
":crypto_core",
":mem",
":mono_time",
":util",
],
)
cc_test(
name = "ping_array_test",
size = "small",
srcs = ["ping_array_test.cc"],
deps = [
":crypto_core_test_util",
":mono_time",
":ping_array",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "LAN_discovery",
srcs = ["LAN_discovery.c"],
hdrs = ["LAN_discovery.h"],
visibility = [
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing:__pkg__",
],
deps = [
":attributes",
":ccompat",
":crypto_core",
":mem",
":network",
":util",
"@psocket",
],
)
cc_library(
name = "DHT",
srcs = [
"DHT.c",
"ping.c",
],
hdrs = [
"DHT.h",
"ping.h",
],
visibility = [
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
"//c-toxcore/testing:__pkg__",
],
deps = [
":LAN_discovery",
":attributes",
":bin_pack",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":ping_array",
":shared_key_cache",
":sort",
":state",
":util",
],
)
cc_library(
name = "DHT_test_util",
testonly = True,
srcs = ["DHT_test_util.cc"],
hdrs = ["DHT_test_util.hh"],
deps = [
":DHT",
":crypto_core",
":crypto_core_test_util",
":logger",
":mono_time",
":net_crypto",
":network",
":network_test_util",
":test_util",
"//c-toxcore/testing/support",
],
)
cc_test(
name = "DHT_test",
size = "small",
srcs = ["DHT_test.cc"],
deps = [
":DHT",
":DHT_test_util",
":crypto_core",
":crypto_core_test_util",
":logger",
":mono_time",
":network",
":network_test_util",
":test_util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "DHT_fuzz_test",
size = "small",
testonly = True,
srcs = ["DHT_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:DHT_fuzz_test"],
deps = [
":DHT",
":net_profile",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "onion",
srcs = ["onion.c"],
hdrs = ["onion.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":shared_key_cache",
":util",
],
)
cc_library(
name = "forwarding",
srcs = ["forwarding.c"],
hdrs = ["forwarding.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":timed_auth",
],
)
cc_fuzz_test(
name = "forwarding_fuzz_test",
size = "small",
srcs = ["forwarding_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:forwarding_fuzz_test"],
deps = [
":forwarding",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "announce",
srcs = ["announce.c"],
hdrs = ["announce.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":LAN_discovery",
":attributes",
":ccompat",
":crypto_core",
":forwarding",
":logger",
":mem",
":mono_time",
":network",
":shared_key_cache",
":timed_auth",
":util",
],
)
cc_library(
name = "TCP_common",
srcs = ["TCP_common.c"],
hdrs = ["TCP_common.h"],
visibility = ["//c-toxcore/auto_tests:__pkg__"],
deps = [
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":net_profile",
":network",
],
)
cc_library(
name = "TCP_server",
srcs = ["TCP_server.c"],
hdrs = ["TCP_server.h"],
copts = select({
"//tools/config:linux": ["-DTCP_SERVER_USE_EPOLL=1"],
"//conditions:default": [],
}),
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":TCP_common",
":attributes",
":ccompat",
":crypto_core",
":forwarding",
":list",
":logger",
":mem",
":mono_time",
":net_profile",
":network",
":onion",
":util",
"@psocket",
],
)
cc_library(
name = "TCP_client",
srcs = ["TCP_client.c"],
hdrs = ["TCP_client.h"],
visibility = ["//c-toxcore/auto_tests:__pkg__"],
deps = [
":TCP_common",
":attributes",
":ccompat",
":crypto_core",
":forwarding",
":logger",
":mem",
":mono_time",
":net_profile",
":network",
":util",
],
)
cc_library(
name = "TCP_connection",
srcs = ["TCP_connection.c"],
hdrs = ["TCP_connection.h"],
visibility = ["//c-toxcore/auto_tests:__pkg__"],
deps = [
":DHT",
":TCP_client",
":TCP_common",
":attributes",
":ccompat",
":crypto_core",
":forwarding",
":list",
":logger",
":mem",
":mono_time",
":net_profile",
":network",
":onion",
":util",
],
)
cc_test(
name = "TCP_connection_test",
size = "small",
srcs = ["TCP_connection_test.cc"],
deps = [
":TCP_connection",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "TCP_client_test",
size = "small",
srcs = ["TCP_client_test.cc"],
deps = [
":TCP_client",
":TCP_common",
":crypto_core",
":logger",
":mono_time",
":net_profile",
":network",
":util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "net_crypto",
srcs = ["net_crypto.c"],
hdrs = ["net_crypto.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":DHT",
":LAN_discovery",
":TCP_client",
":TCP_connection",
":attributes",
":ccompat",
":crypto_core",
":list",
":logger",
":mem",
":mono_time",
":net_profile",
":network",
":util",
"@pthread",
],
)
cc_test(
name = "net_crypto_test",
size = "small",
srcs = ["net_crypto_test.cc"],
deps = [
":DHT_test_util",
":crypto_core",
":logger",
":mono_time",
":net_crypto",
":net_profile",
":network",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "friend_connection_test",
size = "small",
srcs = ["friend_connection_test.cc"],
deps = [
":DHT_test_util",
":crypto_core",
":friend_connection",
":logger",
":mono_time",
":net_crypto",
":net_profile",
":network",
":onion_client",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "net_crypto_fuzz_test",
size = "small",
testonly = True,
srcs = ["net_crypto_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:net_crypto_fuzz_test"],
deps = [
":DHT",
":TCP_client",
":net_crypto",
":net_profile",
":network",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "onion_announce",
srcs = ["onion_announce.c"],
hdrs = ["onion_announce.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":LAN_discovery",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":onion",
":shared_key_cache",
":sort",
":timed_auth",
":util",
],
)
cc_library(
name = "group_announce",
srcs = ["group_announce.c"],
hdrs = ["group_announce.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":LAN_discovery",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":util",
],
)
cc_test(
name = "group_announce_test",
size = "small",
srcs = ["group_announce_test.cc"],
deps = [
":DHT",
":crypto_core",
":group_announce",
":logger",
":mono_time",
":mono_time_test_util",
":network",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "group_announce_fuzz_test",
size = "small",
testonly = True,
srcs = ["group_announce_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:group_announce_fuzz_test"],
deps = [
":group_announce",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "group_onion_announce",
srcs = ["group_onion_announce.c"],
hdrs = ["group_onion_announce.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/other/bootstrap_daemon:__pkg__",
],
deps = [
":DHT",
":attributes",
":ccompat",
":crypto_core",
":group_announce",
":logger",
":mem",
":mono_time",
":network",
":onion_announce",
":timed_auth",
],
)
cc_library(
name = "onion_client",
srcs = ["onion_client.c"],
hdrs = ["onion_client.h"],
visibility = ["//c-toxcore/auto_tests:__pkg__"],
deps = [
":DHT",
":LAN_discovery",
":TCP_connection",
":attributes",
":ccompat",
":crypto_core",
":group_announce",
":group_onion_announce",
":list",
":logger",
":mem",
":mono_time",
":net_crypto",
":network",
":onion",
":onion_announce",
":ping_array",
":sort",
":timed_auth",
":util",
],
)
cc_test(
name = "onion_client_test",
size = "small",
srcs = ["onion_client_test.cc"],
deps = [
":DHT_test_util",
":crypto_core",
":logger",
":mono_time",
":net_crypto",
":net_profile",
":network",
":onion",
":onion_announce",
":onion_client",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "onion_client_fuzz_test",
size = "small",
testonly = True,
srcs = ["onion_client_fuzz_test.cc"],
# corpus = ["//tools/toktok-fuzzer/corpus:onion_client_fuzz_test"],
deps = [
":DHT",
":net_crypto",
":net_profile",
":onion_client",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "friend_connection",
srcs = ["friend_connection.c"],
hdrs = ["friend_connection.h"],
visibility = ["//c-toxcore/auto_tests:__pkg__"],
deps = [
":DHT",
":LAN_discovery",
":TCP_connection",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":net_crypto",
":network",
":onion",
":onion_announce",
":onion_client",
":util",
],
)
cc_library(
name = "friend_requests",
srcs = ["friend_requests.c"],
hdrs = ["friend_requests.h"],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/testing:__pkg__",
],
deps = [
":attributes",
":ccompat",
":crypto_core",
":friend_connection",
":mem",
":network",
":onion",
":onion_announce",
":onion_client",
":util",
],
)
cc_library(
name = "group_moderation",
srcs = ["group_moderation.c"],
hdrs = ["group_moderation.h"],
deps = [
":DHT",
":attributes",
":ccompat",
":crypto_core",
":logger",
":mem",
":mono_time",
":network",
":util",
"@libsodium",
],
)
cc_test(
name = "group_moderation_test",
size = "small",
srcs = ["group_moderation_test.cc"],
deps = [
":DHT",
":crypto_core",
":crypto_core_test_util",
":group_moderation",
":logger",
":util",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "group_moderation_fuzz_test",
size = "small",
testonly = True,
srcs = ["group_moderation_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:group_moderation_fuzz_test"],
deps = [
":group_moderation",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "Messenger",
srcs = [
"Messenger.c",
"group_chats.c",
"group_connection.c",
"group_pack.c",
],
hdrs = [
"Messenger.h",
"group_chats.h",
"group_common.h",
"group_connection.h",
"group_pack.h",
],
visibility = [
"//c-toxcore/auto_tests:__pkg__",
"//c-toxcore/other:__pkg__",
"//c-toxcore/testing:__pkg__",
"//c-toxcore/toxav:__pkg__",
],
deps = [
":DHT",
":LAN_discovery",
":TCP_client",
":TCP_connection",
":TCP_server",
":announce",
":attributes",
":bin_pack",
":bin_unpack",
":ccompat",
":crypto_core",
":crypto_core_pack",
":forwarding",
":friend_connection",
":friend_requests",
":group_announce",
":group_moderation",
":group_onion_announce",
":logger",
":mem",
":mono_time",
":net_crypto",
":net_profile",
":network",
":onion",
":onion_announce",
":onion_client",
":state",
":util",
"@libsodium",
],
)
cc_library(
name = "group",
srcs = ["group.c"],
hdrs = ["group.h"],
visibility = ["//c-toxcore/toxav:__pkg__"],
deps = [
":DHT",
":Messenger",
":attributes",
":ccompat",
":crypto_core",
":friend_connection",
":logger",
":mem",
":mono_time",
":net_crypto",
":network",
":sort",
":state",
":util",
],
)
cc_library(
name = "tox_options",
srcs = ["tox_options.c"],
hdrs = ["tox_options.h"],
copts = ["-UTOX_HIDE_DEPRECATED"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":ccompat",
":tox_log_level",
],
)
cc_library(
name = "tox_log_level",
srcs = ["tox_log_level.c"],
hdrs = ["tox_log_level.h"],
visibility = ["//c-toxcore:__subpackages__"],
)
cc_library(
name = "tox",
srcs = [
"tox.c",
"tox_api.c",
"tox_private.c",
],
hdrs = [
"tox.h",
"tox_private.h",
"tox_struct.h",
],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":DHT",
":Messenger",
":TCP_client",
":TCP_server",
":attributes",
":ccompat",
":crypto_core",
":friend_requests",
":group",
":group_moderation",
":logger",
":mem",
":mono_time",
":net_crypto",
":net_profile",
":network",
":onion_client",
":os_memory",
":os_random",
":state",
":tox_log_level",
":tox_options",
":util",
"//c-toxcore/toxencryptsave:defines",
"@pthread",
],
)
cc_test(
name = "tox_test",
size = "small",
srcs = ["tox_test.cc"],
deps = [
":crypto_core",
":os_random",
":tox",
":tox_log_level",
":tox_options",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "tox_pack",
srcs = ["tox_pack.c"],
hdrs = ["tox_pack.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":bin_pack",
":ccompat",
":tox",
],
)
cc_library(
name = "tox_unpack",
srcs = ["tox_unpack.c"],
hdrs = ["tox_unpack.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":bin_unpack",
":ccompat",
":tox",
],
)
cc_library(
name = "tox_events",
srcs = [
"tox_event.c",
"tox_events.c",
] + glob([
"events/*.c",
]),
hdrs = [
"events/events_alloc.h",
"tox_event.h",
"tox_events.h",
],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":bin_pack",
":bin_unpack",
":ccompat",
":logger",
":mem",
":tox",
":tox_pack",
":tox_unpack",
"//c-toxcore/third_party:cmp",
],
)
cc_test(
name = "tox_events_test",
size = "small",
srcs = ["tox_events_test.cc"],
deps = [
":crypto_core",
":tox",
":tox_events",
"//c-toxcore/testing/support",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_fuzz_test(
name = "tox_events_fuzz_test",
size = "small",
srcs = ["tox_events_fuzz_test.cc"],
corpus = ["//tools/toktok-fuzzer/corpus:tox_events_fuzz_test"],
deps = [
":tox_dispatch",
":tox_events",
"//c-toxcore/testing/support",
],
)
cc_library(
name = "tox_dispatch",
srcs = ["tox_dispatch.c"],
hdrs = ["tox_dispatch.h"],
visibility = ["//c-toxcore:__subpackages__"],
deps = [
":attributes",
":ccompat",
":tox",
":tox_events",
],
)
alias(
name = "toxcore",
actual = ":tox_dispatch",
visibility = ["//c-toxcore:__subpackages__"],
)
sh_library(
name = "cimple_files",
srcs = glob([
"events/*.c",
"events/*.h",
"*.c",
"*.h",
]),
visibility = ["//c-toxcore/testing:__pkg__"],
)