blob: 6df30786ea4cd86b2ae1ef54bd9e1d3c0124b243 [file] [log] [blame]
Bob Badour370808d2021-02-12 14:17:41 -08001package {
2 default_applicable_licenses: ["external_android-clat_license"],
3}
4
5// Added automatically by a large-scale-change
6//
7// large-scale-change included anything that looked like it might be a license
8// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
9//
10// Please consider removing redundant or irrelevant files from 'license_text:'.
11// See: http://go/android-license-faq
12license {
13 name: "external_android-clat_license",
14 visibility: [":__subpackages__"],
15 license_kinds: [
16 "SPDX-license-identifier-Apache-2.0",
17 ],
18 license_text: [
19 "LICENSE",
20 "NOTICE",
21 ],
22}
23
Lorenzo Colittieb92f482019-01-04 14:59:11 +090024cc_defaults {
25 name: "clatd_defaults",
Dan Willemsen1e562182018-11-16 12:52:08 -080026
27 cflags: [
28 "-Wall",
29 "-Werror",
30 "-Wunused-parameter",
31
32 // Bug: http://b/33566695
33 "-Wno-address-of-packed-member",
34 ],
35
Lorenzo Colitti27da0ad2020-06-01 12:15:20 +090036 // For MARK_UNSET.
37 header_libs: [
38 "libnetd_client_headers"
39 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +090040}
41
42// Code used both by the daemon and by unit tests.
43filegroup {
44 name: "clatd_common",
45 srcs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +090046 "clatd.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090047 "dump.c",
48 "getaddr.c",
49 "icmp.c",
50 "ipv4.c",
51 "ipv6.c",
52 "logging.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090053 "netlink_callbacks.c",
54 "netlink_msg.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090055 "setif.c",
Lorenzo Colittieb92f482019-01-04 14:59:11 +090056 "translate.c",
57 ],
58}
59
60// The clat daemon.
61cc_binary {
62 name: "clatd",
63 defaults: ["clatd_defaults"],
64 srcs: [
65 ":clatd_common",
66 "main.c"
67 ],
Lorenzo Colittia4e96812021-12-09 17:36:58 +090068 static_libs: [
69 "libipchecksum",
70 "libnl",
71 ],
Dan Willemsen1e562182018-11-16 12:52:08 -080072 shared_libs: [
73 "libcutils",
74 "liblog",
Dan Willemsen1e562182018-11-16 12:52:08 -080075 ],
Lorenzo Colitti6a095df2019-04-10 23:22:30 +090076
77 // Only enable clang-tidy for the daemon, not the tests, because enabling it for the
78 // tests substantially increases build/compile cycle times and doesn't really provide a
79 // security benefit.
80 tidy: true,
81 tidy_checks: [
82 "-*",
83 "cert-*",
84 "clang-analyzer-security*",
85 "android-*",
86 ],
87 tidy_flags: [
88 "-warnings-as-errors=clang-analyzer-security*,cert-*,android-*",
89 ],
Lorenzo Colitti92928722021-01-18 17:40:34 +090090 // Actually not required for clatd itself. See comments in the rc file.
91 init_rc: [
92 "vendor-464xlat.rc",
93 ],
Evgenii Stepanovafe05e12021-05-21 16:33:45 -070094 sanitize: {
95 memtag_heap: true,
96 },
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",
105 "clatd_test.cpp"
Dan Willemsen1e562182018-11-16 12:52:08 -0800106 ],
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900107 static_libs: [
108 "libbase",
Lorenzo Colittia4e96812021-12-09 17:36:58 +0900109 "libipchecksum",
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900110 "libnetd_test_tun_interface",
111 "libnl",
112 ],
Dan Willemsen1e562182018-11-16 12:52:08 -0800113 shared_libs: [
Lorenzo Colittieb92f482019-01-04 14:59:11 +0900114 "libcutils",
Dan Willemsen1e562182018-11-16 12:52:08 -0800115 "liblog",
116 "libnetutils",
117 ],
Lorenzo Colitti33351932019-01-04 19:36:51 +0900118 test_suites: ["device-tests"],
Maciej Żenczykowski76f4b742019-09-19 14:38:34 -0700119 require_root: true,
Dan Willemsen1e562182018-11-16 12:52:08 -0800120}