Commit Graph

1189 Commits

Author SHA1 Message Date
Nathan Harold
426d6f088f IpSecManager and IpSecTransform API Cleanup am: 55e8910aa8 am: 91b516e78b
am: 37f260f5d8

Change-Id: Ie84a720356466000930030de6f7a9182500afadb
2017-04-02 00:33:17 +00:00
nharold
38e47af3ef Merge changes from topic 'ipsec-transport-impl'
am: 464dc5c07e

Change-Id: I6caf23f5fef995f1ad735ea64b99660a5180799f
2017-04-02 00:19:44 +00:00
Nathan Harold
91b516e78b IpSecManager and IpSecTransform API Cleanup
am: 55e8910aa8

Change-Id: I1524f8381c8a73ba4dc7a36b343e11066b75c08d
2017-04-02 00:18:42 +00:00
Nathan Harold
031acb850f Add Initial IPsec APIs to IpSecService
-Plumb IpSecManager APIs to NetD
-Add Resource Management to IpSecService

Bug: 33695893
Test: CTS verifies nearly all of these paths
Change-Id: Ic43965c6158f28cac53810adbf5cf50d2c54f920
2017-03-31 18:11:27 -07:00
Nathan Harold
55e8910aa8 IpSecManager and IpSecTransform API Cleanup
-Remove Int-based SPI usage from the IpSecTransform.Builder
 This is essentially a less-safe method overload, and it is both
 unnecessary and difficult to implement: the cross-validation
 between SPI and Transform is actually useful, and the kernel
 requires two different mechanisms to use an unreserved vs a
 reserved (alloc'd) SPI: CREATESA vs UPDATESA, which makes this
 hard to support. API Council has questioned the value of this,
 and they are right: everything points to "remove this". In the
 future, if we find that SPI reservation is overhead, we can
 always add it back.

-Hiding the TunnelMode builder method and application/remove
 methods. These will not land by the time the next API
 stabilizes, so better to hide them now that this is a
 near-certainty. Expectation is to un-hide them in the subsequent
 API bump.

Bug: 36073210
Test: Compilation, verified nobody is calling these stubs
Change-Id: Ic1a3f2cf7128633318ac175d6b56b45eb8d21cab
2017-03-31 11:21:10 -07:00
Nathan Harold
e91cac67c8 Merge "Change reserveSecurityParameterIndex() to take a remoteAddress" am: d118826971 am: d083810c0b am: 81d48a99e0
am: abf3bde466

Change-Id: I86d5e1c019336707f7d3f1102aaca52a91dea310
2017-03-30 03:51:47 +00:00
Nathan Harold
abf3bde466 Merge "Change reserveSecurityParameterIndex() to take a remoteAddress" am: d118826971 am: d083810c0b
am: 81d48a99e0

Change-Id: I941ee00099df0afdbce94b73c1bd81c246fac1e8
2017-03-30 03:48:20 +00:00
Nathan Harold
d083810c0b Merge "Change reserveSecurityParameterIndex() to take a remoteAddress"
am: d118826971

Change-Id: Ie59322c4e80aab89d784a2fcb3edd6458677bbb7
2017-03-30 03:39:46 +00:00
Nathan Harold
909d66e80a Change reserveSecurityParameterIndex() to take a remoteAddress
To make the SPI reservation more semantically consistent with the
transform creation API, and to ensure that we always create SPI
reservations relative to a well-known remote, we should take the
SPI request relative to a remote (rather than to a destination).
This necessitates that we now consider direction separately, which
is used for keying the SA-Id.

Bug: 36073210
Test: compilation
Change-Id: I81e955c20128c1f8e04fd68eb26669561f827a78
2017-03-29 17:46:47 -07:00
Nathan Harold
49046bbc73 Merge commit 'e45e328821ba' into oc-dev-plus-aosp
am: 7e854f1b82

Change-Id: I136c31aa5b27a3520c93141d91d6198e2dae3a1d
2017-03-30 00:15:17 +00:00
Nathan Harold
7e854f1b82 Merge commit 'e45e328821ba' into oc-dev-plus-aosp
Change-Id: I30ad9038be8faee57e5d6b1391d9e70a966a9a77
2017-03-29 17:05:10 -07:00
Nathan Harold
caf765db81 Merge commit 'ce073d70bedc' into stage-aosp-master
Change-Id: I319034a5b77de5cf71de0e110bb17819fb907f1b
2017-03-29 16:04:31 -07:00
Nathan Harold
927e040ae3 Add a Skeleton IpSecService
-Add IpSecService with the necessary glue to connect to netd
-Add code to retrieve IpSecService from System Server

Bug: 34811227
Test: Service boots (and dumpsys works), more via b/34811227
Change-Id: I4cdcb643421141202f77a0e2f87a37012de0cd92
2017-03-29 11:38:20 -07:00
Nathan Harold
d2a1dad9a8 Add a Skeleton IpSecService
-Add IpSecService with the necessary glue to connect to netd
-Add code to retrieve IpSecService from System Server

Bug: 34811227
Test: Service boots (and dumpsys works), more via b/34811227
Merged-In: I4cdcb643421141202f77a0e2f87a37012de0cd92
Change-Id: I4cdcb643421141202f77a0e2f87a37012de0cd92
2017-03-29 11:31:27 -07:00
Ryuki Nakamura
f8dd5d479a Merge "Fix NPE while performing NetworkStatsService.removeUidsLocked()" am: a6ce3f3021 am: 8d2a076b4e
am: 06659047f0

Change-Id: Ia7c8309f68d85a88e2a26169509d3e45d4d2ff69
2017-03-20 17:24:37 +00:00
Ryuki Nakamura
8d2a076b4e Merge "Fix NPE while performing NetworkStatsService.removeUidsLocked()"
am: a6ce3f3021

Change-Id: I3f43b25622e5052e6336983da84b92e12f3e06dc
2017-03-20 17:05:16 +00:00
Ryuki Nakamura
662a01236a Fix NPE while performing NetworkStatsService.removeUidsLocked()
Symptom:
NPE occurred while performing NetworkStatsService.removeUidsLocked().

Root cause:
NetworkStatsService refers to mUidRecorder at
NetworkStatsService.removeUidsLocked() when mUserReceiver received
Intent.ACTION_USER_REMOVED.
However NetworkStatsService sets mUidRecorder to null without
unregistering mUserReceiver when mShutdownReceiver received
Intent.ACTION_SHUTDOWN.
Therefore NPE occurred when mUserReceiver received
Intent.ACTION_USER_REMOVED after mShutdownReceiver received
Intent.ACTION_SHUTDOWN.

Solution:
Unregister mUserReceiver before setting mUidRecorder to null when
mShutdownReceiver received Intent.ACTION_SHUTDOWN.

Bug: 36015339

Change-Id: I9279e4c6ae07d94e7ec519c40b2d973c84d8fef1
2017-03-07 07:12:51 +00:00
Nathan Harold
fab5eff9a6 Merge "Add API Surface for creating IpSec Transforms" am: 7645fa2816 am: 5466fbdc27
am: 3ddaf3e6b0

Change-Id: Idceae0e5a1af2f357378b03fc0d257dab605b217
2017-03-01 14:22:57 +00:00
Nathan Harold
5466fbdc27 Merge "Add API Surface for creating IpSec Transforms"
am: 7645fa2816

Change-Id: Ibe70a60c5c5808a7877145cccefcc1f11bfacc51
2017-03-01 14:12:55 +00:00
Nathan Harold
b1f605fc33 Add API Surface for creating IpSec Transforms
This CL adds an API to set up an IPSec Security Association
and Security Policy to perform Transport-Mode and Tunnel-Mode encapuslation
of IP Packets.

Bug: 30984788
Bug: 34811752
Test: 34812052, 34811227
Change-Id: Ic9f63c7bb366302a24baa3e1b79020210910ac0a
2017-02-28 22:01:20 -08:00
Stephen Chen
a86d26ef4b Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp am: 8aa88a533c
am: 30fb2f228b

Change-Id: I318efe59e1967150338a7bd8001c27d9ebe3cf75
2017-01-27 07:42:07 +00:00
Hugo Benichi
7ee689b582 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp am: cf7d2e1221 -s ours
am: d44a2395e3

Change-Id: I7028ef23f597e6e82ecdb6c11a6c8dcdb1d1f77b
2017-01-27 07:40:56 +00:00
Stephen Chen
30fb2f228b Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp
am: 8aa88a533c

Change-Id: I3de8f91b1c9d0160ec58be8347502769580e0159
2017-01-27 07:29:07 +00:00
Hugo Benichi
d44a2395e3 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
am: cf7d2e1221  -s ours

Change-Id: Ie2f8c1e18acf57238fe4816812562ecd1644cf51
2017-01-27 07:28:06 +00:00
The Android Automerger
8aa88a533c Merge commit '29a9cf2250e0eaed062fd0f990a04b923896279b' into nyc-mr1-dev-plus-aosp
* commit '29a9cf2250e0eaed062fd0f990a04b923896279b':
  Implement metered tracking for NetworkStats summary queries.
2017-01-27 06:39:41 +00:00
The Android Automerger
cf7d2e1221 Merge commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1' into nyc-mr1-dev-plus-aosp
* commit 'a19056c35d16ddb5a6c1d3343729701b8939f1e1': (35 commits)
  NetworkMonitor: send one DNS probe per web probe
  NetworkMonitor metrics: add first validation information
  APF: also drop any ICMPv6 RSs
  ConnectivityServiceTest: fix testAvoidBadWifiSettings
  Fix ConnectivityServiceTest testRequestBenchmark
  Switch over to new "time.android.com" NTP pool.
  Define API for metering network stats buckets.
  Refactored NetworkStatsServiceTest to use Mockito instead of EasyMock.
  Use @Ignore to explicitly disable a @Test method.
  Fixed NetworkStatsServiceTest and converted it to JUnit4.
  VPN network stat accounting changes.
  ConnectivityThread: use lazy holder idiom
  ConnectivityManager: use ConnectivityThread looper
  ConnectivityManager: a simpler CallbackHandler
  Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
  Add a null check for the OnStartTetheringCallback.
  TokenBucket for rate-limiting and throttling
  IpConnectivityMetrics reads buffer size in settings
  CaptivePortalLogin: set mixed content policy to compatibility.
  Add IP conn metrics to dumpsys and bug reports
  ...
2017-01-27 06:39:05 +00:00
Stephen Chen
29a9cf2250 Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 357f8fabc8)

