Commit graph android_packages_modules_Co.../staticlibs/netd
Message SHA1
Adding isLocalRoute parameter to RouteInfoParcel
ConnectivityService would be centralized location for deciding local
network so for this effort adding isLocalRoute parameter to RouteInfoParcel

Bug: 394308861
Test: Manually tested.
Test: atest ConnectivityCoverageTests
Flag: EXEMPT Using device config kill-switch
Change-Id: I3ed34f96af1cbd7d8645a6c19e696a75525ce68a

Sarup Dalwani   commited 2025-08-06 15:40:08 +00:00
1bec0d629b
Add more NativeVpnType AIDL constants for OEM-specific VPNs.
Test: m
Bug: 389829981
Change-Id: If39e012dcf6388f2d4e7f8d2eebf01410e3f1543

Lorenzo Colitti   commited 2025-03-18 13:13:31 +09:00
d731b8136e
Deprecating PERMISSION constants that are not used in aidl
PERMISSION_INTERNET, PERMISSION_UPDATE_DEVICE_STATS,
PERMISSION_UNINSTALLED and NO_PERMISSIONS are used only internally
and don't need to be maintained as part of the public interface.

Bug: b/326383676
Test: PermissionMonitorTest
Change-Id: If906382965c8593f9078278af37cb0bc2825117f

Melisa CZ   commited 2025-02-03 22:50:42 +00:00
0d08a89d86
libnetdutils: avoid deque<const T>
A container of const T uses std::allocator<const T>, which was an
undocumented libc++ extension that has been removed.

See https://github.com/llvm/llvm-project/pull/96319.

Bug: 349681543
Test: m libnetdutils
Change-Id: I0b0eb07a6c95b4781ad04a82068bd33aef68e33b

Ryan Prichard   commited 2024-06-28 00:52:39 -07:00
b2d7582274
Fix build with ToT libc++
packages/modules/Connectivity/staticlibs/netd/libnetdutils/InternetAddresses.cpp:140:31: error: use of undeclared identifier 'strtoul'
  140 |     unsigned long prefixlen = strtoul(prefixString, &endptr, 10);
      |

Test: Build with ToT libc++
Change-Id: I12e66d27897d11e6d6ace36312ef6b80b29d069e

Yi Kong   commited 2024-05-24 00:51:02 +09:00
0b75fb9cba
Add networkAllowBypassVpnOnNetwork to INetd.aidl interface
This will allow the system to temporarily grant the browser to bypass
VPN when explicitly selecting a network, which will be used for
migrating the CaptivePortal app to custom tabs.

Test: atest netd_integration_test
Change-Id: I68bd5e537e9ca61487cc227ad4c009c092cc5ad4

