History log of /system/netd/server/Android.mk
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1171ea500e70ea2748bc746cb01947a99b89a389 10-Aug-2017 Lorenzo Colitti <lorenzo@google.com> Add a test for IdleTimerController.

Bug: 28362720
Test: bullhead builds,boots
Test: netd_{unit,integration}_test pass
Change-Id: I0e3c2462676969b26a4cbee7aa6552078fde90f5
Merged-In: Ifc7b7045f00f7803b31a22d96a04e208917af5a5
/system/netd/server/Android.mk
09d8c762645a18f359ab80558a8aad9003d86461 08-Aug-2017 Lorenzo Colitti <lorenzo@google.com> Add test coverage for setting up initial iptables rules.

Bug: 28362720
Test: bullhead builds, boots
Test: netd_{unit,integration}_test pass
Change-Id: I2ab9269d9bca3a7b8b168b801360d3fdb6119f05
Merged-In: Ifc7b7045f00f7803b31a22d96a04e208917af5a5
/system/netd/server/Android.mk
964d616b83049757ae72d1a446d7696ba1ef5743 31-Jul-2017 Niranjan Pendharkar <npendhar@codeaurora.org> netd: HAL implmentation
am: 7e08f85244

Change-Id: Ic6c89f7f85e76ac08899f89f82febee5e1506ec2
7e08f852440c4e9aaada7acc734e45920ec5c398 24-Jul-2017 Niranjan Pendharkar <npendhar@codeaurora.org> netd: HAL implmentation

Implement Netd HAL server and register service.
OEM network create and destroy

Test: ran VtsHalNetNetdV1_0TargetTest, netd_unit_test, netd_integration_test
Bug: 36682246
CRs-fixed: 2070022
Change-Id: I35681f0fbffbe09bf6db0ad25a276844ea997398
(cherry picked from commit 9560bedd6ce334d64d4e9e9331d00f90f5103e0e)
/system/netd/server/Android.mk
e760181ff41a5f4526e4f543f3838eb05690e2aa 28-Apr-2017 Ben Schwartz <bemasc@google.com> Support RFC 7858 DNS over TLS

This change adds the core capability for DNS over TLS, and creates
private APIs for activating it, but does not provide any way to
activate the functionality in a development environment or on a
real device.

Based on https://android-review.googlesource.com/#/c/373776/

Test: Complete unit+integration tests. Manual tests look good.
Bug: 34953048
Change-Id: Ib99ac1f631fd2c2c8fbf53bdb05f67f8be7713ac
/system/netd/server/Android.mk
b38def83dd3ac67e75ea0e66b93af7c746fbb3c2 01-Jun-2017 Joel Scherpelz <jscherpelz@google.com> Enable RFC 7217 stable privacy addresses

... on kernels that support this feature. Android property server is
used in combination with SELinux policy to limit access to the
necessary stable secret.

This change also makes some small improvements and fixes to
libnetdutils.

ip -6 addr indicates stable_privacy addresses with "flags 800"

wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 3000
inet6 fdd5:6241:900d:0:d547:442:33d7:1982/64 scope global temporary dynamic
inet6 fdd5:6241:900d:0:9dbe:3875:1cab:eaf2/64 scope global mngtmpaddr dynamic flags 800
inet6 2401:fa00:4:ca0:d547:442:33d7:1982/64 scope global temporary dynamic
inet6 2401:fa00:4:ca0:6281:68a2:7124:6848/64 scope global mngtmpaddr dynamic flags 800
inet6 fe80::d5a7:18ed:4ea7:50d8/64 scope link flags 800

Test: as follows
- built
- flashed
- booted
- "runtest -x .../netd_unit_test.cpp" passes
Bug: 17613910

Change-Id: I0e0b6bbd15cb9d46368bed8aef5dac2f6183d32a
/system/netd/server/Android.mk
de9379641d5fc4b5912d6838075df9490518cca6 01-Jun-2017 Joel Scherpelz <jscherpelz@google.com> Enable RFC 7217 stable privacy addresses

... on kernels that support this feature. Android property server is
used in combination with SELinux policy to limit access to the
necessary stable secret.

This change also makes some small improvements and fixes to
libnetdutils.

ip -6 addr indicates stable_privacy addresses with "flags 800"

wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 3000
inet6 fdd5:6241:900d:0:d547:442:33d7:1982/64 scope global temporary dynamic
inet6 fdd5:6241:900d:0:9dbe:3875:1cab:eaf2/64 scope global mngtmpaddr dynamic flags 800
inet6 2401:fa00:4:ca0:d547:442:33d7:1982/64 scope global temporary dynamic
inet6 2401:fa00:4:ca0:6281:68a2:7124:6848/64 scope global mngtmpaddr dynamic flags 800
inet6 fe80::d5a7:18ed:4ea7:50d8/64 scope link flags 800