Change-Id: I46da93ba4afa968facf98f7c3d844fd0c469095a
2017-01-26 18:52:32 +09:00
Stephen Chen
a471b1647e Define API for metering network stats buckets.
This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit ed7fcb4d26)

Change-Id: I6a2fcc8577d62daa8823dff9e0128a5cf39ede7b
2017-01-26 18:52:08 +09:00
Jeremy Joslin
921f6f6797 VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871

(cherry picked from commit 12255e3655)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de
2017-01-26 18:51:53 +09:00
Jeff Sharkey
289eac11a2 StrictMode to detect untagged network traffic.
Network usage is tracked by the kernel at the UID level, which is
granular enough for normal apps, but large components (such as the
system server) are impossible to debug without adding additional
socket tagging to help identify subsystems within a UID.

To help ensure that system components tag all their network traffic,
this change offers a new StrictMode option to detect and report
untagged sockets.

Test: builds, boots, all common traffic tagged
Bug: 30943431, 30414041
Change-Id: I825c7941076054732264690247de2863342638e2
2017-01-19 20:52:05 -07:00
Makoto Onuki
3f75b41a1c Merge "Support protofied dumpsys for NetStats" 2017-01-18 21:30:20 +00:00
Stephen Chen
ff7dba4721 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
am: f57c4def50  -s ours