Patrick Rohr   commited 2024-05-21 14:37:48 -07:00
7959e96bc8
[DON'T BLOCK] Test ownership migration rules
This CL is created as a best effort to migrate test targets
to the new android ownership model. If you find incorrect or unnecessary
attribution in this CL, please create a separate CL to fix that.

For more details please refer to the link below,
<add g3 doc link>

Bug: 304529413
Test: N/A
Change-Id: I243f17b3f0ad7af9ffa15ca242456e36688733f5
Merged-In: I243f17b3f0ad7af9ffa15ca242456e36688733f5

Aditya Choudhary   commited 2024-01-31 12:34:50 +00:00
01b5ede2b2
Add missing libc++ includes
Bug: 175635923
Test: m MODULES-IN-packages-modules-Connectivity
Change-Id: I94dafe991ccd73450671ea68eaf65b787dc1d0fa

Tomasz Wasilczyk   commited 2024-01-09 11:01:22 -08:00
661ec166c7
Merge changes from topic "deprecate_mdns_aidl_interface" into main
* changes:
  Freeze mdns_aidl_interface
  Deprecate mdns_aidl_interface

Ken Chen   authored and   Gerrit Code Review   commited 2023-12-26 06:44:04 +00:00
1b57a0eff1
Freeze mdns_aidl_interface
All AIDL interfaces need to be a stable version in release branch.

Bug: 298594687
Test: m
Change-Id: Ia81eb29214f3ff76ca21c3ac098d26c4e8d9440d

Ken Chen   commited 2023-12-13 10:09:45 +08:00
15e2374a87
Deprecate mdns_aidl_interface
Mark @Deprecated in mdns_aidl_interface functions in the latest unstable
version.

Bug: 298594687
Test: m mdns_aidl_interface-update-api
Change-Id: I5a5799de7b58e334bddec81bfada7f976038f457

Ken Chen   commited 2023-12-13 10:09:32 +08:00
fe523c2a8b
Return error Status from BpfHandler::initPrograms()
Instead of logging and aborting from the BpfHandler::initPrograms(),
return a Status object with an error message. The caller
NetdUpdatable::libnetd_updatable_init() will log the message. Netd
main() will exit and restart.

Bug: 312094533
Test: m
Change-Id: I6717da871a9a53357ac895709ea0094c089e7bbd

Ken Chen   commited 2023-12-03 23:45:47 +08:00
d6ea75ac97
Delete mdns_aidl_interface-lateststable-java
It's no longer needed because the only useful version is v1 and all
functions are deprecated in v2.

Bug: 298594687
Test: m
Change-Id: I0226b7f3d3cda6fb897e02a035e84943913a944e

Ken Chen   commited 2023-11-21 09:04:03 +00:00
a3b4febfe5
Migrate to netd_aidl_interface-V14
Test: m
Change-Id: I13f23d63fd9db763958119c5fb440d4e88b7ac8b

Ken Chen   commited 2023-11-13 12:23:44 +08:00
670189a647
Add @deprecated annotation and bump netd_aidl_interface
1. Annotate binder interfaces which return
   binder::Status::EX_UNSUPPORTED_OPERATION.
2. Freeze netd_aidl_interface to v14.

Test: m
Change-Id: Ibdc083ce7ac4a8e3dcd1e7cf1dc310210ca76f38

Ken Chen   commited 2023-11-13 12:18:53 +08:00
91dc3a102d
Update fmtlib to 10.1.1
Test: m
Change-Id: I15107355d2c26f69be5bb336e978eac55f65c437

Henri Chataing   commited 2023-11-03 23:26:47 +00:00
6cc0283095
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

Maciej Å»enczykowski   commited 2023-09-19 23:22:58 +00:00
127a1441c3
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

Motomu Utsumi   commited 2023-08-22 19:16:12 +09:00
68cd731381
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

Alex Buynytskyy   authored and   Android Build Cherrypicker Worker   commited 2023-08-17 04:07:50 +00:00
57bd2e41e9
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

Ken Chen   commited 2022-12-23 09:47:29 +00:00
da7a00d147
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

Yan Yan   commited 2022-12-20 01:10:00 +00:00
111118096a
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

Chalard Jean   commited 2022-12-14 19:33:09 +09:00
8a00b8cf7c
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

Ryan Prichard   commited 2022-08-26 20:31:55 -07:00
8cbe32c501
Merge "Add NetNativeTestBase"
Paul Hu   authored and   Gerrit Code Review   commited 2022-06-24 13:56:01 +00:00
94ef9a22d3
Add NetNativeTestBase
Add a helper class NetNativeTestBase to log the life cycle of
each test.

Bug: 223731710
Test: m
Change-Id: I2c3b561c5ecf33b6eb3b4512b2a8c2638f3db609

Paul Hu   commited 2022-06-23 03:37:31 +00:00
2ca2fc6d32
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

Ken Chen   commited 2022-06-22 04:18:21 +00:00
53eeb697c7
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

Lorenzo Colitti   commited 2022-06-16 07:03:04 +00:00
788015bfe4
Delete netd_aidl_interface-lateststable-cpp.
This is now unused.

Test: m
Change-Id: I30130526f2ef25c7ede64417fec03422d04319a7

Lorenzo Colitti   commited 2022-06-15 23:42:49 +09:00
25efa313df
Add an int constant for CLAT_MARK and freeze INetd v10.
Test: m
Bug: 235778483
Change-Id: I45a0bd6be39022a913bc6cff8216df0b6559cd4b

Lorenzo Colitti   commited 2022-06-15 23:42:29 +09:00
747ba67de6
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

Chiachang   authored and   chiachangwang   commited 2022-05-13 09:16:33 +00:00
d39942d65a
Revert "Delete netd_aidl_interface-lateststable-cpp"
This reverts commit 41fb07fc2f87db0f1f2bf6198a3b4d9f660768f6.

Reason for revert: b/231290697 broken mainline test build

Change-Id: I8051e634b06c645739779078c0ff6445db9304d0

Simon Bowden   commited 2022-05-03 11:53:44 +00:00
96f0254477
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

Ken Chen   commited 2022-04-28 07:27:27 +00:00
3707615abc
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

Hungming Chen   commited 2022-04-28 15:03:18 +08:00
ed1292644e
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

Ken Chen   commited 2022-04-21 08:19:15 +08:00
ae296b2178
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

paulhu   authored and   Paul Hu   commited 2022-04-04 14:15:27 +00:00
973f6f8d59
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

paulhu   commited 2022-04-03 16:04:05 +00:00
483b356965
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

Wayne Ma   commited 2022-01-20 15:07:46 +08:00
b48a1205be
Merge "[NETD-TC#12] Fix dependency on libtraffic_controller"
Wayne Ma   authored and   Gerrit Code Review   commited 2022-01-14 10:44:52 +00:00
321a9f0719
[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

Wayne Ma   commited 2022-01-14 12:24:13 +08:00
67a69e7396
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

Chiachang Wang   commited 2022-01-12 02:56:46 +00:00
3faa0a0911
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

Jiyong Park   commited 2021-12-20 13:43:26 +09:00
e1ac304dc6
Merge "Remove apex_available for bluetooth.updatable"
Etienne Ruffieux   authored and   Gerrit Code Review   commited 2021-12-15 18:07:07 +00:00
37b7ca2e7c
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

Remi NGUYEN VAN   commited 2021-12-15 09:48:20 +09:00
5b33e07357
[NETD-TC#7] Move getIfaceNames() and getIfaceList() to libnetdutils.
getIfaceNames() and getIfaceList() are used by Netd.

Test: m; flash; boot
Change-Id: Id95e2e7e83c07b2f420880feebdf12d4c477c958

waynema   commited 2021-12-08 14:33:21 +08:00
51800daf8e
[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

Ken Chen   commited 2021-12-07 03:22:07 +00:00
3250a84f93
[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

Ken Chen   commited 2021-11-20 17:10:41 +08:00
38cf698179
[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

Bob Badour   commited 2021-10-07 11:58:21 -07:00
957b694ed6
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

markchien   commited 2021-10-07 14:43:03 +08:00
38c3248623