Commit Graph

1140 Commits

Author SHA1 Message Date
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
Lorenzo Colitti
81bd73ba98 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
2018-01-22 22:30:27 +09:00
Lorenzo Colitti
e47bf09f9b 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
2018-01-22 21:41:20 +09:00
Lorenzo Colitti
d5059166ac Merge changes from topic "multipath-datausage"
* changes:
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.
2018-01-21 16:07:29 +00:00
Lorenzo Colitti
9ab3929812 Remove obsolete NetworkStats.Entry constructor.
The only caller is telephony code, and it's being fixed in this
topic.

Bug: 35142602
Test: builds, boots
Change-Id: Ia77a1c2c297037f311c2355610c206cd8e3192c4
2018-01-21 23:01:35 +09:00
nharold
1b818c5bc4 Merge "Add Tunnel Interface APIs to IpSecManager" am: a82dbcb3c7 am: 696cff166c
am: e7e979071c

Change-Id: I094751d965b679e85a0f200b2382f1715d69e400
2018-01-19 20:25:18 +00:00
nharold
e7e979071c Merge "Add Tunnel Interface APIs to IpSecManager" am: a82dbcb3c7
am: 696cff166c

Change-Id: I0cd07c51e9512b7e9471e1a09c977fca2bf12e48
2018-01-19 20:16:38 +00:00
nharold
a82dbcb3c7 Merge "Add Tunnel Interface APIs to IpSecManager" 2018-01-19 19:43:17 +00:00
Benedict Wong
0fff56eae5 Rename create/delete transform methods
CreateTransportModeTransform and DeleteTransportModeTransform are both
agnostic as far as which mode of transform it creates/deletes. As such,
to facilitate the implementation of tunnel mode, this patch renames them
to CreateTransform and DeleteTransform, along with all test names.

Bug: 63588681
Test: frameworks/base unit tests and CTS tests run, passed
Change-Id: I1f015eb7ad0e85fca966658a9402485ca2b44091
2018-01-19 10:43:01 -08:00
Lorenzo Colitti
76a6f956dd 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
2018-01-20 02:26:58 +09:00
Lorenzo Colitti
b8e79f3312 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
2018-01-20 02:26:58 +09:00
Lorenzo Colitti
d99f4ff71f Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: c48f4cb7f1 am: b36b423230
am: 0d74e0554c

Change-Id: I12108d96e29bfe71406106c2af950a6d6a9f8351
2018-01-19 16:46:11 +00:00
Lorenzo Colitti
0d74e0554c Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: c48f4cb7f1
am: b36b423230

Change-Id: I1ac9d349850d607c5fbf4a47760bc09de1c18043
2018-01-19 16:37:44 +00:00