Test: as follows
- built
- flashed
- booted
- "runtest -x .../netd_unit_test.cpp" passes
Bug: 17613910

Change-Id: I0e0b6bbd15cb9d46368bed8aef5dac2f6183d32a
/system/netd/server/Android.mk
bcad661ab90d5e4d04d41747d109f9c97c5f9490 30-May-2017 Joel Scherpelz <jscherpelz@google.com> Modernize string handling in BandwidthController

This change is preparation for removal of xt_quota2 in favor of NFLOG.
Note that the scope of changes is mostly limited to mechanical single
line changes from "const char*" to "const std::string&".

Test: as follows
- built
- flashed
- booted
- "runtest -x .../netd_unit_test.cpp" passes
- "runtest -x .../netd_integration_test.cpp" passes
Bug: 38143143
Bug: 28362720

Change-Id: I56ba810ff6fa2f409e32d86508cfdb1a81a50a4e
/system/netd/server/Android.mk
08b84cd0d223ae3059ce7d4d55b389fdea187580 22-May-2017 Joel Scherpelz <jscherpelz@google.com> Add WakeupController and NFLogListener

These classes work together to parse and dispatch NFLOG messages in
response to inbound packets annotated by the WiFi driver.

Test: as follows
- built
- flashed
- booted
- netd_unit_test passes

Change-Id: Id26d62858bf4bc4186ae66850f08077adf6fc2ac
/system/netd/server/Android.mk
e2dd4c7ccab83878703d9bb12aa9bca12c63994c 19-Apr-2017 Nathan Harold <nharold@google.com> Fix ABI incompatibility for Netlink XFRM on Fugu

Fugu is compiled with an x86 userspace and an x86_64
kernel. This means that there is no guarantee of ABI
compatibility between the kernel and userspace. The
xfrm_usersa_info struct is one such place where the
compatibility happens to not exist due to struct
alignment differences. This CL patches the
xfrm_usersa_info struct to match the kernel's 64-bit
alignment in at least the case of x86 vs x86_64.

Bug: 37252170
Test: CTS - IpSecManagerTest passes
Change-Id: Ic08a75d543f92f7fa5e0cf8b4277de12464fd406
/system/netd/server/Android.mk
b4140197bc5606564e2a16790517d10876e43911 02-Apr-2017 nharold <nharold@google.com> Merge "Add XfrmController to NetdNativeService"
1a37153768aa605e0787591c39d73b674acd92c3 30-Jan-2017 Nathan Harold <nharold@google.com> Add XfrmController to NetdNativeService

Add a new controller to Netd that can handle IPSec XFRM
commands from the framework.

-Add new XfrmController controller
-Connect XfrmController to Controllers
-Add APIs in XfrmController for creating Transport IpSec Assocs

Bug: 34811756
Test: 34812052
Change-Id: If518a53a83fa76ea4c866992055a741ae064c30d
/system/netd/server/Android.mk
8190e18646d20b27d5faa214500d1f8ca2aee167 27-Mar-2017 Dan Shi <dshi@google.com> Add test config to netd_benchmark, netd_unit_test and netd_integration_test

Details about test configs changes are tracked in doc
https://docs.google.com/document/d/1EWUjJ7fjy8ge_Nk0YQbFdRp8DSHo3z6GU0R8jLgrAcw/edit#

Bug: 35882476
Test: local test
Change-Id: If856899c8c281a6507b4b336285a7d0788dcea1a
/system/netd/server/Android.mk
df42ddd92719b5af6a93ef8817a94bcfa2115bbf 27-Feb-2017 Lorenzo Colitti <lorenzo@google.com> Add a unit test for BandwidthController quota commands.

Bug: 28362720
Test: test-only change.
Change-Id: I11d7c55afda4cfd72eb2f3de2362ecf3bf1d3b4e
/system/netd/server/Android.mk
60367db98fe9cca5b46210a5db8d8bfc638ce094 13-Feb-2017 Lorenzo Colitti <lorenzo@google.com> Add a test for RouteController.

Test: netd_{unit,integration}_test pass.
Change-Id: I19416fd8a79354303dabec042d090f7ae6962b1b
/system/netd/server/Android.mk
1ef549de8a21612ab61861ff0035877a4b76184d 13-Feb-2017 Lorenzo Colitti <lorenzo@google.com> Move the netlink command code to a new NetlinkCommands file.

Test: bullhead builds, netd boots
Test: netd_{unit,integration}_test pass
Bug: 34873832
Change-Id: Ia6fcde63e1092a62cad1c5238bbb9a91a9f39080
/system/netd/server/Android.mk
cd28377ac7736aa18700ffdc075e3b16c1d1f656 31-Jan-2017 Lorenzo Colitti <lorenzo@google.com> Support reading output from IptablesRestoreController.

