Android.bp 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. // AIDL interface between netd and services.core
  2. aidl_interface {
  3. name: "netd_event_listener_interface",
  4. local_include_dir: "binder",
  5. srcs: [
  6. "binder/android/net/metrics/INetdEventListener.aidl",
  7. ],
  8. api_dir: "aidl/netdeventlistener",
  9. versions: ["1"],
  10. }
  11. // These are used in netd_integration_test
  12. // TODO: fold these into a cc_library_static after converting netd/server to Android.bp
  13. filegroup {
  14. name: "netd_integration_test_shared",
  15. srcs: [
  16. "NetdConstants.cpp",
  17. "InterfaceController.cpp",
  18. "NetlinkCommands.cpp",
  19. "NetlinkListener.cpp",
  20. "XfrmController.cpp",
  21. "TrafficController.cpp",
  22. ],
  23. }
  24. aidl_interface {
  25. name: "netd_aidl_interface",
  26. local_include_dir: "binder",
  27. srcs: [
  28. "binder/android/net/INetd.aidl",
  29. // AIDL interface that callers can implement to receive networking events from netd.
  30. "binder/android/net/INetdUnsolicitedEventListener.aidl",
  31. "binder/android/net/InterfaceConfigurationParcel.aidl",
  32. "binder/android/net/TetherStatsParcel.aidl",
  33. "binder/android/net/UidRangeParcel.aidl",
  34. ],
  35. api_dir: "aidl/netd",
  36. backend: {
  37. cpp: {
  38. gen_log: true,
  39. },
  40. },
  41. versions: [
  42. "1",
  43. "2",
  44. ],
  45. }
  46. aidl_interface {
  47. // This interface is for OEM calls to netd and vice versa that do not exist in AOSP.
  48. // Those calls cannot be part of INetd.aidl and INetdUnsolicitedEventListener.aidl
  49. // because those interfaces are versioned.
  50. // These interfaces must never be versioned or OEMs will not be able to change them.
  51. name: "oemnetd_aidl_interface",
  52. local_include_dir: "binder",
  53. srcs: [
  54. "binder/com/android/internal/net/IOemNetd.aidl",
  55. "binder/com/android/internal/net/IOemNetdUnsolicitedEventListener.aidl",
  56. ],
  57. }
  58. // Modules common to both netd and netd_unit_test
  59. cc_library_static {
  60. name: "libnetd_server",
  61. defaults: ["netd_defaults"],
  62. include_dirs: [
  63. "system/netd/include",
  64. "system/netd/server/binder",
  65. ],
  66. srcs: [
  67. "BandwidthController.cpp",
  68. "ClatdController.cpp",
  69. "ClatUtils.cpp",
  70. "Controllers.cpp",
  71. "NetdConstants.cpp",
  72. "FirewallController.cpp",
  73. "IdletimerController.cpp",
  74. "InterfaceController.cpp",
  75. "IptablesRestoreController.cpp",
  76. "NFLogListener.cpp",
  77. "NetlinkCommands.cpp",
  78. "NetlinkListener.cpp",
  79. "NetlinkManager.cpp",
  80. "RouteController.cpp",
  81. "SockDiag.cpp",
  82. "StrictController.cpp",
  83. "TcpSocketMonitor.cpp",
  84. "TetherController.cpp",
  85. "TrafficController.cpp",
  86. "UidRanges.cpp",
  87. "WakeupController.cpp",
  88. "XfrmController.cpp",
  89. ],
  90. shared_libs: [
  91. "libbpf_android",
  92. "libbase",
  93. "libbinder",
  94. "liblogwrap",
  95. "libnetdbpf",
  96. "libnetutils",
  97. "libnetdutils",
  98. "libpcap",
  99. "libqtaguid",
  100. "libssl",
  101. "netd_aidl_interface-V2-cpp",
  102. "netd_event_listener_interface-V1-cpp",
  103. ],
  104. header_libs: [
  105. "libnetd_resolv_headers",
  106. ],
  107. aidl: {
  108. export_aidl_headers: true,
  109. local_include_dirs: ["binder"],
  110. },
  111. }
  112. cc_binary {
  113. name: "netd",
  114. defaults: ["netd_defaults"],
  115. include_dirs: [
  116. "external/mdnsresponder/mDNSShared",
  117. "system/netd/include",
  118. ],
  119. init_rc: ["netd.rc"],
  120. shared_libs: [
  121. "[email protected]",
  122. "[email protected]",
  123. "libbase",
  124. "libbinder",
  125. "libbpf_android",
  126. "libcutils",
  127. "libdl",
  128. "libhidlbase",
  129. "libhidltransport",
  130. "libjsoncpp",
  131. "liblog",
  132. "liblogwrap",
  133. "libmdnssd",
  134. "libnetdbpf",
  135. "libnetdutils",
  136. "libnetutils",
  137. "libpcap",
  138. "libprocessgroup",
  139. "libqtaguid",
  140. "libselinux",
  141. "libsysutils",
  142. "libutils",
  143. "netd_aidl_interface-V2-cpp",
  144. "netd_event_listener_interface-V1-cpp",
  145. "oemnetd_aidl_interface-cpp",
  146. ],
  147. static_libs: [
  148. "libnetd_server",
  149. ],
  150. header_libs: [
  151. "libnetd_resolv_headers",
  152. ],
  153. srcs: [
  154. "DummyNetwork.cpp",
  155. "EventReporter.cpp",
  156. "FwmarkServer.cpp",
  157. "LocalNetwork.cpp",
  158. "MDnsSdListener.cpp",
  159. "NetdCommand.cpp",
  160. "NetdHwService.cpp",
  161. "NetdNativeService.cpp",
  162. "NetlinkHandler.cpp",
  163. "Network.cpp",
  164. "NetworkController.cpp",
  165. "OemNetdListener.cpp",
  166. "PhysicalNetwork.cpp",
  167. "PppController.cpp",
  168. "Process.cpp",
  169. "ResolvStub.cpp",
  170. "VirtualNetwork.cpp",
  171. "main.cpp",
  172. "oem_iptables_hook.cpp",
  173. ],
  174. }
  175. cc_binary {
  176. name: "ndc",
  177. defaults: ["netd_defaults"],
  178. include_dirs: [
  179. "system/netd/include",
  180. ],
  181. header_libs: [
  182. "libnetd_client_headers",
  183. ],
  184. shared_libs: [
  185. "libbase",
  186. "libnetdutils",
  187. "libnetutils",
  188. "libcutils",
  189. "liblog",
  190. "libutils",
  191. "libbinder",
  192. "dnsresolver_aidl_interface-V2-cpp",
  193. "netd_aidl_interface-V2-cpp",
  194. ],
  195. srcs: [
  196. "ndc.cpp",
  197. "UidRanges.cpp",
  198. "NdcDispatcher.cpp",
  199. ],
  200. }
  201. cc_test {
  202. name: "netd_unit_test",
  203. defaults: ["netd_defaults"],
  204. test_suites: ["device-tests"],
  205. require_root: true,
  206. include_dirs: [
  207. "system/netd/include",
  208. "system/netd/server/binder",
  209. "system/netd/tests",
  210. "system/core/logwrapper/include",
  211. ],
  212. srcs: [
  213. "BandwidthControllerTest.cpp",
  214. "ClatdControllerTest.cpp",
  215. "ClatUtilsTest.cpp",
  216. "ControllersTest.cpp",
  217. "FirewallControllerTest.cpp",
  218. "IdletimerControllerTest.cpp",
  219. "InterfaceControllerTest.cpp",
  220. "IptablesBaseTest.cpp",
  221. "IptablesRestoreControllerTest.cpp",
  222. "NFLogListenerTest.cpp",
  223. "RouteControllerTest.cpp",
  224. "SockDiagTest.cpp",
  225. "StrictControllerTest.cpp",
  226. "TetherControllerTest.cpp",
  227. "TrafficControllerTest.cpp",
  228. "XfrmControllerTest.cpp",
  229. "WakeupControllerTest.cpp",
  230. ],
  231. static_libs: [
  232. "libgmock",
  233. "libnetd_server",
  234. "libnetd_test_tun_interface",
  235. ],
  236. shared_libs: [
  237. "libbase",
  238. "libbinder",
  239. "libbpf_android",
  240. "libcrypto",
  241. "libcutils",
  242. "liblog",
  243. "libnetdbpf",
  244. "libnetdutils",
  245. "libnetutils",
  246. "libqtaguid",
  247. "libsysutils",
  248. "libutils",
  249. "netd_aidl_interface-V2-cpp",
  250. "netd_event_listener_interface-V1-cpp",
  251. ],
  252. }