1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "system_netd_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["system_netd_license"],
8}
9
10cc_library {
11    name: "libnetdutils",
12    srcs: [
13        "DumpWriter.cpp",
14        "Fd.cpp",
15        "InternetAddresses.cpp",
16        "Log.cpp",
17        "Netfilter.cpp",
18        "Netlink.cpp",
19        "Slice.cpp",
20        "Socket.cpp",
21        "SocketOption.cpp",
22        "Status.cpp",
23        "Syscalls.cpp",
24        "UniqueFd.cpp",
25        "UniqueFile.cpp",
26    ],
27    defaults: ["netd_defaults"],
28    cflags: ["-Wall", "-Werror"],
29    shared_libs: [
30        "libbase",
31        "liblog",
32    ],
33    export_shared_lib_headers: [
34        "libbase",
35    ],
36    export_include_dirs: ["include"],
37    sanitize: {
38        cfi: true,
39    },
40
41    apex_available: [
42        "//apex_available:platform",
43        "com.android.resolv",
44    ],
45    min_sdk_version: "29",
46}
47
48cc_test {
49    name: "netdutils_test",
50    srcs: [
51        "BackoffSequenceTest.cpp",
52        "FdTest.cpp",
53        "InternetAddressesTest.cpp",
54        "LogTest.cpp",
55        "MemBlockTest.cpp",
56        "SliceTest.cpp",
57        "StatusTest.cpp",
58        "SyscallsTest.cpp",
59        "ThreadUtilTest.cpp",
60    ],
61    defaults: ["netd_defaults"],
62    test_suites: ["device-tests"],
63    static_libs: [
64        "libgmock",
65        "libnetdutils",
66    ],
67    shared_libs: [
68        "libbase",
69    ],
70}
71