Commit Graph

174 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c83f2378e3 Merge "Fix network usage stats on 464xlat tethered." am: 83088dcd8e
am: 7ea8c51311

Change-Id: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
2018-03-29 07:46:34 +00:00
Benedict Wong
5f38c02385 Require explicitly supplied truncation length
Instead of providing default truncation lengths (based on RFC or
otherwise), this change imposes a restriction that the truncation length
must be supplied for all auth or aead algorithms.

Bug: 77204048
Test: Updated tests, ran on walleye
Change-Id: I4a0e2e71aa97259e56f44e7c8a2ce53135708d97
2018-03-28 18:02:54 -07:00
Remi NGUYEN VAN
c19a5eb8e4 Fix network usage stats on 464xlat tethered.
Usage stats corrections for 464xlat in NetworkStatsFactory are not applied
to tethered traffic. Add adjustments in NetworkStatsService. After
migrating external callers off NetworkStatsFactory, we will be able to
only apply adjustments in NetworkStatsService and remove stacked
interface tracking from NetworkStatsFactory.
Bug: 72107146
Fixes: 72107146
Test: runtest frameworks-net & manual - checked corrected network usage

Change-Id: I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda
2018-03-28 12:14:14 +09:00
Benedict Wong
a042c3f82b Clarify UDP encapsulation socket API
This change updates the getSocket() methods for IPsec to improve clarity
of the return types, both for public APIs, and internal-only methods.

Bug: 72473753
Test: APIs updated, CTS + unit tests ran.
Change-Id: I0afebd432c5d04c47c93daa1ce616d712aa323d7
2018-03-27 19:46:50 -07:00
Pavel Maltsev
51f4d8a11d Merge "Minor clean-up in NetworkCapabilities" am: 539f85a18d am: b1e2bfe4df
am: 8a956a5141

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Change-Id: I2f45d2c70c7c0142ae3b3ce9e6329c5f25b63380
(cherry picked from commit feb8d1498a822730e29cf346fe3382e3f5293a58)
2018-03-27 22:45:49 +00:00
Remi NGUYEN VAN
7370f4270e Merge "Add method to NetworkStatsService for UID stats." am: db89ca3c12
am: f61f5ff462

Change-Id: I2527d95000c7500c824ede70f87ecb38e21ed323
2018-03-23 04:01:09 +00:00
Remi NGUYEN VAN
1cb92c713f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Change-Id: I763b77f601c827fd2963204694fb5b45425cc791
2018-03-22 15:31:28 +09:00
Benedict Wong
76df78ffbf Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Merged-In: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
(cherry picked from commit ecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe)
2018-03-20 16:01:27 -07:00
Benedict Wong
696b853a11 Merge "Added implementation for VTI add/remove address" am: 3f3410ae6b
am: c9b0114429

Change-Id: Idaab45998f4765655bde6cf0274f2ba3c1b3ecf1
2018-03-20 00:09:15 +00:00
Benedict Wong
3f3410ae6b Merge "Added implementation for VTI add/remove address" 2018-03-19 22:05:09 +00:00
Benedict Wong
0da1f39e22 Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
2018-03-16 10:25:43 -07:00
Pavel Maltsev
3152f214df Merge "Fixing comments in Network Capabilities" am: b6477d22ca
am: 2c36870f3d

Change-Id: If3c0d76f9598d931d801271c4d0634e15f4b9ed4
2018-03-12 08:08:31 +00:00
Pavel Maltsev
1f9f48e1c4 Fixing comments in Network Capabilities
Clean up after aosp/606338

Test: m -j (only comments has been changed)
Change-Id: I2627654450244024c2be92f9067534dfc2a80891
2018-03-09 10:42:32 -08:00
Pavel Maltsev
5d97ad9fe4 Merge "Minor clean-up in NetworkCapabilities" am: 1dd43b192c
am: 6ab3c9c246

