Commit Graph

73 Commits

Author SHA1 Message Date
Luke Huang
fbd8ecfe17 Correct buffer size limitation for DnsResolver API
Bug: 131055651
Test: atest DnsResolverTest
Change-Id: I29decd480172eacb452ccb0da524ef1bf2ffadcf
2019-05-02 11:48:54 +08:00
Luke Huang
81cec00c55 API council feedbacks for DnsResolver
To address the API review feedback provided by
the API council.

Bug: 129261432
Test: atest DnsResolverTest
Change-Id: I3de11c913682abf790850b45cd5d50ac28b3fc5c
2019-04-11 22:17:20 +08:00
paulhu
fd7c030082 Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods
were added there because they could not be added as JNI inside
the NetworkStack. This was not possible because on Go devices,
the NetworkStack was a jar library. But now, Go also uses an APK.
Hence, move these methods to the NetworkStack.

Change-Id: I1d88a0f0be23f2b15d5103fa092b9bf982329d7c
Fix: 129433183
Test: atest NetworkStackTests FrameworksNetTests
2019-04-03 17:49:36 +08:00
Luke Huang
e17bb2dff4 Fix cancellation race problem for aysnc DNS API
This problem might cause double-close fd and result in app crash
or unexpected behaviour

Bug: 129317069
Test: atest DnsResolverTest
      manual test with delaying response callback/cancel
Change-Id: I223234f527edafc51d34fa6be390419c05def8d8
2019-03-28 19:46:56 +08:00
Luke Huang
b1cf5aaf06 Support query cancellation for async DNS API
Bug: 124882626
Test: built, flashed, booted
      atest DnsResolverTest DnsPacketTest

Change-Id: Iaa72f5c17f58cf0a58663b892bb18cfdf23cd545
2019-03-16 18:53:09 +08:00
markchien
e5591ce2fa [KA03] Support tcp keepalive offload
When offload is starting, socket will be switched to repair
mode. Read and write on the socket will not be allowed until
repair mode is turned off. If remote packet arrives, repair
mode will be turned off automatically and a callback will
be raised to indicate that socket is ready to read from.

Bug: 114151147
Test: -atest FrameworksNetTests
      -manual

Change-Id: I0c335865912e183e7ad32a8ea12188f02ccde5fd
2019-02-06 12:22:22 +09:00
Luke Huang
4e5831aecc Add jni method for DnsResolver
Test: built, flashed, booted
      atest DnsResolverTest

Change-Id: Iff730ec918f4db1ba0216f90a12550fe26e271d0
2019-01-23 00:07:43 +08:00
Remi NGUYEN VAN
029434e9ac Add util to add an ARP table entry
This is to be used by the new DhcpServer to add ARP entries with new
addresses before sending unicast responses.

Test: manual: cat /proc/net/arp with implementation based on this
Bug: b/109584964
Change-Id: I3559893583aa3c49b188ad689a41ee2f3e9d9bf3
2018-08-23 16:01:44 +09:00
Steven Moreland
b9e50d94d1 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
Erik Kline
63c2cd962a Have IpManager track L2-L4 signaling traffic required for IP connectivity.
am: 929ed666b5

Change-Id: Ie95309464d8f368f5040c74b59daba9700191e86
2016-12-15 10:13:36 +00:00
Erik Kline
929ed666b5 Have IpManager track L2-L4 signaling traffic required for IP connectivity.
Test: as follows
    - built and flashed
    - observed logcat
    - observed "dumpsys wifi ipmanager"
    - runtest BlockingSocketReaderTest passes
    - runtest ConnectivityPacketSummaryTest passes
Bug: 21859053
Bug: 26101306
Bug: 31742572
Bug: 31707128
Bug: 33531488

Change-Id: Ibecaf809dcc1813924b25749e8ba8eb2d4bdf114
2016-12-15 17:16:48 +09:00
Erik Kline
78bf01826a Basic IPv6 Router Advertisement daemon
am: 1a1cb0e914

Change-Id: I242eb8e932581a537a47f31e3f16c7e776da91cf
2016-07-11 10:38:49 +00:00
Erik Kline
1a1cb0e914 Basic IPv6 Router Advertisement daemon
Bug: 9580643
Change-Id: Iebd4d1f694699ffd4daf7d71e9b9d8f49e9b632f
2016-07-11 18:37:25 +09:00
Elliott Hughes
bdd12ec7b3 resolve merge conflicts of bc90502 to nyc-dev-plus-aosp
Change-Id: Ic78042d45085718b2220107e9a84767df316440a
2016-05-13 08:57:40 -07:00
Elliott Hughes
9d18567aeb Make android_net_NetUtils include what it actually uses.
Bug: http://b/28519060
Change-Id: I49dcd358d3fc8e0ba5c5e0b50a0f5dcc63281d22
2016-05-11 15:18:13 -07:00
Lorenzo Colitti
d8332d1a1b Remove framework code that calls SIOCKILLADDR
Bug: 26976388
Change-Id: I652361d9e650a77085070d6c26b28b7638ba2dfe
2016-03-22 12:54:32 +09:00
Paul Jensen
9eca1f6072 Have ConnectivityService install packet filters when possible
Listen for ICMP6 router advertisements on networks that support
packet filters.  Construct packet filters and install them to
ignore redundant future ICMP6 router advertisements.