Add the ability to IptablesRestoreController to return the output
of a command. This is useful to run commands that list chains or
return counters through the ip[6]tables-restore.

Also enable unsigned-integer-overflow sanitization the unit tests
because their behaviour should be representative of actual code.
Having address sanitization enabled would have saved a fair
amount of time debugging an on-device abort() that did not affect
the tests.

Test: new unit test passes
Bug: 32323979
Change-Id: I70726ebbade0cb792aba38787c57378df177f2d8
/system/netd/server/Android.mk
1ed96e2d3fa89ca4848750a6b3bbbcf677946d27 01-Feb-2017 Lorenzo Colitti <lorenzo@google.com> Move some code out of CommandListener.

1. Move lots of initialization code to Controllers.cpp.
2. Move stringToPermission to Permission.h, which seems like a
better place for it.

Bug: 34873832
Test: builds, boots
Change-Id: I01ba8e1d062d298eab71a1b90899df042fdc2360
/system/netd/server/Android.mk
a5ace89be511d5a9f76d2d987fe8f61c0a8102f5 06-Jan-2017 Narayan Kamath <narayan@google.com> netd: Use a persistent iptables[6]-restore process

iptables-restore and ip[6]tables-restore are forked on demand
whenever we need them, and their stdin/out/err are replaced by
pipes to the parent process. All commands are sent via the stdin
pipe. We also add SIGCHLD handling so that we can detect error
conditions and restart the process whenever required.

Bug: 32323979
Test: Manual
Test: netd_unit_test, netd_integration_test

Change-Id: Ia12ee01f8b45e5b8a699c27eea1b6b55d40f16b5
/system/netd/server/Android.mk
5f94198b18eaf9ef972d7ae9b6b3735365e3abd3 12-Dec-2016 Jaekyun Seok <jaekyun@google.com> Use shared lib of libpcap in netd instead of static one.

libpcap is used by netd and tcpdump on angler build.
Size diffs on angler build image are as follows.

netd : 290248 -> 290216 (- 32)
tcpdump : 1301840 -> 1024376 (-277464)
libpcap.so: 0 -> 307552 (+307552)
total : (+ 30056)

But libpcap is being linked by some vendors' components.
So on such builds, the size diff will be reduced more; it could be
negative possibly.

Test: building succeeded, and the image was tested on angler.
Bug: 33056637
Change-Id: I44d3e8284e5da2ce9f57bb11feba652f056a6465
/system/netd/server/Android.mk
dc0d578a69cc5a57167a508207e2198590142d51 20-Jul-2016 Robin Lee <rgl@google.com> UidRanges: use class instead of pair<uid_t, uid_t>

Reuse the UidRange that was introduced in 7.0 (NYC) to ease transition
from CommandListener to binder which supports this as a parcelable type.

There is a small difference in behaviour: UidRange uses signed int32_t
vs. uid_t being unsigned and potentially a different size. This should
not be a problem as all of the java-side code is converting from int.

Updating to use int64_t in future would be a large effort and involve
changing the java-side UidRange class to use longs, and not fixing the
native side would cause unit tests to fail, so it shouldn't be possible
to overlook if that happens.

Committing this early with an appropriately loud warning so that it can
get soak time over the next year.

Test: runtest -x netd_integration_test.cpp
Change-Id: I6c217b347724ba5bfe2df28d6142a4343cb06353
/system/netd/server/Android.mk
d544011db2537092fe4f76d238dfe3a82ad15a36 06-Oct-2016 Michal Karpinski <mkarpinski@google.com> Adding EventReporter class

This class stores the reporting level and can be used to get
the event listener service.

Bug: 29748723

(cherry picked from commit be581e228bd1a97efd179edcdd3e744622fb99b8)

Change-Id: I98bfa97cb502f4d19ccf8c79f32d347e7e168492
/system/netd/server/Android.mk
a8352e9d36ca0341f99c216214d3e9fc73a76ba4 01-Jun-2016 Thurston Hou Yeen Dang <thurston@google.com> Unsigned integer overflow sanitization for netd/server

Enable unsigned-integer-overflow sanitization for netd/server
(libnetdaidl, netd, ndc).

This does not cause any aborts on CtsNetTestCases (includes
android.net.cts.VpnServiceTest), CtsNetTestCasesLegacyApi22, and
CtsNetTestCasesLegacyPermission22.
(Some tests are finicky and need to be re-run individually to pass; there is similar behavior on the unsanitized build.)

(cherry picked from commit 547f0f09b6b28debd894daa610df9d00bcc3e5b8)

Change-Id: I021bae3cf20df7669822977d3221a44f207614a8
/system/netd/server/Android.mk
08a30b997792a8ea13ebdfe6363e623c1161b1e5 09-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Add a test for NatController.

Bug: 9580643

