1// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4//
5// Sync protocol datatype extension for Wi-Fi configuration items.
6
7// If you change or add any fields in this file, update proto_visitors.h and
8// potentially proto_enum_conversions.{h, cc}.
9
10syntax = "proto2";
11
12option java_multiple_files = true;
13option java_package = "org.chromium.components.sync.protocol";
14
15option optimize_for = LITE_RUNTIME;
16
17package sync_pb;
18
19message WifiConfigurationSpecifics {
20  // SSID encoded to hex, letters should be upper case and 0x prefix should be
21  // omitted. For example, ssid "network" would be provided as "6E6574776F726B".
22  optional bytes hex_ssid = 1;
23  enum SecurityType {
24    SECURITY_TYPE_UNSPECIFIED = 0;
25    SECURITY_TYPE_NONE = 1;
26    SECURITY_TYPE_WEP = 2;
27    SECURITY_TYPE_PSK = 3;  // WPA-PSK or RSN-PSK
28  }
29  optional SecurityType security_type = 2;
30  // The passphrase can be ASCII, UTF-8, or a string of hex digits.
31  optional bytes passphrase = 3;
32  enum AutomaticallyConnectOption {
33    AUTOMATICALLY_CONNECT_UNSPECIFIED = 0;
34    AUTOMATICALLY_CONNECT_DISABLED = 1;
35    AUTOMATICALLY_CONNECT_ENABLED = 2;
36  }
37  optional AutomaticallyConnectOption automatically_connect = 4;
38  enum IsPreferredOption {
39    IS_PREFERRED_UNSPECIFIED = 0;
40    IS_PREFERRED_DISABLED = 1;
41    IS_PREFERRED_ENABLED = 2;
42  }
43  optional IsPreferredOption is_preferred = 5;
44  enum MeteredOption {
45    METERED_OPTION_UNSPECIFIED = 0;
46    METERED_OPTION_NO = 1;
47    METERED_OPTION_YES = 2;
48    // Allows the device to use heuristics to determine if network is metered.
49    METERED_OPTION_AUTO = 3;
50  }
51  optional MeteredOption metered = 6;
52  message ProxyConfiguration {
53    enum ProxyOption {
54      PROXY_OPTION_UNSPECIFIED = 0;
55      PROXY_OPTION_DISABLED = 1;
56      // Use a Proxy Auto-config(PAC) Url, set in proxy_url
57      PROXY_OPTION_AUTOMATIC = 2;
58      // Uses Web Proxy Auto-Discovery Protocol (WPAD) to discover the proxy
59      // settings using DHCP/DNS.
60      PROXY_OPTION_AUTODISCOVERY = 3;
61      // User sets details in manual_proxy_configuration.
62      PROXY_OPTION_MANUAL = 4;
63    }
64    optional ProxyOption proxy_option = 1;
65    // Only set if PROXY_OPTION_AUTOMATIC.
66    optional string autoconfiguration_url = 2;
67    message ManualProxyConfiguration {
68      optional string http_proxy_url = 1;
69      optional int32 http_proxy_port = 2;
70      optional string secure_http_proxy_url = 3;
71      optional int32 secure_http_proxy_port = 4;
72      optional string socks_host_url = 5;
73      optional int32 socks_host_port = 6;
74      repeated string excluded_domains = 7;
75    }
76    // Only set if PROXY_OPTION_MANUAL.
77    optional ManualProxyConfiguration manual_proxy_configuration = 3;
78  }
79  optional ProxyConfiguration proxy_configuration = 7;
80  enum DnsOption {
81    DNS_OPTION_UNSPECIFIED = 0;
82    DNS_OPTION_DEFAULT_DHCP = 1;
83    DNS_OPTION_CUSTOM = 2;
84  }
85  optional DnsOption dns_option = 10;
86  // List of DNS servers to be used when set to DNS_OPTION_CUSTOM.  Up to 4.
87  repeated string custom_dns = 8;
88  // The last time this configuration was connected to before being synced.  It
89  // will only be updated when the configuration is changed. This is represented
90  // with the UNIX timestamp, ms since epoch.
91  optional int64 last_connected_timestamp = 9;
92}
93