Change-Id: Ie6839576f61563f2a82fec53afc42208f5a37f3c
2018-03-07 23:09:04 +00:00
Treehugger Robot
1dd43b192c Merge "Minor clean-up in NetworkCapabilities" 2018-03-07 21:06:59 +00:00
Remi NGUYEN VAN
1252af5564 Merge "Allow null subscriberId in NetworkStatsManager." am: 09639d8ad0
am: cbcf2a49ea

Change-Id: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
2018-03-06 19:52:57 +00:00
Remi NGUYEN VAN
a08eb7203b Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I4b39e7031416cb33b23d89aa36ff0f774eaa942f
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
2018-03-06 13:28:19 +09:00
Pavel Maltsev
1016f7327a Merge "Extend network request to query networks w/o capabilites" am: 47d4d15483 am: 334cde1ec2
am: fa04c2d802

Change-Id: I3bf776767be61577f1bca0d98d4aaf82a0e45336
2018-03-03 00:14:52 +00:00
Treehugger Robot
47d4d15483 Merge "Extend network request to query networks w/o capabilites" 2018-03-02 19:04:31 +00:00
Chalard Jean
0a8dbc7886 Merge "Give apps with NETWORK_SETTINGS right to see any VPN." am: faed85f2b0 am: 331e50f601
am: ec7c68cb2b

Change-Id: I9a9d0eb212f6de105abc070a1eb5ff698b4e67bc
2018-03-02 13:25:02 +00:00
Chalard Jean
562e154642 Merge "Give VPNs the INTERNET capability when they route most of the IP space" am: f477aedec5 am: 7506c131c1
am: 941de3f74c

Change-Id: Ifd77149ca2c45249b8776c878c6fac46ae81c2a4
2018-03-02 12:54:29 +00:00
Chalard Jean
faed85f2b0 Merge "Give apps with NETWORK_SETTINGS right to see any VPN." 2018-03-02 11:52:15 +00:00
Chalard Jean
9a396cc3c6 Give apps with NETWORK_SETTINGS right to see any VPN.
...not only the ones that apply to them.

Bug: 73217368
Test: runtest frameworks-net and CTS
Change-Id: I436972a3e51e98bdd815771b451bcedadf684763
2018-03-02 17:10:11 +09:00
Chalard Jean
9cbc882c08 Give VPNs the INTERNET capability when they route most of the IP space
Test: manual, plus wrote some new tests for this
Bug: 72765718
Change-Id: I9759da72b752fd8eeb1d0647db9ab341f04c0528
2018-03-02 16:20:22 +09:00
Pavel Maltsev
15e839f111 Minor clean-up in NetworkCapabilities
Follow up clean up for aosp/606338

Bug: 72828388
Test: frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest
Change-Id: I2d2cfeb51caaa339602f7d97ffffed6e4cfad432
2018-03-01 18:06:25 -08:00
Pavel Maltsev
7c600431b5 Extend network request to query networks w/o capabilites
Add another bit mask into NetworkCapabilities class that represents
unwanted capabilities and corresponding methods to add and remove them.

Bug: 72828388
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/
Change-Id: Ie291167eb74fdb696c7ee145c8cc46ea8115d6ba
2018-03-01 17:52:02 -08:00
Pavel Maltsev
013f8a445f Merge "Add OEM_PAID network capability" am: 2501283064 am: 82fdea2d7b
am: 5cb05a12bd

Change-Id: Id64d288764dc5a556b60f5e3b866b40792647ac0
2018-02-28 08:42:24 +00:00
Treehugger Robot
2501283064 Merge "Add OEM_PAID network capability" 2018-02-28 07:06:00 +00:00
Benedict Wong
614a50d5d7 Merge "Correct bug in IpSecTransformTest" am: b05d401748 am: 4a52c1438a
am: fb006fa020

Change-Id: Ic29f13053365f3de8d01f9c38f8460d92748a41d
2018-02-16 20:51:37 +00:00
Benedict Wong
b7ca6bf4c1 Correct bug in IpSecTransformTest
testCreateTransformsWithSameConfigEqual used assertFalse rather than
assertTrue