(cherry picked from commit 8e1cee9064af5b2e0d8095d5a6a05953616d7d4c)

Change-Id: I1cb66b503885073c653f6e8ce527356c8ce04557
/system/netd/server/Android.mk
b88ae11d21377b6499a07d24be7cc2bf51dd1601 08-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Add a test for getTetherStats.

(cherry picked from commit bbeaf9a4d272eefb11748d7d40c6bd117ab468fb)

Bug: 9580643
Change-Id: Ice734897e66e299b4db39ad369087e0f8fa263c0
/system/netd/server/Android.mk
bd3ed5fd2933ed8a8795006db8b9a37ded814213 08-Oct-2016 Elliott Hughes <enh@google.com> Rely on the platform -std default.

Bug: http://b/32019064
Test: builds
Change-Id: I917cddbb456f3d6fbefa3617844bb2af59a0d3a8
/system/netd/server/Android.mk
5005134a6ab717c55a02a2684cfae42484b801aa 15-Sep-2016 Michal Karpinski <mkarpinski@google.com> Rename the DnsEventListenerService to NetdEventListenerService

The service will be extended to include listening for connect events as well

Test: this is just a renaming change

Bug: 29748723
Change-Id: I6e290c0e559856490b24ce3e7fc1f13f33a22828
/system/netd/server/Android.mk
a62db754d9c78c352f64dc9d07877eb84a75b547 02-Aug-2016 Christopher Wiley <wiley@google.com> Remove WiFi related logic from netd

This is now managed by wificond.

Bug: 30041228
Test: There were no more callsites for the corresponding methods
in NetworkManagementService.

Change-Id: Ia07a8819f8b46e15695819c6beb64d69b0dcfde1
(cherry picked from commit ac392585811ea4488116342fc3bc3b9925bbfd8a)
/system/netd/server/Android.mk
226e1f006fd07b52c9e22e35577af933b99fbd2b 17-Jun-2016 Christopher Wiley <wiley@google.com> Depend on libwifi-hal for device specific functionality

Bug: 29418968
Change-Id: Id98db298c0cdbebec97015458f849f408d749059
(cherry picked from commit 341c282c91176605913687a6b44aa2f1b8a78301)
/system/netd/server/Android.mk
74e6bb634a5b39db740283554c495fbf3f3b7fc3 15-Jun-2016 Christopher Wiley <wiley@google.com> Depend on libwifi-system for wifi.h

This functionality was moved to reflect its hardware independence.

Bug: 29321445
Change-Id: Ifc5d3a68e32f4fa2dec2724e4a2ea7990a2dbacb
(cherry picked from commit 6953268ebaf388509be055549db417ca38637c5e)
/system/netd/server/Android.mk
2f3cbf1cd59bcdf813aa4b46811dfcd4c2cf3c6a 29-Jun-2016 Pirama Arumuga Nainar <pirama@google.com> Disable warnings triggered in Clang r271374

http://b/28149048
http://b/29823425

Disable -Wvarargs that gets triggered in server/NetdConstants.cpp on
modules that are currently internal-only. The second bug above tracks
that this warning gets re-enabled.

Change-Id: Iba51a413b32f238c915e14dd7696b97c2cb81d71
(cherry picked from commit fcdf725f04eebc4d2954d653f907c08fe01119ce)
/system/netd/server/Android.mk
f10fc5418e59f04fe64b9c314b491e01d6874726 20-Jul-2016 Pirama Arumuga Nainar <pirama@google.com> Merge \"Disable warnings triggered in Clang r271374\"
am: 451debdc6b

Change-Id: I5bd7f7ff9e3c55c5db7e69a1a18a060b5af27f8e
dde4a5570f4a58e5fad2ee357fb300d46307773b 28-Jun-2016 Pirama Arumuga Nainar <pirama@google.com> Disable warnings triggered in Clang r271374

http://b/28149048
http://b/29823425

Disable -Wvarargs that gets triggered in server/NetdConstants.cpp. The
second bug above tracks that this warning gets re-enabled.

Test: Tested build, boot and common usage for Arm, Arm64, x86, x86_64,
Mips images in AOSP and internal branch.

Change-Id: I5efea1897d7f7c2c1593475563b567503948b135
/system/netd/server/Android.mk
05bfccf131db48b9bad0f9d567fec2026b3aa54d 14-Jun-2016 Elliott Hughes <enh@google.com> Merge \"Switch netd\'s last C file to C++.\"
am: a71ce29d47

Change-Id: I7855517ed13d99faed7eb582613de24816a36bae
12c32784f13ef9ffe2ff92c84f104c539cff2417 13-Jun-2016 Elliott Hughes <enh@google.com> Switch netd's last C file to C++.

(I stumbled into this in the my "who needs _GNU_SOURCE?" investigation.)

