tree: a01f3347417f5998d84a0daaee9e7eefb7ad1205 [path history] [tgz]
  1. bin/
  2. cellular/
  3. client/
  4. dbus/
  5. dbus_bindings/
  6. doc/
  7. ethernet/
  8. init/
  9. mobile_operator_db/
  10. net/
  11. network/
  12. setgid_restrictions/
  13. setuid_restrictions/
  14. shims/
  15. store/
  16. supplicant/
  17. test-scripts/
  18. tmpfiles.d/
  19. udev/
  20. upstart/
  21. vpn/
  22. wifi/
  23. .gitignore
  24. adaptor_interfaces.h
  25. arp_client_test_helper.cc
  26. arp_client_test_helper.h
  27. BUILD.gn
  28. callbacks.h
  29. certificate_file.cc
  30. certificate_file.h
  31. certificate_file_test.cc
  32. connection.cc
  33. connection.h
  34. connection_diagnostics.cc
  35. connection_diagnostics.h
  36. connection_diagnostics_test.cc
  37. connection_test.cc
  38. control_interface.h
  39. daemon_task.cc
  40. daemon_task.h
  41. daemon_task_test.cc
  42. data_types.h
  43. default_profile.cc
  44. default_profile.h
  45. default_profile_test.cc
  46. default_service_observer.h
  47. device.cc
  48. device.h
  49. device_claimer.cc
  50. device_claimer.h
  51. device_claimer_test.cc
  52. device_id.cc
  53. device_id.h
  54. device_id_test.cc
  55. device_info.cc
  56. device_info.h
  57. device_info_test.cc
  58. device_portal_detector_test.cc
  59. device_test.cc
  60. dns_client.cc
  61. dns_client.h
  62. dns_client_test.cc
  63. dns_util.cc
  64. dns_util.h
  65. dns_util_test.cc
  66. eap_credentials.cc
  67. eap_credentials.h
  68. eap_credentials_test.cc
  69. ephemeral_profile.cc
  70. ephemeral_profile.h
  71. error.cc
  72. error.h
  73. error_test.cc
  74. event_dispatcher.cc
  75. event_dispatcher.h
  76. external_task.cc
  77. external_task.h
  78. external_task_test.cc
  79. file_io.cc
  80. file_io.h
  81. geolocation_info.cc
  82. geolocation_info.h
  83. HACKING.md
  84. hook_table.cc
  85. hook_table.h
  86. hook_table_test.cc
  87. http_request.cc
  88. http_request.h
  89. http_request_test.cc
  90. http_url.cc
  91. http_url.h
  92. http_url_fuzzer.cc
  93. http_url_test.cc
  94. icmp.cc
  95. icmp.h
  96. icmp_session.cc
  97. icmp_session.h
  98. icmp_session_test.cc
  99. icmp_test.cc
  100. ipconfig.cc
  101. ipconfig.h
  102. ipconfig_test.cc
  103. logging.cc
  104. logging.h
  105. mac_address.cc
  106. mac_address.h
  107. mac_address_test.cc
  108. manager.cc
  109. manager.h
  110. manager_test.cc
  111. metrics.cc
  112. metrics.h
  113. metrics_test.cc
  114. mock_adaptors.cc
  115. mock_adaptors.h
  116. mock_ares.cc
  117. mock_ares.h
  118. mock_arp_client.cc
  119. mock_arp_client.h
  120. mock_certificate_file.cc
  121. mock_certificate_file.h
  122. mock_connection.cc
  123. mock_connection.h
  124. mock_control.cc
  125. mock_control.h
  126. mock_device.cc
  127. mock_device.h
  128. mock_device_info.cc
  129. mock_device_info.h
  130. mock_dns_client.cc
  131. mock_dns_client.h
  132. mock_eap_credentials.cc
  133. mock_eap_credentials.h
  134. mock_event_dispatcher.cc
  135. mock_event_dispatcher.h
  136. mock_external_task.cc
  137. mock_external_task.h
  138. mock_file_io.h
  139. mock_icmp.cc
  140. mock_icmp.h
  141. mock_icmp_session.cc
  142. mock_icmp_session.h
  143. mock_ipconfig.cc
  144. mock_ipconfig.h
  145. mock_log.cc
  146. mock_log.h
  147. mock_log_test.cc
  148. mock_manager.cc
  149. mock_manager.h
  150. mock_metrics.cc
  151. mock_metrics.h
  152. mock_portal_detector.cc
  153. mock_portal_detector.h
  154. mock_power_manager.cc
  155. mock_power_manager.h
  156. mock_power_manager_proxy.cc
  157. mock_power_manager_proxy.h
  158. mock_process_manager.cc
  159. mock_process_manager.h
  160. mock_profile.cc
  161. mock_profile.h
  162. mock_resolver.cc
  163. mock_resolver.h
  164. mock_routing_table.cc
  165. mock_routing_table.h
  166. mock_service.cc
  167. mock_service.h
  168. mock_throttler.cc
  169. mock_throttler.h
  170. mock_virtual_device.cc
  171. mock_virtual_device.h
  172. mockable.h
  173. NETLINK_MESSAGES.txt
  174. OWNERS
  175. portal_detector.cc
  176. portal_detector.h
  177. portal_detector_test.cc
  178. power_manager.cc
  179. power_manager.h
  180. power_manager_proxy_interface.h
  181. power_manager_test.cc
  182. ppp_daemon.cc
  183. ppp_daemon.h
  184. ppp_daemon_test.cc
  185. ppp_device.cc
  186. ppp_device.h
  187. ppp_device_test.cc
  188. process_manager.cc
  189. process_manager.h
  190. process_manager_test.cc
  191. profile.cc
  192. profile.h
  193. profile_fuzzer.cc
  194. profile_test.cc
  195. protobuf_lite_streams.cc
  196. protobuf_lite_streams.h
  197. provider_db_unittest.bfd
  198. provider_interface.h
  199. README.md
  200. refptr_types.h
  201. resolver.cc
  202. resolver.h
  203. resolver_test.cc
  204. result_aggregator.cc
  205. result_aggregator.h
  206. result_aggregator_test.cc
  207. routing_policy_entry.cc
  208. routing_policy_entry.h
  209. routing_table.cc
  210. routing_table.h
  211. routing_table_entry.cc
  212. routing_table_entry.h
  213. routing_table_test.cc
  214. rpc_task.cc
  215. rpc_task.h
  216. rpc_task_test.cc
  217. scope_logger.cc
  218. scope_logger.h
  219. scope_logger_test.cc
  220. service.cc
  221. service.h
  222. service_fuzzer.cc
  223. service_property_change_test.cc
  224. service_property_change_test.h
  225. service_test.cc
  226. service_under_test.cc
  227. service_under_test.h
  228. shill_ares.cc
  229. shill_ares.h
  230. shill_config.cc
  231. shill_config.h
  232. shill_daemon.cc
  233. shill_daemon.h
  234. shill_main.cc
  235. shill_test_config.cc
  236. shill_test_config.h
  237. static_ip_parameters.cc
  238. static_ip_parameters.h
  239. static_ip_parameters_test.cc
  240. technology.cc
  241. technology.h
  242. technology_fuzzer.cc
  243. technology_test.cc
  244. test_event_dispatcher.h
  245. testing.h
  246. TESTING.md
  247. testrunner.cc
  248. tethering.cc
  249. tethering.h
  250. tethering_manager.cc
  251. tethering_manager.h
  252. throttler.cc
  253. throttler.h
  254. throttler_test.cc
  255. timeout_set.h
  256. timeout_set_test.cc
  257. unblocked_terms.txt
  258. virtual_device.cc
  259. virtual_device.h
  260. virtual_device_test.cc
