Commit Graph

1101 Commits

Author SHA1 Message Date
nharold
c20e9c8b4b Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4 am: bbb4b05a64
am: b9d614d4df

Change-Id: Ic554e34d9b16f522156bc7e8b176f96693e8e32c
2018-01-25 07:59:57 +00:00
nharold
b9d614d4df Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4
am: bbb4b05a64

Change-Id: I383aa402d9d570ee7c7d5a603d022d1dade267a5
2018-01-25 07:49:59 +00:00
Nathan Harold
b559164017 Move Keepalive out of IpSecTransform.Builder
The lifecycle of Keepalive offloading is, unfortunately
different from that of an IpSecTransform. Because starting
a keepalive is fundamentally asynchronous, and isn't valid
until after a transform exists, it will now be a separate
optional procedure that may succeed or fail. It remains
linked with a Transform by the need for a Transform to exist
in order to initiate a Keepalive.

Bug: 38350389
Test: compilation
Change-Id: Ia76fccee41f86d694dff436043293d0c0762c041
2018-01-24 19:32:04 -08:00
Benedict Wong
49f46b8e74 Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50 am: 02d6d81006
am: 24dd1e9fb7

Change-Id: I998d44bac0993a8f2e9e228a0b0a80adfaa4d87e
2018-01-24 20:07:20 +00:00
Benedict Wong
24dd1e9fb7 Merge "Add tunnel-mode calls to netd in IpSecService" am: 475fe28c50
am: 02d6d81006

Change-Id: I8a3d16c8e58ad1c09d967943abe1c729fe37636a
2018-01-24 19:56:24 +00:00
Benedict Wong
45828d7122 Merge "Add TunnelInterface API and KernelResourceRecords" am: e02b700032 am: e1aa92f1c1
am: 5c3eb9ce8e

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35
2018-01-24 09:54:06 +00:00
Benedict Wong
f86780fa1f Merge "Add xfrm mark in IpSecConfig" am: 6b3456b253 am: 4077e802ad
am: fc2bcb4153

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a
2018-01-24 09:48:25 +00:00
Benedict Wong
5c3eb9ce8e Merge "Add TunnelInterface API and KernelResourceRecords" am: e02b700032
am: e1aa92f1c1

Change-Id: If27d78708ce225a900ad78a82d9f323770223808
2018-01-24 09:02:56 +00:00
Benedict Wong
8edc557ede Add tunnel-mode calls to netd in IpSecService
Adds calls to relevant netd methods in IpSecService, enabling Tunnel
mode functionality.

Bug: 63588681
Test: Compiles, passing CTS + unit tests
Change-Id: I6deb68584cddb03f21bd76370d4ef69cadc1bf16
2018-01-24 08:19:55 +00:00
Benedict Wong
fc2bcb4153 Merge "Add xfrm mark in IpSecConfig" am: 6b3456b253
am: 4077e802ad

Change-Id: I03ddca0611c4e0b41edc705cdb39b415205bb14b
2018-01-24 08:19:16 +00:00
Benedict Wong
e02b700032 Merge "Add TunnelInterface API and KernelResourceRecords" 2018-01-24 07:25:04 +00:00
Benedict Wong
8bc907311b Add TunnelInterface API and KernelResourceRecords
This change adds one KernelResourceRecord type (TunnelInterfaceRecord),
and adds methods for the creation of TunnelInterfaces, as well as the
application of Transforms to the given TunnelInterfaces

As part of the generation of ikeys/okeys, a ReserveKeyTracker manages a
java bitset to avoid collisions and reserve/release keys.

Bug: 63588681
Test: Compiles, CTS, unit tests all pass on AOSP_marlin
Change-Id: I9e9b6455e27073acd4491eae666aa966b3b10e0f
2018-01-24 07:24:27 +00:00
Benedict Wong
6b3456b253 Merge "Add xfrm mark in IpSecConfig" 2018-01-24 05:53:29 +00:00
Chenbo Feng
a94de8c9b5 Merge changes from topic "bpfStats" am: bd268b204c am: e041f38289
am: c10bd12062

Change-Id: I672efa1221e17d0962ca5702330fc83d75fcac81
2018-01-24 05:46:52 +00:00
Chenbo Feng
c10bd12062 Merge changes from topic "bpfStats" am: bd268b204c
am: e041f38289

Change-Id: Ib4790159fd331858ce9f3343a44ccec66fae638c
2018-01-24 05:39:54 +00:00
Treehugger Robot
bd268b204c Merge changes from topic "bpfStats"
* changes:
  Use /proc/net/dev to get stats summary
  Add bpf support for NetworkStatsFactory
  Add BPF support for NetworkStatsService
2018-01-24 04:08:29 +00:00
Benedict Wong
7ea128e242 Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9 am: c2253ff48d
am: 82d8e1a25d

Change-Id: Ia1f81f5696814f5b9479882e1102a5f8508a4512
2018-01-24 02:58:17 +00:00
Benedict Wong
82d8e1a25d Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9
am: c2253ff48d

