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 libbinder \ 67 libcutils \ 68 libdl \ 69 liblog \ 70 liblogwrap \ 71 libmdnssd \ 72 libnetdaidl \ 73 libnetutils \ 74 libnl \ 75 libsysutils \ 76 libbase \ 77 libutils \ 78 libpcap \ 79 80LOCAL_SRC_FILES := \ 81 BandwidthController.cpp \ 82 ClatdController.cpp \ 83 CommandListener.cpp \ 84 Controllers.cpp \ 85 DnsProxyListener.cpp \ 86 DummyNetwork.cpp \ 87 DumpWriter.cpp \ 88 EventReporter.cpp \ 89 FirewallController.cpp \ 90 FwmarkServer.cpp \ 91 IdletimerController.cpp \ 92 InterfaceController.cpp \ 93 IptablesRestoreController.cpp \ 94 LocalNetwork.cpp \ 95 MDnsSdListener.cpp \ 96 NatController.cpp \ 97 NetdCommand.cpp \ 98 NetdConstants.cpp \ 99 NetdNativeService.cpp \ 100 NetlinkHandler.cpp \ 101 NetlinkManager.cpp \ 102 NetlinkCommands.cpp \ 103 Network.cpp \ 104 NetworkController.cpp \ 105 PhysicalNetwork.cpp \ 106 PppController.cpp \ 107 ResolverController.cpp \ 108 RouteController.cpp \ 109 SockDiag.cpp \ 110 StrictController.cpp \ 111 TetherController.cpp \ 112 UidRanges.cpp \ 113 VirtualNetwork.cpp \ 114 XfrmController.cpp \ 115 main.cpp \ 116 oem_iptables_hook.cpp \ 117 binder/android/net/UidRange.cpp \ 118 binder/android/net/metrics/INetdEventListener.aidl \ 119 120LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/binder 121 122include $(BUILD_EXECUTABLE) 123 124 125### 126### ndc binary. 127### 128include $(CLEAR_VARS) 129 130LOCAL_CFLAGS := -Wall -Werror 131LOCAL_SANITIZE := unsigned-integer-overflow 132LOCAL_CLANG := true 133LOCAL_MODULE := ndc 134LOCAL_SHARED_LIBRARIES := libcutils 135LOCAL_SRC_FILES := ndc.cpp 136 137include $(BUILD_EXECUTABLE) 138 139### 140### netd unit tests. 141### 142include $(CLEAR_VARS) 143LOCAL_MODULE := netd_unit_test 144LOCAL_SANITIZE := unsigned-integer-overflow 145LOCAL_CFLAGS := -Wall -Werror -Wunused-parameter 146# Bug: http://b/29823425 Disable -Wvarargs for Clang update to r271374 147LOCAL_CFLAGS += -Wno-varargs 148 149LOCAL_C_INCLUDES := \ 150 bionic/libc/dns/include \ 151 system/netd/include \ 152 system/netd/server \ 153 system/netd/server/binder \ 154 system/netd/tests \ 155 system/core/logwrapper/include \ 156 157LOCAL_SRC_FILES := \ 158 Controllers.cpp \ 159 NetdConstants.cpp IptablesBaseTest.cpp \ 160 IptablesRestoreController.cpp IptablesRestoreControllerTest.cpp \ 161 BandwidthController.cpp BandwidthControllerTest.cpp \ 162 FirewallControllerTest.cpp FirewallController.cpp \ 163 IdletimerController.cpp \ 164 NatControllerTest.cpp NatController.cpp \ 165 NetlinkCommands.cpp \ 166 RouteController.cpp RouteControllerTest.cpp \ 167 SockDiagTest.cpp SockDiag.cpp \ 168 StrictController.cpp StrictControllerTest.cpp \ 169 UidRanges.cpp \ 170 binder/android/net/UidRange.cpp \ 171 binder/android/net/metrics/INetdEventListener.aidl \ 172 ../tests/tun_interface.cpp \ 173 174LOCAL_MODULE_TAGS := tests 175LOCAL_SHARED_LIBRARIES := \ 176 libbase \ 177 libbinder \ 178 libcutils \ 179 liblog \ 180 liblogwrap \ 181 libnetutils \ 182 libsysutils \ 183 libutils \ 184 185include $(BUILD_NATIVE_TEST) 186 187