shill/README.md

Shill

Updated Jan 2022

Packages

The shill directory contains 2 primary packages:

  • shill
  • shill-net

Shill depends on shill-net which is built as a separate package. Building or deploying shill will not also build or deploy shill-net (and vice versa).

e.g. when making changes to code in shill/net it is important to use cros_workon --board=${BOARD} start shill-net and to build and deploy shill-net (in addition to any dependent binaries, e.g. shill or patchpanel).

There are also additional support / utility packages:

  • shill-client
  • shill-dbus-client
  • shill-test-scripts

Architecture

The Architecture document provides an overview of Shill's architecture.

Subsystem Documentation

Overview

Shill is the connection manager for Chrome OS. It is responsible for such functionality as:

  • Setting up network interfaces to behave as desired, which involves:
    • Acquiring link information from the kernel.
    • Handling different logic for different network interface technologies like WiFi, Ethernet, or cellular.
      • For wireless interfaces, there may be many different “connectivity services” that can be connected to (e.g., different 802.11 ESSs within range of the WiFi adapter).
    • Potentially interacting with separate daemons, like wpa_supplicant for WiFi or 802.1X on Ethernet, or ModemManager for cellular, for technology-specific behavior.
    • Acquiring suitable IP configuration parameters, which may involve using DHCP.
  • Persisting relevant user information, such as previously connected networks and associated credentials.
  • Configuring DNS appropriately on the system.
  • Properly handling multiple connected interfaces, including:
    • Prioritizing connected interfaces in a predictable and intuitive manner.
    • Routing traffic to comply with the interface prioritization and ensuring that traffic always goes out of the right interface(s) (traffic may go through multiple interfaces when virtual interfaces are involved).
  • Providing VPN support for:
    • Third-party Chrome extensions that support the third-party VPN interface
    • Android VPN apps (which is primarily taken care of by patchpanel; Shill‘s main responsibility is to ensure that traffic which doesn’t originate in Android and should go through the VPN is sent to ARC rather than directly out of a physical interface).
    • Built-in OpenVPN (a very limited subset; it is recommended that OpenVPN users use an Android VPN app for this) and L2TP/IPsec VPNs.
  • Detecting connectivity issues and trying to determine potential causes.
  • Collecting non-privacy-invasive metrics to allow for a better understanding of user network experience (e.g., which WiFi disconnect reasons are most common? What is the usage of WiFi vs. Ethernet vs. cellular?).