Change-Id: Ie4e69802bdea3c5e462f68916dc05b8617642e2b
/system/netd/server/Android.mk
9f9aae9102f62f5f96ccec670170ee1fb262ef09 30-Mar-2016 Robin Lee <rgl@google.com> Move UidRange aidl to create a native cpp version

Moved from:
//frameworks/base/core/java/android/net/
To:
//system/netd/binder

Since frameworks/base depends on netd but not vice versa, it is cleaner
to keep the internal aidl in the same place as the native implementation
in netd.

Bug: 26694104
Change-Id: If21a72978ad5b93f0eed04c75143b55157c1a014
/system/netd/server/Android.mk
6c97716e41d751cb0ebf49c93943923a356d3a96 12-Apr-2016 Lorenzo Colitti <lorenzo@google.com> Netd metrics logging for DNS queries

This CL defines a new IDnsEventListener interface and instruments
DnsProxyListener to send log events to it after every DNS query.

Bug: 28204408
Change-Id: I7ef09d8fac2a583fb3dc8e392c4fff5649258b28
/system/netd/server/Android.mk
fff4bd31ff2bad0acfd8f2439eccf7df70e9695f 13-Apr-2016 Lorenzo Colitti <lorenzo@google.com> Kill sockets when a VPN comes up.

1. Change the SockDiag callback function to be a filter that
returns a bool instead of a function that optionally kills a
socket. All existing callbacks basically only existed to kill
sockets under certain conditions, and making them return a
boolean allows reusing the same callback function signature
to filter sockets as well.
2. Add a new SockDiag method to kill sockets based on a UidRanges
object (which contains a number of UID ranges) and a list of
users to skip.
3. Add a new UIDRANGE mode to SockDiagTest to test the above.
4. When UID ranges are added or removed from the VPN, kill
sockets in those UID ranges unless the socket UIDs are in
mProtectableUsers and thus their creator might have set the
protect bit on their mark. Short of actually being
able to see the socket mark on each socket and basing our
decision on that, this is the best we can do.

Bug: 26976388
Change-Id: I53a30df3feb63254a6451a29fa6041c9b679f9bb
/system/netd/server/Android.mk
9028d91fd86a2d517c7ce163c1d88b41de961ba8 27-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Add a test for StrictController.

Bug: 21725996
Bug: 25691379
Change-Id: I24b838161eaf98dede2ae897157ba42414fc926f
/system/netd/server/Android.mk
0f15055ba127da5c8bff3617f04ac6df0b4ee2f4 27-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Move iptables test code to a new IptablesBaseTest class.

Bug: 25691379
Bug: 21725996
Change-Id: Ia0598e60ad24714d53470e05849929831ba9dbf6
/system/netd/server/Android.mk
7fa41f337b9b1ecb7accc429ab7caea462482392 22-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Merge changes I149ccda5,I4457abd4,I67bff7c3,Ie15b0775,I8dd9fc60 into nyc-dev

* changes:
Stop using SIOCKILLADDR in netd.
Add a rudimentary unit test for BandwidthController.
Slightly restructure the data saver iptables rules.
Remove the ability to enable/disable the happy box.
Don't keep naughty/nice app state in BandwidthController.
86a4798264c9421cb02bc69836a323d918f73779 18-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Add a rudimentary unit test for BandwidthController.

Bug: 26685616
Bug: 27506285
Change-Id: I4457abd43697a0425f167b81c1432d743800abb8
/system/netd/server/Android.mk
2d3a163433c435ff053402ae8965f8602c7ac6da 15-Mar-2016 Erik Kline <ek@google.com> Add initial dump() method to NetdNativeService

This is called by "dumpsys netd".

Bug: 27239233
Change-Id: I27fb308f8067243ff241a6f8fd6a83f406087d2a
/system/netd/server/Android.mk
dcce00131ef210f79585ee82889744a0ebbd30a9 04-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Support killing sockets using SOCK_DESTROY.

This gives netd the ability to close sockets on a particular
source IP address using SOCK_DESTROY. It does not yet enable
this behaviour.

The microbenchmark is able to close 500 IPv6 sockets in ~30ms on
my angler. Specifically:

- Scanning 500 socketpairs: ~5ms
- Scanning 500 socketpairs and killing one half of each: ~30ms
- Scanning 500 socketpairs and killing both halves of each: ~40ms

This is about ~2.5x-3.5x slower than SIOCKILLADDR:
- For 500 sockets, it's 9.5ms vs. 22.9ms.
- For 4000 sockets, it's ~40ms vs ~135ms.

A large part of that is due to sending RST packets, which
SIOCKILLADDR does not do. If the kernel is modified so that
SOCK_DESTROY does not send RSTs, the time taken to kill 4000
sockets goes down to ~70ms

Batching the destroy operations does not help much. It saves
5-10%, but it complicates error handling.

Bug: 26976388

