// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module ash.diagnostics.mojom;
// Contains IP config properties for a single network connection.
struct IPConfigProperties {
array<string>? name_servers;
int32 routing_prefix;
string? gateway;
string? ip_address;
};
// Ethernet Authentication types.
enum AuthenticationType {
kNone,
k8021x,
};
// Connection state of visible networks.
enum NetworkState {
kOnline,
kConnected,
kPortal,
kConnecting,
kNotConnected,
kDisabled,
};
// The network technology type.
enum NetworkType {
kCellular,
kEthernet,
kWiFi,
kUnsupported,
};
// The roaming status of the cellular modem on the current network.
enum RoamingState {
kNone,
kRoaming,
kHome,
};
// Specifies the type of SIM lock in effect.
enum LockType {
kNone,
kSimPin,
kSimPuk,
kNetworkPin,
};
struct CellularStateProperties {
// The Integrated Circuit Card Identifier of the SIM card installed in the
// device.
string iccid;
// The Embedded Universal Integrated Circuit Card Identifier of the eSIM card
// installed in the device.
string eid;
// The network technology currently in use (EDGE, LTE, etc).
string network_technology;
// True when in a roaming state and the provider is not always roaming.
bool roaming;
RoamingState roaming_state;
// The current signal strength for this network in the range [0, 100].
int32 signal_strength;
// True when a SIM is present and locked.
bool sim_locked;
LockType lock_type;
};
struct EthernetStateProperties {
AuthenticationType authentication;
};
// The security type for WiFi Ethernet networks.
enum SecurityType {
kNone,
kWep8021x,
kWepPsk,
kWpaEap,
kWpaPsk,
};
// Contains network properties related to WiFi connections.
struct WiFiStateProperties {
// Indicates the signal strength of the service. This is a normalized value
// between 0 and 100.
int32 signal_strength;
int32 frequency;
string ssid;
string bssid;
SecurityType security;
};
// Contains network properties specific to a network type.
union NetworkTypeProperties {
CellularStateProperties cellular;
EthernetStateProperties ethernet;
WiFiStateProperties wifi;
};
// Contains information for a single network connection and underlying
// network technology.
struct Network {
NetworkState state;
NetworkType type;
NetworkTypeProperties? type_properties;
string observer_guid;
string name;
// May be null if no MAC address is available for the network's
// corresponding device.
string? mac_address;
IPConfigProperties? ip_config;
};
// Implemented by clients that wish to receive a list of guids representing
// active networks as well as the guid for the network that is currently
// online.
interface NetworkListObserver {
// Fired when the list of active networks provided by CrosNetworkConfig
// changes.
OnNetworkListChanged(array<string> network_guids, string active_guid);
};
// Implemented by clients that wish to receive updates for an active network.
interface NetworkStateObserver {
// Fired for each active guid provided by OnNetworkListChanged. Provides
// information for a single network and underlying network technology.
OnNetworkStateChanged(Network network);
};
// Enables clients to receive networking information for WiFi, Ethernet,
// and Cellular connections. Implemented in the browser process and called
// by the Diagnostics SWA (a renderer process).
interface NetworkHealthProvider {
// Registers an observer to be notified on changes to active networks.
ObserveNetworkList(pending_remote<NetworkListObserver> observer);
// Registers an observer to be notified on changes to an active network.
ObserveNetwork(pending_remote<NetworkStateObserver> observer, string guid);
};