In addition, Shill provides a D-Bus service for use by D-Bus clients. One of the largest clients is Chrome, which provides an actual UI for the underlying network functionality provided by Shill. Chrome both drives some part of Shill state (e.g., a user pressing a Connect button for a WiFi network, which causes Chrome to call the Connect D-Bus method) and reads Shill state (e.g., to display the proper network icon and provide accurate and up-to-date network information). Policy-derived network configuration is also applied to Shill through Chrome.

Brief History

Shill is not the first connection manager that was used on Chrome OS. The first consideration was to use Intel's ConnMan connection manager. Following issues with upstream responsiveness, Chrome OS forked ConnMan into the Flimflam connection manager. A number of remaining issues with the legacy of ConnMan, including a GPL license and a supposedly poor separation of concerns within the project, led to the decision to create a new connection manager and hence Shill was born.

Initially, the intention was for Shill to be D-Bus compatible with Flimflam, allowing for the two to be interchangeable. D-Bus API compatibility with Flimflam is no longer of any interest. Future changes to both the architecture and D-Bus interface of Shill should be made on the basis of suitability to our needs and the maintainability of the project. Ultimately the legacy of ConnMan still lives within Shill to some degree based on that initial decision to design Shill around Flimflam's D-Bus API, and future design decisions must be evaluated with the understanding that the goals and requirements for Shill are not what they were in 2012.

D-Bus Interface Specification

Command Line Interface

Shill is controlled exclusively via D-Bus, and currently (see also b/172222930), there is no proper Command Line Interface for it. Instead, there are a patchwork of scripts and utilities that can be useful in a pinch.

There are a variety of other connectivity-related CLI tools which are useful, even if not directly tied to Shill:

  • iw: tool for interacting with WiFi devices.
  • iproute2: link and routing management tools (such as ip, tc, ss, ...).
  • tcpdump: packet capturing and analysis.
  • iptables, ip6tables: packet filtering utility.
  • ping: generate ICMP traffic.
  • traceroute, traceroute6: tool to track the route taken by IP packets from source to destination.
  • dig: DNS lookup utility.

Some of these CLI utilities (or wrapper helpers) are also available in crosh. See its help_advanced output for info.