Change-Id: I85c761df4b77dba0b62adfd3488f66cdcf780fa3
2018-01-24 02:50:47 +00:00
Benedict Wong
03e732a299 Expose applyTunnelModeTransform as a system API
Simple change to expose systemAPI for applyTunnelModeTransform

Bug: 36033193
Test: All CTS, unit tests passing
Change-Id: I2d857c048bc0dc80c3949387f946b1f5adf0527e
2018-01-23 23:25:54 +00:00
Benedict Wong
fd337e9e6a Merge "Add checks to ensure SPIs are not reused" am: 66aa524a04 am: 1a2e3f3b54
am: ac94b41c42

Change-Id: I13738ac37710ec7934998ef269681ae7c41c612e
2018-01-23 20:40:39 +00:00
Lorenzo Colitti
d3a884ac8d Merge changes from topic "multipath-datausage-backport" am: 1afa23dade am: c46c21c702
am: d1e9c2795c  -s ours

Change-Id: Ib16c50de2a3846dae9736e7ca68a4282831f0812
2018-01-23 20:20:53 +00:00
Lorenzo Colitti
6b13ceec95 Add metered, roaming, and defaultNetwork info to NetworkTemplate. am: 75ec1aed18 am: e383807d7f
am: cc323a7179  -s ours

Change-Id: I2710d5205e1d010f0b928acb7f76631a66d6349e
2018-01-23 20:16:55 +00:00
Lorenzo Colitti
c6aaed2a6e Add the defaultNetwork element to the netstats.proto. am: 0ba426b8a1 am: adcb94472a
am: aa2d703fd6  -s ours

Change-Id: Ife16614408062fb3a4a8954008a5d1aa63986edf
2018-01-23 20:06:47 +00:00
Lorenzo Colitti
359e76bb9f Add getDefaultNetwork to the NetworkStats public API. am: 92a946d09f am: 66eab17abc
am: 4ee6a6fb12  -s ours

Change-Id: I5df239d3da75332233b5043a163938d03f889881
2018-01-23 20:03:40 +00:00
Benedict Wong
ac94b41c42 Merge "Add checks to ensure SPIs are not reused" am: 66aa524a04
am: 1a2e3f3b54

Change-Id: I8c7243bc600e5f2e9abec03b5a357ed6376aa9bf
2018-01-23 19:55:47 +00:00
Lorenzo Colitti
d1e9c2795c Merge changes from topic "multipath-datausage-backport" am: 1afa23dade
am: c46c21c702

Change-Id: I45f0c69e3440e9ec69c82e81c41bea682a359389
2018-01-23 19:43:13 +00:00
Lorenzo Colitti
cc323a7179 Add metered, roaming, and defaultNetwork info to NetworkTemplate. am: 75ec1aed18
am: e383807d7f

Change-Id: I1faf95edec0e836c69016c84ad2a2c8518f8eb53
2018-01-23 19:39:18 +00:00
Lorenzo Colitti
aa2d703fd6 Add the defaultNetwork element to the netstats.proto. am: 0ba426b8a1
am: adcb94472a

Change-Id: I292e903617d3af1867529e68eb20538afb66f665
2018-01-23 19:30:57 +00:00
Lorenzo Colitti
4ee6a6fb12 Add getDefaultNetwork to the NetworkStats public API. am: 92a946d09f
am: 66eab17abc

Change-Id: If0aa0a4522df0061645d34cb3af8a33f288ed46d
2018-01-23 19:28:14 +00:00
Benedict Wong
66aa524a04 Merge "Add checks to ensure SPIs are not reused" 2018-01-23 18:00:06 +00:00
Lorenzo Colitti
1afa23dade Merge changes from topic "multipath-datausage-backport"
* changes:
  Support passing a template to NetworkStatsManager queries.
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.
  Disable IpConnectivityMetricsTest.
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-23 15:22:18 +00:00
Lorenzo Colitti
75ec1aed18 Add metered, roaming, and defaultNetwork info to NetworkTemplate.
This will allow data usage clients to query for and receive
callbacks on data usage matching these conditions.

Bug: 35142602
Test: atest FrameworksNetTests
Change-Id: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
Merged-In: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
2018-01-23 18:38:48 +09:00
Lorenzo Colitti
0ba426b8a1 Add the defaultNetwork element to the netstats.proto.
This is in its own commit because AOSP has diverged from internal
master.

Bug: 35142602
Test: builds, boots
Change-Id: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379
Merged-In: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379
2018-01-23 18:38:48 +09:00
Lorenzo Colitti
f1b197b23b Support passing a template to NetworkStatsManager queries.
Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
Merged-In: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
2018-01-23 18:38:48 +09:00
Lorenzo Colitti
92a946d09f Add getDefaultNetwork to the NetworkStats public API.
This allows an app using the public API to know whether the
traffic in a particular bucket was on the default network
(i.e., the network was selected by the system), or not (i.e.,
the network was selected by the app).