Bug: 69385347
Test: Passing on walleye
Change-Id: I8caa26e184e8bfc3e8acc9061d85c22d27ebf448
2018-02-15 18:52:07 -08:00
Pavel Maltsev
d4d611954e Add OEM_PAID network capability
Bug: 68762530

Test: runtest -x frameworks/base/tests/net/

Change-Id: I51c07e0c2211d631e90b27468c26b599e7b07bc8
2018-02-15 10:46:00 -08:00
Chalard Jean
74ef4d0b1d Merge changes I3d68dbf8,I6ea524bb,I978d9119 am: 91d3912eab am: 004939fd82
am: d9663d47c5

Change-Id: Ic6d639358c3310820bd925df93d4843d7edffc57
2018-02-15 14:23:57 +00:00
Chalard Jean
91d3912eab Merge changes I3d68dbf8,I6ea524bb,I978d9119
* changes:
  Deprecate CONNECTIVITY_ACTION.
  Publish FOREGROUND and add NOT_SUSPENDED capabilities.
  Send null UIDs to apps instead of single-uid lists.
2018-02-15 11:25:36 +00:00
Benedict Wong
b771edfea4 Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e am: 978037db6c
am: cce3e4687d

Change-Id: I511e6b0cadfc24f24a492ae63c48a8b4baa89edb
2018-02-15 06:01:49 +00:00
Chalard Jean
a23bc9e501 Publish FOREGROUND and add NOT_SUSPENDED capabilities.
NOT_SUSPENDED and FOREGROUND are capabilities that need to
be public so as to reach feature parity with what information
can be gotten through the use of CONNECTIVITY_ACTION and
synchronous calls to ConnectivityManager. This change makes
them public, and wires up the NOT_SUSPENDED capability.
This deprecates in effect the old onSuspended and onResumed
callbacks, but these have never been public.

This also converts the onAvailable path from a multiple
binder call design to a simpler, single binder call. This
is only for internal convenience

Test: runtest frameworks-net
Test: cts
Test: also manual testing
Change-Id: I6ea524bb361ecef0569ea2f9006c1e516378bc25
2018-02-14 15:14:41 +09:00
Benedict Wong
159abb6cff Copy IpSecConfig when IpSecTransforms are created
This change prevents IpSecTransforms from being inadvertently modified
by changes to the IpSecConfig. Specifically, once the transform is
created, it takes a copy of the config, rather than a reference.

Bug: 69385347
Test: New tests added, and all test passing
Change-Id: I89b8660c175ca20aa70352dcda893434ff7fd42b
2018-02-13 23:23:13 +00:00
Jong Wook Kim
622cda4338 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 028e2a048e am: c7ec0f6fc3
am: 83939e37af

Change-Id: I5f2d395705841b7da03b1552b16507466e47ef84
2018-02-07 09:26:56 +00:00
Jong Wook Kim
93dd5e6964 MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator
Use SecureRandom instead of Random since Random is time based and can
increase the chance of generating same MAC address across multiple
devices.

createRandomUnicastAddress should randomize all bits of the address,
except for locally assigned bit and unicast bit. The previous method
that only randomizes NIC and use Google Base OUI is renamed to
createRandomUnicastAddressWithGoogleBase.

Bug: 72450936
Test: runtest frameworks-net
Change-Id: Icda650638c2c1c9fd90d509a87e86347c0e05f2d
2018-02-07 01:28:46 +00:00
Chalard Jean
5589119697 Resolve merge conflicts of d15f09adf7 to master
Test: this is the exact code these changes were meant to give
      without conflict had the auto-merger not squashed them
      together before it tried to merge them. It was tested on
      master in this state.