(cherry picked from commit 8464e1ed13a30ca91ae44dd2e334f63de7ade0f3)

Change-Id: Ib85d573ee2af6f6ffc4ce50a31cfbb6e9a720ca1
/system/netd/server/Android.mk
b19fcc7c65e9715d85a40ac3c6c044a395e8b6fe 11-Mar-2016 Pierre Imai <imaipi@google.com> Fix netd tests for use with APCT

Change-Id: Ica37a812c37036ffecd45b8f078d8ed9928d01fc
/system/netd/server/Android.mk
77862190b093552da949e2506d99005f955dc432 02-Mar-2016 Lorenzo Colitti <lorenzo@google.com> Move SockDiagTest into system/netd/server.

My recollection is that we decided to put unit tests next to
the corresponding code and integration tests into tests/.

Change-Id: I2dc1a074ba8d323253d9be3b2052d6b287bacc15
/system/netd/server/Android.mk
89faa349525ad1110b6fa3f2149e6ef825c65662 26-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Add an RPC to replace a UID firewall rule.

Also add a binder_test that exercises binder RPCs to the real
netd service running on the device

Bug: 21725996
Bug: 27239233
Change-Id: Ic83d81605021a0578d6cd32f889290be61d76125
/system/netd/server/Android.mk
1cfa54374f5ba63d69d6fcca767c4f6647cb6de2 24-Feb-2016 Pierre Imai <imaipi@google.com> Wrap netd's controller to make them usable from other classes

Change-Id: Icb76b43e89c5a9e5806b95002d3653dd99912494
/system/netd/server/Android.mk
e4d626ea35b7a402388b524e2feafc81e6387697 02-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Initial netd binder interface.

In this change:

1. AIDL files for a new, android.net.INetd service, and
corresponding implementation using generated code. For now the
interface is just a prototype: it only has one trivial method.
2. Permission checking code to check for CONNECTIVITY_INTERNAL.
3. Add a Big Netd Lock and provide a wrapper that makes it easy
to ensure that it is taken by every CommandListener command.

Bug: 27239233
Change-Id: I448d0ac233edd0e351a7fe7f13901fb6871683a2
/system/netd/server/Android.mk
8464e1ed13a30ca91ae44dd2e334f63de7ade0f3 04-Feb-2016 Lorenzo Colitti <lorenzo@google.com> Support killing sockets using SOCK_DESTROY.

This gives netd the ability to close sockets on a particular
source IP address using SOCK_DESTROY. It does not yet enable
this behaviour.

The microbenchmark is able to close 500 IPv6 sockets in ~30ms on
my angler. Specifically:

- Scanning 500 socketpairs: ~5ms
- Scanning 500 socketpairs and killing one half of each: ~30ms
- Scanning 500 socketpairs and killing both halves of each: ~40ms

This is about ~2.5x-3.5x slower than SIOCKILLADDR:
- For 500 sockets, it's 9.5ms vs. 22.9ms.
- For 4000 sockets, it's ~40ms vs ~135ms.

A large part of that is due to sending RST packets, which
SIOCKILLADDR does not do. If the kernel is modified so that
SOCK_DESTROY does not send RSTs, the time taken to kill 4000
sockets goes down to ~70ms

Batching the destroy operations does not help much. It saves
5-10%, but it complicates error handling.

Bug: 26976388
Change-Id: I2e1ac30af5dbcdb98dbb7c6e4d4d67c55b9fd00f
/system/netd/server/Android.mk
4e9e23c50a080719f55e54db783f0c2cb130c95b 21-Aug-2015 Tom Cherry <tomcherry@google.com> am 8246d45e: Merge "bundle init.rc contents with its service"

* commit '8246d45e94bfb0ce878f41a01602b7b8d78c40ad':
bundle init.rc contents with its service
c149ef715933f8adeff33f32e323d9e96518332c 14-Aug-2015 Tom Cherry <tomcherry@google.com> bundle init.rc contents with its service

Bug: 23186545
Change-Id: Iab00111d55494def6009c7b6c0da56ecd4b6aa9f
/system/netd/server/Android.mk
42d41d5d43bf99d939ee1d66645cea836241201c 27-Mar-2015 Dan Albert <danalbert@google.com> Remove uses of libcxx.mk.

This is a no-op.

Change-Id: Ic9d3070b7c329d9744ed660e426c5f39704ffccc
/system/netd/server/Android.mk
5407e14fd3d81bb76f94221b4a359faa2806de65 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Update for libbase.""

This reverts commit 4a0ab5ff4a87cfc4a987da99546b01e44875a2e5.

(cherry picked from commit 3e87c785434fdfed2fb00496cb391c411a426bdd)

Change-Id: I042f485f3cc84206766298853491ddd26dbba13f
/system/netd/server/Android.mk
0bad1be08c2eac24231baab2a743b49024032629 16-Mar-2015 Dan Albert <danalbert@google.com> Revert "Revert "Update for libbase.""

