• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (C) 2014 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
15LOCAL_PATH := $(call my-dir)
16
17###
18### netd service AIDL interface.
19###
20include $(CLEAR_VARS)
21
22LOCAL_CFLAGS := -Wall -Werror
23LOCAL_CLANG := true
24LOCAL_SANITIZE := unsigned-integer-overflow
25LOCAL_MODULE := libnetdaidl
26LOCAL_SHARED_LIBRARIES := \
27        libbinder \
28        libutils
29LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/binder
30LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
31LOCAL_C_INCLUDES := $(LOCAL_PATH)/binder
32LOCAL_SRC_FILES := \
33        binder/android/net/INetd.aidl \
34        binder/android/net/UidRange.cpp
35
36include $(BUILD_SHARED_LIBRARY)
37
38###
39### netd daemon.
40###
41include $(CLEAR_VARS)
42
43LOCAL_C_INCLUDES := \
44        $(call include-path-for, libhardware_legacy)/hardware_legacy \
45        bionic/libc/dns/include \
46        external/mdnsresponder/mDNSShared \
47        system/netd/include \
48
49LOCAL_CLANG := true
50LOCAL_CPPFLAGS := -Wall -Werror
51LOCAL_SANITIZE := unsigned-integer-overflow
52LOCAL_MODULE := netd
53
54# Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
55LOCAL_CPPFLAGS +=  -Wno-varargs \
56
57ifeq ($(TARGET_ARCH), x86)
58ifneq ($(TARGET_PRODUCT), gce_x86_phone)
59        LOCAL_CPPFLAGS += -D NETLINK_COMPAT32
60endif
61endif
62
63LOCAL_INIT_RC := netd.rc
64
65LOCAL_SHARED_LIBRARIES := \
66        android.system.net.netd@1.0 \
67        libbinder \
68        libcrypto \
69        libcutils \
70        libdl \
71        libhidlbase \
72        libhidltransport \
73        liblog \
74        liblogwrap \
75        libmdnssd \
76        libnetdaidl \
77        libnetutils \
78        libnetdutils \
79        libnl \
80        libssl \
81        libsysutils \
82        libbase \
83        libutils \
84        libpcap \
85
86LOCAL_SRC_FILES := \
87        BandwidthController.cpp \
88        ClatdController.cpp \
89        CommandListener.cpp \
90        Controllers.cpp \
91        DnsProxyListener.cpp \
92        DummyNetwork.cpp \
93        DumpWriter.cpp \
94        EventReporter.cpp \
95        FirewallController.cpp \
96        FwmarkServer.cpp \
97        IdletimerController.cpp \
98        InterfaceController.cpp \
99        IptablesRestoreController.cpp \
100        LocalNetwork.cpp \
101        MDnsSdListener.cpp \
102        NatController.cpp \
103        NetdCommand.cpp \
104        NetdConstants.cpp \
105        NetdHwService.cpp \
106        NetdNativeService.cpp \
107        NetlinkHandler.cpp \
108        NetlinkManager.cpp \
109        NetlinkCommands.cpp \
110        NetlinkListener.cpp \
111        Network.cpp \
112        NetworkController.cpp \
113        NFLogListener.cpp \
114        PhysicalNetwork.cpp \
115        PppController.cpp \
116        ResolverController.cpp \
117        RouteController.cpp \
118        SockDiag.cpp \
119        StrictController.cpp \
120        TetherController.cpp \
121        UidRanges.cpp \
122        VirtualNetwork.cpp \
123        WakeupController.cpp \
124        XfrmController.cpp \
125        main.cpp \
126        oem_iptables_hook.cpp \
127        binder/android/net/UidRange.cpp \
128        binder/android/net/metrics/INetdEventListener.aidl \
129        dns/DnsTlsTransport.cpp \
130
131LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder
132
133include $(BUILD_EXECUTABLE)
134
135
136###
137### ndc binary.
138###
139include $(CLEAR_VARS)
140
141LOCAL_CFLAGS := -Wall -Werror
142LOCAL_SANITIZE := unsigned-integer-overflow
143LOCAL_CLANG := true
144LOCAL_MODULE := ndc
145LOCAL_SHARED_LIBRARIES := libcutils
146LOCAL_SRC_FILES := ndc.cpp
147
148include $(BUILD_EXECUTABLE)
149
150###
151### netd unit tests.
152###
153include $(CLEAR_VARS)
154LOCAL_MODULE := netd_unit_test
155LOCAL_COMPATIBILITY_SUITE := device-tests
156LOCAL_SANITIZE := unsigned-integer-overflow
157LOCAL_CFLAGS := -Wall -Werror -Wunused-parameter
158# Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374
159LOCAL_CFLAGS += -Wno-varargs
160
161LOCAL_C_INCLUDES := \
162        bionic/libc/dns/include \
163        system/netd/include \
164        system/netd/server \
165        system/netd/server/binder \
166        system/netd/tests \
167        system/core/logwrapper/include \
168
169LOCAL_SRC_FILES := \
170        InterfaceController.cpp InterfaceControllerTest.cpp \
171        Controllers.cpp ControllersTest.cpp \
172        NetdConstants.cpp IptablesBaseTest.cpp \
173        IptablesRestoreController.cpp IptablesRestoreControllerTest.cpp \
174        BandwidthController.cpp BandwidthControllerTest.cpp \
175        FirewallControllerTest.cpp FirewallController.cpp \
176        IdletimerController.cpp IdletimerControllerTest.cpp \
177        NatControllerTest.cpp NatController.cpp \
178        NetlinkCommands.cpp NetlinkManager.cpp \
179        RouteController.cpp RouteControllerTest.cpp \
180        SockDiagTest.cpp SockDiag.cpp \
181        StrictController.cpp StrictControllerTest.cpp \
182        UidRanges.cpp \
183        NetlinkListener.cpp \
184        WakeupController.cpp WakeupControllerTest.cpp \
185        NFLogListener.cpp NFLogListenerTest.cpp \
186        binder/android/net/UidRange.cpp \
187        binder/android/net/metrics/INetdEventListener.aidl \
188        ../tests/tun_interface.cpp \
189
190LOCAL_MODULE_TAGS := tests
191LOCAL_STATIC_LIBRARIES := libgmock libpcap
192LOCAL_SHARED_LIBRARIES := \
193        libnetdaidl \
194        libbase \
195        libbinder \
196        libcrypto \
197        libcutils \
198        liblog \
199        liblogwrap \
200        libnetutils \
201        libnetdutils \
202        libnl \
203        libsysutils \
204        libutils \
205        libssl \
206
207include $(BUILD_NATIVE_TEST)
208
209