Commit Graph

32 Commits

Author SHA1 Message Date
Maciej Żenczykowski
127a1441c3 bump min_sdk_version from 29 (Q) to 30 (R)
Mainline no longer supports Q.
These files were recently moved into p/m/C as part of a refactor.

Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I0f06ace921db6c79d63c0048bdb73d167ff606cf
2023-09-19 23:22:58 +00:00
Motomu Utsumi
68cd731381 Add libnetd_utils_headers cc_library_headers
There is a module that specifies libnetdutils/include from include_dirs
which is not recommended.
Using the cc_library_headers makes it easy to move
frameworks/libs/net to packages/modules/Connectivity.

Bug: 296014682
Test: m

Change-Id: Ia52ede9787009102ebf626fcb3b337511b0a809f
2023-08-22 19:16:12 +09:00
Alex Buynytskyy
57bd2e41e9 UpsideDownCake is now 34
Ignore-AOSP-First: UpsideDownCake Finalization
Bug: 275409981
Test: build
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:8bc31011a242dddb401273b5b6505b49b649ae67)
Merged-In: Ic36cad45118f0220e44279a8b6ac89d22c3319d3
Change-Id: Ic36cad45118f0220e44279a8b6ac89d22c3319d3
2023-08-17 04:07:50 +00:00
Ken Chen
da7a00d147 Adds setNetworkAllowlist and freeze AIDL to v13
Add this interface so that CS can tell netd the network is allowed for
the given UID ranges.

Freeze AIDL to v13.

Test: netd_integration_test
Change-Id: I00c45a663dc917fc0ba4da5a99828edad1562d8c
2022-12-23 09:47:29 +00:00
Yan Yan
111118096a Add XFRM_MIGRATE support and freeze INetd v12.
This commit updates netd_aidl_interface to support
migrating IPsec tunnel mode SA to different source
and destination addresses.

server/aidl_api/netd_aidl_interface/12/ are generated
by "m netd_aidl_interface-freeze-api"

Bug: 169170985
Test: atest netd_integration_test (new tests)
Change-Id: I89b54272c1528f12e6351819e0efe666af7a2946
2022-12-20 01:10:00 +00:00
Chalard Jean
8a00b8cf7c Add a physical local native network type.
There are no local networks yet, but they will come in
followup patches.

Test: netd_integration_test
Bug: 64955351
Change-Id: Ic82cf2390f52024e44e03b264b55c9843b932b71
2022-12-14 19:33:09 +09:00
Ryan Prichard
8cbe32c501 Switch from std::result_of to std::invoke_result
std::result_of is deprecated in C++17 and removed in C++20.
std::invoke_result is added in C++17.

Upstream libc++ has started removing the declaration of std::result_of
when a new-enough C++ dialect is selected, so switch to the supported
type.

Bug: http://b/175635923
Test: treehugger
Change-Id: Ie2db3e092b4300e20858097ac4e88ebaedc7ae07
2022-08-26 20:31:55 -07:00
Paul Hu
94ef9a22d3 Merge "Add NetNativeTestBase" 2022-06-24 13:56:01 +00:00
Paul Hu
2ca2fc6d32 Add NetNativeTestBase
Add a helper class NetNativeTestBase to log the life cycle of
each test.

Bug: 223731710
Test: m
Change-Id: I2c3b561c5ecf33b6eb3b4512b2a8c2638f3db609
2022-06-23 03:37:31 +00:00
Ken Chen
53eeb697c7 Delete netd_aidl_interface-lateststable-cpp
The netd_aidl_interface-lateststable-cpp has been replaced by
netd_aidl_interface_lateststable_cpp_static. The dependencies in
tm-mainline-prod were removed in ag/18922953.

Change-Id: I7eae884f4040f00ac6870dfa338a820cd7217ed0
Test: TH
Bug: N/A
2022-06-22 04:18:21 +00:00
Lorenzo Colitti
788015bfe4 Revert "Delete netd_aidl_interface-lateststable-cpp."
This reverts commit c6f9d5dc8f4b486c30e178a55ebf98c415bd3562.

Reason for revert: broke build in tm-mainline-prod

Bug: 236205815
Change-Id: I4dd1660c58e0acba0d6a036d590355bcbcd85f0f
2022-06-16 07:03:04 +00:00
Lorenzo Colitti
25efa313df Delete netd_aidl_interface-lateststable-cpp.
This is now unused.

Test: m
Change-Id: I30130526f2ef25c7ede64417fec03422d04319a7
2022-06-15 23:42:49 +09:00
Lorenzo Colitti
747ba67de6 Add an int constant for CLAT_MARK and freeze INetd v10.
Test: m
Bug: 235778483
Change-Id: I45a0bd6be39022a913bc6cff8216df0b6559cd4b
2022-06-15 23:42:29 +09:00
Chiachang
d39942d65a Add IPPrefix.contains()
Add helper methods to check whether the specified prefix is
entirely contained in this prefix, or the specified address
is contained in this prefix.