Bug: 26238573
Change-Id: If78300b9fda257c21f3ee6533e1da7de9f897cb4
2016-03-03 17:32:01 +09:00
Erik Kline
af0170a562 Delete all NetworkUtils DHCP-related code.
Bug: 26991160
Change-Id: I2c74e0161f43f65c1b6a85dc9f294b64c8f1ae6e
2016-02-22 15:14:31 +09:00
Elliott Hughes
830ed7c82f resolved conflicts for a884d81e to stage-aosp-master
Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
2015-09-24 10:01:32 -07:00
Daniel Micay
b4dd27d4cf constify JNINativeMethod function pointer tables
Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
2015-09-22 17:10:35 -04:00
Paul Jensen
db93dd93c5 Query HTTP proxy for network via a new API to avoid permissions exceptions
Add @hidden ConnectivityManager.getProxyForNetwork() API.

Bug:20470604
Change-Id: I6a9bc4afc8273bc43b14cdeccfedbbf3ff66be40
2015-05-18 17:05:51 +00:00
Prerepa Viswanadham
9dd7ce3ca2 Merge commit 'e593d0a' into merge_work
Change-Id: I4f8ae40fc446cd9cda4d5c6ec99469a98dda595b
2015-04-10 15:58:10 -07:00
Paul Jensen
ee2f45d85f Deprecate static ConnectivityManager.get/setProcessDefaultNetwork() functions.
These functions risk hitting an unchecked Exception due to ConnectivityManager
not being instantiated yet.  Also, change Network.openConnection() to throw a
checked Exception rather than an unchecked Exception when ConnectivityManager
is not yet instantiated.

bug:19416463
Change-Id: Ie1e2b3238aec0343d267c76b64927073f2f05f85
2015-04-02 14:03:43 +00:00
Lorenzo Colitti
06b991f444 DHCP: Add a native method for making a DHCP socket.
Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be
2015-03-20 16:32:35 +09:00
Erik Kline
d687dc5da9 Fix missing printf argument.
Change-Id: Ifd1eebfbcefa06570882da54a1c410eabf26bce7
2015-03-18 08:41:42 +09:00
Erik Kline
94500b2aae Fix missing printf argument.
Change-Id: Ifd1eebfbcefa06570882da54a1c410eabf26bce7
2015-03-18 08:08:57 +09:00
Lorenzo Colitti
c70fbac892 DHCP: Add a native method for making a DHCP socket.
Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be
2015-03-16 20:08:45 +09:00
Vinit Deshpande
8d1c3be573 am "Refactor NetworkUtils interaction with DHCP."
merged from goog/mirror-m-wireless-internal-release
9def7be Refactor NetworkUtils interaction with DHCP.
2015-03-15 13:40:27 -07:00
Erik Kline
9def7be67d Refactor NetworkUtils interaction with DHCP.
Separate out starting DHCP (DISCOVER) and RENEW operations from fetching
the results.  Add NetworkUtils.getDhcpResults(), to enable quick checks
of any available DhcpResults without extraneous interaction with the
DHCP daemon.

Bug: 19422416
Change-Id: I58808e529dda8429737e749f5caef56d923c0809
2015-03-02 12:35:35 +09:00
Narayan Kamath
0620227e62 Remove hardcoded include paths.
ICU, zlib & openssl export them using LOCAL_EXPORT_C_INCLUDE_DIRS.
The dependency on libc/dns/include was bogus and can be removed
trivially.

bug: 18581021
Change-Id: I4b8047ff0df1050ab48b61c0c886888b3f2f0c18
2014-12-31 10:06:51 +00:00
Andreas Gampe
bc7c99de7a Frameworks/base: Replace LOG_FATAL_IF in core/jni
Do not use LOG_FATAL_IF in JNI setup. This is one-time on startup
and important enough to always check.

Add a header with common helper definitions. Move to inlined functions
instead of macros to clean up the code.

Change-Id: Ib12d0eed61b110c45d748e80ec36c563e9dec7e5
2014-11-19 09:21:12 -08:00
Lorenzo Colitti
45aca20cd7 Rework the per-network URL API.
This addresses API council comments.

Bug: 17112978
Change-Id: I698b243b2b685d1f25414cee72450be3ae0c2bf0
2014-08-21 19:09:27 -07:00
Lorenzo Colitti
ef734f8a3b Stop using LinkProperties for static configuration.
LinkProperties can represent way more complicated configurations
than what we can actually apply to interfaces. This makes it
error-prone to use it to represent static configuration, both
when trying to apply configuration coming from LinkProperties
and when trying to save configuration from current
LinkProperties.

Instead, move static configuration (IPv4 only, since we don't
support static IPv6 configuration) into a separate
StaticIpConfiguration class.

