Commit 4e626508 authored by Hugo Benichi's avatar Hugo Benichi Committed by Commit Bot

arc: net: update net.mojom's NetworkConfiguration

This patch adds a number of fields to NetworkConfiguration objects
defined in net.mojom in order to pass to ARC information it
currently lacks or infers from the environment:

 - Explictly passing the host IPv4 configuration and DNS addresses:
this effectively replaces the ip_configs field which is both
incovenient to parse on ARC side and not necessary for IPv6 outside of
DNS. Instead it is more straightforward and easier on both sides to
directly pass the IPv4 configuration and IPv4 + IPv6 DNS settings. This
matches better with the interface of android.net.LinkProperties.

- List of DNS search domains: similarly to DNS addresses, ARC should use
the settings set for the host during layer3 provisioning or set
statically. This is important for managed networks and necessary for
resolving "short" hostnames inside ARC. Like DNS addresses, search
domains are aggregated over both v4 and v6 and passed as an explicit
array.

- Static IPv4 configuration for ARC: this replaces the legacy mechanism
of arc-networkd setting the IPv4 address assigned to an Android virtual
network by directly entering the ARC container namespace and setting the
address on Android virtual interface. This is necessary for using ARC's
ArcNetworkService in ARCVM where ns-enter cannot be used.

- MTU value: ARC currently does not set the MTU correctly for network
 with non-standard MTUs (like some cellular networks) and always use a
 default MTU value.

Follow-up patches will start populating these fields.

BUG=b:123431422
BUG=b:143258259
BUG=b:145960788
BUG=crbug:795603
TEST=Compiled

Change-Id: I08dfd5daa9ba2946a847e555bb94a01da3866eb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1959203Reviewed-by: default avatarJorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Queue: Hugo Benichi <hugobenichi@google.com>
Cr-Commit-Position: refs/heads/master@{#739163}
parent ac791f4c
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Next MinVersion: 13
// Next MinVersion: 14
// This file defines the mojo interface between the ARC networking stack and
// Chrome OS. There are three different groups of interactions:
......@@ -205,7 +205,7 @@ struct NetworkConfiguration {
// access through tethering on a metered network.
[MinVersion=8] TetheringClientState tethering_client_state;
// The network interface associated with this network service.
// The name of the network interface on the host.
[MinVersion=10] string? network_interface;
// True if this network is the host default network.
......@@ -213,6 +213,59 @@ struct NetworkConfiguration {
// The name of the shill service associated with this network connection.
[MinVersion=12] string? service_name;
// This is the network MTU value (device kIpConfigsProperty) or the
// native VPN MTU value (service property), or 0 if undefined.
[MinVersion=13] uint32 host_mtu;
// Prefix length of the host IPv4 subnet, or 0 for an IPv6 only network.
[MinVersion=13] uint32 host_ipv4_prefix_length;
// IPv4 address assigned to the host, or empty for an IPv6 only network.
[MinVersion=13] string? host_ipv4_address;
// IPv4 address of the local gateway, or empty for an IPv6 only network.
[MinVersion=13] string? host_ipv4_gateway;
// Prefix length of the host IPv6 subnet, or 0 for an IPv4 only network.
[MinVersion=13] uint32 host_ipv6_prefix_length;
// Global unicast IPv6 addresses assigned to the host, or empty for an IPv4
// only network. The link local address and unique local addresses are
// ignored.
[MinVersion=13] array<string>? host_ipv6_global_addresses;
// IPv6 address of the local gateway, or empty for an IPv4 only network.
[MinVersion=13] string? host_ipv6_gateway;
// All IPv4 and IPv6 addresses of name servers for the network,
// either obtained by DHCPv4, by IPv6 RA RDNSS, or set statically.
[MinVersion=13] array<string>? host_dns_addresses;
// All search domains set for the host for the network, either obtained by
// DHCPv4, by IPv6 RA DNSSL, or set statically. Search domains are set as an
// explicit array of strings instead of a comma separated list embedded into
// a single string.
[MinVersion=13] array<string>? host_search_domains;
// The following four fields specify the static IPv4 configuration for the
// virtual network exposed inside ARC environment by arc-networkd, and
// attached to this host network. These values are defined even if the
// host network is an IPv6 only network.
// Prefix length of the IPv4 subnet assigned to the ARC virtual network.
[MinVersion=13] uint32 arc_ipv4_prefix_length;
// IPv4 address assigned to the ARC guest.
[MinVersion=13] string? arc_ipv4_address;
// IPv4 address of the gateway for the ARC virtual network.
[MinVersion=13] string? arc_ipv4_gateway;
// The name of the network interface matching the virtual interface exposed
// to ARC and associated with the network service. This can be different
// from the name of the real physical interface managed by shill.
[MinVersion=13] string? arc_network_interface;
};
// Describes a Wifi network configuration that ARC has requested the host to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment