1//
2// Copyright (C) 2018 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//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "binary_bpf_defaults",
23    srcs: ["BpfTest.cpp"],
24    shared_libs: [
25        "libcgrouprc",
26        "libcutils",
27        "libutils",
28        "liblog",
29        "libbase",
30    ],
31    static_libs: [
32        "libbpf",
33        "libbpf_android",
34        "libnetdutils",
35        "libprocessgroup",
36        "libtestUtil",
37    ],
38    cflags: [
39        "-fno-strict-aliasing",
40        "-Wall",
41        "-Werror",
42        "-Wno-unused-variable",
43    ],
44    data: [
45        ":kern.o",
46    ],
47
48}
49
50bpf {
51    name: "kern.o",
52    // header_libs: ["netd_bpf_progs_headers"],
53    include_dirs: ["system/netd/bpf_progs"],
54    srcs: ["kern.c"],
55    cflags: [
56        "-Wall",
57        "-Werror",
58    ],
59}
60
61cc_test {
62    name: "bpf_module_test",
63    defaults: ["binary_bpf_defaults"],
64    test_config: "bpf_module_test.xml",
65    test_suites: [
66        "device-tests",
67        "vts",
68    ],
69}
70
71cc_test {
72    name: "vts_test_binary_bpf_module",
73    defaults: ["binary_bpf_defaults"],
74}
75