Bug: 184750836
Test: atest IPPrefixTest
Change-Id: I838510b347ac5741c589ee8f3983111209155588
2022-05-13 09:16:33 +00:00
Simon Bowden
96f0254477 Revert "Delete netd_aidl_interface-lateststable-cpp"
This reverts commit 41fb07fc2f87db0f1f2bf6198a3b4d9f660768f6.

Reason for revert: b/231290697 broken mainline test build

Change-Id: I8051e634b06c645739779078c0ff6445db9304d0
2022-05-03 11:53:44 +00:00
Ken Chen
3707615abc Delete netd_aidl_interface-lateststable-cpp
The netd_aidl_interface-lateststable-cpp has been replaced by
netd_aidl_interface_lateststable_cpp_static.

Test: TH
Bug: N/A
Change-Id: I6ea1317bac81b602e6b398681cc453a25bf8c399
2022-04-28 07:27:27 +00:00
Hungming Chen
ed1292644e Freeze netd_aidl_interface V9
Deprecate APIs which were moved the implementation to mainline module.
- clatdStart (since T)
- clatdStop (since T)
- tetherOffloadRuleAdd (since S)
- tetherOffloadRuleRemove (since S)
- tetherOffloadGetStats (since S)
- tetherOffloadSetInterfaceQuota (since S)
- tetherOffloadGetAndClearStats (since S)

Bug: 212345928
Test: cd system/netd; atest
Change-Id: I7916512c7174a7b50833036bc89df37a266ca67e
2022-04-28 15:03:18 +08:00
Ken Chen
ae296b2178 Add wrappers for the latest stable version of netd_aidl_interface-V*-cpp
Currently, we need to update linked AILD interface in several places
when we freeze a new interface version. Otherwise, it will have multiple
versions of an AIDL lib and waste space/memory (b/220392885).

To avoid manually update all AILD interface users every time, adds
wrappers for the latest version of netd_aidl_interface-V*-cpp.

The reason to use cc_default as a wrapper instead of cc_library is that
it doesn't create an extra .so.

Bug: 220392885
Test: TH
Change-Id: I281b2e5f7d04fadfae0ede4db7565e9f222dbe95
2022-04-21 08:19:15 +08:00
paulhu
973f6f8d59 Freeze Mdns AIDL interface to V1
- Also add mdns_aidl_interface-lateststable-java lib for
  Connectivity module usage.

Bug: 209894875
Test: m mdns_aidl_interface-freeze-api
Change-Id: I58364dcf6d0377fbac7533eb95d2aacddd120092
2022-04-04 14:15:27 +00:00
paulhu
483b356965 Add MDNS aidl
- Add MDNS aidl that NsdService can communicate with mdns service
  via binder call instead of using ndc.
- Add mdns_aidl_interface to separate the mdns aidl from
  netd_aidl_interface.

Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I7bcbd6146269bdd9ac973d651a676bd9d126ae2d
2022-04-03 16:04:05 +00:00
Wayne Ma
b48a1205be Move NetlinkListener relevant files to frameworks/libs/net
NetlinkListener is used by Netd, so move it to frameworks/libs/net
and then it can be used by platform code and mainline module.

