Commit graph android_packages_modules_Co.../staticlibs/netd/libnetdutils
Message SHA1
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
[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
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
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
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
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
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
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
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
[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