• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15cc_defaults {
16    name: "libpcap_defaults",
17    cflags: [
18        "-D_BSD_SOURCE",
19        "-DHAVE_CONFIG_H",
20        "-Dlint",
21        "-D_U_=__attribute__((__unused__))",
22        "-Wall",
23        "-Werror",
24        "-Wno-macro-redefined",
25        "-Wno-pointer-arith",
26        "-Wno-sign-compare",
27        "-Wno-unused-parameter",
28        "-Wno-unused-result",
29        "-Wno-tautological-compare",
30    ],
31}
32
33cc_library {
34    name: "libpcap",
35    host_supported: false,
36    vendor_available: true,
37    defaults: ["libpcap_defaults"],
38
39    // (Matches order in libpcap's Makefile.)
40    srcs: [
41        "pcap-linux.c",
42        "pcap-usb-linux.c",
43        "pcap-netfilter-linux-android.c",
44        "fad-getad.c",
45        "pcap.c",
46        "inet.c",
47        "fad-helpers.c",
48        "gencode.c",
49        "optimize.c",
50        "nametoaddr.c",
51        "etherent.c",
52        "savefile.c",
53        "sf-pcap.c",
54        "sf-pcap-ng.c",
55        "pcap-common.c",
56        "bpf_image.c",
57        "bpf_dump.c",
58        "scanner.c",
59        "grammar.c",
60        "bpf_filter.c",
61        "version.c",
62    ],
63
64    export_include_dirs: ["."],
65}
66
67//
68// Tests.
69//
70
71cc_test {
72    name: "libpcap_test",
73    defaults: ["libpcap_defaults"],
74    gtest: false,
75    // (Matches order in libpcap's Makefile.)
76    srcs: [
77        "tests/capturetest.c",
78        "tests/can_set_rfmon_test.c",
79        "tests/filtertest.c",
80        "tests/findalldevstest.c",
81        "tests/opentest.c",
82        "tests/reactivatetest.c",
83        "tests/selpolltest.c",
84    ],
85    static_libs: ["libpcap"],
86    test_per_src: true,
87}
88