Change-Id: I5cbde17fb6016e5e6b5d0b04c8f41858d708ef4a
2018-01-24 15:59:26 +09:00
Chalard Jean
753d9734d2 Move VPN allowed UIDs into NetworkCapabilities.
Test: runtest frameworks-net
Test: also new specific tests for this new code
Test: also tested with VPN app
Test: also cts passing
Change-Id: If0311bae2bf99dedac959febadecf4f92f3064b8
2018-01-23 21:38:00 +09:00
Lorenzo Colitti
e31ae2650d Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: 5087f93c36 am: 69a42fa9c5
am: 6eb22572ce

Change-Id: I12108d96e29bfe71406106c2af950a6d6a9f8351
2018-01-19 16:46:11 +00:00
Lorenzo Colitti
cd969ef97c Add the default network to NetworkStats and NetworkStatsCollection.
This allows us to maintain NetworkStats entries that track
whether the traffic was on the default network.

At the moment, the stats collection code always passes in
DEFAULT_NETWORK_NO. However, this value is a no-op, since it is
not persisted to disk. Only the ident, the uid/set/tag, and the
packet/byte/operation counters are persisted.

A future change will add defaultNetwork to the ident and start
persisting it.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: Ifa291c62c0fa389b88e5561086a29dcd7cee2253
2018-01-19 19:49:16 +09:00
Lorenzo Colitti
482dfac4be Merge "Add public API methods for private DNS." am: 6cba185910 am: a57e5c074c
am: 2e00fc0771

Change-Id: Icd04bc83624ea4d13ac7737e6f9a7b0c5f0f7314
2018-01-18 03:36:37 +00:00
Lorenzo Colitti
6cba185910 Merge "Add public API methods for private DNS." 2018-01-18 01:17:17 +00:00
dalyk
7643abcbe3 Add public API methods for private DNS.
Test: Small modifications to LinkProperties test.
Bug: 71828272
Change-Id: Id2f5acb5469132ec4a917837739f42085c71498e
2018-01-17 15:46:21 -05:00
Nathan Harold
3da8511490 Make Transforms Unidirectional am: 3865a008e7 am: 41fe8097ed
am: 7b0b71c853

Change-Id: I608be255a307891ec3fe2d97cda817d75240c95c
2018-01-17 10:03:31 +00:00
Nathan Harold
41fe8097ed Make Transforms Unidirectional
am: 3865a008e7

Change-Id: I7e80c75b3b227fdd16479120d8b7203cc5f28d1c
2018-01-17 09:37:57 +00:00
nharold
60a21328d5 Merge changes from topic "ipsec-oneway-transform"
* changes:
  Update IpSecService UnitTests
  Make Transforms Unidirectional
2018-01-17 08:40:37 +00:00
Nathan Harold
3865a008e7 Make Transforms Unidirectional
Convert the IpSecTransform from being a bi-directional
pair of SAs to a unidirectional single SA. This CL
also removes the concept of "direction from SAs meaning
that a IpSecTransform may now be applied to a socket
in either direction.

-Make transforms unidirectional
-Add Convert allocateSpi() to use destination rather
 than direction and remote address
-Remove directionality from builders for IpSecTransform
-Change applyTransportModeTransform() to take a
 direction in which to apply the transform object.
-Additional minor naming updates
-Restrict IpSecConfig to only print keys on eng builds
-Move DIRECTION constants to IpSecManager
-Add sourceAddress parameter to IpSecTransform to provide
 additional guarantees about the source address of data;
 (explicit failure rather than implicit failure).
-Move SPI to the build() method of IpSecTransform

Bug: 71717213
Test: runtest frameworks-net, CTS - IpSecManagerTest
Change-Id: I0824b37f443f4b8c62536d9801238c63ed8f2a1c
2018-01-16 11:08:31 -08:00
Lorenzo Colitti
d4f6b43b19 Merge "Update netId to nethandle mapping in NetworkTest." am: 75c5e3dcb5 am: 503135596b
am: d38b9f7acf

Change-Id: I6feaa589fc43ff8ee1635be0fbd58aaa25679a5a
2018-01-16 13:46:46 +00:00