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