blob: 43eb2d8e593c0f5cbd5624728f13fccec6bcd07f [file] [log] [blame]
Bob Badour370808d2021-02-12 14:17:41 -08001package {
Aditya Choudhary71086be2024-01-31 11:08:57 +00002 default_team: "trendy_team_fwk_core_networking",
Bob Badour370808d2021-02-12 14:17:41 -08003 default_applicable_licenses: ["external_android-clat_license"],
4}
5
6// Added automatically by a large-scale-change
7//
8// large-scale-change included anything that looked like it might be a license
9// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
10//
11// Please consider removing redundant or irrelevant files from 'license_text:'.
12// See: http://go/android-license-faq
13license {
14 name: "external_android-clat_license",
15 visibility: [":__subpackages__"],
16 license_kinds: [
17 "SPDX-license-identifier-Apache-2.0",
18 ],
19 license_text: [
20 "LICENSE",
21 "NOTICE",
22 ],
23}
24
Lorenzo Colittieb92f482019-01-04 14:59:11 +090025cc_defaults {
26 name: "clatd_defaults",
Dan Willemsen1e562182018-11-16 12:52:08 -080027
28 cflags: [
29 "-Wall",
30 "-Werror",
31 "-Wunused-parameter",
32
33 // Bug: http://b/33566695
34 "-Wno-address-of-packed-member",
35 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090036}
37
38// Code used both by the daemon and by unit tests.
39filegroup {
40 name: "clatd_common",
41 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090042 "clatd.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090043 "dump.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090044 "icmp.c",
45 "ipv4.c",
46 "ipv6.c",
47 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090048 "translate.c",
49 ],
50}
51
52// The clat daemon.
53cc_binary {
54 name: "clatd",
55 defaults: ["clatd_defaults"],
56 srcs: [
57 ":clatd_common",
Aditya Choudhary71086be2024-01-31 11:08:57 +000058 "main.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090059 ],
Lorenzo Colittia4e96812021-12-09 17:36:58 +090060 static_libs: [
Lorenzo Colitti0cd5aa52021-12-09 15:05:52 +090061 "libip_checksum",
Lorenzo Colittia4e96812021-12-09 17:36:58 +090062 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080063 shared_libs: [
Dan Willemsen1e562182018-11-16 12:52:08 -080064 "liblog",
Dan Willemsen1e562182018-11-16 12:52:08 -080065 ],
Hungming Chenef9f62b2022-01-11 15:51:28 +080066 relative_install_path: "for-system",
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090067
Hungming Chen03486e02022-01-07 18:13:20 +080068 // Static libc++ for smaller apex size while shipping clatd in the mainline module.
69 // See b/213123047
70 stl: "libc++_static",
71
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090072 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
73 // tests substantially increases build/compile cycle times and doesn't really provide a
74 // security benefit.
75 tidy: true,
76 tidy_checks: [
77 "-*",
78 "cert-*",
79 "clang-analyzer-security*",
Chih-Hung Hsieh3abac002022-04-04 04:23:34 -070080 // b/2043314, warnings on memcpy_s, memset_s, snprintf_s calls
81 // are blocking the migration from gnu99 to gnu11.
82 // Until those warnings are fixed, disable these checks.
83 "-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling",
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090084 "android-*",
85 ],
Chih-Hung Hsieh3abac002022-04-04 04:23:34 -070086 tidy_checks_as_errors: [
87 "clang-analyzer-security*",
88 "cert-*",
89 "android-*",
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090090 ],
Hungming Chen07125612021-12-16 12:38:34 +080091
92 apex_available: [
93 "com.android.tethering",
94 "//apex_available:platform",
95 ],
96 min_sdk_version: "30",
Dan Willemsen1e562182018-11-16 12:52:08 -080097}
98
Dan Willemsen1e562182018-11-16 12:52:08 -080099// Unit tests.
100cc_test {
101 name: "clatd_test",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900102 defaults: ["clatd_defaults"],
Dan Willemsen1e562182018-11-16 12:52:08 -0800103 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900104 ":clatd_common",
Aditya Choudhary71086be2024-01-31 11:08:57 +0000105 "clatd_test.cpp",
Dan Willemsen1e562182018-11-16 12:52:08 -0800106 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900107 static_libs: [
108 "libbase",
Lorenzo Colitti0cd5aa52021-12-09 15:05:52 +0900109 "libip_checksum",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900110 "libnetd_test_tun_interface",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900111 ],
Dan Willemsen1e562182018-11-16 12:52:08 -0800112 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900113 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -0800114 "liblog",
115 "libnetutils",
116 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +0900117 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -0700118 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -0800119}