This reverts commit 4a0ab5ff4a87cfc4a987da99546b01e44875a2e5.
/system/netd/server/Android.mk
e298ded6ade9744f2a79cae045b5c324886262f4 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> resolved conflicts for merge of 6066d418 to master

Change-Id: I2aa9721365e96c363648dd8e9e15718ed50e3c12
4a0ab5ff4a87cfc4a987da99546b01e44875a2e5 16-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Update for libbase."

Breaks internal master.

This reverts commit b67219a71d1d896bcb34c4a7a797824b88515b2c.

Change-Id: I43145f0724ad2d669b65d20b6fd6ccc44b8f0a4f
/system/netd/server/Android.mk
a4614fe5bfaafd0ff6be60ddb6fd135f99f5a5a5 16-Mar-2015 Vinit Deshpande <vinitd@google.com> Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release'

Change-Id: I51337014e2851f47dd5e183c4bfdf39bafa59942
6d631575749406ad4d69ce14f59910bf5f186deb 15-Mar-2015 Dan Albert <danalbert@google.com> am e3734499: Merge "Update for libbase."

* commit 'e37344992f49c8e0e6e9b816f590afbd00a961ca':
Update for libbase.
b67219a71d1d896bcb34c4a7a797824b88515b2c 14-Mar-2015 Dan Albert <danalbert@google.com> Update for libbase.

StringPrintf and the string based file I/O are being moved to libbase.

Change-Id: I765d9e53f65a76d318d9d0d9503403fc092254d5
/system/netd/server/Android.mk
3667936aadcabddc708797ac38ce1ffb2f992cb3 25-Feb-2015 Lorenzo Colitti <lorenzo@google.com> Add a dummy network that discards all packets.

Bug: 19500693
Change-Id: Ic25f2d8c481f1528e887e43ca3fa868189582110
/system/netd/server/Android.mk
1e05c8b6be8f6ff5771bd18f28ece90015c052ff 03-Feb-2015 Elliott Hughes <enh@google.com> am 561ad8c1: resolved conflicts for merge of c9692899 to lmp-mr1-dev-plus-aosp

* commit '561ad8c1a4fd519a6ae632ea1d414f90e62da95f':
Switch netd over to <utils/file.h>.
d161406141619f84d94b2ecee618569cbbabcb30 03-Feb-2015 Elliott Hughes <enh@google.com> Switch netd over to <utils/file.h>.

Change-Id: Id79961cc4feee1c307dad06d64e3f4ffe060c4da
/system/netd/server/Android.mk
452baaeec66c03e7f581bb9c577bd044239f938b 16-Jan-2015 Jeff Sharkey <jsharkey@android.com> am 732c34ee: am 535b94fa: Merge "Offer to detect non-SSL/TLS network traffic."

* commit '732c34ee7cf9fdd93e8e2aa41bac1df231d9b50b':
Offer to detect non-SSL/TLS network traffic.
fbe497fcd808e4317572ad48c42545105309a347 29-Oct-2014 Jeff Sharkey <jsharkey@android.com> Offer to detect non-SSL/TLS network traffic.

Introduces new module that provides network-related features for
the StrictMode developer API. The first feature offers to detect
sockets sending data not wrapped inside a layer of SSL/TLS
encryption.

This carefully only adds overhead to UIDs that have requested
detection, and it uses CONNMARK to quickly accept/reject packets
from streams that have already been inspected. Detection is done
by looking for a well-known TLS handshake header; it's not future
proof, but it's a good start. Handles both IPv4 and IPv6.

When requested, we also log the triggering packet through NFLOG and
back up to the framework to aid investigation.

Bug: 18335678
Change-Id: Ie8fab785139dfb55a71b6dc7a0f3c75a8408224b
/system/netd/server/Android.mk
67cbbfe38c843e1b6f5afaaa0f3e38cf29676b64 27-Aug-2014 Dan Albert <danalbert@google.com> Need to link libc++ as well as include.

This has been working for the time being because netd has only been
using parts of libc++ that are defined in headers. While updating
libc++, this has changed, and the symptoms of not linking now show.

Bug: 17255369
Change-Id: I17a390e2aff52faba90e7022a6c68a745c1fa74b
/system/netd/server/Android.mk
1604e18615f824adb2d54c36320069ba6fcb4796 20-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Cleanup: Delete dead code.

Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
/system/netd/server/Android.mk
6a773534e7f8541f221f27fb8063af079b1a5936 11-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix tethering in the case of a regular upstream connection.

Fixes tethering via Ethernet, Bluetooth and WiFi (hotspot).

Tethering when the upstream has a DUN-specific APN is likely still broken
(untested).

For now, assign a fixed NetId (a hack) until we can change the framework to
create a valid NetworkAgent and all that jazz.

