1// Copyright 2016 The Android Open Source Project
2
3package {
4    default_team: "trendy_team_fwk_core_networking",
5    default_applicable_licenses: ["hardware_google_apf_license"],
6}
7
8// Added automatically by a large-scale-change
9// See: http://go/android-license-faq
10license {
11    name: "hardware_google_apf_license",
12    visibility: [":__subpackages__"],
13    license_kinds: [
14        "SPDX-license-identifier-Apache-2.0",
15    ],
16    license_text: [
17        "LICENSE",
18    ],
19}
20
21cc_defaults {
22    name: "apf_defaults",
23
24    cflags: [
25        "-DAPF_FRAME_HEADER_SIZE=14",
26        "-Wall",
27        "-Werror",
28        "-Werror=implicit-fallthrough",
29        "-Wnullable-to-nonnull-conversion",
30        "-Wsign-compare",
31        "-Wthread-safety",
32        "-Wunused-parameter",
33        "-Wuninitialized",
34    ],
35}
36
37cc_library_static {
38    name: "libapf",
39    defaults: ["apf_defaults"],
40    srcs: ["apf_interpreter.c"],
41    sdk_version: "24",
42}
43
44cc_library_static {
45    name: "libapfdisassembler",
46    defaults: ["apf_defaults"],
47    srcs: [
48        "disassembler.c",
49    ],
50    sdk_version: "24",
51}
52
53cc_binary_host {
54    name: "apf_disassembler",
55    defaults: ["apf_defaults"],
56    srcs: [
57        "apf_disassembler.c",
58        "disassembler.c",
59    ],
60}
61
62cc_binary_host {
63    name: "apf_run",
64    defaults: ["apf_defaults"],
65    static_libs: [
66        "libpcap",
67    ],
68    srcs: [
69        "apf_run.c",
70        "apf_interpreter.c",
71        "disassembler.c",
72        "v7/apf_interpreter.c",
73        "v7/test_buf_allocator.c",
74    ],
75    cflags: [
76        "-DAPF_TRACE_HOOK=apf_trace_hook",
77    ],
78    target: {
79        darwin: {
80            enabled: false,
81        },
82    },
83}
84
85sh_test_host {
86    name: "apf_run_test",
87    src: "apf_run_test.sh",
88    filename: "apf_run_test.sh",
89    test_config: "apf_run_test.xml",
90    data: ["testdata/*"],
91    data_bins: ["apf_run"],
92    target: {
93        darwin: {
94            enabled: false,
95        },
96        windows: {
97            enabled: false,
98        },
99    },
100    data_libs: [
101        "libc++",
102    ],
103    test_options: {
104        unit_test: true,
105    },
106}
107
108cc_test_host {
109    name: "apf_checksum_test",
110    srcs: [
111        "apf_checksum_test.cc",
112    ],
113    cflags: [
114        "-Wall",
115        "-Wno-unused-function",
116    ],
117    stl: "c++_static",
118}
119
120cc_test_host {
121    name: "apf_dns_test",
122    srcs: [
123        "apf_dns_test.cc",
124    ],
125    cflags: [
126        "-Wall",
127        "-Wno-unused-function",
128    ],
129    stl: "c++_static",
130}
131