Change-Id: I970aed286a5bcc69d2ee69ea23b53af36dc2bbea
2017-01-18 10:48:16 +00:00
Stephen Chen
1390fbbed8 DO NOT MERGE: Define API for metering network stats buckets.
am: 88b52b25f7  -s ours

Change-Id: I03a015bbc76c762d48688b1c66562bbd599d4265
2017-01-18 10:44:12 +00:00
Philip P. Moltmann
ade5083d25 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
am: 8ad38f0f6c  -s ours

Change-Id: I7d66e82b940bd88c7e5da0d4a4f2008f14d98a2e
2017-01-18 10:37:37 +00:00
Stephen Chen
f57c4def50 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

(cherry picked from commit 357f8fabc8)

(cherry picked from commit 92b6175069)

Change-Id: I79e401fc4159264a075febba82bd8c295b8e677f
2017-01-18 19:08:41 +09:00
Stephen Chen
88b52b25f7 DO NOT MERGE: Define API for metering network stats buckets.
This is a continuation of b/26545374, since now we can also set the
metered bit with NetworkScorer. The tracking of metered state changes
will be implemented in a seperate CL.

Bug: 31015360
Bug: 26545374
Test: N/A

(cherry picked from commit ed7fcb4d26)

(cherry picked from commit ebace40092)

