1//
2// Copyright (C) 2023 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_team: "trendy_team_fwk_core_networking",
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_library {
22    name: "libcom.android.tethering.dns_helper",
23    version_script: "libcom.android.tethering.dns_helper.map.txt",
24    stubs: {
25        versions: [
26            "1",
27        ],
28        symbol_file: "libcom.android.tethering.dns_helper.map.txt",
29    },
30    defaults: ["netd_defaults"],
31    header_libs: [
32        "bpf_connectivity_headers",
33        "libcutils_headers",
34    ],
35    srcs: [
36        "DnsBpfHelper.cpp",
37        "DnsHelper.cpp",
38    ],
39    static_libs: [
40        "libmodules-utils-build",
41    ],
42    shared_libs: [
43        "libbase",
44    ],
45    export_include_dirs: ["include"],
46    header_abi_checker: {
47        enabled: true,
48        symbol_file: "libcom.android.tethering.dns_helper.map.txt",
49    },
50    sanitize: {
51        cfi: true,
52    },
53    apex_available: ["com.android.tethering"],
54    min_sdk_version: "30",
55}
56
57cc_test {
58    name: "dns_helper_unit_test",
59    defaults: ["netd_defaults"],
60    test_suites: [
61        "general-tests",
62        "mts-tethering",
63    ],
64    test_config_template: ":net_native_test_config_template",
65    header_libs: [
66        "bpf_connectivity_headers",
67    ],
68    srcs: [
69        "DnsBpfHelperTest.cpp",
70    ],
71    static_libs: [
72        "libcom.android.tethering.dns_helper",
73    ],
74    shared_libs: [
75        "libbase",
76        "libcutils",
77    ],
78    compile_multilib: "both",
79    multilib: {
80        lib32: {
81            suffix: "32",
82        },
83        lib64: {
84            suffix: "64",
85        },
86    },
87}
88