load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") exports_files( srcs = [ "tox.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", ":crypto_core_test_util", ":test_util", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) cc_library( name = "attributes", hdrs = ["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 = "mem", srcs = ["mem.c"], hdrs = ["mem.h"], visibility = ["//c-toxcore:__subpackages__"], deps = [ ":attributes", ":ccompat", ], ) cc_library( name = "mem_test_util", testonly = True, srcs = ["mem_test_util.cc"], hdrs = ["mem_test_util.hh"], deps = [ ":mem", ":test_util", ], ) cc_test( name = "mem_test", size = "small", srcs = ["mem_test.cc"], deps = [ ":mem", "@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 = [ ":crypto_core", ":crypto_core_test_util", ":util", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) 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", "//c-toxcore/third_party:cmp", ], ) cc_test( name = "bin_pack_test", size = "small", srcs = ["bin_pack_test.cc"], deps = [ ":bin_pack", ":bin_unpack", ":logger", "@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", ":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", ], ) cc_test( name = "crypto_core_test", size = "small", srcs = ["crypto_core_test.cc"], flaky = True, deps = [ ":crypto_core", ":crypto_core_test_util", ":util", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) cc_library( name = "list", srcs = ["list.c"], hdrs = ["list.h"], deps = [ ":attributes", ":ccompat", ], ) cc_test( name = "list_test", size = "small", srcs = ["list_test.cc"], deps = [ ":list", "@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:__pkg__", "//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_test( name = "mono_time_test", size = "small", srcs = ["mono_time_test.cc"], deps = [ ":mem_test_util", ":mono_time", "@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"], deps = [ ":attributes", ":ccompat", ":logger", ":mem", ], ) cc_library( name = "network", srcs = ["network.c"], hdrs = ["network.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", ":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", "@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", ":mem_test_util", ":mono_time", ":ping_array", "@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", ":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", ":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", ":network", ":network_test_util", ":test_util", ], ) cc_test( name = "DHT_test", size = "small", srcs = ["DHT_test.cc"], deps = [ ":DHT", ":DHT_test_util", ":crypto_core", ":crypto_core_test_util", ":logger", ":mem_test_util", ":mono_time", ":network", ":network_test_util", ":test_util", "@com_google_googletest//:gtest", "@com_google_googletest//:gtest_main", ], ) cc_fuzz_test( name = "DHT_fuzz_test", size = "small", srcs = ["DHT_fuzz_test.cc"], corpus = ["//tools/toktok-fuzzer/corpus:DHT_fuzz_test"], deps = [ ":DHT", "//c-toxcore/testing/fuzzing:fuzz_support", ], ) cc_library( name = "onion", srcs = ["onion.c"], hdrs = ["onion.h"], visibility = ["//c-toxcore/auto_tests:__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__"], deps = [ ":DHT", ":attributes", ":ccompat", ":crypto_core", ":logger", ":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/fuzzing:fuzz_support", "//c-toxcore/testing/fuzzing:fuzz_tox", ], ) 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_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_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", ":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", ":mono_time", ":network", ":util", ], ) cc_test( name = "group_announce_test", size = "small", srcs = ["group_announce_test.cc"], deps = [ ":DHT", ":crypto_core", ":group_announce", ":logger", ":mem_test_util", ":mono_time", ":network", "@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", ":mem_test_util", "//c-toxcore/testing/fuzzing:fuzz_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", ":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", ":logger", ":mem", ":mono_time", ":net_crypto", ":network", ":onion", ":onion_announce", ":ping_array", ":timed_auth", ":util", ], ) 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", ":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", ":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", ":mem_test_util", ":util", "@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", ":mem_test_util", "//c-toxcore/testing/fuzzing:fuzz_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", ":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", ":mono_time", ":net_crypto", ":network", ":state", ":util", ], ) 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", ":state", ":util", "//c-toxcore/toxencryptsave:defines", "@pthread", ], ) cc_test( name = "tox_test", size = "small", srcs = ["tox_test.cc"], deps = [ ":crypto_core", ":tox", "@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", "@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/fuzzing:fuzz_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__"], )