Bug: 209935649
Test: m; flash; boot
Change-Id: I4cf0e64eee1dda1e452d76af77642416c9729d42
2022-01-20 15:07:46 +08:00
Wayne Ma
321a9f0719 Merge "[NETD-TC#12] Fix dependency on libtraffic_controller" 2022-01-14 10:44:52 +00:00
Wayne Ma
67a69e7396 [NETD-TC#12] Fix dependency on libtraffic_controller
1. Add visibility for libtraffic_control
2. Add com.android.tethering into apex_available statement

Bug: 202086915
Test: m; flash; boot
Change-Id: I817e22c24dd205f09ef62a2a7ff85b2a970f6d3a
2022-01-14 12:24:13 +08:00
Chiachang Wang
3faa0a0911 Add excludeLocalRoutes in NativeNetworkConfig
Add a extra field in NativeNetworkConfig to allow CS to notify
netd to exclude the local traffic from the VPN network. Also
freeze netd_aidl_interface as v8 and update the corresponding
configuration.

diff -U10 -ru -N common/netd/aidl_api/netd_aidl_interface/7/android/net/NativeNetworkConfig.aidl common/netd/aidl_api/netd_aidl_interface/8/android/net/NativeNetworkConfig.aidl

--- common/netd/aidl_api/netd_aidl_interface/7/android/net/NativeNetworkConfig.aidl	2021-10-29 14:52:13.069757396 +0800
+++ common/netd/aidl_api/netd_aidl_interface/8/android/net/NativeNetworkConfig.aidl	2022-01-11 21:35:55.088966333 +0800
@@ -33,11 +33,12 @@

 package android.net;
 /* @hide */
 @JavaDerive(equals=true, toString=true) @JavaOnlyImmutable
 parcelable NativeNetworkConfig {
   int netId;
   android.net.NativeNetworkType networkType = android.net.NativeNetworkType.PHYSICAL;
   int permission;
   boolean secure;
   android.net.NativeVpnType vpnType = android.net.NativeVpnType.PLATFORM;
+  boolean excludeLocalRoutes = false;
 }
diff -U10 -ru -N common/netd/aidl_api/netd_aidl_interface/7/.hash common/netd/aidl_api/netd_aidl_interface/8/.hash
--- common/netd/aidl_api/netd_aidl_interface/7/.hash	2021-10-29 14:52:13.069757396 +0800
+++ common/netd/aidl_api/netd_aidl_interface/8/.hash	2022-01-11 21:35:55.084966375 +0800
@@ -1 +1 @@
-850353de5d19a0dd718f8fd20791f0532e6a34c7
+e8cf8586fc5da9063818d8775e9a21c4b0addb5b

Bug: 184750836
Test: atest FrameworksNetTests
Change-Id: Icadca719aaba678b06f617c581e3c80a22248f26
2022-01-12 02:56:46 +00:00
Jiyong Park
e1ac304dc6 Remove ambiguity when using error().code().
A recent change in android::base::Result has changed the type of
error().code() from int to Errno. The latter is a new type that provides
a type-safe way of handling errno values. The new type supports
conversion to and from int for compatibility reasons. However, that
conversion has caused an ambiguity when int and Error are used at the
same time in a ternary operator. The type of an expression "(cond) ? 0 :
ret.error().code()" is ambiguous. It can be int because error().code()
can be converted to an int. It can also be Error because 0 can be
converted to Errno.

To eliminate the ambiguity, add a static cast.

Bug: 209929099
Test: m
Change-Id: I0ad634310d9094868c29754f96c5c98e6180b738
2021-12-20 13:43:26 +09:00
Etienne Ruffieux
37b7ca2e7c Merge "Remove apex_available for bluetooth.updatable" 2021-12-15 18:07:07 +00:00
Remi NGUYEN VAN
5b33e07357 Remove apex_available for bluetooth.updatable
The build will pass without it, showing that it's not exercised today,
and the bluetooth apex is being renamed anyway.

Bug: 206614050
Test: m
Change-Id: I71dac10159b799b9f23550d27424f19d077164cc
2021-12-15 09:48:20 +09:00
waynema
51800daf8e [NETD-TC#7] Move getIfaceNames() and getIfaceList() to libnetdutils.
getIfaceNames() and getIfaceList() are used by Netd.

Test: m; flash; boot
Change-Id: Id95e2e7e83c07b2f420880feebdf12d4c477c958
2021-12-08 14:33:21 +08:00
Ken Chen
3250a84f93 [NETD-BPF#23] Make libnetdutils apex_available for tethering module
libconn_for_netd.so in tethering module needs utilities in libnetdutils,
e.g. Status class.

Bug: 202086915
Test: m
Change-Id: Idb7f11d146570972f2467b7faa624f41bd859062
2021-12-07 03:22:07 +00:00
Ken Chen
38cf698179 [NETD-BPF#1] Move libnetdutils to framework/libs/net/...
libnetdutils is referenced by netd.c and TrafficController.cpp, which
are going to be mainlined. Therefore, move libnetdutils to a common
place where both mainline module and platform code (Netd) can refer to.

Bug: 202086915
Test: build; flash; cd system/netd; atest
No-Typo-Check: Clean code move with no other changes.
BYPASS_INCLUSIVE_LANGUAGE_REASON=Clean code move with no other changes.

Merged-In: I645bfe35f6543149c9a9f894cd4158d27a481abe
Change-Id: I645bfe35f6543149c9a9f894cd4158d27a481abe
2021-11-20 17:10:41 +08:00
Bob Badour
957b694ed6 [LSC] Add LOCAL_LICENSE_KINDS to frameworks/libs/net
Added SPDX-license-identifier-Apache-2.0 to:
  common/netd/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ic163988eea096e967a8d04624772b2eff350026d
2021-10-07 11:58:21 -07:00
markchien
38c3248623 Move netd AIDL to frameworks/lib/net
Clean move system/netd/server/aidl_api/ and
system/netd/server/binder/

$ diff -qr frameworks/libs/net/common/binder/netd/aidl_api/ system/netd/server/aidl_api/
$ diff -qr frameworks/libs/net/common/binder/netd/src/ system/netd/server/binder/
Only in system/netd/server/binder/: com

Bug: 201488997
Test: atest netd_integration_test
      atest netd_unit_test
Ignore-AOSP-First: the netd change(same topic) would not automerger from
aosp.
No-Typo-Check: this is a simple code move with no other changes.
BYPASS_INCLUSIVE_LANGUAGE_REASON=this is a simple code move with no other
changes and these files are frozen anyway

Change-Id: Id5bb63794aff4025355c587b372c3ff5b1054da6
Merged-In: Id5bb63794aff4025355c587b372c3ff5b1054da6
2021-10-07 14:43:03 +08:00