summaryrefslogtreecommitdiff
path: root/chromium/components/arc/common/net.mojom
blob: d162a2425640fdbf5ef59aab4e37c9bdde11ea96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Next MinVersion: 9

module arc.mojom;

[Extensible]
enum NetworkResult {
  SUCCESS = 0,
  FAILURE = 1,
};

[Extensible]
enum GetNetworksRequestType {
  CONFIGURED_ONLY = 0,
  VISIBLE_ONLY = 1,
};

[Extensible]
enum ConnectionStateType {
  CONNECTED = 0,
  CONNECTING = 1,
  NOT_CONNECTED = 2,
};

struct VisibleNetworkDetails {
  int32 frequency;
  int32 signal_strength;
  string bssid;
};

struct ConfiguredNetworkDetails {
  string? passphrase;
  bool autoconnect;
};

union NetworkDetails {
  VisibleNetworkDetails visible;
  ConfiguredNetworkDetails configured;
};

[Extensible]
enum IPAddressType {
  IPV4,
  IPV6,
};

struct IPConfiguration {
  string gateway;
  string ip_address;
  array<string> name_servers;
  int32 routing_prefix;
  IPAddressType type;
  string web_proxy_auto_discovery_url;
};

[Extensible]
enum SecurityType {
  NONE,
  WEP_PSK,
  WEP_8021X,
  WPA_PSK,
  WPA_EAP,
};

struct WiFi {
  string bssid;
  int32 frequency;
  string hex_ssid;
  bool hidden_ssid;
  SecurityType security;
  int32 signal_strength;
};

[Extensible]
enum NetworkType {
  CELLULAR,
  ETHERNET,
  VPN,
  WIFI,
  WIMAX,
};

struct NetworkConfiguration {
  // These correspond to ONC properties returned by
  // chrome.networkingPrivate.getProperties().
  // See components/onc/docs/onc_spec.html
  ConnectionStateType connection_state;
  string guid;
  array<IPConfiguration>? ip_configs;
  string? mac_address;
  NetworkType type;
  WiFi? wifi;
};

struct WifiConfiguration {
  // These correspond to ONC properties returned by
  // chrome.networkingPrivate.getNetworks() and createNetwork().
  // See components/onc/docs/onc_spec.html

  // SSID encoded as a series of hex bytes, e.g. "61626364"
  // This allows for handling SSIDs which are not valid UTF-8 strings.
  [MinVersion=2] string? hexssid@6;

  [MinVersion=1] string? guid@5;
  string security@4;

  // Fields specific to either visible or configured networks.
  [MinVersion=2] NetworkDetails? details@7;

  // Deprecated.  These will be removed when both sides support NetworkDetails.
  int32 frequency@1;
  int32 signal_strength@2;
  string bssid@3;

  // Deprecated. |hexssid| will be used, going forward.
  string ssid@0;
};

struct NetworkData {
  NetworkResult status;
  array<WifiConfiguration> networks;
};

struct GetNetworksResponseType {
  NetworkResult status;
  array<NetworkConfiguration> networks;
};

struct AndroidVpnConfiguration {
  // The canonical name of the VPN app (e.g. "com.android.myvpn").
  string app_name@0;

  // The human-readable name of the VPN app (e.g. "OpenVPN").
  string app_label@1;

  // The name of the VPN session, as set by the app using setSession().
  // The app does not need to call setSession() so this may be empty.
  string session_name@2;

  // True if Chrome browser traffic should be sent through the VPN.
  bool tunnel_chrome_traffic@3;

  // The next hop for IPv4 traffic originating on the host.  Currently this
  // will be set to arc0's IP address.
  string ipv4_gateway@4;

  // A list of IPv4 and IPv6 ranges to route through the VPN.  e.g.
  // ["0.0.0.0/0"] or ["192.168.1.0/24", "10.1.0.0/16"].
  array<string> split_include@5;

  // A list of IPv4 and IPv6 ranges to exclude from the VPN.  If specified,
  // all traffic that does not fall into these ranges will use the VPN.
  array<string> split_exclude@6;

  // A list of DNS servers.
  array<string> nameservers@7;

  // A list of search domains for DNS resolution.
  array<string> domains@8;
};

// Next Method ID: 13
interface NetHost {
  // Sends a request to get enabled / disabled status of WiFi.
  GetWifiEnabledState@1() => (bool is_enabled);

  // Sends a request to start scan of WiFi APs.
  [MinVersion=1] StartScan@2();

  // Sends a request to get configured or visible WiFi networks based on the
  // request type.
  [MinVersion=2] GetNetworksDeprecated@3(GetNetworksRequestType type) => (NetworkData data);

  // Sends a request to enable or disable WiFi. The |result| is true when the
  // the state has been successfully set or WiFi is already in the desired
  // state. It is false if WiFi manipulation is prohibited due to a policy or
  // its current state.
  [MinVersion=3] SetWifiEnabledState@4(bool is_enabled) => (bool result);

  // Creates a new network and returns the GUID.  If an error occurs,
  // |guid| will be an empty string.
  [MinVersion=4] CreateNetwork@5(WifiConfiguration cfg) => (string guid);

  // Deletes an existing network.
  [MinVersion=4] ForgetNetwork@6(string guid) => (NetworkResult status);

  // Initiates a network connection.  If called when connected to a different
  // network, it will drop the current connection first.
  [MinVersion=4] StartConnect@7(string guid) => (NetworkResult status);

  // Disconnects from network |guid|.
  [MinVersion=4] StartDisconnect@8(string guid) => (NetworkResult status);

  // Retrieve details (IP, SSID, etc.) about the current network connection.
  [MinVersion=5] GetDefaultNetwork@9() => (
      NetworkConfiguration? logical_default,
      NetworkConfiguration? physical_default);

  // Sends a request to get configured or visible WiFi networks based on the
  // request type.
  [MinVersion=6] GetNetworks@10(GetNetworksRequestType type) =>
      (GetNetworksResponseType response);

  // Inform Chrome OS that a VPN has connected.
  [MinVersion=7] AndroidVpnConnected@11(AndroidVpnConfiguration cfg);

  // Inform Chrome OS that a VPN is disconnected, reconnecting, or reconnected.
  [MinVersion=7] AndroidVpnStateChanged@12(ConnectionStateType state);
};

// Next Method ID: 7
interface NetInstance {
  // DEPRECATED: Please use Init@6 instead.
  InitDeprecated@0(NetHost host_ptr);

  // Establishes full-duplex communication with the host.
  [MinVersion=8] Init@6(NetHost host_ptr) => ();

  // Notifies the instance of a WiFI AP scan being completed.
  [MinVersion=1] ScanCompleted@1();

  [MinVersion=2] DefaultNetworkChanged@2(
      NetworkConfiguration? logical_default,
      NetworkConfiguration? physical_default);

  [MinVersion=3] WifiEnabledStateChanged@3(bool is_enabled);

  // Ask Android to disconnect the VPN, per user request.
  [MinVersion=7] DisconnectAndroidVpn@4();

  // Ask Android to pop up a VPN configuration dialog, per user request.
  [MinVersion=7] ConfigureAndroidVpn@5();
};