Change-Id: I01ebb270c5bf7f2383e8923cce72545ca1bee118
2017-01-18 19:08:32 +09:00
Philip P. Moltmann
8ad38f0f6c DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
Fixes: 28530428

(cherry picked from commit 79a3c031a0)

(cherry picked from commit 2838d9bb56)

Change-Id: Ib8f8da947af804c8b203928e57ed6a8aedbf0684
2017-01-18 19:08:16 +09:00
Makoto Onuki
feb5df9814 Support protofied dumpsys for NetStats
Bug 34228873
Test: manual tests with "incident_report netstats"

Change-Id: I359b364c64d9798fd4229018a905658d5d46ea5c
2017-01-17 14:16:01 -08:00
Jeff Davidson
601bc9b9a7 Merge "Add Log.wtf when getSummaryForAllUid NPEs." 2016-12-14 19:29:15 +00:00
Jeff Davidson
ed23aa6ca4 Add Log.wtf when getSummaryForAllUid NPEs.
This will provide stack trace information from the system process
which should enable us to more easily track down where the crash is
occurring.

Test: Builds locally
Bug: 33427276
Change-Id: I584a568fc038771afb28a534e2eefe2f763ed5e1
2016-12-12 12:11:16 -08:00
Lorenzo Colitti
34af49bb01 Merge changes from topic 'framework-net-aosp' am: a79b99893c am: 1a2fa0f372 am: c1c6b379c4
am: 20b77883fa

Change-Id: Ic6ee235cfbe3eea990f729de36119f8ce12a6a17
2016-12-09 11:25:03 +00:00
Stephen Chen
0e271e1517 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 92b6175069 -s ours am: 3f5785260e -s ours am: c8be8d5853
am: 9b8712a3a0  -s ours

Change-Id: I8d502d83e00fdc1cb295b32c557ab253f4b5c091
2016-12-09 11:10:40 +00:00
Stephen Chen
597d0445ce DO NOT MERGE: Define API for metering network stats buckets. am: ebace40092 -s ours am: 419a061017 -s ours am: f394f5c66f
am: c13d7998dc  -s ours

Change-Id: Ia147a494bf908d64d938355bd357d570ac783b76
2016-12-09 11:03:13 +00:00
Jeremy Joslin
ff852600b5 DO NOT MERGE: VPN network stat accounting changes. am: b135f1d5a8 -s ours am: 12bb3f057b -s ours am: 0e885ddad1
am: 483611214d  -s ours

Change-Id: I356877d99b1304777d3d9103e9e0d421b1bb112b
2016-12-09 10:59:11 +00:00
Philip P. Moltmann
473af6b8f1 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 2838d9bb56 -s ours am: 6e8a33a583 -s ours am: 4ede7f4df7
am: 6c6a790ddc  -s ours

Change-Id: Ie5b45503c2917340397abdbd6df5ecc407d90c26
2016-12-09 10:55:07 +00:00
Lorenzo Colitti
c1c6b379c4 Merge changes from topic 'framework-net-aosp' am: a79b99893c
am: 1a2fa0f372

Change-Id: I746ee7fd37946df2ba31ca8aee928fa3ef04591c
2016-12-09 10:18:11 +00:00
Stephen Chen
c8be8d5853 DO NOT MERGE: Implement metered tracking for NetworkStats summary queries. am: 92b6175069 -s ours
am: 3f5785260e  -s ours

Change-Id: Ib6f4a4af04c3f4e26028604c66f6cc4f1720a801
2016-12-09 10:04:41 +00:00
Stephen Chen
f394f5c66f DO NOT MERGE: Define API for metering network stats buckets. am: ebace40092 -s ours
am: 419a061017  -s ours

Change-Id: Ide68c11828a6473e330715bb4efe4d0ade9a46a2
2016-12-09 09:58:05 +00:00
Jeremy Joslin
0e885ddad1 DO NOT MERGE: VPN network stat accounting changes. am: b135f1d5a8 -s ours
am: 12bb3f057b  -s ours

Change-Id: Id9d26bf1b9512a85cd9b6a3253b86b77a6f62e77
2016-12-09 09:54:07 +00:00
Philip P. Moltmann
4ede7f4df7 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 2838d9bb56 -s ours
am: 6e8a33a583  -s ours

Change-Id: I95d1b3e8b676572dd3fb78aa750731e4c4c6a31f
2016-12-09 09:50:04 +00:00