Bug: 35142602
Test: builds, boots
Test: added coverage to NetworkUsageStatsTest CTS test, still passes
Change-Id: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
Merged-In: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
2018-01-23 18:28:07 +09:00
Chenbo Feng
75a1efb3f5 Use /proc/net/dev to get stats summary
If the qtaguid proc file is no longer exist, the device is running new
eBPF module to do traffic accounting. So the NetworkStatsFactory need to
use the proc/net/dev interface to get the per interface traffic stats
summary. Also, adding a test to verify the helper function work properly

Bug: 30950746
Test: run NetworkStatsFactoryTest
Change-Id: Ia36808bf02f1637dd41a3e7c50917b91b1a77524
2018-01-23 00:35:02 -08:00
Chenbo Feng
adfda6945d Add bpf support for NetworkStatsFactory
Add the native method used to read the detail information of network
stats from bpf maps. The native method of NetworkStatsFactory should
choose the correct implementation to get the stats detail depending on
the kernel version. Currently the bpf result is printed as a reference
and the actual behavior of NetworkStatsFactory should not change.

Test: NetworkStatsFactory related cts test should not fail.
Bug: 30950746
Change-Id: I4715a23559b5b2306bd556cea0431f0ed172a993
2018-01-23 00:34:53 -08:00
Chenbo Feng
7d2d414fd8 Add BPF support for NetworkStatsService
Add the native implementation for NetworkStatsService to read the
uidStatsMap and tagStatsMap to get the network traffic information.
Currently the implementation only try to get the data from bpf for a
reference but the final value returned is still from old xt_qtaguid
module. So the result will not be effected. The bpf implementation is
depending on libbpf inside netd.

Bug: 30950746
Test: CtsNetTestCases -t android.net.cts.TrafficStatsTest

Change-Id: Ia85e4d4d602f6bd536739d89085e6dc37ad82e15
2018-01-22 23:25:11 -08:00
Benedict Wong
68aac2affa Add checks to ensure SPIs are not reused
This change adds an additional check in CheckIpsecConfig to prevent
users from using the same SPI twice. This allows for a more granular
error message.

Bug: 70642141
Test: Tests added in IpSecServiceParameterizedTest
Change-Id: I9621fb05c6b162bd8ae8db4ac1e64feaa9d0ac73
2018-01-22 21:09:47 -08:00
Lorenzo Colitti
1d81c1317f Merge "Support passing a template to NetworkStatsManager queries." 2018-01-23 04:02:58 +00:00
Lorenzo Colitti
942df30e22 Merge "Remove obsolete NetworkStats.Entry constructor." am: ebb1d92eb8 am: cdeb50aa48
am: 56cc2e9765

Change-Id: Id6a664fd5ad8c182468b742e810e65afee248ad5
2018-01-23 02:35:08 +00:00
Lorenzo Colitti
56cc2e9765 Merge "Remove obsolete NetworkStats.Entry constructor." am: ebb1d92eb8
am: cdeb50aa48

Change-Id: If60b58f95707bab3ae89050234226d54386398e8
2018-01-23 02:23:32 +00:00
Lorenzo Colitti
ecf2a65eb7 Merge changes I4d985a27,Ic6f2bc18
* changes:
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.
2018-01-23 00:28:39 +00:00
Benedict Wong
6338fb56f9 Merge "Address comments and final cleanup from refcounting integration" am: faa9b02efc am: 8130c2a718
am: d8166b064c

Change-Id: I0612286b8d95b0ae10c1337214f9c3b4e570fbac
2018-01-23 00:19:05 +00:00
Lorenzo Colitti
ebb1d92eb8 Merge "Remove obsolete NetworkStats.Entry constructor." 2018-01-23 00:15:15 +00:00
Benedict Wong
d8166b064c Merge "Address comments and final cleanup from refcounting integration" am: faa9b02efc
am: 8130c2a718

Change-Id: I7ed4a6bb90f3cf3ed5fd0e6ad20b033e588a4c90
2018-01-23 00:08:17 +00:00
Benedict Wong
faa9b02efc Merge "Address comments and final cleanup from refcounting integration" 2018-01-22 20:32:18 +00:00
Benedict Wong
f9040dea3b Merge "Rename create/delete transform methods" am: da6956a702 am: 5b71c4a0a5
am: f5aae7f1a3

Change-Id: Ie07b0b608b3dfcbfc4228a15e26fe6f6559315f9
2018-01-22 20:03:48 +00:00
Benedict Wong
f5aae7f1a3 Merge "Rename create/delete transform methods" am: da6956a702
am: 5b71c4a0a5

Change-Id: I16bfb511ac2d6094e246f79d51fe4520d3e765cd
2018-01-22 19:53:15 +00:00
Benedict Wong
da6956a702 Merge "Rename create/delete transform methods" 2018-01-22 17:57:15 +00:00