Bug: 15968336
Bug: 14988803
Change-Id: Idcf4d492d9329a9c87913e27be6dd835a792bea2
/system/netd/server/Android.mk
ed4bd1f7d219f9f5f56763ea02cf4947e78397f6 05-Jul-2014 Sreeram Ramachandran <sreeram@google.com> Fix permissions handling.

+ Rename the permissions as per: http://go/android-multinetwork-routing
+ Make the SYSTEM permission explicitly include NETWORK.
+ Grant the SYSTEM permission to system UIDs by default, but allow the framework
to override them if necessary.
+ Move the "string to permission" parsing to CommandListener.cpp, thus allowing
us to get rid of Permission.cpp.
+ There's no need to support multiple permissions string arguments, so tighten
that up.

Change-Id: I73d51b5e2f44a97e6d5ab5943ff198cebfbcc0c4
/system/netd/server/Android.mk
b1425cc09f8a29350520db0d4f489331df5a689b 24-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Add UID range support to VPNs.

This adds the necessary routing rules.

Future CLs will add the ability to select the right netId for connect(),
setNetworkForSocket(), DNS resolutions, etc.

Bug: 15409918
Change-Id: I88a67660d49cecda834dd72ab947fbfed250f09d
/system/netd/server/Android.mk
4043f01f8e25f24246efadc710ad7440aab75529 23-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Introduce VPN support.

This change sets up the basic routing rules for VPNs. It doesn't yet handle UID
ranges (that are meant to apply to the VPN) correctly. That's forthcoming in
other CLs.

Bug: 15409918
Change-Id: I284de04f176dcf6ba702361de6a614266256d04e
/system/netd/server/Android.mk
f4f6c8de3f091be4b91a5a9d7f14e8882ec6d502 23-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Refactor: Encapsulate permissions and interfaces into a Network class.

Currently, there's a lot of logic in NetworkController surrounding events such
as interface addition/removal, network creation/destruction and default network
change, because these events are interwined. For example, adding an interface
means also adding a corresponding default network rule if the interface is being
added to the current default network.

When we introduce VPNs into this mix, things will get hairy real quick for all
this logic in NetworkController.

In this refactor, we introduce an abstract base class Network which supports
adding and removing interfaces. The main concrete implementation of this is
PhysicalNetwork, which allows setting permissions and "default network" state.

Since we've moved network permissions into the above class, and user permissions
into NetworkController, PermissionsController is unused and has been removed.

Also fix a few bugs in RouteController:
+ Use uidEnd correctly.
+ Check for all error cases in inet_pton.
+ Check the return value of android_fork_execvp() correctly.
+ The "return cmd1() && cmd2()" pattern is wrong. Rewrite that code.

Also (non-functional changes):
+ Remove instantiations of RouteController. It has static methods only.
+ Reorder some blocks in CommandListener so that the most frequent commands are
checked first.
+ Remove unused paramError() and clearNetworkPreference().
+ Change all return codes to int (negative errno) wherever applicable.
+ Add WARN_UNUSED_RESULT everywhere.
+ Cleanup some style in RouteController and NetworkController.
+ Use uid_t instead of unsigned for user IDs.
+ Add clearer log messages at the source of failures.
+ Add a check for when fwmark bits are set without corresponding mask bits.

Bug: 15409918

Change-Id: Ibba78b0850160f9f3d17d476f16331a6db0025d1
/system/netd/server/Android.mk
ddabf95e3ef44d7da607de7b0186ef4eb0690ecf 03-Jun-2014 Sreeram Ramachandran <sreeram@google.com> Remove unnecessary includes.

Neither of these actually does anything.

Change-Id: I82ee09a4565a8e8e4dc5f54f278bf83e002d7387
/system/netd/server/Android.mk
56afacf838d24cf8e54d2cf0d8ab9182ab704125 29-May-2014 Sreeram Ramachandran <sreeram@google.com> Turn on C++11 and make all warnings into errors.

As a consequence:
+ Comment out the names of all unused parameters.
+ Remove all unused variables and functions.

In server/Android.mk, there are a couple of non-trivial changes:
+ Use libcxx instead of stlport. This is needed to fix a bunch of errors due to
specifying -std=c++11.
+ LOCAL_SHARED_LIBRARIES is sorted. Technically, the order in which libraries
are listed has an effect on linking, but nobody should be doing such brittle
things anyway.

Change-Id: I0aff5b745e04609da23144d0e8be4c5694321b8b
/system/netd/server/Android.mk
f4cfad361175a7f9ccf4d41e76a9b289c3c3da22 21-May-2014 Sreeram Ramachandran <sreeram@google.com> Move netd_client into netd.

Change-Id: Ie4b6b303225c93f2448a503d6ea9cebb552cbad5
/system/netd/server/Android.mk