summaryrefslogtreecommitdiff
path: root/resolver.h
AgeCommit message (Collapse)Author
2015-09-03License shill to Apache2Peter Qiu
This patch automatically replaced the license on all text files from Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as a reference. The license header was added to .gyp and .gypi, the NOTICE was added with a copy of the Apache2 license and MODULE_LICENSE_* file was added. BUG=23587594 TEST=grep 'Chromium OS Authors' doesn't find anything. Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
2015-06-18shill: Top-level files n-v: Switch pointer/ref spacingPaul Stewart
Switch to Chrome style spacing. BUG=chromium:501026 TEST=Unit tests Change-Id: I8bd6f66ea185ca3a2687986f6f2fd99be957dffe Reviewed-on: https://chromium-review.googlesource.com/278070 Reviewed-by: Rebecca Silberstein <silberst@chromium.org> Commit-Queue: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2014-07-04shill: Fix header guards to conform to coding style.Ben Chan
BUG=chromium:385849 TEST=Tested the following: 1. `USE='cellular wimax' FEATURES=test emerge-$BOARD platform2` 2. `cpplint.py --filter=-build/include_order shill/*.h` reports no 'build/header_guard' issue. Change-Id: I1a3972a1f88e5001550eccd561633bd4e5c5faba Reviewed-on: https://chromium-review.googlesource.com/206680 Reviewed-by: Ben Chan <benchan@chromium.org> Commit-Queue: Ben Chan <benchan@chromium.org> Tested-by: Ben Chan <benchan@chromium.org>
2014-04-10shill: Update to build against libchrome-242728.Ben Chan
BUG=chromium:341521 CQ-DEPEND=CL:193660 TEST=Tested the following: 1. `FEATURES=test USE='cellular wimax' emerge-$BOARD platform2` 2. Run the following tests: - network_3GSmokeTest - network_VPNConnect.* - network_WiMaxSmoke - wifi_matfunc Change-Id: Ic1553c182ab7a833a68c45f012f646b8930cb095 Reviewed-on: https://chromium-review.googlesource.com/193606 Reviewed-by: Ben Chan <benchan@chromium.org> Tested-by: Ben Chan <benchan@chromium.org> Commit-Queue: Ben Chan <benchan@chromium.org>
2013-08-02shill: add some unit tests for ppp dongle supportmukesh agrawal
This is the first in a series of CLs that will provide unit test coverage for code introduced or modified by CL:51356, which added support for PPP dongles. The primary purpose of this CL is to add unit test coverage for the changes made to cellular.cc. (Other files will be covered in other CLs.) While there: - add a PPPDeviceFactory, and a MockPPPDeviceFactory, so that we can force the creation of a Mock in Cellular::StartPPP - add an mm1::MockModemSimpleProxy to CellularTest, so that the PPP tests can use something similar to what we use at runtime - mock out SelectService and UpdateIPConfigFromPPP in MockPPPDevice, so that PPP tests can EXPECT on them - update L2TPIPSecDriverTest.Notify to reflect that SelectService and UpdateIPConfigFromPPP are now mock methods - add some comments in various proxy class headers, to help distinguish between stuff related to old modemmanager and stuff related to new modemmanager - fix a random typo or two BUG=chromium:246826 TEST=new unit tests Change-Id: I5b2d0af0f9beb760d05e802531c0c9bc1ac5a040 Reviewed-on: https://gerrit.chromium.org/gerrit/63937 Tested-by: mukesh agrawal <quiche@chromium.org> Reviewed-by: Thieu Le <thieule@chromium.org> Commit-Queue: mukesh agrawal <quiche@chromium.org>
2013-03-29shill: Revert "shill: resolver: Use (even) smaller DNS timeout"mukesh agrawal
The short DNS timeout was intended to work around an issue with some DNS servers. The belief was that the DNS failure was transient, and that a quick retry would improve DNS lookup times. Field results didn't show any improvement, so back out this change. Note further that, as of M25 stable, Chrome uses its own DNS resolver. That resolver has a fixed one second timeout for the first try, and exponential backoff thereafter. Consequently, if this code remained in the tree, this code would only affect system processes. BUG=chromium:220150 TEST=unit tests This reverts commit bf667617d573e3af4b808ed317b1d6ca04747ee4. Conflicts: connection.cc connection_unittest.cc default_profile_unittest.cc manager.cc manager.h mock_resolver.h resolver.cc resolver.h resolver_unittest.cc Change-Id: Ic96c6c014a973de441ab1771539a0d9f3d5c5967 Reviewed-on: https://gerrit.chromium.org/gerrit/46944 Reviewed-by: Paul Stewart <pstew@chromium.org> Commit-Queue: mukesh agrawal <quiche@chromium.org> Tested-by: mukesh agrawal <quiche@chromium.org>
2013-03-15shill: Implement Service.Remove & delete DHCP leasesAlbert Chaulk
Implement the Service.Remove dbus API and modify the unload sequence to remove the DHCP lease file. Add unit tests to DHCPProvider & WiFiService to check lease file deletion. Currently only WiFi does the DHCP lease delete from DBus - WiMax/Cell/VPN do their own things for IP configuration and Ethernet can't be removed as per the API spec. Also make sure FilePath is qualified as base::FilePath throughout the project. BUG=chromium-os:32756 TEST=added unittests to test the call path on Unload() to delete the lease file Change-Id: Ic6eee17b9d81cd0be8d09c683d85d6a4d19278c9 Reviewed-on: https://gerrit.chromium.org/gerrit/44339 Tested-by: Albert Chaulk <achaulk@chromium.org> Reviewed-by: mukesh agrawal <quiche@chromium.org> Commit-Queue: Albert Chaulk <achaulk@chromium.org>
2012-09-21shill: Ignore certan DNS search pathsPaul Stewart
Add a manager property to provide a list of DNS Search paths that should be ignored when applying DHCP parameters. This covers a list of DNS search suffixes that are popularly provided, but are generally unlikely to provide any useful results, therefore significantly reducing DNS lookup performance. BUG=chromium-os:34495 TEST=Unit-tests + Manual: Add a domain to the default search list and make sure it is filtered from the "search" line in resolv.conf. CQ-DEPENDS: I54bdd33a05bb704d8c3ff05f71e034fe42635e89 Change-Id: Id92b39f1ad0ae64b3ff50c7671cdf388d92a07af Reviewed-on: https://gerrit.chromium.org/gerrit/33460 Reviewed-by: Christopher Wiley <wiley@chromium.org> Reviewed-by: mukesh agrawal <quiche@chromium.org> Commit-Ready: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2012-09-11shill: Connection: Don't call Resolver::SetDNSFromIPConfigPaul Stewart
Don't ever call this function (in fact, remove this from the resolver), and refactor the code that correctly generates the DNS search list so that it is usable both from Connection::UpdateFromIPConfig() and from void Connection::SetIsDefault(). BUG=chromium-os:34260 TEST=Rerun unit tests + Manual: Connect to AP that supplies only "DomainName", and ensure that /etc/resolv.conf contains this domain in the search field both initially and after DHCP renewal. Change-Id: I9a0705cb54e6588915533cc343b05efcdee71293 Reviewed-on: https://gerrit.chromium.org/gerrit/32996 Reviewed-by: mukesh agrawal <quiche@chromium.org> Commit-Ready: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2012-08-07shill: resolver: Use (even) smaller DNS timeoutPaul Stewart
Use the new glibc facility for sub-second timeouts, and choose 300 milliseconds for the timeout. However, only do this by default for Ethernet and WiFi networks, since VPN networks in particular have trouble with this configuration (due to many name servers and search domains, as well as the additional latency inherent to such networks). Also, increase the number of attempts, so we still spend a reasonable amount of time overall waiting for a DNS response. Provide a means to change which technologies are setup in this manner. BUG=chromium-os:29124 TEST=Manual: Install connection manager, verify via strace that gethostbyname now waits 300 ms, and retries 15 times per trial (*). Ensure Chromium continues to work correctly under light loads. Also, connect via Verizon and VPN and ensure DNS parameters are back to the long timeout. List manager properties and ensure it says "ethernet,wifi" for ShortDNSTimeoutTechnologies and that this is saved out to the profile. New unit tests. CQ-DEPENDS=Ib9ffc59bbfcd5bf3f57d146965c5a43a936348f8 *: Each trial consists of a nameserver / IP address pair, so for example, if we have IPv6 connectivity and have two "server" entries in resolv.conf, we first do 30 tries of IPv6 requests, alternating between the two servers, then another 30 alternating IPv4 requests between them. This was tested by intentionally making the DNS server unreachable and instrumenting the gethostbyname request via strace. Change-Id: Idd331b4a9fcf96d457ab9959537aefcb86328e12 Reviewed-on: https://gerrit.chromium.org/gerrit/26493 Commit-Ready: Paul Stewart <pstew@chromium.org> Reviewed-by: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2011-12-01shill: cleaning glint warningsHristo Stefanov
The typical warnings addressed include a lot of missing includes and missing argument names. About 30 files edited in total. Cpplint was the actual lint being run. BUG=chromium-os:15873 TEST=Ran all the unit tests. Change-Id: I64a8b76cd8f94c7729743b76b41a956f1b7370cf Reviewed-on: https://gerrit.chromium.org/gerrit/12253 Commit-Ready: Hristo Stefanov <hstefanov@chromium.org> Reviewed-by: Hristo Stefanov <hstefanov@chromium.org> Tested-by: Hristo Stefanov <hstefanov@chromium.org>
2011-08-16shill: Add connection classPaul Stewart
The connection class represents the snapshot of connectivity state, including routing, address information and addressing. It is able to apply itself as the "default" connection, by setting routing table metrics and DNS resolver files. BUG=chromium-os:19095 TEST=New unittest Change-Id: I7021867ed8a8559db0e84f58a72692abaf105cad Reviewed-on: http://gerrit.chromium.org/gerrit/5938 Reviewed-by: Chris Masone <cmasone@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2011-08-10Move away from SingletonPaul Stewart
Move from Singleton to LazyInstance for one-of classes in Shill. This will allow them to be subclassed (mocked). BUG=chromium-os:18986 TEST=Re-run unit tests Change-Id: I83320694db5df1a263332315ad4f6955b107280b Reviewed-on: http://gerrit.chromium.org/gerrit/5676 Reviewed-by: Darin Petkov <petkov@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>
2011-08-08shill: Add singleton to output resolver filesPaul Stewart
Output a file that can be linked to "resolv.conf" from the contents of an ipconfig file. BUG=chromium-os:17278 TEST=New unittest Change-Id: Ic537dda6f1cb337d631bc75a3aaa835312ce8c01 Reviewed-on: http://gerrit.chromium.org/gerrit/5399 Reviewed-by: Paul Stewart <pstew@chromium.org> Tested-by: Paul Stewart <pstew@chromium.org>