Bug: 16114392
Bug: 16893413
Change-Id: Ib33f35c004e30b6067bb20235ffa43c247d174df
2014-08-19 11:59:43 -07:00
Sreeram Ramachandran
c06ec73149 Cleanup: Delete dead code.
Bug: 15413389
Change-Id: I315468832ef18ffc84174e54774ab63b86d284dc
2014-07-22 15:46:34 -07:00
Sreeram Ramachandran
b5ae69d410 Remove unnecessary code and APIs.
This stuff has been replaced by setNetworkForUser() in NetdClient.

Change-Id: If525ee259b74314191d1913f7c2a3e828e05c38f
2014-07-11 18:16:04 -07:00
Paul Jensen
65743a26ad Define NETID_UNSET in ConnectivityManager.
This allows some cleanup and removal of dead code.

bug:15489928
Change-Id: Iaf0507bc2e8ec6dcc253f01f61c5b221d46581f9
2014-07-11 12:00:10 -04:00
Paul Jensen
8b5fc62d12 Convert Vpn from NetworkStateTracker to NetworkAgent.
This eliminates the need for the ConnectivityService.VpnCallback class.
This requires shifting VPNs to the new "network" netd API.
VpnService.protect() is modified to no longer go through ConnectivityService.
NetworkCapabilities is extended to add a transport type for VPNs and a
capability requiring a non-VPN (so the default NetworkRequest isn't satisfied
by a VPN).

bug:15409918
Change-Id: Ic4498f1961582208add6f375ad16ce376ee9eb95
2014-07-10 20:39:33 +00:00
Paul Jensen
10ba60a4a1 Use return values from JNI functions binding sockets and processes to networks.
bug:15757549
Change-Id: If23b14febc923b9a0348f0cf9029fd4bf6e8d725
2014-06-26 16:33:58 +00:00
Paul Jensen
9e66e88160 Implement bind-to-network functionality of android.net.Network.
This is implemented by calling through to netd_client.
Included are functions to bind-to-network-for-process strictly for DNS to
facilitate startUsingNetworkFeature() reimplementation.

Change-Id: Ib22c7d02ea81d251bdfeeb0f64a47ce32eefcb1b
2014-05-22 04:16:54 +00:00
Vinit Deshapnde
e0fac27d4d Use a single socket to communicate with supplicant
This helps to prepare for future updates from external sources.

Bug: 9298955

Change-Id: I4c63ad5fc1ea3564aab38cfce955de19bad75c0c
(cherry picked from commit fb40801ed8c217ae01082fb1cbd0c30bbf5532ac)
2013-08-08 18:38:53 +00:00
Dmitry Shmidt
1a16846646 dhcp: Get mtu property from dhcp results
Change-Id: I1b032094e0945b27d98f7ac786247b7cc9d60131
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2013-08-02 14:07:50 -07:00
Chad Brubaker
3f3b4e6462 Add NetworkUtil function for marking sockets
Add NetworkUtil function for setting the SO_MARK field of sockets

Change-Id: I94389b64296d87ee928293f24a26f8dd08c3bf37
2013-07-12 19:48:32 +00:00
Robert Greenwalt
0c0db62a64 Don't update routes if Dhcp fails.
bug:8377625
Change-Id: I11d2c29728078813bfb1245cc46e8cce2b307a2c
2013-03-15 10:48:46 -07:00
Robert Greenwalt
72e2243b31 Up our DNS server support from 2 > 4
bug:5958524
Change-Id: I81a9d9293049bcfc16c15ee856887aa7ed076638
2013-01-11 09:47:46 -08:00
Robert Greenwalt
cd2778578b Support for dns domain.
bug:6799630
Change-Id: I10070eddb65b7b60f0bc2b3e1e320e1aa4ec6e98
2012-11-16 11:25:32 -08:00
Robert Greenwalt
462e5705c8 Remove DhcpInfoInternal
First step in accepting a set of patches.
bug:6799630

Change-Id: I6c894c60aeb3022960c2aaa45451bb1dde2b493b
2012-11-09 09:46:32 -08:00
Jeff Sharkey
d6075598cb Pipe DHCP vendor info towards framework.
Bug: 6344821
Change-Id: Ifb9a93c995f4d70f4ae2aa03b7e21f13013ef3b6
2012-04-18 21:55:14 -07:00
Steve Block
1be767cf74 Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156016

Bug: 5449033
Change-Id: I4c4e33bb9df3e39e11cd985e193e6fbab4635298
2012-01-03 22:38:27 +00:00
Wink Saville
620e1078ec resolved conflicts for merge of a3b4b5ca to master
Change-Id: I50f8fe61303efa78f5d450ddda1483e0ecb81d12
2011-07-08 12:49:14 -07:00
Wink Saville
c101c56ecc Use resetConnections with resetMask.
Bug: 4981919
Change-Id: I5dec2da0756d5083bc81494fd583672704537694
2011-07-07 16:17:06 -07:00