Merge branch 'merge-system_api-rewrite' into merge-system_api
BUG=chromium:874735
Change-Id: I5a2fda75f04aefb94fa11d05a987fea04b4ded59
Cr-Mirrored-From: https://chromium.googlesource.com/chromiumos/platform2
Cr-Mirrored-Commit: dbe3ac000d5a270cad816d917ed2f357412259c8
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..d6ec73d
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/MODULE_LICENSE_BSD b/MODULE_LICENSE_BSD
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/MODULE_LICENSE_BSD
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..92015c0
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,7 @@
+set noparent
+
+# Please get a review from someone who's knowledgeable (per commit history)
+# about the component whose constants you're changing.
+derat@chromium.org
+vapier@chromium.org
+benchan@chromium.org
diff --git a/README b/README
new file mode 100644
index 0000000..0347fe7
--- /dev/null
+++ b/README
@@ -0,0 +1,19 @@
+This repository (system_api.git) contains constants and definitions like
+D-Bus service names that are shared between Chromium and Chromium OS.
+
+This repository is only for things like headers and .proto files.
+No implementation should be added.
+
+When writting a .proto file make sure to use:
+"option optimize_for = LITE_RUNTIME;"
+
+This will force usage of a lite protobuf instead of a full/heavy weight
+protobuf. The browser only links against the light version, so you will get
+cryptic link errors about missing parts of Message if you define a protobuf here
+and then try to use it in Chrome. Currently CrOS links against the full
+protobuffer library, but that might change in the future.
+
+When declaring a protobuf, avoid use of required unless it is exactly what you
+mean. "Required is Forever" and very rarely should actually be used. Consult
+http://code.google.com/apis/protocolbuffers/docs/cpptutorial.html for a detailed
+of this issue.
\ No newline at end of file
diff --git a/constants/cryptohome.h b/constants/cryptohome.h
new file mode 100644
index 0000000..8238aa9
--- /dev/null
+++ b/constants/cryptohome.h
@@ -0,0 +1,17 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONSTANTS_CRYPTOHOME_H_
+#define CONSTANTS_CRYPTOHOME_H_
+
+#include <stdint.h>
+
+namespace cryptohome {
+
+// Cleanup is trigerred if the amount of free disk space goes below this value.
+const int64_t kMinFreeSpaceInBytes = 512 * 1LL << 20;
+
+} // namespace cryptohome
+
+#endif // CONSTANTS_CRYPTOHOME_H_
diff --git a/dbus/apmanager/dbus-constants.h b/dbus/apmanager/dbus-constants.h
new file mode 100644
index 0000000..96d180d
--- /dev/null
+++ b/dbus/apmanager/dbus-constants.h
@@ -0,0 +1,62 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_APMANAGER_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_APMANAGER_DBUS_CONSTANTS_H_
+
+namespace apmanager {
+const char kServiceName[] = "org.chromium.apmanager";
+const char kManagerInterface[] = "org.chromium.apmanager.Manager";
+const char kManagerPath[] = "/manager";
+const char kManagerError[] = "org.chromium.apmanager.Manager.Error";
+const char kServiceInterface[] = "org.chromium.apmanager.Service";
+const char kServiceError[] = "org.chromium.apmanager.Service.Error";
+const char kConfigInterface[] = "org.chromium.apmanager.Config";
+const char kConfigError[] = "org.chromium.apmanager.Config.Error";
+const char kClientInterface[] = "org.chromium.apmanager.Client";
+const char kDeviceInterface[] = "org.chromium.apmanager.Device";
+
+// Manager Methods.
+const char kCreateServiceMethod[] = "CreateService";
+const char kRemoveServiceMethod[] = "RemoveService";
+
+// Config Properties.
+const char kConfigSSIDProperty[] = "Ssid";
+const char kConfigInterfaceNameProperty[] = "InterfaceName";
+const char kConfigSecurityModeProperty[] = "SecurityMode";
+const char kConfigPassphraseProperty[] = "Passphrase";
+const char kConfigHwModeProperty[] = "HwMode";
+const char kConfigOperationModeProperty[] = "OperationMode";
+const char kConfigChannelProperty[] = "Channel";
+const char kConfigHiddenNetworkProperty[] = "HiddenNetwork";
+const char kConfigBridgeInterfaceProperty[] = "BridgeInterface";
+const char kConfigServerAddressIndexProperty[] = "ServerAddressIndex";
+
+// Security modes.
+const char kSecurityModeNone[] = "none";
+const char kSecurityModeRSN[] = "rsn";
+
+// Hardware modes.
+const char kHwMode80211a[] = "802.11a";
+const char kHwMode80211b[] = "802.11b";
+const char kHwMode80211g[] = "802.11g";
+const char kHwMode80211n[] = "802.11n";
+const char kHwMode80211ac[] = "802.11ac";
+
+// Operation modes.
+const char kOperationModeServer[] = "server";
+const char kOperationModeBridge[] = "bridge";
+
+// D-Bus error codes.
+const char kErrorInternalError[] =
+ "org.chromium.apmanager.Error.InternalError";
+const char kErrorInvalidArguments[] =
+ "org.chromium.apmanager.Error.InvalidArguments";
+const char kErrorInvalidConfiguration[] =
+ "org.chromium.apmanager.Error.InvalidConfiguration";
+const char kErrorSuccess[] = "org.chromium.apmanager.Error.Success";
+
+} // namespace apmanager
+
+#endif // SYSTEM_API_DBUS_APMANAGER_DBUS_CONSTANTS_H_
diff --git a/dbus/authpolicy/active_directory_info.proto b/dbus/authpolicy/active_directory_info.proto
new file mode 100644
index 0000000..97f3c91
--- /dev/null
+++ b/dbus/authpolicy/active_directory_info.proto
@@ -0,0 +1,234 @@
+// Copyright 2017 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.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package authpolicy;
+
+// D-Bus call error codes. These values are written to logs. New enum values can
+// be added, but existing enums must never be renumbered or deleted and reused.
+enum ErrorType {
+ // TODO(ljusten): Remove this and ERROR_NO_WINDOWS_POLICY when Chrome is
+ // switched over, see crbug.com/807999.
+ option allow_alias = true;
+
+ // Everything is A-OK!
+ ERROR_NONE = 0;
+ // Unspecified error.
+ ERROR_UNKNOWN = 1;
+ // Unspecified D-Bus error.
+ ERROR_DBUS_FAILURE = 2;
+ // Badly formatted user principal name.
+ ERROR_PARSE_UPN_FAILED = 3;
+ // Auth failed because of bad user name.
+ ERROR_BAD_USER_NAME = 4;
+ // Auth failed because of bad password.
+ ERROR_BAD_PASSWORD = 5;
+ // Auth failed because of expired password.
+ ERROR_PASSWORD_EXPIRED = 6;
+ // Auth failed because of bad realm or network.
+ ERROR_CANNOT_RESOLVE_KDC = 7;
+ // kinit exited with unspecified error.
+ ERROR_KINIT_FAILED = 8;
+ // net exited with unspecified error.
+ ERROR_NET_FAILED = 9;
+ // smdclient exited with unspecified error.
+ ERROR_SMBCLIENT_FAILED = 10;
+ // authpolicy_parser exited with unknown error.
+ ERROR_PARSE_FAILED = 11;
+ // Parsing GPOs failed.
+ ERROR_PARSE_PREG_FAILED = 12;
+ // GPO data is bad.
+ ERROR_BAD_GPOS = 13;
+ // Some local IO operation failed.
+ ERROR_LOCAL_IO = 14;
+ // Machine is not joined to AD domain yet.
+ ERROR_NOT_JOINED = 15;
+ // User is not logged in yet.
+ ERROR_NOT_LOGGED_IN = 16;
+ // Failed to send policy to session_manager.
+ ERROR_STORE_POLICY_FAILED = 17;
+ // User doesn't have the right to join machines to the domain.
+ ERROR_JOIN_ACCESS_DENIED = 18;
+ // General network problem.
+ ERROR_NETWORK_PROBLEM = 19;
+ // Machine name contains restricted characters.
+ ERROR_INVALID_MACHINE_NAME = 20;
+ // Machine name too long.
+ ERROR_MACHINE_NAME_TOO_LONG = 21;
+ // User joined maximum number of machines to the domain.
+ ERROR_USER_HIT_JOIN_QUOTA = 22;
+ // Kinit or smbclient failed to contact Key Distribution Center.
+ ERROR_CONTACTING_KDC_FAILED = 23;
+ // Kerberos credentials cache not found.
+ ERROR_NO_CREDENTIALS_CACHE_FOUND = 24;
+ // Kerberos ticket expired while renewing credentials.
+ ERROR_KERBEROS_TICKET_EXPIRED = 25;
+ // Klist exited with unspecified error.
+ ERROR_KLIST_FAILED = 26;
+ // Kinit failed because of bad machine name.
+ ERROR_BAD_MACHINE_NAME = 27;
+ // Kinit failed to change the password because the password was rejected.
+ ERROR_PASSWORD_REJECTED = 28;
+ // Returned by RefreshDevicePolicy when policy fetch succeeded but policy
+ // cannot be sent to session_manager because install attributes are not locked
+ // yet. authpolicyd caches policy in this case and returns it in the next
+ // RefreshDevicePolicy call. Should happen during enrollment only.
+ ERROR_DEVICE_POLICY_CACHED_BUT_NOT_SENT = 29;
+ // Join failed because computer organizational unit does not exist.
+ ERROR_OU_DOES_NOT_EXIST = 30;
+ // Join failed because computer organizational unit is invalid.
+ ERROR_INVALID_OU = 31;
+ // Setting computer organizational unit failed with insufficient permissions.
+ ERROR_OU_ACCESS_DENIED = 32;
+ // Setting computer organizational unit failed with unspecified error.
+ ERROR_SETTING_OU_FAILED = 33;
+ // Fetching user policy failed because device policy was unavailable.
+ ERROR_NO_DEVICE_POLICY = 34;
+ ERROR_NO_WINDOWS_POLICY = 34;
+ // Domain join failed because the device is already joined.
+ ERROR_ALREADY_JOINED = 35;
+ // Domain join failed because KDC does not support the encryption enforced in
+ // the Samba configuration, e.g. if 'kerberos encryption types' is set to
+ // 'strong' to enforce AES encryption, but KDC does not support AES.
+ ERROR_KDC_DOES_NOT_SUPPORT_ENCRYPTION_TYPE = 36;
+ // Kpasswd exited with unspecified error.
+ ERROR_KPASSWD_FAILED = 37;
+ // Setting computer organizational unit failed with constraint violation.
+ ERROR_OU_CONSTRAINT_VIOLATION = 38;
+ // Should be the last.
+ ERROR_COUNT = 39;
+}
+
+// Message sent to Chrome by authpolicyd as a response of a successful
+// AuthenticateUser call. Contains information about authenticated user fetched
+// from Active Directory server with "net ads search ...".
+message ActiveDirectoryAccountInfo {
+ // Unique id of the user account. Taken from the objectGUID property of the
+ // Active Directory user account information.
+ optional string account_id = 1;
+ // Display name of the user. Taken from the displayName property of the Active
+ // account information.
+ optional string display_name = 2;
+ // Given name of the user. AKA first name. Taken from the givenName property
+ // of the Active Directory user account information.
+ optional string given_name = 3;
+ // Logon name of the user (without @realm). Taken from the sAMAccountName
+ // property of the Active Directory user account information.
+ optional string sam_account_name = 4;
+ // Timestamp when the password was last set, see
+ // https://msdn.microsoft.com/en-us/library/ms679430(v=vs.85).aspx. Taken from
+ // the pwdLastSet property of the Active Directory user account information.
+ // Used in authpolicyd only, unused in Chrome.
+ optional uint64 pwd_last_set = 5;
+ // User account control flags, see
+ // https://msdn.microsoft.com/en-us/library/ms680832(v=vs.85).aspx. Taken from
+ // the userAccountControl property of the Active Directory user account
+ // information. Used in authpolicyd only, unused in Chrome.
+ optional uint32 user_account_control = 6;
+ // Common name of the user, e.g. "John Doe [jdoe]". Taken from the commonName
+ // property of the Active Directory user account information.
+ optional string common_name = 7;
+ // Next ID to use: 8
+}
+
+// Message sent to Chrome by authpolicyd as a response to a successful
+// GetUserStatus call.
+message ActiveDirectoryUserStatus {
+ // Ticket-granting-ticket status.
+ enum TgtStatus {
+ TGT_VALID = 0; // Ticket is still valid.
+ TGT_EXPIRED = 1; // Ticket expired.
+ TGT_NOT_FOUND = 2; // Kerberos credentials cache not found.
+ // Next ID to use: 3
+ }
+
+ // Whether the password has to be changed or sync'ed with cryptohome.
+ enum PasswordStatus {
+ PASSWORD_VALID = 0; // Valid as far as we can tell.
+ PASSWORD_EXPIRED = 1; // User has to enter a new password on next logon.
+ PASSWORD_CHANGED = 2; // Changed on server, possibly from other client.
+ // Next ID to use: 3
+ }
+
+ // User's account information, see above.
+ optional ActiveDirectoryAccountInfo account_info = 1;
+ // Status of the user's ticket-granting-ticket (TGT).
+ optional TgtStatus tgt_status = 2;
+ // Status of the user's password.
+ optional PasswordStatus password_status = 3;
+ reserved 4;
+ // Next ID to use: 5
+}
+
+// Message sent to Chrome by authpolicyd as a response to a successful
+// GetUserKerberosFiles call.
+message KerberosFiles {
+ // Kerberos credential cache.
+ optional bytes krb5cc = 1;
+ // Kerberos configuration file.
+ optional bytes krb5conf = 2;
+ // Next ID to use: 3
+}
+
+// What Kerberos encryption types kinit should use.
+enum KerberosEncryptionTypes {
+ ENC_TYPES_ALL = 0; // AES + RC4_HMAC.
+ ENC_TYPES_STRONG = 1; // AES only.
+ ENC_TYPES_LEGACY = 2; // RC4_HMAC only.
+ // Next ID to use: 3
+}
+
+// Message sent by Chrome to authpolicyd with JoinAdDomain call.
+message JoinDomainRequest {
+ // Logon name of the user (with @realm) who joins the machine to the domain.
+ optional string user_principal_name = 1;
+ // Netbios computer (aka machine) name for the joining device.
+ // https://technet.microsoft.com/en-us/library/cc959322.aspx
+ optional string machine_name = 2;
+ // Domain (realm) the machine should be joined to.
+ optional string machine_domain = 3;
+ // Organizational unit the machine should be put into. Goes from leaf to root,
+ // i.e. the OU at index 1 is the parent of OU at index 0, etc.
+ repeated string machine_ou = 4;
+ // Supported Kerberos encryption types for domain join. By default, only
+ // strong types are allowed during negotiation. However, some Active Directory
+ // setups might be configured to not allow strong types, in particular for
+ // cross-domain authentication (join machine to domain A using credentials
+ // from domain B), where at the time of writing the default settings do not
+ // allow strong encryption. In this case, domain join fails. Likewise, there
+ // might also be rare use cases that require legacy encryption only. If the
+ // server supports strong encryption, it is always preferred.
+ // On the sign-in screen and during user sessions the device policy
+ // DeviceKerberosEncryptionTypes policy is used to determine encryption types.
+ optional KerberosEncryptionTypes kerberos_encryption_types = 5
+ [default = ENC_TYPES_STRONG];
+ // The DM token used by Chrome to authenticate to DM server. Passed during
+ // domain join so authpolicyd can set it in device policy as it's done for
+ // cloud management.
+ optional string dm_token = 6;
+ // Next ID to use: 7
+}
+
+// Message sent by Chrome to authpolicyd with AuthenticateUser call.
+message AuthenticateUserRequest {
+ // Logon name of the user (with @realm).
+ optional string user_principal_name = 1;
+ // Unique id of the user account. Taken from the objectGUID property of the
+ // Active Directory user account information.
+ optional string account_id = 2;
+ // Next ID to use: 3
+}
+
+// Message sent by Chrome to authpolicyd with GetUserStatus call.
+message GetUserStatusRequest {
+ // Logon name of the user (with @realm).
+ optional string user_principal_name = 1;
+ // Unique id of the user account. Taken from the objectGUID property of the
+ // Active Directory user account information.
+ optional string account_id = 2;
+ // Next ID to use: 3
+}
diff --git a/dbus/authpolicy/dbus-constants.h b/dbus/authpolicy/dbus-constants.h
new file mode 100644
index 0000000..a3c0d4a
--- /dev/null
+++ b/dbus/authpolicy/dbus-constants.h
@@ -0,0 +1,28 @@
+// Copyright 2016 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
+
+namespace authpolicy {
+
+// General
+const char kAuthPolicyInterface[] = "org.chromium.AuthPolicy";
+const char kAuthPolicyServicePath[] = "/org/chromium/AuthPolicy";
+const char kAuthPolicyServiceName[] = "org.chromium.AuthPolicy";
+
+// Methods
+const char kAuthenticateUserMethod[] = "AuthenticateUser";
+const char kGetUserStatusMethod[] = "GetUserStatus";
+const char kGetUserKerberosFilesMethod[] = "GetUserKerberosFiles";
+const char kJoinADDomainMethod[] = "JoinADDomain";
+const char kRefreshUserPolicyMethod[] = "RefreshUserPolicy";
+const char kRefreshDevicePolicyMethod[] = "RefreshDevicePolicy";
+
+// Signals
+const char kUserKerberosFilesChangedSignal[] = "UserKerberosFilesChanged";
+
+} // namespace authpolicy
+
+#endif // SYSTEM_API_DBUS_AUTHPOLICY_DBUS_CONSTANTS_H_
diff --git a/dbus/biod/constants.proto b/dbus/biod/constants.proto
new file mode 100644
index 0000000..d7266c0
--- /dev/null
+++ b/dbus/biod/constants.proto
@@ -0,0 +1,21 @@
+// Copyright 2017 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.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package biod;
+
+// Included in biod's EnrollScanDone signal.
+enum ScanResult {
+ SCAN_RESULT_SUCCESS = 0;
+ SCAN_RESULT_PARTIAL = 1;
+ SCAN_RESULT_INSUFFICIENT = 2;
+ SCAN_RESULT_SENSOR_DIRTY = 3;
+ SCAN_RESULT_TOO_SLOW = 4;
+ SCAN_RESULT_TOO_FAST = 5;
+ SCAN_RESULT_IMMOBILE = 6;
+ SCAN_RESULT_MAX = 7;
+}
diff --git a/dbus/biod/dbus-constants.h b/dbus/biod/dbus-constants.h
new file mode 100644
index 0000000..19d9e06
--- /dev/null
+++ b/dbus/biod/dbus-constants.h
@@ -0,0 +1,53 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
+
+namespace biod {
+const char kBiodServicePath[] = "/org/chromium/BiometricsDaemon";
+const char kBiodServiceName[] = "org.chromium.BiometricsDaemon";
+
+// Interfaces for objects exported by biod
+const char kBiometricsManagerInterface[] =
+ "org.chromium.BiometricsDaemon.BiometricsManager";
+const char kAuthSessionInterface[] =
+ "org.chromium.BiometricsDaemon.AuthSession";
+const char kEnrollSessionInterface[] =
+ "org.chromium.BiometricsDaemon.EnrollSession";
+const char kRecordInterface[] = "org.chromium.BiometricsDaemon.Record";
+
+// List of all BiometricsManagers
+const char kCrosFpBiometricsManagerName[] = "CrosFpBiometricsManager";
+const char kFakeBiometricsManagerName[] = "FakeBiometricsManager";
+const char kFpcBiometricsManagerName[] = "FpcBiometricsManager";
+
+// Methods
+const char kBiometricsManagerStartEnrollSessionMethod[] = "StartEnrollSession";
+const char kBiometricsManagerGetRecordsForUserMethod[] = "GetRecordsForUser";
+const char kBiometricsManagerDestroyAllRecordsMethod[] = "DestroyAllRecords";
+const char kBiometricsManagerStartAuthSessionMethod[] = "StartAuthSession";
+const char kAuthSessionEndMethod[] = "End";
+const char kEnrollSessionCancelMethod[] = "Cancel";
+const char kRecordRemoveMethod[] = "Remove";
+const char kRecordSetLabelMethod[] = "SetLabel";
+
+// Signals
+const char kBiometricsManagerEnrollScanDoneSignal[] = "EnrollScanDone";
+const char kBiometricsManagerAuthScanDoneSignal[] = "AuthScanDone";
+const char kBiometricsManagerSessionFailedSignal[] = "SessionFailed";
+
+// Properties
+const char kBiometricsManagerBiometricTypeProperty[] = "Type";
+const char kRecordLabelProperty[] = "Label";
+
+// Values
+enum BiometricType {
+ BIOMETRIC_TYPE_UNKNOWN = 0,
+ BIOMETRIC_TYPE_FINGERPRINT = 1,
+ BIOMETRIC_TYPE_MAX,
+};
+} // namespace biod
+
+#endif // SYSTEM_API_DBUS_BIOD_DBUS_CONSTANTS_H_
diff --git a/dbus/biod/messages.proto b/dbus/biod/messages.proto
new file mode 100644
index 0000000..ea0e966
--- /dev/null
+++ b/dbus/biod/messages.proto
@@ -0,0 +1,18 @@
+// Copyright 2017 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.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package biod;
+
+import "constants.proto";
+
+// Included in biod's EnrollScanDone signal.
+message EnrollScanDone {
+ optional ScanResult scan_result = 1;
+ optional bool done = 2;
+ optional int32 percent_complete = 3;
+}
diff --git a/dbus/bootlockbox/boot_lockbox_rpc.proto b/dbus/bootlockbox/boot_lockbox_rpc.proto
new file mode 100644
index 0000000..a701dd6
--- /dev/null
+++ b/dbus/bootlockbox/boot_lockbox_rpc.proto
@@ -0,0 +1,46 @@
+// Copyright 2018 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.
+
+// The messages in this file comprise the DBus/Proto interface for bootlockboxd.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package cryptohome;
+
+enum BootLockboxErrorCode {
+ BOOTLOCKBOX_ERROR_NOT_SET = 0;
+ BOOTLOCKBOX_ERROR_CANNOT_STORE = 1;
+ BOOTLOCKBOX_ERROR_CANNOT_READ = 2;
+ BOOTLOCKBOX_ERROR_TPM_COMM_ERROR = 3;
+}
+
+message BootLockboxBaseReply {
+ optional BootLockboxErrorCode error = 1;
+
+ extensions 1000 to max;
+}
+
+message StoreBootLockboxRequest {
+ // The key for the data.
+ optional bytes key = 1;
+ // The data to be stored.
+ optional bytes data = 2;
+}
+
+message ReadBootLockboxRequest {
+ // The key for the data to read.
+ optional bytes key = 1;
+}
+
+message ReadBootLockboxReply {
+ extend BootLockboxBaseReply {
+ optional ReadBootLockboxReply reply = 1001;
+ }
+ optional bytes data = 1;
+}
+
+message FinalizeNVRamBootLockboxRequest {
+}
diff --git a/dbus/cecservice/dbus-constants.h b/dbus/cecservice/dbus-constants.h
new file mode 100644
index 0000000..de51c51
--- /dev/null
+++ b/dbus/cecservice/dbus-constants.h
@@ -0,0 +1,33 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_CECSERVICE_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_CECSERVICE_DBUS_CONSTANTS_H_
+
+namespace cecservice {
+const char kCecServiceInterface[] = "org.chromium.CecService";
+const char kCecServicePath[] = "/org/chromium/CecService";
+const char kCecServiceName[] = "org.chromium.CecService";
+
+// Methods.
+const char kSendStandByToAllDevicesMethod[] = "SendStandByToAllDevices";
+const char kSendWakeUpToAllDevicesMethod[] = "SendWakeUpToAllDevices";
+const char kGetTvsPowerStatus[] = "GetTvsPowerStatus";
+
+// Result of a TV power status query.
+enum TvPowerStatus {
+ kTvPowerStatusError = 0, // There was an error querying the TV.
+ kTvPowerStatusAdapterNotConfigured =
+ 1, // The adapter is not configured (no EDID).
+ kTvPowerStatusNoTv = 2, // There is no TV (the request was not acked).
+ kTvPowerStatusOn = 3, // TV is on.
+ kTvPowerStatusStandBy = 4, // TV is on standby.
+ kTvPowerStatusToOn = 5, // TV transitions to on.
+ kTvPowerStatusToStandBy = 6, // TV transitions to standby.
+ kTvPowerStatusUnknown = 7, // Unknown power status read from TV.
+};
+
+} // namespace cecservice
+
+#endif // SYSTEM_API_DBUS_CECSERVICE_DBUS_CONSTANTS_H_
diff --git a/dbus/chaps/OWNERS b/dbus/chaps/OWNERS
new file mode 100644
index 0000000..4659435
--- /dev/null
+++ b/dbus/chaps/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+ejcaruso@chromium.org
+apronin@chromium.org
diff --git a/dbus/chaps/ck_structs.proto b/dbus/chaps/ck_structs.proto
new file mode 100644
index 0000000..8fe1421
--- /dev/null
+++ b/dbus/chaps/ck_structs.proto
@@ -0,0 +1,75 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package chaps;
+
+// Proto for CK_MECHANISM_INFO.
+// https://www.cryptsoft.com/pkcs11doc/v220/structCK__MECHANISM__INFO.html
+message MechanismInfo {
+ // Next ID to use: 4
+
+ optional uint64 min_key_size = 1;
+ optional uint64 max_key_size = 2;
+ optional uint64 flags = 3;
+}
+
+// Proto for CK_SESSION_INFO.
+// https://www.cryptsoft.com/pkcs11doc/v220/structCK__SESSION__INFO.html
+message SessionInfo {
+ // Next ID to use: 5
+
+ optional uint64 slot_id = 1;
+ optional uint64 state = 2;
+ optional uint64 flags = 3;
+ optional uint64 device_error = 4;
+}
+
+// Proto for CK_VERSION.
+// https://www.cryptsoft.com/pkcs11doc/v220/structCK__VERSION.html
+message Version {
+ // Next ID to use: 3
+
+ optional uint32 major = 1;
+ optional uint32 minor = 2;
+}
+
+// Proto for CK_SLOT_INFO.
+// https://www.cryptsoft.com/pkcs11doc/v220/structCK__SLOT__INFO.html
+message SlotInfo {
+ // Next ID to use: 6
+
+ optional bytes slot_description = 1;
+ optional bytes manufacturer_id = 2;
+ optional uint64 flags = 3;
+ optional Version hardware_version = 4;
+ optional Version firmware_version = 5;
+}
+
+// Proto for CK_TOKEN_INFO.
+// https://www.cryptsoft.com/pkcs11doc/v220/structCK__TOKEN__INFO.html
+message TokenInfo {
+ // Next ID to use: 18
+
+ optional bytes label = 1;
+ optional bytes manufacturer_id = 2;
+ optional bytes model = 3;
+ optional bytes serial_number = 4;
+ optional uint64 flags = 5;
+ optional uint64 max_session_count = 6;
+ optional uint64 session_count = 7;
+ optional uint64 max_session_count_rw = 8;
+ optional uint64 session_count_rw = 9;
+ optional uint64 max_pin_len = 10;
+ optional uint64 min_pin_len = 11;
+ optional uint64 total_public_memory = 12;
+ optional uint64 free_public_memory = 13;
+ optional uint64 total_private_memory = 14;
+ optional uint64 free_private_memory = 15;
+ optional Version hardware_version = 16;
+ optional Version firmware_version = 17;
+}
diff --git a/dbus/cros-disks/dbus-constants.h b/dbus/cros-disks/dbus-constants.h
new file mode 100644
index 0000000..7493f1f
--- /dev/null
+++ b/dbus/cros-disks/dbus-constants.h
@@ -0,0 +1,136 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
+
+namespace cros_disks {
+const char kCrosDisksInterface[] = "org.chromium.CrosDisks";
+const char kCrosDisksServicePath[] = "/org/chromium/CrosDisks";
+const char kCrosDisksServiceName[] = "org.chromium.CrosDisks";
+const char kCrosDisksServiceError[] = "org.chromium.CrosDisks.Error";
+
+// Methods.
+const char kEnumerateAutoMountableDevices[] = "EnumerateAutoMountableDevices";
+const char kEnumerateDevices[] = "EnumerateDevices";
+const char kEnumerateMountEntries[] = "EnumerateMountEntries";
+const char kFormat[] = "Format";
+const char kGetDeviceProperties[] = "GetDeviceProperties";
+const char kMount[] = "Mount";
+const char kRename[] = "Rename";
+const char kUnmount[] = "Unmount";
+
+// Signals.
+const char kDeviceAdded[] = "DeviceAdded";
+const char kDeviceScanned[] = "DeviceScanned";
+const char kDeviceRemoved[] = "DeviceRemoved";
+const char kDiskAdded[] = "DiskAdded";
+const char kDiskChanged[] = "DiskChanged";
+const char kDiskRemoved[] = "DiskRemoved";
+const char kFormatCompleted[] = "FormatCompleted";
+const char kMountCompleted[] = "MountCompleted";
+const char kRenameCompleted[] = "RenameCompleted";
+
+// Properties.
+// TODO(benchan): Drop unnecessary 'Device' / 'Drive' prefix as they were
+// carried through old code base.
+const char kDeviceFile[] = "DeviceFile";
+const char kDeviceIsDrive[] = "DeviceIsDrive";
+const char kDeviceIsMediaAvailable[] = "DeviceIsMediaAvailable";
+const char kDeviceIsMounted[] = "DeviceIsMounted";
+const char kDeviceIsOnBootDevice[] = "DeviceIsOnBootDevice";
+const char kDeviceIsOnRemovableDevice[] = "DeviceIsOnRemovableDevice";
+const char kDeviceIsReadOnly[] = "DeviceIsReadOnly";
+const char kDeviceIsVirtual[] = "DeviceIsVirtual";
+const char kDeviceMediaType[] = "DeviceMediaType";
+const char kDeviceMountPaths[] = "DeviceMountPaths";
+const char kDevicePresentationHide[] = "DevicePresentationHide";
+const char kDeviceSize[] = "DeviceSize";
+const char kDriveModel[] = "DriveModel";
+const char kIsAutoMountable[] = "IsAutoMountable";
+const char kIdLabel[] = "IdLabel";
+const char kIdUuid[] = "IdUuid";
+const char kVendorId[] = "VendorId";
+const char kVendorName[] = "VendorName";
+const char kProductId[] = "ProductId";
+const char kProductName[] = "ProductName";
+const char kNativePath[] = "NativePath";
+const char kFileSystemType[] = "FileSystemType";
+
+// Enum values.
+// DeviceMediaType enum values are reported through UMA.
+// All values but DEVICE_MEDIA_NUM_VALUES should not be changed or removed.
+// Additional values can be added but DEVICE_MEDIA_NUM_VALUES should always
+// be the last value in the enum.
+enum DeviceMediaType {
+ DEVICE_MEDIA_UNKNOWN = 0,
+ DEVICE_MEDIA_USB = 1,
+ DEVICE_MEDIA_SD = 2,
+ DEVICE_MEDIA_OPTICAL_DISC = 3,
+ DEVICE_MEDIA_MOBILE = 4,
+ DEVICE_MEDIA_DVD = 5,
+ DEVICE_MEDIA_NUM_VALUES,
+};
+
+enum FormatErrorType {
+ FORMAT_ERROR_NONE = 0,
+ FORMAT_ERROR_UNKNOWN = 1,
+ FORMAT_ERROR_INTERNAL = 2,
+ FORMAT_ERROR_INVALID_DEVICE_PATH = 3,
+ FORMAT_ERROR_DEVICE_BEING_FORMATTED = 4,
+ FORMAT_ERROR_UNSUPPORTED_FILESYSTEM = 5,
+ FORMAT_ERROR_FORMAT_PROGRAM_NOT_FOUND = 6,
+ FORMAT_ERROR_FORMAT_PROGRAM_FAILED = 7,
+ FORMAT_ERROR_DEVICE_NOT_ALLOWED = 8,
+};
+
+// TODO(benchan): After both Chrome and cros-disks use these enum values,
+// make these error values contiguous so that they can be directly reported
+// via UMA.
+enum MountErrorType {
+ MOUNT_ERROR_NONE = 0,
+ MOUNT_ERROR_UNKNOWN = 1,
+ MOUNT_ERROR_INTERNAL = 2,
+ MOUNT_ERROR_INVALID_ARGUMENT = 3,
+ MOUNT_ERROR_INVALID_PATH = 4,
+ MOUNT_ERROR_PATH_ALREADY_MOUNTED = 5,
+ MOUNT_ERROR_PATH_NOT_MOUNTED = 6,
+ MOUNT_ERROR_DIRECTORY_CREATION_FAILED = 7,
+ MOUNT_ERROR_INVALID_MOUNT_OPTIONS = 8,
+ MOUNT_ERROR_INVALID_UNMOUNT_OPTIONS = 9,
+ MOUNT_ERROR_INSUFFICIENT_PERMISSIONS = 10,
+ MOUNT_ERROR_MOUNT_PROGRAM_NOT_FOUND = 11,
+ MOUNT_ERROR_MOUNT_PROGRAM_FAILED = 12,
+ MOUNT_ERROR_INVALID_DEVICE_PATH = 100,
+ MOUNT_ERROR_UNKNOWN_FILESYSTEM = 101,
+ MOUNT_ERROR_UNSUPPORTED_FILESYSTEM = 102,
+ MOUNT_ERROR_INVALID_ARCHIVE = 201,
+ MOUNT_ERROR_UNSUPPORTED_ARCHIVE = 202,
+};
+
+// MountSourceType enum values are solely used by Chrome/CrosDisks in
+// the MountCompleted signal, and currently not reported through UMA.
+enum MountSourceType {
+ MOUNT_SOURCE_INVALID = 0,
+ MOUNT_SOURCE_REMOVABLE_DEVICE = 1,
+ MOUNT_SOURCE_ARCHIVE = 2,
+ MOUNT_SOURCE_NETWORK_STORAGE = 3,
+};
+
+enum RenameErrorType {
+ RENAME_ERROR_NONE = 0,
+ RENAME_ERROR_UNKNOWN = 1,
+ RENAME_ERROR_INTERNAL = 2,
+ RENAME_ERROR_INVALID_DEVICE_PATH = 3,
+ RENAME_ERROR_DEVICE_BEING_RENAMED = 4,
+ RENAME_ERROR_UNSUPPORTED_FILESYSTEM = 5,
+ RENAME_ERROR_RENAME_PROGRAM_NOT_FOUND = 6,
+ RENAME_ERROR_RENAME_PROGRAM_FAILED = 7,
+ RENAME_ERROR_DEVICE_NOT_ALLOWED = 8,
+ RENAME_ERROR_LONG_NAME = 9,
+ RENAME_ERROR_INVALID_CHARACTER = 10,
+};
+} // namespace cros_disks
+
+#endif // SYSTEM_API_DBUS_CROS_DISKS_DBUS_CONSTANTS_H_
diff --git a/dbus/cryptohome/dbus-constants.h b/dbus/cryptohome/dbus-constants.h
new file mode 100644
index 0000000..eda693c
--- /dev/null
+++ b/dbus/cryptohome/dbus-constants.h
@@ -0,0 +1,190 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_CRYPTOHOME_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_CRYPTOHOME_DBUS_CONSTANTS_H_
+
+namespace cryptohome {
+
+// Interface exposed by the cryptohome daemon.
+
+const char kCryptohomeInterface[] = "org.chromium.CryptohomeInterface";
+const char kCryptohomeServicePath[] = "/org/chromium/Cryptohome";
+const char kCryptohomeServiceName[] = "org.chromium.Cryptohome";
+
+// Methods of the |kCryptohomeInterface| interface:
+const char kCryptohomeMigrateKey[] = "MigrateKey";
+const char kCryptohomeMigrateKeyEx[] = "MigrateKeyEx";
+const char kCryptohomeRemoveEx[] = "RemoveEx";
+const char kCryptohomeGetSystemSalt[] = "GetSystemSalt";
+const char kCryptohomeGetSanitizedUsername[] = "GetSanitizedUsername";
+const char kCryptohomeIsMounted[] = "IsMounted";
+const char kCryptohomeMount[] = "Mount";
+const char kCryptohomeMountGuest[] = "MountGuest";
+const char kCryptohomeMountGuestEx[] = "MountGuestEx";
+const char kCryptohomeUnmount[] = "Unmount";
+const char kCryptohomeTpmIsReady[] = "TpmIsReady";
+const char kCryptohomeTpmIsEnabled[] = "TpmIsEnabled";
+const char kCryptohomeTpmIsOwned[] = "TpmIsOwned";
+const char kCryptohomeTpmIsBeingOwned[] = "TpmIsBeingOwned";
+const char kCryptohomeTpmGetPassword[] = "TpmGetPassword";
+const char kCryptohomeTpmCanAttemptOwnership[] = "TpmCanAttemptOwnership";
+const char kCryptohomeTpmClearStoredPassword[] = "TpmClearStoredPassword";
+const char kCryptohomePkcs11GetTpmTokenInfo[] = "Pkcs11GetTpmTokenInfo";
+const char kCryptohomePkcs11GetTpmTokenInfoForUser[] =
+ "Pkcs11GetTpmTokenInfoForUser";
+const char kCryptohomePkcs11IsTpmTokenReady[] = "Pkcs11IsTpmTokenReady";
+const char kCryptohomePkcs11IsTpmTokenReadyForUser[] =
+ "Pkcs11IsTpmTokenReadyForUser";
+const char kCryptohomeAsyncMigrateKey[] = "AsyncMigrateKey";
+const char kCryptohomeAsyncMount[] = "AsyncMount";
+const char kCryptohomeAsyncMountGuest[] = "AsyncMountGuest";
+const char kCryptohomeAsyncRemove[] = "AsyncRemove";
+const char kCryptohomeGetStatusString[] = "GetStatusString";
+const char kCryptohomeRemoveTrackedSubdirectories[] =
+ "RemoveTrackedSubdirectories";
+const char kCryptohomeAsyncRemoveTrackedSubdirectories[] =
+ "AsyncRemoveTrackedSubdirectories";
+const char kCryptohomeAsyncDoesUsersExist[] = "AsyncDoesUsersExist";
+const char kCryptohomeInstallAttributesGet[] = "InstallAttributesGet";
+const char kCryptohomeInstallAttributesSet[] = "InstallAttributesSet";
+const char kCryptohomeInstallAttributesCount[] = "InstallAttributesCount";
+const char kCryptohomeInstallAttributesFinalize[] =
+ "InstallAttributesFinalize";
+const char kCryptohomeInstallAttributesIsReady[] = "InstallAttributesIsReady";
+const char kCryptohomeInstallAttributesIsSecure[] =
+ "InstallAttributesIsSecure";
+const char kCryptohomeInstallAttributesIsInvalid[] =
+ "InstallAttributesIsInvalid";
+const char kCryptohomeInstallAttributesIsFirstInstall[] =
+ "InstallAttributesIsFirstInstall";
+const char kCryptohomeTpmIsAttestationPrepared[] = "TpmIsAttestationPrepared";
+const char kCryptohomeTpmIsAttestationEnrolled[] = "TpmIsAttestationEnrolled";
+const char kCryptohomeTpmAttestationCreateEnrollRequest[] =
+ "TpmAttestationCreateEnrollRequest";
+const char kCryptohomeAsyncTpmAttestationCreateEnrollRequest[] =
+ "AsyncTpmAttestationCreateEnrollRequest";
+const char kCryptohomeAsyncTpmAttestationCreateEnrollRequestNew[] =
+ "AsyncTpmAttestationCreateEnrollRequestNew";
+const char kCryptohomeTpmAttestationEnroll[] = "TpmAttestationEnroll";
+const char kCryptohomeAsyncTpmAttestationEnroll[] = "AsyncTpmAttestationEnroll";
+const char kCryptohomeAsyncTpmAttestationEnrollNew[] =
+ "AsyncTpmAttestationEnrollNew";
+const char kCryptohomeTpmAttestationCreateCertRequest[] =
+ "TpmAttestationCreateCertRequest";
+const char kCryptohomeAsyncTpmAttestationCreateCertRequest[] =
+ "AsyncTpmAttestationCreateCertRequest";
+const char kCryptohomeAsyncTpmAttestationCreateCertRequestByProfile[] =
+ "AsyncTpmAttestationCreateCertRequestByProfile";
+const char kCryptohomeTpmAttestationFinishCertRequest[] =
+ "TpmAttestationFinishCertRequest";
+const char kCryptohomeAsyncTpmAttestationFinishCertRequest[] =
+ "AsyncTpmAttestationFinishCertRequest";
+const char kCryptohomeTpmAttestationDoesKeyExist[] =
+ "TpmAttestationDoesKeyExist";
+const char kCryptohomeTpmAttestationGetCertificate[] =
+ "TpmAttestationGetCertificate";
+const char kCryptohomeTpmAttestationGetPublicKey[] =
+ "TpmAttestationGetPublicKey";
+const char kCryptohomeTpmAttestationRegisterKey[] = "TpmAttestationRegisterKey";
+// TODO(crbug.com/789419): Remove this deprecated API.
+const char kCryptohomeTpmAttestationSignEnterpriseChallenge[] =
+ "TpmAttestationSignEnterpriseChallenge";
+const char kCryptohomeTpmAttestationSignEnterpriseVaChallenge[] =
+ "TpmAttestationSignEnterpriseVaChallenge";
+const char kCryptohomeTpmAttestationSignSimpleChallenge[] =
+ "TpmAttestationSignSimpleChallenge";
+const char kCryptohomeTpmAttestationGetKeyPayload[] =
+ "TpmAttestationGetKeyPayload";
+const char kCryptohomeTpmAttestationSetKeyPayload[] =
+ "TpmAttestationSetKeyPayload";
+const char kCryptohomeTpmAttestationDeleteKeys[] =
+ "TpmAttestationDeleteKeys";
+const char kCryptohomeTpmAttestationGetEnrollmentId[] =
+ "TpmAttestationGetEnrollmentId";
+// TODO(isandrk): Deprecated, remove on (or before) 2017/09/21 - after the
+// Chromium side has been changed to use the new TpmGetVersionStructured.
+const char kCryptohomeTpmGetVersion[] = "TpmGetVersion";
+const char kCryptohomeTpmGetVersionStructured[] = "TpmGetVersionStructured";
+const char kCryptohomeGetKeyDataEx[] = "GetKeyDataEx";
+const char kCryptohomeCheckKeyEx[] = "CheckKeyEx";
+const char kCryptohomeMountEx[] = "MountEx";
+const char kCryptohomeAddKeyEx[] = "AddKeyEx";
+const char kCryptohomeUpdateKeyEx[] = "UpdateKeyEx";
+const char kCryptohomeRemoveKeyEx[] = "RemoveKeyEx";
+const char kCryptohomeSignBootLockbox[] = "SignBootLockbox";
+const char kCryptohomeVerifyBootLockbox[] = "VerifyBootLockbox";
+const char kCryptohomeFinalizeBootLockbox[] = "FinalizeBootLockbox";
+const char kCryptohomeGetBootAttribute[] = "GetBootAttribute";
+const char kCryptohomeSetBootAttribute[] = "SetBootAttribute";
+const char kCryptohomeFlushAndSignBootAttributes[] =
+ "FlushAndSignBootAttributes";
+const char kCryptohomeGetLoginStatus[] = "GetLoginStatus";
+const char kCryptohomeGetTpmStatus[] = "GetTpmStatus";
+const char kCryptohomeGetEndorsementInfo[] = "GetEndorsementInfo";
+const char kCryptohomeRenameCryptohome[] = "RenameCryptohome";
+const char kCryptohomeGetAccountDiskUsage[] = "GetAccountDiskUsage";
+const char kCryptohomeGetFirmwareManagementParameters[] =
+ "GetFirmwareManagementParameters";
+const char kCryptohomeSetFirmwareManagementParameters[] =
+ "SetFirmwareManagementParameters";
+const char kCryptohomeRemoveFirmwareManagementParameters[] =
+ "RemoveFirmwareManagementParameters";
+const char kCryptohomeMigrateToDircrypto[] = "MigrateToDircrypto";
+const char kCryptohomeNeedsDircryptoMigration[] = "NeedsDircryptoMigration";
+const char kCryptohomeGetSupportedKeyPolicies[] = "GetSupportedKeyPolicies";
+const char kCryptohomeIsQuotaSupported[] = "IsQuotaSupported";
+const char kCryptohomeGetCurrentSpaceForUid[] = "GetCurrentSpaceForUid";
+const char kCryptohomeGetCurrentSpaceForGid[] = "GetCurrentSpaceForGid";
+
+// Signals of the |kCryptohomeInterface| interface:
+const char kSignalAsyncCallStatus[] = "AsyncCallStatus";
+const char kSignalAsyncCallStatusWithData[] = "AsyncCallStatusWithData";
+const char kSignalTpmInitStatus[] = "TpmInitStatus";
+const char kSignalCleanupUsersRemoved[] = "CleanupUsersRemoved";
+const char kSignalLowDiskSpace[] = "LowDiskSpace";
+const char kSignalDircryptoMigrationProgress[] = "DircryptoMigrationProgress";
+
+// Error code
+enum MountError {
+ MOUNT_ERROR_NONE = 0,
+ MOUNT_ERROR_FATAL = 1 << 0,
+ MOUNT_ERROR_KEY_FAILURE = 1 << 1,
+ MOUNT_ERROR_MOUNT_POINT_BUSY = 1 << 2,
+ MOUNT_ERROR_TPM_COMM_ERROR = 1 << 3,
+ MOUNT_ERROR_TPM_DEFEND_LOCK = 1 << 4,
+ MOUNT_ERROR_USER_DOES_NOT_EXIST = 1 << 5,
+ MOUNT_ERROR_TPM_NEEDS_REBOOT = 1 << 6,
+ // Encrypted in old method, need migration before mounting.
+ MOUNT_ERROR_OLD_ENCRYPTION = 1 << 7,
+ // Previous migration attempt was aborted in the middle. Must resume it first.
+ MOUNT_ERROR_PREVIOUS_MIGRATION_INCOMPLETE = 1 << 8,
+ // The operation to remove a key failed.
+ MOUNT_ERROR_REMOVE_FAILED = 1 << 9,
+ MOUNT_ERROR_RECREATED = 1 << 31,
+};
+// Status code signaled from MigrateToDircrypto().
+enum DircryptoMigrationStatus {
+ // 0 means a successful completion.
+ DIRCRYPTO_MIGRATION_SUCCESS = 0,
+ // Negative values mean failing completion.
+ // TODO(kinaba,dspaid): Add error codes as needed here.
+ DIRCRYPTO_MIGRATION_FAILED = -1,
+ // Positive values mean intermediate state report for the running migration.
+ // TODO(kinaba,dspaid): Add state codes as needed.
+ DIRCRYPTO_MIGRATION_INITIALIZING = 1,
+ DIRCRYPTO_MIGRATION_IN_PROGRESS = 2,
+};
+
+// Interface for key delegate service to be used by the cryptohome daemon.
+
+const char kCryptohomeKeyDelegateInterface[] =
+ "org.chromium.CryptohomeKeyDelegateInterface";
+
+// Methods of the |kCryptohomeKeyDelegateInterface| interface:
+const char kCryptohomeKeyDelegateChallengeKey[] = "ChallengeKey";
+
+} // namespace cryptohome
+
+#endif // SYSTEM_API_DBUS_CRYPTOHOME_DBUS_CONSTANTS_H_
diff --git a/dbus/cryptohome/key.proto b/dbus/cryptohome/key.proto
new file mode 100644
index 0000000..26fb9c6
--- /dev/null
+++ b/dbus/cryptohome/key.proto
@@ -0,0 +1,151 @@
+// Copyright (c) 2014 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.
+//
+// Provides wire-type for cryptohome Key objects. It does not
+// represent the entirety of the bookkeeping data needed by Cryptohome.
+//
+// Anything in this file may be persisted on disk. Update carefully!
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package cryptohome;
+
+message KeyAuthorizationSecretUsage {
+ optional bool encrypt = 1;
+ optional bool sign = 2;
+}
+
+message KeyAuthorizationSecret {
+ optional KeyAuthorizationSecretUsage usage = 1;
+ optional bytes symmetric_key = 2;
+ optional bytes public_key = 3;
+ // Indicates if the symmetric_key is wrapped.
+ optional bool wrapped = 4 [default=false];
+}
+
+message KeyAuthorizationData {
+ enum KeyAuthorizationType {
+ KEY_AUTHORIZATION_TYPE_HMACSHA256 = 0;
+ KEY_AUTHORIZATION_TYPE_AES256CBC_HMACSHA256 = 1;
+ }
+ optional KeyAuthorizationType type = 1;
+ repeated KeyAuthorizationSecret secrets = 2;
+}
+
+// Software-enforced privileges.
+message KeyPrivileges {
+ // Allows the key to mount the cryptohome.
+ optional bool mount = 1 [default=true];
+ // Allows new keys to be added.
+ optional bool add = 2 [default=true];
+ // Allows other existing keys to be removed.
+ optional bool remove = 3 [default=true];
+ // Allows the key to update itself.
+ optional bool update = 4 [default=true];
+ // Allows a key to update itself iff the requested change
+ // is authorized as per KeyAuthorizationData.
+ optional bool authorized_update = 5 [default=false];
+}
+
+// Public metadata stored on behalf of the KeyProvider.
+message KeyProviderData {
+ message Entry {
+ optional string name = 1;
+ optional int64 number = 2;
+ optional bytes bytes = 3;
+ }
+ repeated Entry entry = 1;
+}
+
+// Cryptographic signature algorithm type for challenge requests. Used with
+// challenge-response cryptohome keys.
+enum ChallengeSignatureAlgorithm {
+ CHALLENGE_RSASSA_PKCS1_V1_5_SHA1 = 1;
+ CHALLENGE_RSASSA_PKCS1_V1_5_SHA256 = 2;
+ CHALLENGE_RSASSA_PKCS1_V1_5_SHA384 = 3;
+ CHALLENGE_RSASSA_PKCS1_V1_5_SHA512 = 4;
+}
+
+// Description of a public key of an asymmetric cryptographic key. Used with
+// challenge-response cryptohome keys.
+message ChallengePublicKeyInfo {
+ // DER-encoded blob of the X.509 Subject Public Key Info.
+ optional bytes public_key_spki_der = 1;
+ // Supported signature algorithms, in the order of preference (starting from
+ // the most preferred). Absence of this field denotes that the key cannot be
+ // used for signing.
+ repeated ChallengeSignatureAlgorithm signature_algorithm = 2;
+}
+
+// Policies which determine how a key can be used. |GetSupportedKeyPolicies|
+// request can be used to determine if a given policy value is supported.
+// This message is also used inside of |GetKeyDataReply|, which allows clients
+// to query current key state without submitting an authentication attempt.
+message KeyPolicy {
+ // Is this key additionally protected from brute force attacks as a low
+ // entropy credential? For such keys, delays between subsequent unsuccessful
+ // authorization attempts and/or a limit on the number of such attempts are
+ // enforced to slow down dictionary-based attacks. Set this to true when
+ // registering a key to protect it.
+ optional bool low_entropy_credential = 1;
+ // If true, the key is "locked" after too many unsuccessful authorization
+ // attempts. Future authentication attempts against a locked key fail with
+ // CRYPTOHOME_ERROR_TPM_DEFEND_LOCK error.
+ // Currently, such locking is supported only for keys with
+ // |low_entropy_credential| policy set to true,
+ // This field is ignored when registering a new key.
+ optional bool auth_locked = 2;
+}
+
+// Non-secret data describing the key.
+message KeyData {
+ // The KeyType should specify the handling needed by Cryptohome
+ // and not a provider KeyType.
+ enum KeyType {
+ // Password-based key. The password's text or its hashed/transformed
+ // representation is transmitted in the |secret| field of the Key message.
+ KEY_TYPE_PASSWORD = 0;
+ // The challenge-response type of key. The secret data for such key is not
+ // passed clear-text through D-Bus calls, but is instead handled by
+ // cryptohome internally. In order to authenticate using such key,
+ // cryptohome will issue one or multiple challenge requests.
+ KEY_TYPE_CHALLENGE_RESPONSE = 1;
+ }
+ optional KeyType type = 1;
+ // All keys must be labeled when persisted to disk, but when KeyData
+ // is used in an UpdateKeyRequest, only defined fields are necessary
+ // (so that the caller doesn't need the full KeyData first).
+ optional string label = 2;
+ // If undefined, use the default settings.
+ optional KeyPrivileges privileges = 3;
+ optional int64 revision = 4;
+ // At present, only support for one authorization mechanism is implemented.
+ repeated KeyAuthorizationData authorization_data = 5;
+ // Data stored for use by the provider of the key, often for pre-processing
+ // of passwords or custom provider key typing.
+ // This will be size-limited by serialized size (e.g., 4096 bytes).
+ optional KeyProviderData provider_data = 6;
+ // Is set when |type| is |KEY_TYPE_CHALLENGE_RESPONSE|. Specifies the list of
+ // keys that should be used for challenge requests.
+ repeated ChallengePublicKeyInfo challenge_response_key = 7;
+ // Optional additional policy to apply to the key. Certain policy values
+ // require hardware support which may not be available.
+ optional KeyPolicy policy = 8;
+}
+
+// Key is not presently persisted to disk, but it acts as the single authority
+// for what comprises a key.
+message Key {
+ // In most cases, |data| is required. When used in an UpdateKeyRequest, it
+ // is only required if KeyData is changing. If only the |secret| is changing,
+ // this field may be left unset.
+ optional KeyData data = 1;
+ // |secret| is required for many requests, like AddKeyRequest, but not all.
+ // An UpdateKeyRequest only requires the changes to the Key that was
+ // was authorized in the AuthorizationRequest. Making |secret| required would
+ // logically force a key rotation even if the values were the same.
+ optional bytes secret = 2;
+}
diff --git a/dbus/cryptohome/rpc.proto b/dbus/cryptohome/rpc.proto
new file mode 100644
index 0000000..27b4e59
--- /dev/null
+++ b/dbus/cryptohome/rpc.proto
@@ -0,0 +1,455 @@
+// Copyright (c) 2014 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.
+//
+// The messages in this file comprise the DBus/Proto interface for
+// Cryptohome where there is an AccountIdentifer argument, an
+// AuthorizationRequest (if needed for the call), and the call's
+// parameters as <Call>Request.
+//
+// 'optional' annotations are used heavily in the RPC definition
+// because the RPC endpoints most properly sanity check the contents
+// for application-specific logic, and the more optional-with-default
+// parameters exist, the less data is actually transferred on the wire
+// in "default" situations.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package cryptohome;
+
+import "key.proto";
+
+// Error codes do not need to be sequential per-call.
+// Prefixes by Request/Reply type should be used to help
+// callers know if specialized errors apply.
+enum CryptohomeErrorCode {
+ // 0 is the default value of BaseReply::error. It
+ // should never be used.
+ CRYPTOHOME_ERROR_NOT_SET = 0;
+
+ CRYPTOHOME_ERROR_ACCOUNT_NOT_FOUND = 1;
+ CRYPTOHOME_ERROR_AUTHORIZATION_KEY_NOT_FOUND = 2;
+ CRYPTOHOME_ERROR_AUTHORIZATION_KEY_FAILED = 3;
+ CRYPTOHOME_ERROR_NOT_IMPLEMENTED = 4;
+ CRYPTOHOME_ERROR_MOUNT_FATAL = 5;
+ CRYPTOHOME_ERROR_MOUNT_MOUNT_POINT_BUSY = 6;
+ CRYPTOHOME_ERROR_TPM_COMM_ERROR = 7;
+ CRYPTOHOME_ERROR_TPM_DEFEND_LOCK = 8;
+ CRYPTOHOME_ERROR_TPM_NEEDS_REBOOT = 9;
+ CRYPTOHOME_ERROR_AUTHORIZATION_KEY_DENIED = 10;
+ CRYPTOHOME_ERROR_KEY_QUOTA_EXCEEDED = 11;
+ CRYPTOHOME_ERROR_KEY_LABEL_EXISTS = 12;
+ CRYPTOHOME_ERROR_BACKING_STORE_FAILURE = 13;
+ CRYPTOHOME_ERROR_UPDATE_SIGNATURE_INVALID = 14;
+ CRYPTOHOME_ERROR_KEY_NOT_FOUND = 15;
+ CRYPTOHOME_ERROR_LOCKBOX_SIGNATURE_INVALID = 16;
+ CRYPTOHOME_ERROR_LOCKBOX_CANNOT_SIGN = 17;
+ CRYPTOHOME_ERROR_BOOT_ATTRIBUTE_NOT_FOUND = 18;
+ CRYPTOHOME_ERROR_BOOT_ATTRIBUTES_CANNOT_SIGN = 19;
+ CRYPTOHOME_ERROR_TPM_EK_NOT_AVAILABLE = 20;
+ CRYPTOHOME_ERROR_ATTESTATION_NOT_READY = 21;
+ CRYPTOHOME_ERROR_CANNOT_CONNECT_TO_CA = 22;
+ CRYPTOHOME_ERROR_CA_REFUSED_ENROLLMENT = 23;
+ CRYPTOHOME_ERROR_CA_REFUSED_CERTIFICATE = 24;
+ CRYPTOHOME_ERROR_INTERNAL_ATTESTATION_ERROR = 25;
+ CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_INVALID = 26;
+ CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_STORE = 27;
+ CRYPTOHOME_ERROR_FIRMWARE_MANAGEMENT_PARAMETERS_CANNOT_REMOVE = 28;
+ CRYPTOHOME_ERROR_MOUNT_OLD_ENCRYPTION = 29;
+ CRYPTOHOME_ERROR_MOUNT_PREVIOUS_MIGRATION_INCOMPLETE = 30;
+ CRYPTOHOME_ERROR_MIGRATE_KEY_FAILED = 31;
+ CRYPTOHOME_ERROR_REMOVE_FAILED = 32;
+}
+
+message AccountIdentifier {
+ // |email| is deprecated. Don't use it.
+ optional string email = 1;
+
+ optional string account_id = 2;
+}
+
+// Parameters for connecting and making requests to a key delegate service.
+// This is currently used for making challenge requests for keys of the
+// |KEY_TYPE_CHALLENGE_RESPONSE| type.
+message KeyDelegate {
+ // D-Bus service name of the key delegate service that exports the key
+ // delegate object.
+ optional string dbus_service_name = 1;
+ // D-Bus object path of the key delegate object that implements the
+ // org.chromium.CryptohomeKeyDelegateInterface interface.
+ optional string dbus_object_path = 2;
+}
+
+message AuthorizationRequest {
+ // |key| must supply at least a |key.secret()|. If no |key.data()| or
+ // |key.data().label()| is supplied, the |key.secret()| will be tested
+ // against all compatible |key.data().type()| keys, where
+ // KEY_TYPE_PASSWORD is the default type. If
+ // |key.data().label()| is supplied, then the |key.secret()| will only be
+ // tested against the matching VaultKeyset.
+ optional Key key = 1;
+ // Describes delegate service that should be used for operations with the
+ // |key| key.
+ // Should be set only for keys with the |KEY_TYPE_CHALLENGE_RESPONSE| type.
+ optional KeyDelegate key_delegate = 2;
+}
+
+// These parameters are for inbound data to Cryptohome RPC
+// interfaces. When calls are added that return data, a
+// <Call>Response should be defined.
+message MountRequest {
+ // Perform an ephemeral mount only.
+ optional bool require_ephemeral = 1 [default=false];
+ // If defined, the account will be created if it does not exist.
+ // Additionally, a failed AuthorizationRequest will be expected as
+ // there will be no existing keys.
+ optional CreateRequest create = 2;
+ // If set to true, and cryptohomed supports the new "dircrypto" encryption,
+ // forces to use the new encryption. That is, makes it an error to mount
+ // an existing home directory encrypted in the old way (ecryptfs).
+ optional bool force_dircrypto_if_available = 3;
+ // If set to true, mounts the existing ecryptfs vault to a temporary location
+ // while setting up a new dircrypto directory.
+ optional bool to_migrate_from_ecryptfs = 4;
+ // Performs a public mount, which is used for a Kiosk session. Credentials are
+ // not needed in the request; they are synthesized by cryptohomed from id.
+ optional bool public_mount = 5;
+ // If set to true, mounts the vault to a temporary location. The mount is not
+ // exposed to the usual locations (/home/user, /home/root).
+ optional bool hidden_mount = 6;
+}
+
+// A BaseReply type is used for all cryptohomed responses. A shared base class
+// is used because all calls will always reply with no-error or an error value.
+// A centralized definition allows for a reusable reply handler for cases where
+// there is no Request-specific reply data. Any specialized data will live in
+// an extension as per MountReply below:
+// if (reply.HasExtension(MountReply::reply)) { ... }
+//
+message BaseReply {
+ // If a call was successful, error will not be defined (clear_error()).
+ // If a call failed, it must set an error code (set_error(CODE)).
+ // In either case, call-specific data may be added as an extension.
+ optional CryptohomeErrorCode error = 1;
+
+ extensions 1000 to max;
+ // Next ID to use for extensions: 1011
+}
+
+// The MountRequest call may return more than just success or failure
+// so it embeds itself in a BaseReply as an extension.
+message MountReply {
+ extend BaseReply {
+ optional MountReply reply = 1000;
+ }
+ // |recreated| is set when the cryptohome had to be wiped
+ // because the key or data was an unrecoverable. It does not imply
+ // failure to Mount nor is it 'true' when a CreateRequest creates
+ // a cryptohome for the first time.
+ optional bool recreated = 1 [default=false];
+ // Returns the filesystem-sanitized username.
+ optional string sanitized_username = 2;
+}
+
+message CreateRequest {
+ repeated Key keys = 1;
+ // Explicitly use the |key| from the AuthorizationRequest.
+ // Setting this value means that the KeyData is filled as it
+ // would be with a Key above or in an AddKeyRequest.
+ optional bool copy_authorization_key = 2 [default=false];
+ // If set to true, always use eCryptfs as the encryption method.
+ optional bool force_ecryptfs = 3 [default=false];
+ // In the future, this will contain account-wide data like
+ // the deletion priority or the IdP's origin.
+}
+
+message AddKeyRequest {
+ optional Key key = 1;
+ optional bool clobber_if_exists = 2 [default=false];
+}
+
+message UpdateKeyRequest {
+ optional Key changes = 1;
+ optional bytes authorization_signature = 2;
+}
+
+message CheckKeyRequest {
+}
+
+message RemoveKeyRequest {
+ // Only key.data().label() is used at present.
+ optional Key key = 1;
+}
+
+message SignBootLockboxRequest {
+ // The data to be signed.
+ optional bytes data = 1;
+}
+
+message SignBootLockboxReply {
+ extend BaseReply {
+ optional SignBootLockboxReply reply = 1001;
+ }
+ optional bytes signature = 1;
+}
+
+message VerifyBootLockboxRequest {
+ // The signed data to be verified.
+ optional bytes data = 1;
+ // The signature to be verified.
+ optional bytes signature = 2;
+}
+
+message FinalizeBootLockboxRequest {
+}
+
+message GetKeyDataRequest {
+ // |key| must supply at least one attribute and all others will be treated as
+ // wildcards. Currently only |key.data().label()| may be supplied. Like
+ // AuthorizationRequest, support can be added for queries by
+ // |key.data().type()| to return all keys of a certain class, testing
+ // |key.secret()|, or |key.data().provider_data()| entries.
+ optional Key key = 1;
+}
+
+message GetKeyDataReply {
+ extend BaseReply {
+ optional GetKeyDataReply reply = 1002;
+ }
+ repeated KeyData key_data = 1;
+}
+
+message GetBootAttributeRequest {
+ optional string name = 1;
+}
+
+message GetBootAttributeReply {
+ extend BaseReply {
+ optional GetBootAttributeReply reply = 1003;
+ }
+ optional bytes value = 1;
+}
+
+message SetBootAttributeRequest {
+ optional string name = 1;
+ optional bytes value = 2;
+}
+
+message FlushAndSignBootAttributesRequest {
+}
+
+message ListKeysRequest {
+ // The default behavior is by label so any extension here should honor that.
+}
+
+message ListKeysReply {
+ extend BaseReply {
+ optional ListKeysReply reply = 1004;
+ }
+ repeated string labels = 1;
+}
+
+message GetLoginStatusRequest {
+}
+
+message GetLoginStatusReply {
+ extend BaseReply {
+ optional GetLoginStatusReply reply = 1005;
+ }
+ optional bool owner_user_exists=1;
+ optional bool boot_lockbox_finalized=2;
+}
+
+message GetTpmStatusRequest {
+}
+
+message GetTpmStatusReply {
+ extend BaseReply {
+ optional GetTpmStatusReply reply = 1006;
+ }
+
+ message Identity {
+ // The identity features.
+ optional int32 features = 1;
+ }
+
+ message IdentityCertificate {
+ // The identity that is enrolled.
+ optional int32 identity = 1;
+ // The Privacy CA that the identity is enrolled with.
+ optional int32 aca = 2;
+ }
+
+ // Whether a TPM is enabled on the system.
+ optional bool enabled = 1;
+ // Whether the TPM has been owned.
+ optional bool owned = 2;
+ // Whether the TPM initialization flow has completed. This includes taking
+ // ownership, preparing attestation data, and finalizing lockbox NVRAM.
+ optional bool initialized = 3;
+ // The TPM owner password. This is only available when (owned &&
+ // !initialized) and sometimes not even then.
+ optional string owner_password = 4;
+ // Whether attestation data has been prepared. This includes reading the
+ // endorsement certificate out of NVRAM and generating an identity key. This
+ // does not include any kind of enrollment with a Privacy CA.
+ optional bool attestation_prepared = 7;
+ // Whether the device has enrolled with a Privacy CA. This means the identity
+ // key has been successfully certified.
+ optional bool attestation_enrolled = 8;
+ // The current dictionary attack counter value.
+ optional int32 dictionary_attack_counter = 9;
+ // The current dictionary attack counter threshold.
+ optional int32 dictionary_attack_threshold = 10;
+ // Whether the TPM is in some form of dictionary attack lockout.
+ optional bool dictionary_attack_lockout_in_effect = 11;
+ // The number of seconds remaining in the lockout.
+ optional int32 dictionary_attack_lockout_seconds_remaining = 12;
+ // Whether the install lockbox has been finalized.
+ optional bool install_lockbox_finalized = 13;
+ // Whether the boot lockbox has been finalized.
+ optional bool boot_lockbox_finalized = 14;
+ // Whether the current PCR values show a verified boot.
+ optional bool verified_boot_measured = 15;
+ // List of identities and their identity features.
+ repeated Identity identities = 16;
+ // List of identity certificates.
+ map<int32, IdentityCertificate> identity_certificates = 17;
+}
+
+message GetEndorsementInfoRequest {
+}
+
+message GetEndorsementInfoReply {
+ extend BaseReply {
+ optional GetEndorsementInfoReply reply = 1007;
+ }
+ // The endorsement public key (PKCS #1 RSAPublicKey).
+ optional bytes ek_public_key = 1;
+ // The endorsement certificate (X.509).
+ optional bytes ek_certificate = 2;
+}
+
+message InitializeCastKeyRequest {
+}
+
+// Flags for GetFirmwareManagementParametersReply and
+// SetFirmwareManagementParametersRequest
+enum FirmwareManagementParametersFlags {
+ NONE = 0;
+ DEVELOPER_DISABLE_BOOT = 1;
+ DEVELOPER_DISABLE_RECOVERY_INSTALL = 2;
+ DEVELOPER_DISABLE_RECOVERY_ROOTFS = 4;
+ DEVELOPER_ENABLE_USB = 8;
+ DEVELOPER_ENABLE_LEGACY = 16;
+ DEVELOPER_USE_KEY_HASH = 32;
+ DEVELOPER_DISABLE_CASE_CLOSED_DEBUGGING_UNLOCK = 64;
+}
+
+message GetFirmwareManagementParametersRequest {
+}
+
+message GetFirmwareManagementParametersReply {
+ extend BaseReply {
+ optional GetFirmwareManagementParametersReply reply = 1008;
+ }
+
+ // Flags (zero or more from FirmwareManagementParametersFlags)
+ optional int32 flags = 1;
+ optional bytes developer_key_hash = 2;
+}
+
+message SetFirmwareManagementParametersRequest {
+ // Flags (zero or more from FirmwareManagementParametersFlags)
+ optional int32 flags = 1;
+ optional bytes developer_key_hash = 2;
+}
+
+message RemoveFirmwareManagementParametersRequest {
+}
+
+message GetAccountDiskUsageReply {
+ extend BaseReply {
+ optional GetAccountDiskUsageReply reply = 1009;
+ }
+ // The size of cryptohome in bytes.
+ optional int64 size = 1;
+}
+
+// Request parameters for MigrateToDircrypto.
+message MigrateToDircryptoRequest {
+ // Next ID to use: 2
+
+ // If true, only a few paths (specified in cryptohomed) that are necessary for
+ // a working profile will be migrated. Most user data will be wiped.
+ optional bool minimal_migration = 1;
+}
+
+// Request parameters for challenge requests for keys of the
+// |KEY_TYPE_CHALLENGE_RESPONSE| type.
+message KeyChallengeRequest {
+ // Specifies challenge types.
+ enum ChallengeType {
+ // Challenge is a request of a cryptographic signature of the specified data
+ // using the specified key.
+ CHALLENGE_TYPE_SIGNATURE = 1;
+ }
+ // Type of the requested challenge.
+ optional ChallengeType challenge_type = 1;
+ // Is set when |challenge_type| is |CHALLENGE_TYPE_SIGNATURE|. Contains the
+ // challenge request data.
+ optional SignatureKeyChallengeRequestData signature_request_data = 2;
+}
+
+// Request data for challenge requests of the |CHALLENGE_TYPE_SIGNATURE| request
+// type.
+message SignatureKeyChallengeRequestData {
+ // The blob of data for which the signature is asked.
+ optional bytes data_to_sign = 1;
+ // Specifies the key which is asked to sign the data. Contains the DER-encoded
+ // blob of the X.509 Subject Public Key Info.
+ optional bytes public_key_spki_der = 2;
+ // Specifies the signature algorithm that has to be used.
+ optional ChallengeSignatureAlgorithm signature_algorithm = 3;
+}
+
+// Response for challenge requests.
+message KeyChallengeResponse {
+ // Is set for responses to challenge requests of the
+ // |CHALLENGE_TYPE_SIGNATURE| challenge type. Contains the challenge response
+ // data.
+ optional SignatureKeyChallengeResponseData signature_response_data = 1;
+}
+
+// Response data for challenge requests of the |CHALLENGE_TYPE_SIGNATURE|
+// challenge type.
+message SignatureKeyChallengeResponseData {
+ // The signature blob of the requested data.
+ optional bytes signature = 1;
+}
+
+// Request a GetSupportedKeyPoliciesReply from cryptohome.
+message GetSupportedKeyPoliciesRequest {
+}
+
+// Response that informs the caller which KeyPolicy features are supported.
+message GetSupportedKeyPoliciesReply {
+ // Next ID to use: 2
+
+ extend BaseReply {
+ optional GetSupportedKeyPoliciesReply reply = 1010;
+ }
+
+ // Does it support low entropy credentials.
+ optional bool low_entropy_credentials = 1;
+}
+
+message MigrateKeyRequest {
+ optional bytes secret = 1;
+}
+
+// Mount the guest user partition.
+message MountGuestRequest {
+}
diff --git a/dbus/cryptohome/signed_secret.proto b/dbus/cryptohome/signed_secret.proto
new file mode 100644
index 0000000..16fedab
--- /dev/null
+++ b/dbus/cryptohome/signed_secret.proto
@@ -0,0 +1,34 @@
+// Copyright (c) 2014 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.
+//
+// Provides wire protocol for signed password changes from
+// the cloud for Chrome OS accounts subject to remote management.
+//
+// The data in this file will be shared in Chrome, Chrome OS (cryptohome),
+// and on servers. Ensure all parties are aware when making changes.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package ac.chrome.managedaccounts.account;
+
+// The secret currently assumes a password-equivalent key and a
+// revision, to avoid rollbacks. This secret should be serialized
+// and signed by a pre-negotiated key to authorize updates from the
+// server to the host OS.
+message Secret {
+ optional int64 revision = 1;
+ optional bytes secret = 2;
+ // In the future, a type field will be added to allow encrypted secrets
+ // and different secret types.
+}
+
+// This is an example format if this were sent on the wire.
+// It is assumed that neither Secret or SignedSecret will ever be sent
+// on the wire, but only reconstructed from source data.
+message SignedSecret {
+ optional bytes serialized_secret = 1;
+ optional bytes signature = 2;
+}
diff --git a/dbus/debugd/dbus-constants.h b/dbus/debugd/dbus-constants.h
new file mode 100644
index 0000000..248cc09
--- /dev/null
+++ b/dbus/debugd/dbus-constants.h
@@ -0,0 +1,76 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_DEBUGD_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_DEBUGD_DBUS_CONSTANTS_H_
+
+namespace debugd {
+const char kDebugdInterface[] = "org.chromium.debugd";
+const char kDebugdServicePath[] = "/org/chromium/debugd";
+const char kDebugdServiceName[] = "org.chromium.debugd";
+
+// Methods.
+const char kCupsAddManuallyConfiguredPrinter[] =
+ "CupsAddManuallyConfiguredPrinter";
+const char kCupsAddAutoConfiguredPrinter[] = "CupsAddAutoConfiguredPrinter";
+const char kCupsRemovePrinter[] = "CupsRemovePrinter";
+const char kDumpDebugLogs[] = "DumpDebugLogs";
+const char kGetInterfaces[] = "GetInterfaces";
+const char kGetModemStatus[] = "GetModemStatus";
+const char kGetNetworkStatus[] = "GetNetworkStatus";
+const char kGetPerfOutput[] = "GetPerfOutput";
+const char kGetPerfOutputFd[] = "GetPerfOutputFd";
+const char kGetRoutes[] = "GetRoutes";
+const char kGetWiMaxStatus[] = "GetWiMaxStatus";
+const char kSetDebugMode[] = "SetDebugMode";
+const char kSystraceStart[] = "SystraceStart";
+const char kSystraceStop[] = "SystraceStop";
+const char kSystraceStatus[] = "SystraceStatus";
+const char kGetLog[] = "GetLog";
+const char kGetAllLogs[] = "GetAllLogs";
+const char kGetUserLogFiles[] = "GetUserLogFiles";
+const char kGetFeedbackLogs[] = "GetFeedbackLogs";
+const char kGetBigFeedbackLogs[] = "GetBigFeedbackLogs";
+const char kTestICMP[] = "TestICMP";
+const char kTestICMPWithOptions[] = "TestICMPWithOptions";
+const char kLogKernelTaskStates[] = "LogKernelTaskStates";
+const char kUploadCrashes[] = "UploadCrashes";
+const char kRemoveRootfsVerification[] = "RemoveRootfsVerification";
+const char kEnableChromeRemoteDebugging[] = "EnableChromeRemoteDebugging";
+const char kEnableBootFromUsb[] = "EnableBootFromUsb";
+const char kConfigureSshServer[] = "ConfigureSshServer";
+const char kSetUserPassword[] = "SetUserPassword";
+const char kEnableChromeDevFeatures[] = "EnableChromeDevFeatures";
+const char kQueryDevFeatures[] = "QueryDevFeatures";
+const char kSetOomScoreAdj[] = "SetOomScoreAdj";
+const char kStartVmConcierge[] = "StartVmConcierge";
+const char kStopVmConcierge[] = "StopVmConcierge";
+const char kSetRlzPingSent[] = "SetRlzPingSent";
+
+// Values.
+enum DevFeatureFlag {
+ DEV_FEATURES_DISABLED = 1 << 0,
+ DEV_FEATURE_ROOTFS_VERIFICATION_REMOVED = 1 << 1,
+ DEV_FEATURE_BOOT_FROM_USB_ENABLED = 1 << 2,
+ DEV_FEATURE_SSH_SERVER_CONFIGURED = 1 << 3,
+ DEV_FEATURE_DEV_MODE_ROOT_PASSWORD_SET = 1 << 4,
+ DEV_FEATURE_SYSTEM_ROOT_PASSWORD_SET = 1 << 5,
+ DEV_FEATURE_CHROME_REMOTE_DEBUGGING_ENABLED = 1 << 6,
+};
+
+// CupsAdd* error codes
+enum CupsResult {
+ CUPS_SUCCESS = 0,
+ CUPS_FATAL = 1,
+ CUPS_INVALID_PPD = 2,
+ CUPS_LPADMIN_FAILURE = 3,
+ CUPS_AUTOCONF_FAILURE = 4,
+};
+
+// Debug log keys which should be substituted in the system info dialog.
+const char kIwlwifiDumpKey[] = "iwlwifi_dump";
+
+} // namespace debugd
+
+#endif // SYSTEM_API_DBUS_DEBUGD_DBUS_CONSTANTS_H_
diff --git a/dbus/diagnosticsd/dbus-constants.h b/dbus/diagnosticsd/dbus-constants.h
new file mode 100644
index 0000000..dbb1de7
--- /dev/null
+++ b/dbus/diagnosticsd/dbus-constants.h
@@ -0,0 +1,26 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Constants for the D-Bus API exposed by the diagnosticsd daemon. Normally the
+// consumer of this API is the browser.
+
+#ifndef SYSTEM_API_DBUS_DIAGNOSTICSD_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_DIAGNOSTICSD_DBUS_CONSTANTS_H_
+
+namespace diagnostics {
+
+constexpr char kDiagnosticsdServiceInterface[] =
+ "org.chromium.DiagnosticsdInterface";
+constexpr char kDiagnosticsdServicePath[] = "/org/chromium/Diagnosticsd";
+constexpr char kDiagnosticsdServiceName[] = "org.chromium.Diagnosticsd";
+
+constexpr char kDiagnosticsdBootstrapMojoConnectionMethod[] =
+ "BootstrapMojoConnection";
+
+// Token used for the Mojo connection pipe.
+constexpr char kDiagnosticsdMojoConnectionChannelToken[] = "diagnosticsd";
+
+} // namespace diagnostics
+
+#endif // SYSTEM_API_DBUS_DIAGNOSTICSD_DBUS_CONSTANTS_H_
diff --git a/dbus/drivefs/dbus-constants.h b/dbus/drivefs/dbus-constants.h
new file mode 100644
index 0000000..92ebac6
--- /dev/null
+++ b/dbus/drivefs/dbus-constants.h
@@ -0,0 +1,19 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_DRIVEFS_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_DRIVEFS_DBUS_CONSTANTS_H_
+
+namespace drivefs {
+
+const char kDriveFileStreamInterface[] = "org.chromium.DriveFileStream";
+const char kDriveFileStreamServicePath[] = "/org/chromium/DriveFileStream";
+const char kDriveFileStreamServiceName[] = "org.chromium.DriveFileStream";
+
+const char kDriveFileStreamOpenIpcChannelMethod[] = "OpenIpcChannel";
+
+} // namespace drivefs
+
+
+#endif // SYSTEM_API_DBUS_DRIVEFS_DBUS_CONSTANTS_H_
diff --git a/dbus/field_trial_list.proto b/dbus/field_trial_list.proto
new file mode 100644
index 0000000..5558308
--- /dev/null
+++ b/dbus/field_trial_list.proto
@@ -0,0 +1,20 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+// This protobuf is for serializing Finch experimental field trial data to
+// disk for consumption by processes outside the browser.
+message FieldTrialList {
+ // A pair representing a Field Trial and its selected group.
+ message ActiveGroup {
+ optional string trial_name = 1;
+ optional string group_name = 2;
+ }
+
+ // All the active field trial groups for this device.
+ repeated ActiveGroup group = 1;
+}
diff --git a/dbus/hammerd/dbus-constants.h b/dbus/hammerd/dbus-constants.h
new file mode 100644
index 0000000..9ca6f4b
--- /dev/null
+++ b/dbus/hammerd/dbus-constants.h
@@ -0,0 +1,24 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_HAMMERD_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_HAMMERD_DBUS_CONSTANTS_H_
+
+namespace hammerd {
+const char kHammerdInterface[] = "org.chromium.hammerd";
+const char kHammerdServicePath[] = "/org/chromium/hammerd";
+const char kHammerdServiceName[] = "org.chromium.hammerd";
+
+// Signals emitted by hammerd.
+const char kBaseFirmwareNeedUpdateSignal[] = "BaseFirmwareNeedUpdate";
+const char kBaseFirmwareUpdateStartedSignal[] = "BaseFirmwareUpdateStarted";
+const char kBaseFirmwareUpdateSucceededSignal[] = "BaseFirmwareUpdateSucceeded";
+const char kBaseFirmwareUpdateFailedSignal[] = "BaseFirmwareUpdateFailed";
+const char kPairChallengeSucceededSignal[] = "PairChallengeSucceeded";
+const char kPairChallengeFailedSignal[] = "PairChallengeFailed";
+const char kInvalidBaseConnectedSignal[] = "InvalidBaseConnected";
+
+} // namespace hammerd
+
+#endif // SYSTEM_API_DBUS_HAMMERD_DBUS_CONSTANTS_H_
diff --git a/dbus/login_manager/arc.proto b/dbus/login_manager/arc.proto
new file mode 100644
index 0000000..16dc3fa
--- /dev/null
+++ b/dbus/login_manager/arc.proto
@@ -0,0 +1,82 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package login_manager;
+
+// ARC start options sent from Chrome to session manager. This message is used
+// in the SessionManagerInterface.StartArcMiniContainer method.
+message StartArcMiniContainerRequest {
+ optional bool native_bridge_experiment = 1 [default = false];
+ // The density value passed to "ro.sf.lcd_density" property.
+ optional int32 lcd_density = 2 [default = -1];
+}
+
+// ARC upgrade options sent from Chrome to session manager. This message is used
+// in the SessionManagerInterface.UpgradeArcContainer method.
+message UpgradeArcContainerRequest {
+ enum PackageCacheMode {
+ // Performs packages cache setup if the pre-generated cache exists.
+ DEFAULT = 0;
+ // Performs packages cache setup if the pre-generated cache exists and
+ // copies resulting packages.xml to the temporary location after
+ // SystemServer initialized the package manager.
+ COPY_ON_INIT = 1;
+ // Skips packages cache setup and copies resulting packages.xml to the
+ // temporary location after SystemServer initialized the package manager.
+ SKIP_SETUP_COPY_ON_INIT = 2;
+ }
+
+ enum SupervisionTransition {
+ // No transition necessary.
+ NONE = 0;
+ // Child user is transitioning to regular account, need to lift supervision.
+ CHILD_TO_REGULAR = 1;
+ // Regular user is transitioning to child account, need to enable
+ // supervision.
+ REGULAR_TO_CHILD = 2;
+ }
+
+ // Account ID of the user to start ARC for. This must be the same as the
+ // one given in StartSession.
+ required string account_id = 1;
+
+ // Option to disable ACTION_BOOT_COMPLETED broadcast for 3rd party apps.
+ optional bool skip_boot_completed_broadcast = 2 [default = false];
+
+ // Option to enable package manager service to scan /vendor/priv-app
+ // directory.
+ optional bool scan_vendor_priv_app = 3 [default = false];
+
+ // Optional mode for packages cache tests.
+ optional PackageCacheMode packages_cache_mode = 4 [default = DEFAULT];
+
+ // Option to notify ARC if the account is a child, allowing us to provide
+ // special behavior for child account on ARC.
+ optional bool is_child = 9;
+
+ // Whether the container is being upgraded for a Chrome OS demo session.
+ optional bool is_demo_session = 10;
+
+ // Non-empty only if the ARC container is being upgraded for a Chrome OS demo
+ // session. The absolute path to the squashfs image that contains the set of
+ // Android apps to be pre-installed into demo sessions. Note that arc-setup
+ // expects this to be a path loaded by the imageloader service.
+ optional string demo_session_apps_path = 6;
+
+ // Locale to set in Android container during the boot.
+ optional string locale = 7;
+
+ // Preferred languages to set in Android container during the boot.
+ repeated string preferred_languages = 8;
+
+ // Option to notify ARC that it should transition from a supervised state to
+ // a non-supervised state, and vice-versa.
+ optional SupervisionTransition supervision_transition = 11;
+
+ // Next ID to use: 12
+}
diff --git a/dbus/login_manager/dbus-constants.h b/dbus/login_manager/dbus-constants.h
new file mode 100644
index 0000000..d215003
--- /dev/null
+++ b/dbus/login_manager/dbus-constants.h
@@ -0,0 +1,144 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_
+
+namespace login_manager {
+const char kSessionManagerInterface[] = "org.chromium.SessionManagerInterface";
+const char kSessionManagerServicePath[] = "/org/chromium/SessionManager";
+const char kSessionManagerServiceName[] = "org.chromium.SessionManager";
+// Methods
+const char kSessionManagerEmitLoginPromptVisible[] = "EmitLoginPromptVisible";
+const char kSessionManagerEmitAshInitialized[] = "EmitAshInitialized";
+const char kSessionManagerEnableChromeTesting[] = "EnableChromeTesting";
+const char kSessionManagerSaveLoginPassword[] = "SaveLoginPassword";
+const char kSessionManagerStartSession[] = "StartSession";
+const char kSessionManagerStopSession[] = "StopSession";
+const char kSessionManagerRestartJob[] = "RestartJob";
+const char kSessionManagerStorePolicy[] = "StorePolicy";
+const char kSessionManagerStorePolicyEx[] = "StorePolicyEx";
+const char kSessionManagerStoreUnsignedPolicy[] = "StoreUnsignedPolicy";
+const char kSessionManagerStoreUnsignedPolicyEx[] = "StoreUnsignedPolicyEx";
+const char kSessionManagerRetrievePolicy[] = "RetrievePolicy";
+const char kSessionManagerRetrievePolicyEx[] = "RetrievePolicyEx";
+const char kSessionManagerStorePolicyForUser[] = "StorePolicyForUser";
+const char kSessionManagerStoreUnsignedPolicyForUser[] =
+ "StoreUnsignedPolicyForUser";
+const char kSessionManagerRetrievePolicyForUser[] = "RetrievePolicyForUser";
+const char kSessionManagerRetrievePolicyForUserWithoutSession[] =
+ "RetrievePolicyForUserWithoutSession";
+const char kSessionManagerStoreDeviceLocalAccountPolicy[] =
+ "StoreDeviceLocalAccountPolicy";
+const char kSessionManagerRetrieveDeviceLocalAccountPolicy[] =
+ "RetrieveDeviceLocalAccountPolicy";
+const char kSessionManagerListStoredComponentPolicies[] =
+ "ListStoredComponentPolicies";
+const char kSessionManagerRetrieveSessionState[] = "RetrieveSessionState";
+const char kSessionManagerRetrieveActiveSessions[] = "RetrieveActiveSessions";
+const char kSessionManagerRetrievePrimarySession[] = "RetrievePrimarySession";
+const char kSessionManagerStartTPMFirmwareUpdate[] = "StartTPMFirmwareUpdate";
+const char kSessionManagerStartDeviceWipe[] = "StartDeviceWipe";
+const char kSessionManagerHandleSupervisedUserCreationStarting[] =
+ "HandleSupervisedUserCreationStarting";
+const char kSessionManagerHandleSupervisedUserCreationFinished[] =
+ "HandleSupervisedUserCreationFinished";
+const char kSessionManagerLockScreen[] = "LockScreen";
+const char kSessionManagerHandleLockScreenShown[] = "HandleLockScreenShown";
+const char kSessionManagerHandleLockScreenDismissed[] =
+ "HandleLockScreenDismissed";
+const char kSessionManagerSetFlagsForUser[] = "SetFlagsForUser";
+const char kSessionManagerGetServerBackedStateKeys[] =
+ "GetServerBackedStateKeys";
+const char kSessionManagerInitMachineInfo[] = "InitMachineInfo";
+const char kSessionManagerCheckArcAvailability[] = "CheckArcAvailability";
+const char kSessionManagerStartArcMiniContainer[] = "StartArcMiniContainer";
+const char kSessionManagerUpgradeArcContainer[] = "UpgradeArcContainer";
+const char kSessionManagerStopArcInstance[] = "StopArcInstance";
+const char kSessionManagerSetArcCpuRestriction[] = "SetArcCpuRestriction";
+const char kSessionManagerEmitArcBooted[] = "EmitArcBooted";
+const char kSessionManagerGetArcStartTimeTicks[] = "GetArcStartTimeTicks";
+const char kSessionManagerRemoveArcData[] = "RemoveArcData";
+const char kSessionManagerStartContainer[] = "StartContainer";
+const char kSessionManagerStopContainer[] = "StopContainer";
+// Signals
+const char kLoginPromptVisibleSignal[] = "LoginPromptVisible";
+const char kSessionStateChangedSignal[] = "SessionStateChanged";
+// ScreenLock signals.
+const char kScreenIsLockedSignal[] = "ScreenIsLocked";
+const char kScreenIsUnlockedSignal[] = "ScreenIsUnlocked";
+// Ownership API signals.
+const char kOwnerKeySetSignal[] = "SetOwnerKeyComplete";
+const char kPropertyChangeCompleteSignal[] = "PropertyChangeComplete";
+// ARC instance signals.
+const char kArcInstanceStopped[] = "ArcInstanceStopped";
+const char kArcInstanceRebooted[] = "ArcInstanceRebooted";
+
+// D-Bus error codes
+namespace dbus_error {
+#define INTERFACE "org.chromium.SessionManagerInterface"
+
+const char kNone[] = INTERFACE ".None";
+const char kInvalidParameter[] = INTERFACE ".InvalidParameter";
+const char kArcCpuCgroupFail[] = INTERFACE ".ArcCpuCgroupFail";
+const char kArcInstanceRunning[] = INTERFACE ".ArcInstanceRunning";
+const char kArcContainerNotFound[] = INTERFACE ".ArcContainerNotFound";
+const char kContainerStartupFail[] = INTERFACE ".ContainerStartupFail";
+const char kContainerShutdownFail[] = INTERFACE ".ContainerShutdownFail";
+const char kDeleteFail[] = INTERFACE ".DeleteFail";
+const char kEmitFailed[] = INTERFACE ".EmitFailed";
+const char kGetServiceFail[] = INTERFACE ".kGetServiceFail";
+const char kInitMachineInfoFail[] = INTERFACE ".InitMachineInfoFail";
+const char kInvalidAccount[] = INTERFACE ".InvalidAccount";
+const char kLowFreeDisk[] = INTERFACE ".LowFreeDisk";
+const char kNoOwnerKey[] = INTERFACE ".NoOwnerKey";
+const char kNoUserNssDb[] = INTERFACE ".NoUserNssDb";
+const char kNotAvailable[] = INTERFACE ".NotAvailable";
+const char kNotStarted[] = INTERFACE ".NotStarted";
+const char kPolicyInitFail[] = INTERFACE ".PolicyInitFail";
+const char kPubkeySetIllegal[] = INTERFACE ".PubkeySetIllegal";
+const char kPolicySignatureRequired[] = INTERFACE ".PolicySignatureRequired";
+const char kSessionDoesNotExist[] = INTERFACE ".SessionDoesNotExist";
+const char kSessionExists[] = INTERFACE ".SessionExists";
+const char kSigDecodeFail[] = INTERFACE ".SigDecodeFail";
+const char kSigEncodeFail[] = INTERFACE ".SigEncodeFail";
+const char kTestingChannelError[] = INTERFACE ".TestingChannelError";
+const char kUnknownPid[] = INTERFACE ".UnknownPid";
+const char kVerifyFail[] = INTERFACE ".VerifyFail";
+const char kVpdUpdateFailed[] = INTERFACE ".VpdUpdateFailed";
+
+#undef INTERFACE
+} // namespace dbus_error
+
+// Values
+enum ContainerCpuRestrictionState {
+ CONTAINER_CPU_RESTRICTION_FOREGROUND = 0,
+ CONTAINER_CPU_RESTRICTION_BACKGROUND = 1,
+ NUM_CONTAINER_CPU_RESTRICTION_STATES = 2,
+};
+
+enum class ArcContainerStopReason {
+ // The ARC container is crashed.
+ CRASH = 0,
+
+ // Stopped by the user request, e.g. disabling ARC.
+ USER_REQUEST = 1,
+
+ // Session manager is shut down. So, ARC is also shut down along with it.
+ SESSION_MANAGER_SHUTDOWN = 2,
+
+ // Browser was shut down. ARC is also shut down along with it.
+ BROWSER_SHUTDOWN = 3,
+
+ // Disk space is too small to upgrade ARC.
+ LOW_DISK_SPACE = 4,
+
+ // Failed to upgrade ARC mini container into full container.
+ // Note that this will be used if the reason is other than low-disk-space.
+ UPGRADE_FAILURE = 5,
+};
+
+} // namespace login_manager
+
+#endif // SYSTEM_API_DBUS_LOGIN_MANAGER_DBUS_CONSTANTS_H_
diff --git a/dbus/login_manager/policy_descriptor.proto b/dbus/login_manager/policy_descriptor.proto
new file mode 100644
index 0000000..2ea8809
--- /dev/null
+++ b/dbus/login_manager/policy_descriptor.proto
@@ -0,0 +1,71 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package login_manager;
+
+// Specifies the account type that the |account_id| in PolicyDescriptor
+// references.
+enum PolicyAccountType {
+ // |account_id| must be empty. Policy is stored in a device-wide root-owned
+ // location.
+ ACCOUNT_TYPE_DEVICE = 0;
+
+ // |account_id| references a user account. Policy is stored on the user's
+ // cryptohome.
+ ACCOUNT_TYPE_USER = 1;
+
+ // |account_id| references a user account where the user session hasn't been
+ // added to Session Manager yet. Special case to retrieve user policy on the
+ // login screen.
+ ACCOUNT_TYPE_SESSIONLESS_USER = 2;
+
+ // |account_id| references a device local account. Policy is stored in a
+ // device-wide root-owned location in a folder that depends on |account_id|.
+ ACCOUNT_TYPE_DEVICE_LOCAL_ACCOUNT = 3;
+
+ // Next ID to use: 4
+};
+
+// Within a given account, policies are namespaced by a
+// (|domain|, |component_id|) pair in PolicyDescriptor.
+// The meaning of the |component_id| depends on the domain, see below.
+enum PolicyDomain {
+ // Domain for Chrome policies. |component_id| must be empty.
+ POLICY_DOMAIN_CHROME = 0;
+
+ // Domain for policies for regular Chrome extensions. |component_id| must be
+ // equal to the extension ID.
+ POLICY_DOMAIN_EXTENSIONS = 1;
+
+ // Domain for policies for Chrome extensions running under the Chrome OS
+ // signin profile. |component_id| must be equal to the extension ID.
+ POLICY_DOMAIN_SIGNIN_EXTENSIONS = 2;
+
+ // Next ID to use: 3
+};
+
+// Descriptor for policy blobs to give SessionManager's StorePolicy*Ex and
+// RetrievePolicyEx enough context to decide how to store policy.
+message PolicyDescriptor {
+ // The pair (|account_type|, |account_id|) determines the account for policy
+ // storage.
+ optional PolicyAccountType account_type = 1;
+
+ // The meaning of |account_id| depends on |account_type|, see
+ // PolicyAccountType.
+ optional string account_id = 2;
+
+ // The pair (|domain|, |component_id|) determines the namespace for policy
+ // storage.
+ optional PolicyDomain domain = 3;
+
+ // The meaning of |component_id| depends on |domain|, see PolicyDomain.
+ optional string component_id = 4;
+
+ // Next ID to use: 5
+}
diff --git a/dbus/lorgnette/dbus-constants.h b/dbus/lorgnette/dbus-constants.h
new file mode 100644
index 0000000..ac2e8ac
--- /dev/null
+++ b/dbus/lorgnette/dbus-constants.h
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_LORGNETTE_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_LORGNETTE_DBUS_CONSTANTS_H_
+
+namespace lorgnette {
+const char kManagerServiceName[] = "org.chromium.lorgnette";
+const char kManagerServiceInterface[] = "org.chromium.lorgnette.Manager";
+const char kManagerServicePath[] = "/org/chromium/lorgnette/Manager";
+const char kManagerServiceError[] = "org.chromium.lorgnette.Error";
+
+// Methods.
+const char kListScannersMethod[] = "ListScanners";
+const char kScanImageMethod[] = "ScanImage";
+
+// Attributes of scanners returned from "ListScanners".
+const char kScannerPropertyManufacturer[] = "Manufacturer";
+const char kScannerPropertyModel[] = "Model";
+const char kScannerPropertyType[] = "Type";
+
+// Parameters supplied to a "ScanImage" request.
+const char kScanPropertyMode[] = "Mode";
+const char kScanPropertyModeColor[] = "Color";
+const char kScanPropertyModeGray[] = "Gray";
+const char kScanPropertyModeLineart[] = "Lineart";
+const char kScanPropertyResolution[] = "Resolution";
+} // namespace lorgnette
+
+#endif // SYSTEM_API_DBUS_LORGNETTE_DBUS_CONSTANTS_H_
diff --git a/dbus/metrics_event/metrics_event.proto b/dbus/metrics_event/metrics_event.proto
new file mode 100644
index 0000000..c1a2762
--- /dev/null
+++ b/dbus/metrics_event/metrics_event.proto
@@ -0,0 +1,30 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+
+option optimize_for = LITE_RUNTIME;
+
+package metrics_event;
+
+// Content of signals emitted by Chrome (the ChromeEvent signal in the
+// MetricsEventService) and the anomaly_collector daemon (the AnomalyEvent
+// signal in the AnomalyEventService) to report events of interest for
+// measurements.
+message Event {
+ // Event types.
+ enum Type {
+ TAB_DISCARD = 0;
+ OOM_KILL = 1; // obsolete---use OOM_KILL_BROWSER instead
+ TAB_SWITCH = 2;
+ OOM_KILL_BROWSER = 3;
+ OOM_KILL_KERNEL = 4;
+ }
+
+ // The type of the event being signaled.
+ Type type = 1;
+
+ // The time of the event (CLOCK_MONOTONIC in milliseconds).
+ int64 timestamp = 2;
+}
diff --git a/dbus/mtp_file_entry.proto b/dbus/mtp_file_entry.proto
new file mode 100644
index 0000000..943498b
--- /dev/null
+++ b/dbus/mtp_file_entry.proto
@@ -0,0 +1,55 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+// This protobuf is for sending file entries from a mtp/ptp device to the
+// browser.
+message MtpFileEntry {
+ // The id for the file on the mtp/ptp device.
+ optional uint32 item_id = 1;
+
+ // The id of this file's parent on the mtp/ptp device.
+ optional uint32 parent_id = 2;
+
+ // The file's name.
+ optional string file_name = 3;
+
+ // The file's size.
+ optional uint64 file_size = 4;
+
+ // The file's modification time. This is approximately the number of seconds
+ // since Unix epoch. However, it does not account for timezone offsets or
+ // daylight savings time.
+ optional int64 modification_time = 5;
+
+ // Values match libmtp values unless noted below.
+ enum FileType {
+ FILE_TYPE_FOLDER = 0;
+ FILE_TYPE_JPEG = 14;
+ FILE_TYPE_JFIF = 15;
+ FILE_TYPE_TIFF = 16;
+ FILE_TYPE_BMP = 17;
+ FILE_TYPE_GIF = 18;
+ FILE_TYPE_PICT = 19;
+ FILE_TYPE_PNG = 20;
+ FILE_TYPE_WINDOWSIMAGEFORMAT = 25;
+ FILE_TYPE_JP2 = 40;
+ FILE_TYPE_JPX = 41;
+ // Truly unknown file type.
+ FILE_TYPE_UNKNOWN = 44;
+ // There's more file types to map to, but right now they are not
+ // interesting. Just assign a dummy value for now.
+ FILE_TYPE_OTHER = 9999;
+ }
+
+ // The file's type.
+ optional FileType file_type = 6;
+}
+
+message MtpFileEntries {
+ repeated MtpFileEntry file_entries = 1;
+}
diff --git a/dbus/mtp_storage_info.proto b/dbus/mtp_storage_info.proto
new file mode 100644
index 0000000..0551b2a
--- /dev/null
+++ b/dbus/mtp_storage_info.proto
@@ -0,0 +1,57 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+// This protobuf is for sending the characteristics of a storage from a mtp/ptp
+// device to the browser.
+message MtpStorageInfo {
+ // The name of the storage. e.g. usb:2,5:65537
+ optional string storage_name = 1;
+
+ // Device vendor name. e.g. Kodak
+ optional string vendor = 2;
+
+ // Device vendor id. e.g. 0x040a
+ optional uint32 vendor_id = 3;
+
+ // Device product name. e.g. DC4800
+ optional string product = 4;
+
+ // Device product id. e.g. 0x0160
+ optional uint32 product_id = 5;
+
+ // Device flags as defined by libmtp. See libmtp's src/device-flags.h.
+ optional uint32 device_flags = 6;
+
+ // Device storage type as defined in the PIMA 15740-2000 standard, first
+ // edition, section 5.5.3, table 11.
+ optional uint32 storage_type = 7;
+
+ // Device file system type as defined in the PIMA 15740-2000 standard, first
+ // edition, section 5.5.3, table 12.
+ optional uint32 filesystem_type = 8;
+
+ // Access capability as defined in the PIMA 15740-2000 standard, first
+ // edition, section 5.5.3, table 13.
+ optional uint32 access_capability = 9;
+
+ // Capacity of the storage in bytes.
+ optional uint64 max_capacity = 10;
+
+ // Free space of the storage in bytes.
+ optional uint64 free_space_in_bytes = 11;
+
+ // Free space of the storage in objects. i.e. How many more objects can be
+ // created on the device.
+ optional uint64 free_space_in_objects = 12;
+
+ // A description of the storage. This is device dependent.
+ optional string storage_description = 13;
+
+ // The volume label of the storage. This is device dependent.
+ optional string volume_identifier = 14;
+}
diff --git a/dbus/oobe_config/dbus-constants.h b/dbus/oobe_config/dbus-constants.h
new file mode 100644
index 0000000..ef5b04e
--- /dev/null
+++ b/dbus/oobe_config/dbus-constants.h
@@ -0,0 +1,20 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_OOBE_CONFIG_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_OOBE_CONFIG_DBUS_CONSTANTS_H_
+
+namespace oobe_config {
+
+// General
+const char kOobeConfigRestoreInterface[] = "org.chromium.OobeConfigRestore";
+const char kOobeConfigRestoreServicePath[] = "/org/chromium/OobeConfigRestore";
+const char kOobeConfigRestoreServiceName[] = "org.chromium.OobeConfigRestore";
+
+// Methods
+const char kProcessAndGetOobeAutoConfigMethod[] = "ProcessAndGetOobeAutoConfig";
+
+} // namespace oobe_config
+
+#endif // SYSTEM_API_DBUS_OOBE_CONFIG_DBUS_CONSTANTS_H_
diff --git a/dbus/oobe_config/oobe_config.proto b/dbus/oobe_config/oobe_config.proto
new file mode 100644
index 0000000..d5d4b55
--- /dev/null
+++ b/dbus/oobe_config/oobe_config.proto
@@ -0,0 +1,13 @@
+// Copyright 2018 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.
+
+syntax = "proto3";
+
+option optimize_for = LITE_RUNTIME;
+
+package oobe_config;
+
+message OobeRestoreData {
+ string chrome_config_json = 1;
+}
diff --git a/dbus/permission_broker/dbus-constants.h b/dbus/permission_broker/dbus-constants.h
new file mode 100644
index 0000000..4e6467a
--- /dev/null
+++ b/dbus/permission_broker/dbus-constants.h
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_PERMISSION_BROKER_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_PERMISSION_BROKER_DBUS_CONSTANTS_H_
+
+namespace permission_broker {
+const char kPermissionBrokerInterface[] = "org.chromium.PermissionBroker";
+const char kPermissionBrokerServicePath[] = "/org/chromium/PermissionBroker";
+const char kPermissionBrokerServiceName[] = "org.chromium.PermissionBroker";
+
+// Methods
+const char kCheckPathAccess[] = "CheckPathAccess";
+const char kOpenPath[] = "OpenPath";
+const char kRequestTcpPortAccess[] = "RequestTcpPortAccess";
+const char kRequestUdpPortAccess[] = "RequestUdpPortAccess";
+const char kReleaseTcpPort[] = "ReleaseTcpPort";
+const char kReleaseUdpPort[] = "ReleaseUdpPort";
+const char kRequestVpnSetup[] = "RequestVpnSetup";
+const char kRemoveVpnSetup[] = "RemoveVpnSetup";
+const char kPowerCycleUsbPorts[] = "PowerCycleUsbPorts";
+} // namespace permission_broker
+
+#endif // SYSTEM_API_DBUS_PERMISSION_BROKER_DBUS_CONSTANTS_H_
diff --git a/dbus/power_manager/OWNERS b/dbus/power_manager/OWNERS
new file mode 100644
index 0000000..6a46306
--- /dev/null
+++ b/dbus/power_manager/OWNERS
@@ -0,0 +1,3 @@
+set noparent
+derat@chromium.org
+snanda@chromium.org
diff --git a/dbus/power_manager/backlight.proto b/dbus/power_manager/backlight.proto
new file mode 100644
index 0000000..5ceb19b
--- /dev/null
+++ b/dbus/power_manager/backlight.proto
@@ -0,0 +1,78 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// See
+// https://chromium.googlesource.com/chromiumos/platform2/+/master/power_manager/docs/screen_brightness.md
+// for information about the mapping between brightness percents and backlight
+// hardware levels.
+
+// Request to change the backlight brightness sent from Chrome to powerd in a
+// SetScreenBrightness D-Bus method call.
+message SetBacklightBrightnessRequest {
+ // Desired backlight brightness as a percent in the range [0.0, 100.0].
+ optional double percent = 1;
+
+ // The speed at which the brightness should go to the requested percent.
+ enum Transition {
+ // The brightness should animate to the new percent.
+ GRADUAL = 0;
+ // The brightness should instantaneously go to the new percent.
+ INSTANT = 1;
+ }
+ optional Transition transition = 2;
+
+ // The reason the request was sent.
+ enum Cause {
+ // Explicit user request (typically using the onscreen brightness slider).
+ USER_REQUEST = 0;
+ // Automated request based on a prediction of the desired brightness.
+ MODEL = 1;
+ }
+ optional Cause cause = 3;
+
+ // Next value to use: 4
+}
+
+// Announcement of a backlight brightness change emitted by powerd via a
+// ScreenBrightnessChanged or KeyboardBrightnessChanged D-Bus signal.
+message BacklightBrightnessChange {
+ // Current backlight brightness as a percent in the range [0.0, 100.0].
+ optional double percent = 1;
+
+ // The reason the brightness was changed.
+ enum Cause {
+ // Explicit user request, e.g. brightness keys or brightness slider.
+ USER_REQUEST = 0;
+ // Automated change in response to user activity (input event, video
+ // activity, etc.).
+ USER_ACTIVITY = 1;
+ // Automated powerd change triggered by idle timeout due to user inactivity.
+ USER_INACTIVITY = 2;
+ // Automated powerd change due by a change to the ambient light level.
+ AMBIENT_LIGHT_CHANGED = 3;
+ // An external power source was connected.
+ EXTERNAL_POWER_CONNECTED = 4;
+ // An external power source was disconnected.
+ EXTERNAL_POWER_DISCONNECTED = 5;
+ // Backlights were forced off by Chrome (typically due to the user tapping
+ // the power button on a convertible device).
+ FORCED_OFF = 6;
+ // Backlights are no longer being forced off by Chrome.
+ NO_LONGER_FORCED_OFF = 7;
+ // Unspecified automated change (suspend/resume, shutdown, etc.).
+ OTHER = 8;
+ // Automated request based on a prediction of the desired brightness.
+ MODEL = 9;
+ // Next value to use: 10
+ }
+ optional Cause cause = 2;
+
+ // Next value to use: 3
+}
diff --git a/dbus/power_manager/dbus-constants.h b/dbus/power_manager/dbus-constants.h
new file mode 100644
index 0000000..580db56
--- /dev/null
+++ b/dbus/power_manager/dbus-constants.h
@@ -0,0 +1,97 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
+
+namespace power_manager {
+
+// powerd
+const char kPowerManagerInterface[] = "org.chromium.PowerManager";
+const char kPowerManagerServicePath[] = "/org/chromium/PowerManager";
+const char kPowerManagerServiceName[] = "org.chromium.PowerManager";
+
+// Methods exposed by powerd.
+const char kSetScreenBrightnessMethod[] = "SetScreenBrightness";
+const char kDecreaseScreenBrightnessMethod[] = "DecreaseScreenBrightness";
+const char kIncreaseScreenBrightnessMethod[] = "IncreaseScreenBrightness";
+const char kGetScreenBrightnessPercentMethod[] = "GetScreenBrightnessPercent";
+// TODO(derat): Delete this after callers are using SetScreenBrightness.
+const char kSetScreenBrightnessPercentMethod[] = "SetScreenBrightnessPercent";
+const char kGetKeyboardBrightnessPercentMethod[] =
+ "GetKeyboardBrightnessPercent";
+const char kDecreaseKeyboardBrightnessMethod[] = "DecreaseKeyboardBrightness";
+const char kIncreaseKeyboardBrightnessMethod[] = "IncreaseKeyboardBrightness";
+const char kRequestRestartMethod[] = "RequestRestart";
+const char kRequestShutdownMethod[] = "RequestShutdown";
+const char kRequestSuspendMethod[] = "RequestSuspend";
+const char kGetPowerSupplyPropertiesMethod[] = "GetPowerSupplyProperties";
+const char kGetSwitchStatesMethod[] = "GetSwitchStates";
+const char kHandleUserActivityMethod[] = "HandleUserActivity";
+const char kHandleVideoActivityMethod[] = "HandleVideoActivity";
+const char kSetIsProjectingMethod[] = "SetIsProjecting";
+const char kSetPolicyMethod[] = "SetPolicy";
+const char kSetPowerSourceMethod[] = "SetPowerSource";
+const char kSetBacklightsForcedOffMethod[] = "SetBacklightsForcedOff";
+const char kGetBacklightsForcedOffMethod[] = "GetBacklightsForcedOff";
+const char kRegisterSuspendDelayMethod[] = "RegisterSuspendDelay";
+const char kUnregisterSuspendDelayMethod[] = "UnregisterSuspendDelay";
+const char kHandleSuspendReadinessMethod[] = "HandleSuspendReadiness";
+const char kRegisterDarkSuspendDelayMethod[] = "RegisterDarkSuspendDelay";
+const char kUnregisterDarkSuspendDelayMethod[] = "UnregisterDarkSuspendDelay";
+const char kHandleDarkSuspendReadinessMethod[] = "HandleDarkSuspendReadiness";
+const char kHandlePowerButtonAcknowledgmentMethod[] =
+ "HandlePowerButtonAcknowledgment";
+const char kIgnoreNextPowerButtonPressMethod[] = "IgnoreNextPowerButtonPress";
+const char kRecordDarkResumeWakeReasonMethod[] = "RecordDarkResumeWakeReason";
+const char kGetInactivityDelaysMethod[] = "GetInactivityDelays";
+const char kDeferScreenDimMethod[] = "DeferScreenDim";
+const char kCreateArcTimersMethod[] = "CreateArcTimers";
+const char kStartArcTimerMethod[] = "StartArcTimer";
+const char kDeleteArcTimersMethod[] = "DeleteArcTimers";
+
+// Signals emitted by powerd.
+const char kScreenBrightnessChangedSignal[] = "ScreenBrightnessChanged";
+const char kKeyboardBrightnessChangedSignal[] = "KeyboardBrightnessChanged";
+const char kPeripheralBatteryStatusSignal[] = "PeripheralBatteryStatus";
+const char kPowerSupplyPollSignal[] = "PowerSupplyPoll";
+const char kSuspendImminentSignal[] = "SuspendImminent";
+const char kDarkSuspendImminentSignal[] = "DarkSuspendImminent";
+const char kSuspendDoneSignal[] = "SuspendDone";
+const char kInputEventSignal[] = "InputEvent";
+const char kScreenDimImminentSignal[] = "ScreenDimImminent";
+const char kIdleActionImminentSignal[] = "IdleActionImminent";
+const char kIdleActionDeferredSignal[] = "IdleActionDeferred";
+const char kScreenIdleStateChangedSignal[] = "ScreenIdleStateChanged";
+const char kInactivityDelaysChangedSignal[] = "InactivityDelaysChanged";
+
+// Values
+const int kBrightnessTransitionGradual = 1;
+const int kBrightnessTransitionInstant = 2;
+enum UserActivityType {
+ USER_ACTIVITY_OTHER = 0,
+ USER_ACTIVITY_BRIGHTNESS_UP_KEY_PRESS = 1,
+ USER_ACTIVITY_BRIGHTNESS_DOWN_KEY_PRESS = 2,
+ USER_ACTIVITY_VOLUME_UP_KEY_PRESS = 3,
+ USER_ACTIVITY_VOLUME_DOWN_KEY_PRESS = 4,
+ USER_ACTIVITY_VOLUME_MUTE_KEY_PRESS = 5,
+};
+enum RequestRestartReason {
+ // An explicit user request (e.g. clicking a button).
+ REQUEST_RESTART_FOR_USER = 0,
+ // A system update.
+ REQUEST_RESTART_FOR_UPDATE = 1,
+ // Some other reason.
+ REQUEST_RESTART_OTHER = 2,
+};
+enum RequestShutdownReason {
+ // An explicit user request (e.g. clicking a button).
+ REQUEST_SHUTDOWN_FOR_USER = 0,
+ // Some other reason.
+ REQUEST_SHUTDOWN_OTHER = 1,
+};
+
+} // namespace power_manager
+
+#endif // SYSTEM_API_DBUS_POWER_MANAGER_DBUS_CONSTANTS_H_
diff --git a/dbus/power_manager/idle.proto b/dbus/power_manager/idle.proto
new file mode 100644
index 0000000..b733759
--- /dev/null
+++ b/dbus/power_manager/idle.proto
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Included in powerd's ScreenIdleStateChanged signal, emitted when the screen's
+// dimming or on/off state changes in response to user activity or inactivity.
+message ScreenIdleState {
+ // Next ID to use: 3
+
+ // If true, the screen-dim timeout has been reached.
+ //
+ // Note that this only reflects the inactivity delay. The screen may actually
+ // be turned off due to an earlier user request to reduce its brightness to 0,
+ // for instance. Use kBrightnessChangedSignal if you need to know the
+ // screen brightness currently requested by powerd.
+ optional bool dimmed = 1;
+
+ // If true, the screen-off timeout has been reached.
+ optional bool off = 2;
+}
diff --git a/dbus/power_manager/input_event.proto b/dbus/power_manager/input_event.proto
new file mode 100644
index 0000000..85aaadd
--- /dev/null
+++ b/dbus/power_manager/input_event.proto
@@ -0,0 +1,29 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Included in powerd's InputEvent signals.
+message InputEvent {
+ // Next ID to use: 3
+
+ // Type of event.
+ enum Type {
+ POWER_BUTTON_DOWN = 0;
+ POWER_BUTTON_UP = 1;
+ LID_OPEN = 2;
+ LID_CLOSED = 3;
+ TABLET_MODE_ON = 4;
+ TABLET_MODE_OFF = 5;
+ }
+ optional Type type = 1;
+
+ // Monotonically-increasing time at which this event occured, as given by
+ // base::TimeTicks::ToInternalValue().
+ optional int64 timestamp = 2;
+}
diff --git a/dbus/power_manager/peripheral_battery_status.proto b/dbus/power_manager/peripheral_battery_status.proto
new file mode 100644
index 0000000..fd4ba9e
--- /dev/null
+++ b/dbus/power_manager/peripheral_battery_status.proto
@@ -0,0 +1,22 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+message PeripheralBatteryStatus {
+ // Path of the battery sysfs.
+ optional string path = 1;
+
+ // Name of the peripheral device.
+ optional string name = 2;
+
+ // Battery level in range [0, 100]. Unset if the level is
+ // unknown or the device is disconnected.
+ optional int32 level = 3;
+}
+
diff --git a/dbus/power_manager/policy.proto b/dbus/power_manager/policy.proto
new file mode 100644
index 0000000..6c8f7f9
--- /dev/null
+++ b/dbus/power_manager/policy.proto
@@ -0,0 +1,168 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Power management policy sent from Chrome to powerd.
+//
+// New settings take effect immediately. For example, if |idle_ms| is
+// currently set to 15 minutes, the user has been inactive for 12 minutes,
+// and a message setting |idle_ms| to 10 minutes is received,
+// |idle_action| will be performed immediately. If |lid_closed_action| is
+// DO_NOTHING, the lid is closed, and |lid_closed_action| is then set to
+// SHUT_DOWN, the system will shut down immediately.
+//
+// In the case of an unset field, powerd will restore a default value (as
+// opposed to continuing to use a value set by a previous message). An
+// empty message will restore all settings to their defaults.
+//
+// Next ID to use: 19
+message PowerManagementPolicy {
+
+ enum Action {
+ // Suspends the system. Chrome may lock the screen first depending on
+ // its "Require password to wake from sleep" setting and the type of
+ // user that is logged in.
+ SUSPEND = 0;
+
+ // Ends the current user's session. Does nothing at the login screen.
+ STOP_SESSION = 1;
+
+ // Shuts the system down.
+ SHUT_DOWN = 2;
+
+ // Does nothing.
+ DO_NOTHING = 3;
+
+ // Next value to use: 4
+ }
+
+ message Delays {
+ // Delay after which |idle_action| is performed, in milliseconds. The
+ // inactivity timeout is reset in response to things like user activity
+ // (including the lid being opened, the power source changing, an
+ // external display being connected, etc.), resuming from suspend, or
+ // the session state changing.
+ optional int64 idle_ms = 1;
+
+ // Delay after which the screen will be turned off, in milliseconds. 0
+ // disables turning the screen off. Capped to be less than or equal to
+ // |idle_ms|. The same events that cause the inactivity timeout to be
+ // reset cause the screen to be turned back on.
+ optional int64 screen_off_ms = 2;
+
+ // Delay after which the screen will be dimmed, in milliseconds. 0
+ // disables dimming. Capped to be less than or equal to
+ // |screen_off_ms| if |screen_off_ms| is set or less than or equal to
+ // |idle_ms| otherwise. The same events that cause the inactivity
+ // timeout to be reset cause the screen to be undimmed.
+ optional int64 screen_dim_ms = 3;
+
+ // Delay after which the screen will be locked, in milliseconds. 0
+ // disables locking. Capped to be less than |idle_ms|. Note that
+ // lock-on-suspend is implemented within Chrome; this delay is provided
+ // for cases where the screen must be locked a significant amount of
+ // time before the device is suspended.
+ optional int64 screen_lock_ms = 4;
+
+ // Delay after which an IdleActionImminent signal will be emitted, in
+ // milliseconds. If the inactivity timeout is then reset before the idle
+ // action is performed, an IdleActionDeferred signal will be emitted. If the
+ // idle delay is changed after IdleActionImminent has been emitted, an
+ // additional signal will be emitted. 0 disables the signal. Capped to be
+ // less than or equal to |idle_ms|.
+ optional int64 idle_warning_ms = 5;
+
+ // Next ID to use: 6
+ }
+
+ // Action to perform when |idle_ms| (see Delays) is reached without any
+ // user activity while the system is on AC power.
+ optional Action ac_idle_action = 1;
+
+ // Idle action when the system is on battery power.
+ optional Action battery_idle_action = 11;
+
+ // Action to perform when the lid is closed.
+ optional Action lid_closed_action = 2;
+
+ // Delays used while the system is on AC power.
+ optional Delays ac_delays = 3;
+
+ // Delays used while the system is on battery power.
+ optional Delays battery_delays = 4;
+
+ // True if at least one full-brightness, dimmed-but-on, or system-level wake
+ // lock is currently held.
+ optional bool screen_wake_lock = 16;
+ optional bool dim_wake_lock = 17;
+ optional bool system_wake_lock = 18;
+
+ // Should audio activity be honored? If true, audio activity will
+ // prevent |idle_action| from being performed, although the screen
+ // dimming, off, and lock delays will still be in effect. Once the audio
+ // has stopped, |idle_action| will be performed if no user or audio
+ // activity is observed for |idle_ms|.
+ optional bool use_audio_activity = 5;
+
+ // Should video activity be honored? If true, video activity will
+ // prevent |idle_action| from being performed and the screen from being
+ // automatically dimmed, turned off, or locked. All these timeouts will
+ // be reset once the video has stopped.
+ optional bool use_video_activity = 6;
+
+ // Backlight brightness in the range [0.0, 100.0] to use when on AC or battery
+ // power. When a message containing these fields is received, the backlight is
+ // set to the requested brightness. The updated brightness persists until the
+ // user manually changes it or a new policy containing the currently-relevant
+ // field is received.
+ optional double ac_brightness_percent = 13;
+ optional double battery_brightness_percent = 14;
+
+ // Factor by which |screen_dim_ms| will be scaled while the device is in
+ // presentation mode. Other delays' distances from |screen_dim_ms| are
+ // preserved after scaling. A value of 1.0 (or less) leaves delays
+ // unchanged. If the conditions used for both this field and
+ // |user_activity_screen_dim_delay_factor| are true, this field takes
+ // precedence.
+ optional double presentation_screen_dim_delay_factor = 10;
+
+ // Factor by which |screen_dim_ms| will be scaled if user activity is
+ // observed while the screen is dimmed or soon after it is turned off.
+ // Other delays' distances from |screen_dim_ms| are preserved after
+ // scaling. The delays will return to their original values at the end
+ // of the current user session. A value of 1.0 (or less) or an unset
+ // |screen_dim_ms| delay leaves delays unchanged.
+ optional double user_activity_screen_dim_delay_factor = 9;
+
+ // If true, instructs the power manager not to perform any
+ // delay-triggered actions while in a user session until user activity
+ // has been observed. After activity is seen, the inactivity timeout
+ // starts. The actions are deferred again after a new session starts.
+ // Note that this has no immediate effect if activity has already been
+ // seen within an already-started session (activity that took place
+ // before the policy change is honored) and also that it has no effect at
+ // the login screen.
+ optional bool wait_for_initial_user_activity = 12;
+
+ // If true, force the panel backlight to a non-zero brightness level in
+ // response to user activity if it was previously manually set to zero by the
+ // user.
+ optional bool force_nonzero_brightness_for_user_activity = 15;
+
+ // Human-readable description of the factors contributing to this policy.
+ // Logged by the power manager to aid in debugging.
+ optional string reason = 8;
+}
+
+// Message included in IdleActionImminent signals.
+message IdleActionImminent {
+ // Time until the idle action will be performed as given by
+ // base::TimeDelta::ToInternalValue().
+ optional int64 time_until_idle_action = 1;
+}
diff --git a/dbus/power_manager/power_supply_properties.proto b/dbus/power_manager/power_supply_properties.proto
new file mode 100644
index 0000000..17cc90f
--- /dev/null
+++ b/dbus/power_manager/power_supply_properties.proto
@@ -0,0 +1,167 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Power supply status sent from powerd to Chrome.
+message PowerSupplyProperties {
+ // For any of these power sources, the system may be consuming power at a high
+ // enough rate that the battery is discharging rather than charging; see
+ // BatteryState. See the PowerSource submessage's |type| field for more
+ // details about the active power source.
+ enum ExternalPower {
+ // AC/line/mains or USB PD power is connected. This is typically the
+ // highest-power source that can be attached to the system.
+ AC = 0;
+
+ // A low-power USB source (SDP, DCP, CDP, or ACA) is connected.
+ USB = 1;
+
+ // No external power source is connected.
+ DISCONNECTED = 2;
+
+ // Next value to use: 4
+ }
+
+ enum BatteryState {
+ // The battery is full or close to full.
+ FULL = 0;
+
+ // The battery is being charged but is not yet full.
+ CHARGING = 1;
+
+ // The battery is discharging. Note that an external power source may be
+ // connected but not supplying enough power to offset the system's
+ // instantaneous power consumption. This state is also used if the battery
+ // is neither charging nor discharging (i.e. current is zero) in a non-full
+ // state, which may indicate a battery defect.
+ DISCHARGING = 2;
+
+ // The system doesn't have a battery.
+ NOT_PRESENT = 3;
+
+ // Next value to use: 4
+ }
+
+ // Details about a potential source of power to the system.
+ message PowerSource {
+ enum Port {
+ // The location of the port is unknown, or there's only one port.
+ UNKNOWN = 0;
+
+ // Various positions on the device. The first word describes the side of
+ // the device where the port is located while the second clarifies the
+ // position. For example, LEFT_BACK means the farthest-back port on the
+ // left side, while BACK_LEFT means the leftmost port on the back of the
+ // device.
+ LEFT = 1;
+ RIGHT = 2;
+ BACK = 3;
+ FRONT = 4;
+ LEFT_FRONT = 5;
+ LEFT_BACK = 6;
+ RIGHT_FRONT = 7;
+ RIGHT_BACK = 8;
+ BACK_LEFT = 9;
+ BACK_RIGHT = 10;
+
+ // Next value to use: 11
+ }
+
+ enum Type {
+ // Unspecified type.
+ OTHER = 0;
+
+ // Dedicated charger. Typically single-purpose and non-USB (e.g. barrel
+ // jack plugs). Corresponds to kernel-reported type "Mains". This source
+ // is reported by the ACPI driver and may also appear (along with a USB_PD
+ // source) on Type-C-only systems if the ACPI driver is present.
+ MAINS = 1;
+
+ // USB Type-C, including dedicated Type-C chargers. Typically >= 7.5W.
+ // Corresponds to kernel-reported types "USB_C", "USB_PD", "USB_PD_DRP",
+ // and "BrickID".
+ USB_C = 2;
+
+ // USB Battery Charging r1.2. Typically <= 7.5W. Corresponds to
+ // kernel-reported types "USB", "USB_ACA", "USB_CDP", and "USB_DCP".
+ USB_BC_1_2 = 3;
+
+ // Next value to use: 4
+ }
+
+ // Opaque ID corresponding to the device. Do not use this for any purpose
+ // beyond comparisons with |external_power_source_id| or as an argument to
+ // powerd's SetPowerSource D-Bus method.
+ optional string id = 1;
+
+ // The charging port to which this power source is connected.
+ optional Port port = 7;
+
+ // Power source type.
+ optional Type type = 8;
+
+ // Raw strings read from |manufacturer| and |model_name| files in sysfs.
+ optional string manufacturer_id = 4;
+ optional string model_id = 5;
+
+ // Maximum power this source is capable of delivering, in watts.
+ optional double max_power = 6;
+
+ // True if the power source will automatically deliver charge to the system
+ // when connected (assuming there isn't another |active_by_default| source
+ // doing so). If false, the source will not deliver charge unless requested
+ // to do so by the user.
+ optional bool active_by_default = 3;
+
+ // Next ID to use: 9
+ }
+
+ // Current state of the external power source.
+ optional ExternalPower external_power = 14;
+
+ // ID of the PowerSource that is currently providing power to the system.
+ optional string external_power_source_id = 17;
+
+ // Currently-connected external power sources.
+ repeated PowerSource available_external_power_source = 18;
+
+ // Current state of the battery.
+ optional BatteryState battery_state = 15;
+
+ // Estimated battery charge as a percent of its total capacity, in the
+ // range [0.0, 100.0]. Unset if a battery isn't present.
+ optional double battery_percent = 7 [default = -1.0];
+
+ // Estimated time until the battery is empty, in seconds, or zero if the
+ // battery isn't discharging. -1 if the estimated time would be huge
+ // (e.g. because the current is zero or close to zero). Unset if a battery
+ // isn't present.
+ optional int64 battery_time_to_empty_sec = 5;
+
+ // Estimated time until the battery is full, in seconds, or zero if the
+ // battery isn't charging. -1 if the estimated time would be huge (e.g.
+ // because the current is zero or close to zero). Unset if a battery isn't
+ // present.
+ optional int64 battery_time_to_full_sec = 6;
+
+ // True when |battery_time_to_*| can't be trusted, e.g. because the power
+ // source just changed. Unset if a battery isn't present.
+ optional bool is_calculating_battery_time = 12 [default = false];
+
+ // The battery discharge rate measured in W. Positive if the battery is being
+ // discharged, negative if it's being charged, or unset if a battery isn't
+ // present.
+ optional double battery_discharge_rate = 16;
+
+ // True if it is possible for some connected devices to function as either
+ // sources or sinks (i.e. to either deliver or receive charge).
+ optional bool supports_dual_role_devices = 19;
+
+ // Next ID to use: 20
+}
diff --git a/dbus/power_manager/suspend.proto b/dbus/power_manager/suspend.proto
new file mode 100644
index 0000000..933045d
--- /dev/null
+++ b/dbus/power_manager/suspend.proto
@@ -0,0 +1,139 @@
+// Copyright 2014 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Included in powerd's SuspendImminent signal, sent when the system is about to
+// suspend. If any clients previously called RegisterSuspendDelay, suspending
+// will be deferred until they've called powerd's HandleSuspendReadiness method.
+//
+// The general flow is as follows:
+//
+// 1. A client that needs to perform some work before the system can be
+// suspended listens for SuspendImminent and SuspendDone signals from powerd.
+// 2. The client passes a RegisterSuspendDelayRequest message to powerd's
+// RegisterSuspendDelay method and receives a RegisterSuspendDelayReply
+// message in response. The client saves the |delay_id| field from the
+// response.
+// 3. When the power manager is about to suspend the system, it emits a
+// SuspendImminent signal containing a SuspendImminent message.
+// 4. Upon receipt of the signal, the client performs any last minute work
+// that it needs to do and then calls powerd's HandleSuspendReadiness method,
+// including a SuspendReadinessInfo message with its |delay_id| and the
+// |suspend_id| field from the SuspendImminent signal.
+// 5. Once powerd has received notification that all registered clients are
+// ready to suspend, the system will be suspended. If the initial suspend
+// attempt fails, it will be retried automatically, but additional
+// SuspendImminent signals will not be emitted.
+// 6. After the suspend request is complete, powerd emits a SuspendDone signal
+// containing a SuspendDone message. The client should undo any pre-suspend
+// work that was done in response to the SuspendImminent signal.
+// 7. Before the client exits, it calls UnregisterSuspendDelayRequest with a
+// UnregisterSuspendDelayRequest message containing its delay ID.
+//
+// Note that the original suspend request may be aborted before all clients have
+// reported readiness; this can happen if a user closes and then quickly opens
+// the lid, for instance. In this case, powerd will emit SuspendDone and return
+// to normal unsuspended behavior without waiting for clients to report
+// readiness. It's unnecessary for clients to report readiness for the original
+// |suspend_id| after a SuspendDone containing the same ID has been received.
+//
+// Clients that start asynchronous operations in response to SuspendImminent
+// should take this possibility into account. One approach is to queue the
+// "undo" operation when SuspendDone is received so it will run after the
+// original operation completes. Note that a second SuspendImminent signal may
+// be emitted before the original operation has completed; in this case, the
+// client may wish to unqueue the undo operation and instead report readiness
+// for the second, current |suspend_id| once the original operation completes.
+message SuspendImminent {
+ // Next ID to use: 2
+
+ enum Reason {
+ // The user inactivity idle timeout was reached.
+ IDLE = 0;
+ // The lid was closed.
+ LID_CLOSED = 1;
+ // Some other reason (e.g. an explicit user request).
+ OTHER = 2;
+ }
+
+ // Unique ID corresponding to this suspend request. This is included in the
+ // SuspendReadinessInfo message passed via HandleSuspendReadiness.
+ optional int32 suspend_id = 1;
+
+ // The reason the system is suspending.
+ optional Reason reason = 2;
+}
+
+// Included in powerd's SuspendDone signal, sent after the system has completed
+// a suspend request. Each SuspendImminent signal will be followed by a
+// SuspendDone signal.
+message SuspendDone {
+ // Next ID to use: 3
+
+ // Unique ID corresponding to the suspend request.
+ optional int32 suspend_id = 1;
+
+ // Wall time that the system was suspended, as given by
+ // base::TimeDelta::ToInternalValue().
+ optional int64 suspend_duration = 2;
+}
+
+// Included in calls to powerd's RegisterSuspendDelay method.
+message RegisterSuspendDelayRequest {
+ // Next ID to use: 3
+
+ // Upper bound on the amount of time that the power manager will wait for this
+ // client to call HandleSuspendReadiness before suspending the system, as
+ // given by base::TimeDelta::ToInternalValue().
+ optional int64 timeout = 1;
+
+ // Human-readable description of the delay's purpose (e.g. the name of
+ // the daemon that requested the delay). Only used for debugging.
+ optional string description = 2;
+}
+
+// Included in responses to powerd's RegisterSuspendDelay method.
+message RegisterSuspendDelayReply {
+ // Next ID to use: 2
+
+ // Unique ID assigned to the client that registered this suspend delay. This
+ // is included in later HandleSuspendReadiness and UnregisterSuspendDelay
+ // calls.
+ optional int32 delay_id = 1;
+}
+
+// Included in calls to powerd's UnregisterSuspendDelay method.
+message UnregisterSuspendDelayRequest {
+ // Next ID to use: 2
+
+ // ID that was returned in response to the original RegisterSuspendDelay call.
+ optional int32 delay_id = 1;
+}
+
+// Included in calls to powerd's HandleSuspendReadiness method.
+message SuspendReadinessInfo {
+ // Next ID to use: 3
+
+ // ID that was returned to the client in response to its invocation of
+ // RegisterSuspendDelay.
+ optional int32 delay_id = 1;
+
+ // ID that was included in the SuspendImminent signal that provoked this
+ // readiness call.
+ optional int32 suspend_id = 2;
+}
+
+// Included in calls to powerd's RecordDarkResumeWakeReason method.
+message DarkResumeWakeReason {
+ // Next ID to use: 2
+
+ // Wake reason that caused the current dark resume.
+ optional string wake_reason = 1;
+}
+
diff --git a/dbus/power_manager/switch_states.proto b/dbus/power_manager/switch_states.proto
new file mode 100644
index 0000000..e1a827c
--- /dev/null
+++ b/dbus/power_manager/switch_states.proto
@@ -0,0 +1,28 @@
+// Copyright 2017 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.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package power_manager;
+
+// Included in responses to GetSwitchStates method calls to powerd.
+message SwitchStates {
+ // Next ID to use: 3
+
+ enum LidState {
+ OPEN = 0;
+ CLOSED = 1;
+ NOT_PRESENT = 2;
+ }
+ optional LidState lid_state = 1;
+
+ enum TabletMode {
+ ON = 0;
+ OFF = 1;
+ UNSUPPORTED = 2;
+ }
+ optional TabletMode tablet_mode = 2;
+}
diff --git a/dbus/seneschal/dbus-constants.h b/dbus/seneschal/dbus-constants.h
new file mode 100644
index 0000000..feb2c12
--- /dev/null
+++ b/dbus/seneschal/dbus-constants.h
@@ -0,0 +1,24 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_SENESCHAL_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_SENESCHAL_DBUS_CONSTANTS_H_
+
+namespace vm_tools {
+namespace seneschal {
+
+const char kSeneschalInterface[] = "org.chromium.Seneschal";
+const char kSeneschalServicePath[] = "/org/chromium/Seneschal";
+const char kSeneschalServiceName[] = "org.chromium.Seneschal";
+
+// Exported methods.
+const char kStartServerMethod[] = "StartServer";
+const char kStopServerMethod[] = "StopServer";
+const char kSharePathMethod[] = "SharePath";
+
+
+} // namespace seneschal
+} // namespace vm_tools
+
+#endif // SYSTEM_API_DBUS_SENESCHAL_DBUS_CONSTANTS_H_
diff --git a/dbus/seneschal/seneschal_service.proto b/dbus/seneschal/seneschal_service.proto
new file mode 100644
index 0000000..9fe7285
--- /dev/null
+++ b/dbus/seneschal/seneschal_service.proto
@@ -0,0 +1,134 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+option optimize_for = LITE_RUNTIME;
+
+// This file defines messages for starting, stopping, and managing 9p servers
+// with access to the user's home directory.
+package vm_tools.seneschal;
+option go_package = "seneschal_proto";
+
+// Defines a path to be shared with a 9p server.
+message SharedPath {
+ // Path to be shared. Must be relative, must not have any ".." elements, and
+ // must not end with ".". The destination path is constructed by appending
+ // the name of the storage location and this path to the root of the server.
+ // So if |path| is "foo/bar" and the |storage_location| field of the
+ // SharePathRequest is "DOWNLOADS", then the destination path will be
+ // "/Downloads/foo/bar". Any ancestor directories will be automatically
+ // created but will not be writable unless they have been shared via a
+ // SharePathRequest.
+ string path = 1;
+
+ // Whether the path should be writable by the server. Due to limitations in
+ // the way bind mounts interact with user namespaces, setting this to false
+ // will not currently do anything. All shared paths are writable. Maybe
+ // one day if the linux developers decide that dropping privileges should
+ // not require having additional privileges that you wouldn't otherwise need
+ // we can maybe do something useful with this.
+ bool writable = 2;
+}
+
+// Defines the vsock address on which a server should listen for requests.
+// The server will always use context id 2 (VM host) as its address.
+message VsockAddress {
+ // The port number on which the server should listen for requests.
+ uint32 port = 1;
+
+ // The context id from which this server should accept connections.
+ uint32 accept_cid = 2;
+}
+
+// Defines the unix address on which a server should listen for requests.
+message UnixAddress {
+ // The path on the system where the server should listen for requests.
+ string path = 1;
+}
+
+// Defines the network address on which a server should listen for requests.
+// The server will always use localhost as its address.
+message NetworkAddress {
+ // The port on which the server should listen for requests.
+ uint32 port = 1;
+}
+
+// Indicates that the message includes a file descriptor on which the server
+// should listen for requests.
+message FileDescriptor {}
+
+// Information that must be included with every StartServer dbus request.
+message StartServerRequest {
+ // The address on which the server should listen for requests.
+ oneof listen_address {
+ VsockAddress vsock = 1;
+ UnixAddress unix_addr = 2;
+ NetworkAddress net = 3;
+ FileDescriptor fd = 4;
+ }
+}
+
+// Information sent back by seneschal in response to a StartServer message.
+message StartServerResponse {
+ // Set to true if the server was started successfully.
+ bool success = 1;
+
+ // The handle with which to refer to this server in future requests. Only
+ // valid if |success| is true.
+ uint32 handle = 2;
+
+ // The reason why the server failed to start, if any. Only valid when
+ // |success| is false.
+ string failure_reason = 3;
+}
+
+// Information that must be included with every StopServer request.
+message StopServerRequest {
+ // The handle to the server that should be stopped.
+ uint32 handle = 1;
+}
+
+// Information sent back by seneschal when it receives a StopServer requests.
+message StopServerResponse {
+ // If true, then the server was successfully stopped.
+ bool success = 1;
+
+ // The reason why the server could not be stopped, if any. Only valid when
+ // |success| is false.
+ string failure_reason = 2;
+}
+
+// Information that must be included with every SharePath request.
+message SharePathRequest {
+ // The handle to the server with whom the path should be shared.
+ uint32 handle = 1;
+
+ // The actual path to be shared. Must be relative to |storage_location|
+ // and must not contain any "../" elements or end with ".".
+ SharedPath shared_path = 2;
+
+ // The location where the path to be shared lives.
+ enum StorageLocation {
+ // The user's Downloads/ directory.
+ DOWNLOADS = 0;
+ }
+ StorageLocation storage_location = 3;
+
+ // The user's cryptohome. This is the <hash> part of /home/user/<hash>.
+ string owner_id = 4;
+}
+
+// Information sent back by seneschal when it receives a SharePath request.
+message SharePathResponse {
+ // If true, then the path was shared successfully.
+ bool success = 1;
+
+ // The path relative to the server's root where the shared path can be
+ // accessed. Only valid if |success| is true.
+ string path = 2;
+
+ // The reason why the path could not be shared, if any. Only valid when
+ // |success| is false.
+ string failure_reason = 3;
+}
diff --git a/dbus/service_constants.h b/dbus/service_constants.h
new file mode 100644
index 0000000..9de9dc6
--- /dev/null
+++ b/dbus/service_constants.h
@@ -0,0 +1,1198 @@
+// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_SERVICE_CONSTANTS_H_
+#define SYSTEM_API_DBUS_SERVICE_CONSTANTS_H_
+
+#include <stdint.h> // for uint32_t
+
+// We use relative includes here to make this compatible with both the
+// Chromium OS and Chromium environment.
+#include "apmanager/dbus-constants.h"
+#include "authpolicy/dbus-constants.h"
+#include "biod/dbus-constants.h"
+#include "cecservice/dbus-constants.h"
+#include "cros-disks/dbus-constants.h"
+#include "cryptohome/dbus-constants.h"
+#include "debugd/dbus-constants.h"
+#include "diagnosticsd/dbus-constants.h"
+#include "drivefs/dbus-constants.h"
+#include "hammerd/dbus-constants.h"
+#include "login_manager/dbus-constants.h"
+#include "lorgnette/dbus-constants.h"
+#include "oobe_config/dbus-constants.h"
+#include "permission_broker/dbus-constants.h"
+#include "power_manager/dbus-constants.h"
+#include "seneschal/dbus-constants.h"
+#include "shill/dbus-constants.h"
+#include "smbprovider/dbus-constants.h"
+#include "update_engine/dbus-constants.h"
+#include "vm_applications/dbus-constants.h"
+#include "vm_cicerone/dbus-constants.h"
+#include "vm_concierge/dbus-constants.h"
+
+namespace dbus {
+const char kDBusInterface[] = "org.freedesktop.DBus";
+const char kDBusServiceName[] = "org.freedesktop.DBus";
+const char kDBusServicePath[] = "/org/freedesktop/DBus";
+
+// Object Manager interface
+const char kDBusObjectManagerInterface[] = "org.freedesktop.DBus.ObjectManager";
+// Methods
+const char kDBusObjectManagerGetManagedObjects[] = "GetManagedObjects";
+// Signals
+const char kDBusObjectManagerInterfacesAddedSignal[] = "InterfacesAdded";
+const char kDBusObjectManagerInterfacesRemovedSignal[] = "InterfacesRemoved";
+
+// Properties interface
+const char kDBusPropertiesInterface[] = "org.freedesktop.DBus.Properties";
+// Methods
+const char kDBusPropertiesGet[] = "Get";
+const char kDBusPropertiesSet[] = "Set";
+const char kDBusPropertiesGetAll[] = "GetAll";
+// Signals
+const char kDBusPropertiesChangedSignal[] = "PropertiesChanged";
+} // namespace dbus
+
+namespace imageburn {
+const char kImageBurnServiceName[] = "org.chromium.ImageBurner";
+const char kImageBurnServicePath[] = "/org/chromium/ImageBurner";
+const char kImageBurnServiceInterface[] = "org.chromium.ImageBurnerInterface";
+// Methods
+const char kBurnImage[] = "BurnImage";
+// Signals
+const char kSignalBurnFinishedName[] = "burn_finished";
+const char kSignalBurnUpdateName[] = "burn_progress_update";
+} // namespace imageburn
+
+namespace imageloader {
+const char kImageLoaderServiceInterface[] = "org.chromium.ImageLoaderInterface";
+const char kImageLoaderServiceName[] = "org.chromium.ImageLoader";
+const char kImageLoaderServicePath[] = "/org/chromium/ImageLoader";
+// Methods
+const char kRegisterComponent[] = "RegisterComponent";
+const char kLoadComponent[] = "LoadComponent";
+const char kLoadComponentAtPath[] = "LoadComponentAtPath";
+const char kGetComponentVersion[] = "GetComponentVersion";
+const char kRemoveComponent[] = "RemoveComponent";
+const char kUnmountComponent[] = "UnmountComponent";
+const char kLoadDlcImage[] = "LoadDlcImage";
+// Constants
+const char kBadResult[] = "";
+const char kTerminaComponentName[] = "cros-termina";
+} // namespace imageloader
+
+namespace dlcservice {
+const char kDlcServiceInterface[] = "org.chromium.DlcServiceInterface";
+const char kDlcServiceName[] = "org.chromium.DlcService";
+const char kDlcServicePath[] = "/org/chromium/DlcService";
+// Methods
+const char kInstallMethod[] = "Install";
+const char kUninstallMethod[] = "Uninstall";
+} // namespace dlcservice
+
+namespace speech_synthesis {
+const char kSpeechSynthesizerInterface[] =
+ "org.chromium.SpeechSynthesizerInterface";
+const char kSpeechSynthesizerServicePath[] = "/org/chromium/SpeechSynthesizer";
+const char kSpeechSynthesizerServiceName[] = "org.chromium.SpeechSynthesizer";
+// Methods
+const char kSpeak[] = "Speak";
+const char kStop[] = "Stop";
+const char kIsSpeaking[] = "IsSpeaking";
+const char kShutdown[] = "Shutdown";
+} // namespace speech_synthesis
+
+namespace chromium {
+const char kChromiumInterface[] = "org.chromium.Chromium";
+// Text-to-speech service signals.
+const char kTTSReadySignal[] = "TTSReady";
+const char kTTSFailedSignal[] = "TTSFailed";
+} // namespace chromium
+
+// Services in the chromeos namespace are owned by Chrome. Different services
+// may be instantiated in different Chrome processes.
+namespace chromeos {
+
+const char kNetworkProxyServiceName[] = "org.chromium.NetworkProxyService";
+const char kNetworkProxyServicePath[] = "/org/chromium/NetworkProxyService";
+const char kNetworkProxyServiceInterface[] =
+ "org.chromium.NetworkProxyServiceInterface";
+const char kNetworkProxyServiceResolveProxyMethod[] = "ResolveProxy";
+
+const char kLivenessServiceName[] = "org.chromium.LivenessService";
+const char kLivenessServicePath[] = "/org/chromium/LivenessService";
+const char kLivenessServiceInterface[] =
+ "org.chromium.LivenessServiceInterface";
+const char kLivenessServiceCheckLivenessMethod[] = "CheckLiveness";
+
+const char kMetricsEventServiceName[] = "org.chromium.MetricsEventService";
+const char kMetricsEventServicePath[] = "/org/chromium/MetricsEventService";
+const char kMetricsEventServiceInterface[] =
+ "org.chromium.MetricsEventServiceInterface";
+const char kMetricsEventServiceChromeEventSignal[] = "ChromeEvent";
+
+const char kComponentUpdaterServiceName[] =
+ "org.chromium.ComponentUpdaterService";
+const char kComponentUpdaterServicePath[] =
+ "/org/chromium/ComponentUpdaterService";
+const char kComponentUpdaterServiceInterface[] =
+ "org.chromium.ComponentUpdaterService";
+const char kComponentUpdaterServiceLoadComponentMethod[] = "LoadComponent";
+const char kComponentUpdaterServiceUnloadComponentMethod[] = "UnloadComponent";
+const char kComponentUpdaterServiceComponentInstalledSignal[] =
+ "ComponentInstalled";
+
+const char kKioskAppServiceName[] = "org.chromium.KioskAppService";
+const char kKioskAppServicePath[] = "/org/chromium/KioskAppService";
+const char kKioskAppServiceInterface[] =
+ "org.chromium.KioskAppServiceInterface";
+const char kKioskAppServiceGetRequiredPlatformVersionMethod[] =
+ "GetRequiredPlatformVersion";
+
+const char kDisplayServiceName[] = "org.chromium.DisplayService";
+const char kDisplayServicePath[] = "/org/chromium/DisplayService";
+const char kDisplayServiceInterface[] = "org.chromium.DisplayServiceInterface";
+const char kDisplayServiceSetPowerMethod[] = "SetPower";
+const char kDisplayServiceSetSoftwareDimmingMethod[] = "SetSoftwareDimming";
+const char kDisplayServiceTakeOwnershipMethod[] = "TakeOwnership";
+const char kDisplayServiceReleaseOwnershipMethod[] = "ReleaseOwnership";
+enum DisplayPowerState {
+ DISPLAY_POWER_ALL_ON = 0,
+ DISPLAY_POWER_ALL_OFF = 1,
+ DISPLAY_POWER_INTERNAL_OFF_EXTERNAL_ON = 2,
+ DISPLAY_POWER_INTERNAL_ON_EXTERNAL_OFF = 3,
+};
+
+const char kScreenLockServiceName[] = "org.chromium.ScreenLockService";
+const char kScreenLockServicePath[] = "/org/chromium/ScreenLockService";
+const char kScreenLockServiceInterface[] =
+ "org.chromium.ScreenLockServiceInterface";
+const char kScreenLockServiceShowLockScreenMethod[] = "ShowLockScreen";
+
+constexpr char kVirtualFileRequestServiceName[] =
+ "org.chromium.VirtualFileRequestService";
+constexpr char kVirtualFileRequestServicePath[] =
+ "/org/chromium/VirtualFileRequestService";
+constexpr char kVirtualFileRequestServiceInterface[] =
+ "org.chromium.VirtualFileRequestService";
+constexpr char kVirtualFileRequestServiceHandleReadRequestMethod[] =
+ "HandleReadRequest";
+constexpr char kVirtualFileRequestServiceHandleIdReleasedMethod[] =
+ "HandleIdReleased";
+
+const char kChromeFeaturesServiceName[] = "org.chromium.ChromeFeaturesService";
+const char kChromeFeaturesServicePath[] = "/org/chromium/ChromeFeaturesService";
+const char kChromeFeaturesServiceInterface[] =
+ "org.chromium.ChromeFeaturesServiceInterface";
+const char kChromeFeaturesServiceIsCrostiniEnabledMethod[] =
+ "IsCrostiniEnabled";
+const char kChromeFeaturesServiceIsUsbguardEnabledMethod[] =
+ "IsUsbguardEnabled";
+const char kChromeFeaturesServiceIsShillSandboxingEnabledMethod[] =
+ "IsShillSandboxingEnabled";
+
+const char kUrlHandlerServiceName[] = "org.chromium.UrlHandlerService";
+const char kUrlHandlerServicePath[] = "/org/chromium/UrlHandlerService";
+const char kUrlHandlerServiceInterface[] =
+ "org.chromium.UrlHandlerServiceInterface";
+const char kUrlHandlerServiceOpenUrlMethod[] = "OpenUrl";
+
+} // namespace chromeos
+
+namespace cromo {
+// cromo D-Bus service identifiers
+const char kCromoServiceName[] = "org.chromium.ModemManager";
+const char kCromoServicePath[] = "/org/chromium/ModemManager";
+
+// cromo D-Bus interfaces
+const char kModemInterface[] = "org.freedesktop.ModemManager.Modem";
+const char kModemSimpleInterface[] =
+ "org.freedesktop.ModemManager.Modem.Simple";
+const char kModemCdmaInterface[] = "org.freedesktop.ModemManager.Modem.Cdma";
+const char kModemGsmInterface[] = "org.freedesktop.ModemManager.Modem.Gsm";
+const char kModemGsmCardInterface[] =
+ "org.freedesktop.ModemManager.Modem.Gsm.Card";
+const char kModemGsmNetworkInterface[] =
+ "org.freedesktop.ModemManager.Modem.Gsm.Network";
+const char kModemGobiInterface[] = "org.chromium.ModemManager.Modem.Gobi";
+} // namespace cromo
+
+namespace media_perception {
+
+const char kMediaPerceptionServiceName[] = "org.chromium.MediaPerception";
+const char kMediaPerceptionServicePath[] = "/org/chromium/MediaPerception";
+const char kMediaPerceptionInterface[] = "org.chromium.MediaPerception";
+
+const char kStateFunction[] = "State";
+const char kGetDiagnosticsFunction[] = "GetDiagnostics";
+const char kDetectionSignal[] = "MediaPerceptionDetection";
+const char kBootstrapMojoConnection[] = "BootstrapMojoConnection";
+
+} // namespace media_perception
+
+namespace modemmanager {
+// ModemManager D-Bus service identifiers
+const char kModemManagerSMSInterface[] =
+ "org.freedesktop.ModemManager.Modem.Gsm.SMS";
+
+// ModemManager function names.
+const char kSMSGetFunction[] = "Get";
+const char kSMSDeleteFunction[] = "Delete";
+const char kSMSListFunction[] = "List";
+
+// ModemManager monitored signals
+const char kSMSReceivedSignal[] = "SmsReceived";
+
+// ModemManager1 interfaces and signals
+// The canonical source for these constants is:
+// /usr/include/ModemManager/ModemManager-names.h
+const char kModemManager1ServiceName[] = "org.freedesktop.ModemManager1";
+const char kModemManager1ServicePath[] = "/org/freedesktop/ModemManager1";
+const char kModemManager1ModemInterface[] =
+ "org.freedesktop.ModemManager1.Modem";
+const char kModemManager1MessagingInterface[] =
+ "org.freedesktop.ModemManager1.Modem.Messaging";
+const char kModemManager1SmsInterface[] =
+ "org.freedesktop.ModemManager1.Sms";
+const char kSMSAddedSignal[] = "Added";
+} // namespace modemmanager
+
+namespace wimax_manager {
+// WiMaxManager D-Bus service identifiers
+const char kWiMaxManagerServiceName[] = "org.chromium.WiMaxManager";
+const char kWiMaxManagerServicePath[] = "/org/chromium/WiMaxManager";
+const char kWiMaxManagerServiceError[] = "org.chromium.WiMaxManager.Error";
+const char kWiMaxManagerInterface[] = "org.chromium.WiMaxManager";
+const char kWiMaxManagerDeviceInterface[] = "org.chromium.WiMaxManager.Device";
+const char kWiMaxManagerNetworkInterface[] =
+ "org.chromium.WiMaxManager.Network";
+const char kDeviceObjectPathPrefix[] = "/org/chromium/WiMaxManager/Device/";
+const char kNetworkObjectPathPrefix[] = "/org/chromium/WiMaxManager/Network/";
+const char kDevicesProperty[] = "Devices";
+const char kNetworksProperty[] = "Networks";
+const char kEAPAnonymousIdentity[] = "EAPAnonymousIdentity";
+const char kEAPUserIdentity[] = "EAPUserIdentity";
+const char kEAPUserPassword[] = "EAPUserPassword";
+
+enum DeviceStatus {
+ kDeviceStatusUninitialized,
+ kDeviceStatusDisabled,
+ kDeviceStatusReady,
+ kDeviceStatusScanning,
+ kDeviceStatusConnecting,
+ kDeviceStatusConnected
+};
+} // namespace wimax_manager
+
+namespace bluetooth_plugin {
+// Service identifiers for the plugin interface added to the /org/bluez object.
+const char kBluetoothPluginServiceName[] = "org.bluez";
+const char kBluetoothPluginInterface[] = "org.chromium.Bluetooth";
+
+// Bluetooth plugin properties.
+const char kSupportsLEServices[] = "SupportsLEServices";
+const char kSupportsConnInfo[] = "SupportsConnInfo";
+} // namespace bluetooth_plugin
+
+namespace bluetooth_plugin_device {
+// Service identifiers for the plugin interface added to Bluetooth Device
+// objects.
+const char kBluetoothPluginServiceName[] = "org.bluez";
+const char kBluetoothPluginInterface[] = "org.chromium.BluetoothDevice";
+
+// Bluetooth Device plugin methods.
+const char kGetConnInfo[] = "GetConnInfo";
+const char kSetLEConnectionParameters[] = "SetLEConnectionParameters";
+// Valid connection parameters that can be passed to the
+// SetLEConnectionParameters API as dictionary keys.
+const char kLEConnectionParameterMinimumConnectionInterval[] =
+ "MinimumConnectionInterval";
+const char kLEConnectionParameterMaximumConnectionInterval[] =
+ "MaximumConnectionInterval";
+} // namespace bluetooth_plugin_device
+
+namespace bluetooth_adapter {
+// Bluetooth Adapter service identifiers.
+const char kBluetoothAdapterServiceName[] = "org.bluez";
+const char kBluetoothAdapterInterface[] = "org.bluez.Adapter1";
+
+// Bluetooth Adapter methods.
+const char kStartDiscovery[] = "StartDiscovery";
+const char kSetDiscoveryFilter[] = "SetDiscoveryFilter";
+const char kStopDiscovery[] = "StopDiscovery";
+const char kPauseDiscovery[] = "PauseDiscovery";
+const char kUnpauseDiscovery[] = "UnpauseDiscovery";
+const char kRemoveDevice[] = "RemoveDevice";
+const char kCreateServiceRecord[] = "CreateServiceRecord";
+const char kRemoveServiceRecord[] = "RemoveServiceRecord";
+
+// Bluetooth Adapter properties.
+const char kAddressProperty[] = "Address";
+const char kNameProperty[] = "Name";
+const char kAliasProperty[] = "Alias";
+const char kClassProperty[] = "Class";
+const char kPoweredProperty[] = "Powered";
+const char kDiscoverableProperty[] = "Discoverable";
+const char kPairableProperty[] = "Pairable";
+const char kPairableTimeoutProperty[] = "PairableTimeout";
+const char kDiscoverableTimeoutProperty[] = "DiscoverableTimeout";
+const char kDiscoveringProperty[] = "Discovering";
+const char kUUIDsProperty[] = "UUIDs";
+const char kModaliasProperty[] = "Modalias";
+const char kStackSyncQuittingProperty[] = "StackSyncQuitting";
+
+// Bluetooth Adapter errors.
+const char kErrorNotReady[] = "org.bluez.Error.NotReady";
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorNotAuthorized[] = "org.bluez.Error.NotAuthorized";
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+
+// Bluetooth Adapter parameters supplied to SetDiscoveryFilter request.
+const char kDiscoveryFilterParameterUUIDs[] = "UUIDs";
+const char kDiscoveryFilterParameterRSSI[] = "RSSI";
+const char kDiscoveryFilterParameterPathloss[] = "Pathloss";
+const char kDiscoveryFilterParameterTransport[] = "Transport";
+} // namespace bluetooth_adapter
+
+namespace bluetooth_agent_manager {
+// Bluetooth Agent Manager service indentifiers
+const char kBluetoothAgentManagerServiceName[] = "org.bluez";
+const char kBluetoothAgentManagerServicePath[] = "/org/bluez";
+const char kBluetoothAgentManagerInterface[] = "org.bluez.AgentManager1";
+
+// Bluetooth Agent Manager methods.
+const char kRegisterAgent[] = "RegisterAgent";
+const char kUnregisterAgent[] = "UnregisterAgent";
+const char kRequestDefaultAgent[] = "RequestDefaultAgent";
+
+// Bluetooth capabilities.
+const char kNoInputNoOutputCapability[] = "NoInputNoOutput";
+const char kDisplayOnlyCapability[] = "DisplayOnly";
+const char kKeyboardOnlyCapability[] = "KeyboardOnly";
+const char kDisplayYesNoCapability[] = "DisplayYesNo";
+const char kKeyboardDisplayCapability[] = "KeyboardDisplay";
+
+// Bluetooth Agent Manager errors.
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+} // namespace bluetooth_agent_manager
+
+
+namespace bluetooth_agent {
+// Bluetooth Agent service indentifiers
+const char kBluetoothAgentInterface[] = "org.bluez.Agent1";
+
+// Bluetooth Agent methods.
+const char kRelease[] = "Release";
+const char kRequestPinCode[] = "RequestPinCode";
+const char kDisplayPinCode[] = "DisplayPinCode";
+const char kRequestPasskey[] = "RequestPasskey";
+const char kDisplayPasskey[] = "DisplayPasskey";
+const char kRequestConfirmation[] = "RequestConfirmation";
+const char kRequestAuthorization[] = "RequestAuthorization";
+const char kAuthorizeService[] = "AuthorizeService";
+const char kCancel[] = "Cancel";
+
+// Bluetooth Agent errors.
+const char kErrorRejected[] = "org.bluez.Error.Rejected";
+const char kErrorCanceled[] = "org.bluez.Error.Canceled";
+} // namespace bluetooth_agent
+
+namespace bluetooth_device {
+// Bluetooth Device service identifiers.
+const char kBluetoothDeviceServiceName[] = "org.bluez";
+const char kBluetoothDeviceInterface[] = "org.bluez.Device1";
+
+// Bluetooth Device methods.
+const char kConnect[] = "Connect";
+const char kDisconnect[] = "Disconnect";
+const char kConnectProfile[] = "ConnectProfile";
+const char kDisconnectProfile[] = "DisconnectProfile";
+const char kPair[] = "Pair";
+const char kCancelPairing[] = "CancelPairing";
+const char kGetServiceRecords[] = "GetServiceRecords";
+const char kExecuteWrite[] = "ExecuteWrite";
+
+// Bluetooth Device properties.
+const char kAddressProperty[] = "Address";
+const char kNameProperty[] = "Name";
+const char kIconProperty[] = "Icon";
+const char kClassProperty[] = "Class";
+const char kTypeProperty[] = "Type";
+const char kAppearanceProperty[] = "Appearance";
+const char kUUIDsProperty[] = "UUIDs";
+const char kPairedProperty[] = "Paired";
+const char kConnectedProperty[] = "Connected";
+const char kTrustedProperty[] = "Trusted";
+const char kBlockedProperty[] = "Blocked";
+const char kAliasProperty[] = "Alias";
+const char kAdapterProperty[] = "Adapter";
+const char kLegacyPairingProperty[] = "LegacyPairing";
+const char kModaliasProperty[] = "Modalias";
+const char kRSSIProperty[] = "RSSI";
+const char kTxPowerProperty[] = "TxPower";
+const char kManufacturerDataProperty[] = "ManufacturerData";
+const char kServiceDataProperty[] = "ServiceData";
+const char kServicesResolvedProperty[] = "ServicesResolved";
+const char kAdvertisingDataFlagsProperty[] = "AdvertisingFlags";
+const char kMTUProperty[] = "MTU";
+
+// Bluetooth Device errors.
+const char kErrorNotReady[] = "org.bluez.Error.NotReady";
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorInProgress[] = "org.bluez.Error.InProgress";
+const char kErrorAlreadyConnected[] = "org.bluez.Error.AlreadyConnected";
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorNotConnected[] = "org.bluez.Error.NotConnected";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+
+// Undocumented errors that we know BlueZ returns for Bluetooth Device methods.
+const char kErrorNotSupported[] = "org.bluez.Error.NotSupported";
+const char kErrorAuthenticationCanceled[] =
+ "org.bluez.Error.AuthenticationCanceled";
+const char kErrorAuthenticationFailed[] =
+ "org.bluez.Error.AuthenticationFailed";
+const char kErrorAuthenticationRejected[] =
+ "org.bluez.Error.AuthenticationRejected";
+const char kErrorAuthenticationTimeout[] =
+ "org.bluez.Error.AuthenticationTimeout";
+const char kErrorConnectionAttemptFailed[] =
+ "org.bluez.Error.ConnectionAttemptFailed";
+} // namespace bluetooth_device
+
+namespace bluetooth_gatt_characteristic {
+// Bluetooth GATT Characteristic service identifiers. The service name is used
+// only for characteristic objects hosted by bluetoothd.
+const char kBluetoothGattCharacteristicServiceName[] = "org.bluez";
+const char kBluetoothGattCharacteristicInterface[] =
+ "org.bluez.GattCharacteristic1";
+
+// Bluetooth GATT Characteristic methods.
+const char kReadValue[] = "ReadValue";
+const char kWriteValue[] = "WriteValue";
+const char kStartNotify[] = "StartNotify";
+const char kStopNotify[] = "StopNotify";
+const char kPrepareWriteValue[] = "PrepareWriteValue";
+
+// Bluetooth GATT Characteristic signals.
+const char kValueUpdatedSignal[] = "ValueUpdated";
+
+// Possible keys for option dict used in ReadValue, WriteValue and
+// PrepareWriteValue.
+const char kOptionOffset[] = "offset";
+const char kOptionDevice[] = "device";
+const char kOptionHasSubsequentWrite[] = "has-subsequent-write";
+
+// Bluetooth GATT Characteristic properties.
+const char kUUIDProperty[] = "UUID";
+const char kServiceProperty[] = "Service";
+const char kValueProperty[] = "Value";
+const char kFlagsProperty[] = "Flags";
+const char kNotifyingProperty[] = "Notifying";
+const char kDescriptorsProperty[] = "Descriptors";
+
+// Possible values for Bluetooth GATT Characteristic "Flags" property.
+const char kFlagBroadcast[] = "broadcast";
+const char kFlagRead[] = "read";
+const char kFlagWriteWithoutResponse[] = "write-without-response";
+const char kFlagWrite[] = "write";
+const char kFlagNotify[] = "notify";
+const char kFlagIndicate[] = "indicate";
+const char kFlagAuthenticatedSignedWrites[] = "authenticated-signed-writes";
+const char kFlagExtendedProperties[] = "extended-properties";
+const char kFlagReliableWrite[] = "reliable-write";
+const char kFlagWritableAuxiliaries[] = "writable-auxiliaries";
+const char kFlagEncryptRead[] = "encrypt-read";
+const char kFlagEncryptWrite[] = "encrypt-write";
+const char kFlagEncryptAuthenticatedRead[] = "encrypt-authenticated-read";
+const char kFlagEncryptAuthenticatedWrite[] = "encrypt-authenticated-write";
+const char kFlagPermissionRead[] = "permission-read";
+const char kFlagPermissionWrite[] = "permission-write";
+const char kFlagPermissionEncryptRead[] = "permission-encrypt-read";
+const char kFlagPermissionEncryptWrite[] = "permission-encrypt-write";
+const char kFlagPermissionAuthenticatedRead[] = "permission-authenticated-read";
+const char kFlagPermissionAuthenticatedWrite[] =
+ "permission-authenticated-write";
+const char kFlagPermissionSecureRead[] = "permission-secure-read";
+const char kFlagPermissionSecureWrite[] = "permission-secure-write";
+} // namespace bluetooth_gatt_characteristic
+
+namespace bluetooth_gatt_descriptor {
+// Bluetooth GATT Descriptor service identifiers. The service name is used
+// only for descriptor objects hosted by bluetoothd.
+const char kBluetoothGattDescriptorServiceName[] = "org.bluez";
+const char kBluetoothGattDescriptorInterface[] = "org.bluez.GattDescriptor1";
+
+// Bluetooth GATT Descriptor methods.
+const char kReadValue[] = "ReadValue";
+const char kWriteValue[] = "WriteValue";
+
+// Possible keys for option dict used in ReadValue and WriteValue.
+const char kOptionOffset[] = "offset";
+const char kOptionDevice[] = "device";
+
+// Bluetooth GATT Descriptor properties.
+const char kUUIDProperty[] = "UUID";
+const char kCharacteristicProperty[] = "Characteristic";
+const char kValueProperty[] = "Value";
+const char kFlagsProperty[] = "Flags";
+
+// Possible values for Bluetooth GATT Descriptor "Flags" property.
+const char kFlagRead[] = "read";
+const char kFlagWrite[] = "write";
+const char kFlagEncryptRead[] = "encrypt-read";
+const char kFlagEncryptWrite[] = "encrypt-write";
+const char kFlagEncryptAuthenticatedRead[] = "encrypt-authenticated-read";
+const char kFlagEncryptAuthenticatedWrite[] = "encrypt-authenticated-write";
+} // namespace bluetooth_gatt_descriptor
+
+namespace bluetooth_gatt_manager {
+// Bluetooth GATT Manager service identifiers.
+const char kBluetoothGattManagerServiceName[] = "org.bluez";
+const char kBluetoothGattManagerInterface[] = "org.bluez.GattManager1";
+
+// Bluetooth GATT Manager methods.
+const char kRegisterApplication[] = "RegisterApplication";
+const char kUnregisterApplication[] = "UnregisterApplication";
+const char kRegisterService[] = "RegisterService";
+const char kUnregisterService[] = "UnregisterService";
+
+// Bluetooth GATT Manager errors.
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+} // namespace bluetooth_gatt_manager
+
+namespace bluetooth_gatt_service {
+// Bluetooth GATT Service service identifiers. The service name is used
+// only for service objects hosted by bluetoothd.
+const char kBluetoothGattServiceServiceName[] = "org.bluez";
+const char kBluetoothGattServiceInterface[] = "org.bluez.GattService1";
+
+// Bluetooth GATT Service properties.
+const char kUUIDProperty[] = "UUID";
+const char kDeviceProperty[] = "Device";
+const char kPrimaryProperty[] = "Primary";
+const char kIncludesProperty[] = "Includes";
+const char kCharacteristicsProperty[] = "Characteristics";
+
+// Bluetooth GATT Service errors.
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorInProgress[] = "org.bluez.Error.InProgress";
+const char kErrorInvalidValueLength[] = "org.bluez.Error.InvalidValueLength";
+const char kErrorNotAuthorized[] = "org.bluez.Error.NotAuthorized";
+const char kErrorNotPaired[] = "org.bluez.Error.NotPaired";
+const char kErrorNotSupported[] = "org.bluez.Error.NotSupported";
+const char kErrorNotPermitted[] = "org.bluez.Error.NotPermitted";
+} // namespace bluetooth_gatt_service
+
+namespace bluetooth_input {
+// Bluetooth Input service identifiers.
+const char kBluetoothInputServiceName[] = "org.bluez";
+const char kBluetoothInputInterface[] = "org.bluez.Input1";
+
+// Bluetooth Input properties.
+const char kReconnectModeProperty[] = "ReconnectMode";
+
+// Bluetooth Input property values.
+const char kNoneReconnectModeProperty[] = "none";
+const char kHostReconnectModeProperty[] = "host";
+const char kDeviceReconnectModeProperty[] = "device";
+const char kAnyReconnectModeProperty[] = "any";
+} // namespace bluetooth_input
+
+namespace bluetooth_media {
+// Bluetooth Media service identifiers
+const char kBluetoothMediaServiceName[] = "org.bluez";
+const char kBluetoothMediaInterface[] = "org.bluez.Media1";
+
+// Bluetooth Media methods
+const char kRegisterEndpoint[] = "RegisterEndpoint";
+const char kUnregisterEndpoint[] = "UnregisterEndpoint";
+const char kRegisterPlayer[] = "RegisterPlayer";
+const char kUnregisterPlayer[] = "UnregisterPlayer";
+
+// Bluetooth Media errors
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorNotSupported[] = "org.bluez.Error.NotSupported";
+} // namespace bluetooth_media
+
+namespace bluetooth_media_endpoint {
+// Bluetooth Media Endpoint service identifiers
+const char kBluetoothMediaEndpointServiceName[] = "org.bluez";
+const char kBluetoothMediaEndpointInterface[] = "org.bluez.MediaEndpoint1";
+
+// Bluetooth Media Endpoint methods
+const char kSetConfiguration[] = "SetConfiguration";
+const char kSelectConfiguration[] = "SelectConfiguration";
+const char kClearConfiguration[] = "ClearConfiguration";
+const char kRelease[] = "Release";
+} // namespace bluetooth_media_endpoint
+
+namespace bluetooth_media_transport {
+// Bluetooth Media Transport service identifiers
+const char kBluetoothMediaTransportServiceName[] = "org.bluez";
+const char kBluetoothMediaTransportInterface[] = "org.bluez.MediaTransport1";
+
+// Bluetooth Media Transport methods
+const char kAcquire[] = "Acquire";
+const char kTryAcquire[] = "TryAcquire";
+const char kRelease[] = "Release";
+
+// Bluetooth Media Transport property names.
+const char kDeviceProperty[] = "Device";
+const char kUUIDProperty[] = "UUID";
+const char kCodecProperty[] = "Codec";
+const char kConfigurationProperty[] = "Configuration";
+const char kStateProperty[] = "State";
+const char kDelayProperty[] = "Delay";
+const char kVolumeProperty[] = "Volume";
+
+// Possible states for the "State" property
+const char kStateIdle[] = "idle";
+const char kStatePending[] = "pending";
+const char kStateActive[] = "active";
+
+// Bluetooth Media Transport errors.
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorNotAuthorized[] = "org.bluez.Error.NotAuthorized";
+const char kErrorNotAvailable[] = "org.bluez.Error.NotAvailable";
+} // namespace bluetooth_media_transport
+
+namespace bluez_object_manager {
+// BlueZ daemon Object Manager service identifiers.
+const char kBluezObjectManagerServiceName[] = "org.bluez";
+const char kBluezObjectManagerServicePath[] = "/";
+} // namespace bluez_object_manager
+
+namespace bluetooth_object_manager {
+// Bluetooth daemon Object Manager service identifiers.
+const char kBluetoothObjectManagerServiceName[] = "org.chromium.Bluetooth";
+const char kBluetoothObjectManagerServicePath[] = "/";
+} // namespace bluetooth_object_manager
+
+namespace newblue_object_manager {
+// NewBlue daemon Object Manager service identifiers.
+const char kNewblueObjectManagerServiceName[] = "org.chromium.Newblue";
+const char kNewblueObjectManagerServicePath[] = "/";
+} // namespace newblue_object_manager
+
+namespace bluetooth_profile_manager {
+// Bluetooth Profile Manager service identifiers.
+const char kBluetoothProfileManagerServiceName[] = "org.bluez";
+const char kBluetoothProfileManagerServicePath[] = "/org/bluez";
+const char kBluetoothProfileManagerInterface[] = "org.bluez.ProfileManager1";
+
+// Bluetooth Profile Manager methods.
+const char kRegisterProfile[] = "RegisterProfile";
+const char kUnregisterProfile[] = "UnregisterProfile";
+
+// Bluetooth Profile Manager option names.
+const char kNameOption[] = "Name";
+const char kServiceOption[] = "Service";
+const char kRoleOption[] = "Role";
+const char kChannelOption[] = "Channel";
+const char kPSMOption[] = "PSM";
+const char kRequireAuthenticationOption[] = "RequireAuthentication";
+const char kRequireAuthorizationOption[] = "RequireAuthorization";
+const char kAutoConnectOption[] = "AutoConnect";
+const char kServiceRecordOption[] = "ServiceRecord";
+const char kVersionOption[] = "Version";
+const char kFeaturesOption[] = "Features";
+
+// Bluetooth Profile Manager option values.
+const char kClientRoleOption[] = "client";
+const char kServerRoleOption[] = "server";
+
+// Bluetooth Profile Manager errors.
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+} // namespace bluetooth_profile_manager
+
+namespace bluetooth_profile {
+// Bluetooth Profile service identifiers.
+const char kBluetoothProfileInterface[] = "org.bluez.Profile1";
+
+// Bluetooth Profile methods.
+const char kRelease[] = "Release";
+const char kNewConnection[] = "NewConnection";
+const char kRequestDisconnection[] = "RequestDisconnection";
+const char kCancel[] = "Cancel";
+
+// Bluetooth Profile property names.
+const char kVersionProperty[] = "Version";
+const char kFeaturesProperty[] = "Features";
+
+// Bluetooth Profile errors.
+const char kErrorRejected[] = "org.bluez.Error.Rejected";
+const char kErrorCanceled[] = "org.bluez.Error.Canceled";
+} // namespace bluetooth_profile
+
+namespace bluetooth_advertisement {
+// Bluetooth LE Advertisement service identifiers.
+const char kBluetoothAdvertisementServiceName[] = "org.bluez";
+const char kBluetoothAdvertisementInterface[] =
+ "org.bluez.LEAdvertisement1";
+
+// Bluetooth Advertisement methods.
+const char kRelease[] = "Release";
+
+// Bluetooth Advertisement properties.
+const char kManufacturerDataProperty[] = "ManufacturerData";
+const char kServiceUUIDsProperty[] = "ServiceUUIDs";
+const char kServiceDataProperty[] = "ServiceData";
+const char kSolicitUUIDsProperty[] = "SolicitUUIDs";
+const char kTypeProperty[] = "Type";
+const char kIncludeTxPowerProperty[] = "IncludeTxPower";
+
+// Possible values for the "Type" property.
+const char kTypeBroadcast[] = "broadcast";
+const char kTypePeripheral[] = "peripheral";
+
+} // namespace bluetooth_advertisement
+
+namespace bluetooth_advertising_manager {
+// Bluetooth LE Advertising Manager service identifiers.
+const char kBluetoothAdvertisingManagerServiceName[] = "org.bluez";
+const char kBluetoothAdvertisingManagerInterface[] =
+ "org.bluez.LEAdvertisingManager1";
+
+// Bluetooth LE Advertising Manager methods.
+const char kRegisterAdvertisement[] = "RegisterAdvertisement";
+const char kUnregisterAdvertisement[] = "UnregisterAdvertisement";
+const char kSetAdvertisingIntervals[] = "SetAdvertisingIntervals";
+const char kResetAdvertising[] = "ResetAdvertising";
+
+// Bluetooth LE Advertising Manager errors.
+const char kErrorAlreadyExists[] = "org.bluez.Error.AlreadyExists";
+const char kErrorDoesNotExist[] = "org.bluez.Error.DoesNotExist";
+const char kErrorFailed[] = "org.bluez.Error.Failed";
+const char kErrorInvalidArguments[] = "org.bluez.Error.InvalidArguments";
+const char kErrorInvalidLength[] = "org.bluez.Error.InvalidLength";
+} // namespace bluetooth_advertising_manager
+
+namespace nfc_adapter {
+// NFC Adapter service identifiers.
+const char kNfcAdapterServiceName[] = "org.neard";
+const char kNfcAdapterInterface[] = "org.neard.Adapter";
+
+// NFC Adapter methods.
+const char kStartEmulation[] = "StartEmulation";
+const char kStartPollLoop[] = "StartPollLoop";
+const char kStopEmulation[] = "StopEmulation";
+const char kStopPollLoop[] = "StopPollLoop";
+
+// NFC Adapter signals.
+const char kTagFoundSignal[] = "TagFound";
+const char kTagLostSignal[] = "TagLost";
+
+// NFC Adapter properties.
+const char kDevicesProperty[] = "Devices";
+const char kModeProperty[] = "Mode";
+const char kPollingProperty[] = "Polling";
+const char kPoweredProperty[] = "Powered";
+const char kProtocolsProperty[] = "Protocols";
+const char kTagsProperty[] = "Tags";
+
+// NFC Adapter mode values.
+const char kModeInitiator[] = "Initiator";
+const char kModeTarget[] = "Target";
+const char kModeIdle[] = "Idle";
+
+} // namespace nfc_adapter
+
+namespace nfc_device {
+// NFC Device service identifiers.
+const char kNfcDeviceServiceName[] = "org.neard";
+const char kNfcDeviceInterface[] = "org.neard.Device";
+
+// NFC Device methods.
+const char kPush[] = "Push";
+
+// NFC Device properties.
+const char kRecordsProperty[] = "Records";
+
+} // namespace nfc_device
+
+namespace nfc_manager {
+// NFC Manager service identifiers.
+const char kNfcManagerServiceName[] = "org.neard";
+const char kNfcManagerServicePath[] = "/";
+const char kNfcManagerInterface[] = "org.neard.Manager";
+
+// NFC Manager methods.
+const char kRegisterHandoverAgent[] = "RegisterHandoverAgent";
+const char kUnregisterHandoverAgent[] = "UnregisterHandoverAgent";
+const char kRegisterNDEFAgent[] = "RegisterNDEFAgent";
+const char kUnregisterNDEFAgent[] = "UnregisterNDEFAgent";
+
+// NFC Manager signals.
+const char kAdapterAddedSignal[] = "AdapterAdded";
+const char kAdapterRemovedSignal[] = "AdapterRemoved";
+
+// NFC Manager properties.
+const char kAdaptersProperty[] = "Adapters";
+
+// NFC Manager handover carrier values.
+const char kCarrierBluetooth[] = "bluetooth";
+const char kCarrierWifi[] = "wifi";
+} // namespace nfc_manager
+
+namespace nfc_tag {
+// NFC Tag service identifiers.
+const char kNfcTagServiceName[] = "org.neard";
+const char kNfcTagInterface[] = "org.neard.Tag";
+
+// NFC Tag methods.
+const char kWrite[] = "Write";
+
+// NFC Tag properties.
+const char kProtocolProperty[] = "Protocol";
+const char kReadOnlyProperty[] = "ReadOnly";
+const char kRecordsProperty[] = "Records";
+const char kTypeProperty[] = "Type";
+
+// NFC Tag type values.
+const char kTagType1[] = "Type 1";
+const char kTagType2[] = "Type 2";
+const char kTagType3[] = "Type 3";
+const char kTagType4[] = "Type 4";
+
+} // namespace nfc_tag
+
+namespace nfc_record {
+// NFC Record service identifiers.
+const char kNfcRecordServiceName[] = "org.neard";
+const char kNfcRecordInterface[] = "org.neard.Record";
+
+// NFC Record properties.
+const char kTypeProperty[] = "Type";
+const char kEncodingProperty[] = "Encoding";
+const char kLanguageProperty[] = "Language";
+const char kRepresentationProperty[] = "Representation";
+const char kUriProperty[] = "URI";
+const char kMimeTypeProperty[] = "MIMEType";
+const char kSizeProperty[] = "Size";
+const char kActionProperty[] = "Action";
+
+// NFC Record type values.
+const char kTypeSmartPoster[] = "SmartPoster";
+const char kTypeText[] = "Text";
+const char kTypeUri[] = "URI";
+const char kTypeHandoverRequest[] = "HandoverRequest";
+const char kTypeHandoverSelect[] = "HandoverSelect";
+const char kTypeHandoverCarrier[] = "HandoverCarrier";
+
+// NFC Record encoding values.
+const char kEncodingUtf8[] = "UTF-8";
+const char kEncodingUtf16[] = "UTF-16";
+} // namespace nfc_record
+
+namespace nfc_handover_agent {
+// NFC Handover Agent service identifiers.
+// TODO(armansito): Add the correct service name once the HandoverAgent feature
+// is fully implemented.
+const char kNfcHandoverAgentServiceName[] = "";
+const char kNfcHandoverInterface[] = "org.neard.HandoverAgent";
+
+// NFC Handover Agent methods.
+const char kRequestOOB[] = "RequestOOB";
+const char kPushOOB[] = "PushOOB";
+const char kRelease[] = "Release";
+
+// NFC Handover Agent properties.
+const char kEIRProperty[] = "EIR";
+const char kNokiaDotComBtProperty[] = "nokia.com:bt";
+const char kWSCProperty[] = "WSC";
+const char kStateProperty[] = "State";
+} // namespace nfc_handover_agent
+
+namespace nfc_ndef_agent {
+// NFC NDEF Agent service identifiers.
+// TODO(armansito): Add the correct service name once the NDEFAgent feature
+// is fully implemented.
+const char kNfcNdefAgentServiceName[] = "";
+const char kNfcNdefAgentInterface[] = "org.neard.NDEFAgent";
+
+// NFC NDEF Agent methods.
+const char kGetNDEF[] = "GetNDEF";
+const char kRelease[] = "Release";
+
+// NFC NDEF properties.
+const char kNDEFProperty[] = "NDEF";
+const char kRecordProperty[] = "Record";
+} // namespace nfc_ndef_agent
+
+namespace nfc_common {
+// NFC Adapter/Tag protocol values.
+const char kProtocolFelica[] = "Felica";
+const char kProtocolMifare[] = "MIFARE";
+const char kProtocolJewel[] = "Jewel";
+const char kProtocolIsoDep[] = "ISO-DEP";
+const char kProtocolNfcDep[] = "NFC-DEP";
+
+// Common methods for NFC property access and signals.
+const char kGetProperties[] = "GetProperties";
+const char kSetProperty[] = "SetProperty";
+const char kPropertyChangedSignal[] = "PropertyChanged";
+} // namespace nfc_common
+
+namespace nfc_error {
+// NFC errors.
+const char kAlreadyExists[] = "org.neard.Error.AlreadyExists";
+const char kDoesNotExist[] = "org.neard.Error.DoesNotExist";
+const char kFailed[] = "org.neard.Error.Failed";
+const char kInProgress[] = "org.neard.Error.InProgress";
+const char kInvalidArguments[] = "org.neard.Error.InvalidArguments";
+const char kNotReady[] = "org.neard.Error.NotReady";
+const char kNotSupported[] = "org.neard.Error.NotSupported";
+const char kPermissionDenied[] = "org.neard.Error.PermissionDenied";
+
+// NFC Handover Agent errors.
+const char kHandoverAgentFailed[] = "org.neard.HandoverAgent.Error.Failed";
+const char kHandoverAgentInProgress[] =
+ "org.neard.HandoverAgent.Error.InProgress";
+} // namespace nfc_error
+
+namespace mtpd {
+const char kMtpdInterface[] = "org.chromium.Mtpd";
+const char kMtpdServicePath[] = "/org/chromium/Mtpd";
+const char kMtpdServiceName[] = "org.chromium.Mtpd";
+const char kMtpdServiceError[] = "org.chromium.Mtpd.Error";
+
+// Methods.
+const char kEnumerateStorages[] = "EnumerateStorages";
+const char kGetStorageInfo[] = "GetStorageInfo";
+const char kGetStorageInfoFromDevice[] = "GetStorageInfoFromDevice";
+const char kOpenStorage[] = "OpenStorage";
+const char kCloseStorage[] = "CloseStorage";
+const char kReadDirectoryEntryIds[] = "ReadDirectoryEntryIds";
+const char kGetFileInfo[] = "GetFileInfo";
+const char kReadFileChunk[] = "ReadFileChunk";
+const char kCopyFileFromLocal[] = "CopyFileFromLocal";
+const char kDeleteObject[] = "DeleteObject";
+const char kRenameObject[] = "RenameObject";
+const char kCreateDirectory[] = "CreateDirectory";
+
+// Signals.
+const char kMTPStorageAttached[] = "MTPStorageAttached";
+const char kMTPStorageDetached[] = "MTPStorageDetached";
+
+// For FileEntry struct:
+const uint32_t kInvalidFileId = 0xffffffff;
+
+// For OpenStorage method:
+const char kReadOnlyMode[] = "ro";
+const char kReadWriteMode[] = "rw";
+
+// For GetFileInfo() method:
+// The id of the root node in a storage, as defined by the PTP/MTP standards.
+// Use this when referring to the root node in the context of GetFileInfo().
+const uint32_t kRootFileId = 0;
+} // namespace mtpd
+
+namespace system_clock {
+const char kSystemClockInterface[] = "org.torproject.tlsdate";
+const char kSystemClockServicePath[] = "/org/torproject/tlsdate";
+const char kSystemClockServiceName[] = "org.torproject.tlsdate";
+
+// Methods.
+const char kSystemClockCanSet[] = "CanSetTime";
+const char kSystemClockSet[] = "SetTime";
+const char kSystemLastSyncInfo[] = "LastSyncInfo";
+
+// Signals.
+const char kSystemClockUpdated[] = "TimeUpdated";
+} // namespace system_clock
+
+namespace cras {
+const char kCrasServicePath[] = "/org/chromium/cras";
+const char kCrasServiceName[] = "org.chromium.cras";
+const char kCrasControlInterface[] = "org.chromium.cras.Control";
+
+// Methods.
+const char kSetOutputVolume[] = "SetOutputVolume";
+const char kSetOutputNodeVolume[] = "SetOutputNodeVolume";
+const char kSwapLeftRight[] = "SwapLeftRight";
+const char kSetOutputMute[] = "SetOutputMute";
+const char kSetOutputUserMute[] = "SetOutputUserMute";
+const char kSetSuspendAudio[] = "SetSuspendAudio";
+const char kSetInputGain[] = "SetInputGain";
+const char kSetInputNodeGain[] = "SetInputNodeGain";
+const char kSetInputMute[] = "SetInputMute";
+const char kGetVolumeState[] = "GetVolumeState";
+const char kGetDefaultOutputBufferSize[] = "GetDefaultOutputBufferSize";
+const char kGetNodes[] = "GetNodes";
+const char kSetActiveOutputNode[] = "SetActiveOutputNode";
+const char kSetActiveInputNode[] = "SetActiveInputNode";
+const char kAddActiveOutputNode[] = "AddActiveOutputNode";
+const char kAddActiveInputNode[] = "AddActiveInputNode";
+const char kRemoveActiveOutputNode[] = "RemoveActiveOutputNode";
+const char kRemoveActiveInputNode[] = "RemoveActiveInputNode";
+const char kGetNumberOfActiveStreams[] = "GetNumberOfActiveStreams";
+const char kGetNumberOfActiveInputStreams[] = "GetNumberOfActiveInputStreams";
+const char kGetNumberOfActiveOutputStreams[] = "GetNumberOfActiveOutputStreams";
+const char kIsAudioOutputActive[] = "IsAudioOutputActive";
+const char kSetGlobalOutputChannelRemix[] = "SetGlobalOutputChannelRemix";
+const char kGetSystemAecSupported[] = "GetSystemAecSupported";
+
+// Names of properties returned by GetNodes()
+const char kIsInputProperty[] = "IsInput";
+const char kIdProperty[] = "Id";
+const char kTypeProperty[] = "Type";
+const char kNameProperty[] = "Name";
+const char kDeviceNameProperty[] = "DeviceName";
+const char kActiveProperty[] = "Active";
+const char kPluggedTimeProperty[] = "PluggedTime";
+const char kMicPositionsProperty[] = "MicPositions";
+const char kStableDeviceIdProperty[] = "StableDeviceId";
+const char kStableDeviceIdNewProperty[] = "StableDeviceIdNew";
+
+// Signals.
+const char kOutputVolumeChanged[] = "OutputVolumeChanged";
+const char kOutputMuteChanged[] = "OutputMuteChanged";
+const char kOutputNodeVolumeChanged[] = "OutputNodeVolumeChanged";
+const char kNodeLeftRightSwappedChanged[] = "NodeLeftRightSwappedChanged";
+const char kInputGainChanged[] = "InputGainChanged";
+const char kInputMuteChanged[] = "InputMuteChanged";
+const char kNodesChanged[] = "NodesChanged";
+const char kActiveOutputNodeChanged[] = "ActiveOutputNodeChanged";
+const char kActiveInputNodeChanged[] = "ActiveInputNodeChanged";
+const char kNumberOfActiveStreamsChanged[] = "NumberOfActiveStreamsChanged";
+const char kAudioOutputActiveStateChanged[] = "AudioOutputActiveStateChanged";
+const char kHotwordTriggered[] = "HotwordTriggered";
+} // namespace cras
+
+namespace feedback {
+const char kFeedbackServicePath[] = "/org/chromium/feedback";
+const char kFeedbackServiceName[] = "org.chromium.feedback";
+
+// Methods.
+const char kSendFeedback[] = "SendFeedback";
+} // namespace feedback
+
+namespace easy_unlock {
+const char kEasyUnlockServicePath[] = "/org/chromium/EasyUnlock";
+const char kEasyUnlockServiceName[] = "org.chromium.EasyUnlock";
+const char kEasyUnlockServiceInterface[] = "org.chromium.EasyUnlock";
+
+// Values supplied as enrcryption type to CreateSecureMessage and
+// UnwrapSecureMessage methods.
+const char kEncryptionTypeNone[] = "NONE";
+const char kEncryptionTypeAES256CBC[] = "AES_256_CBC";
+
+// Values supplied as signature type to CreateSecureMessage and
+// UnwrapSecureMessage methods.
+const char kSignatureTypeECDSAP256SHA256[] = "ECDSA_P256_SHA256";
+const char kSignatureTypeHMACSHA256[] = "HMAC_SHA256";
+
+// Values supplied as key algorithm to WrapPublicKey method.
+const char kKeyAlgorithmRSA[] = "RSA";
+const char kKeyAlgorithmECDSA[] = "ECDSA";
+
+// Methods
+const char kPerformECDHKeyAgreementMethod[] = "PerformECDHKeyAgreement";
+const char kWrapPublicKeyMethod[] = "WrapPublicKey";
+const char kGenerateEcP256KeyPairMethod[] = "GenerateEcP256KeyPair";
+const char kCreateSecureMessageMethod[] = "CreateSecureMessage";
+const char kUnwrapSecureMessageMethod[] = "UnwrapSecureMessage";
+} // namespace easy_unlock
+
+namespace arc_oemcrypto {
+const char kArcOemCryptoServiceInterface[] = "org.chromium.ArcOemCrypto";
+const char kArcOemCryptoServiceName[] = "org.chromium.ArcOemCrypto";
+const char kArcOemCryptoServicePath[] = "/org/chromium/ArcOemCrypto";
+// Methods
+const char kBootstrapMojoConnection[] = "BootstrapMojoConnection";
+} // namespace arc_oemcrypto
+
+namespace midis {
+constexpr char kMidisServiceName[] = "org.chromium.Midis";
+constexpr char kMidisServicePath[] = "/org/chromium/Midis";
+constexpr char kMidisInterfaceName[] = "org.chromium.Midis";
+// Methods
+constexpr char kBootstrapMojoConnectionMethod[] = "BootstrapMojoConnection";
+} // namespace midis
+
+namespace ml {
+constexpr char kMachineLearningServiceName[] = "org.chromium.MachineLearning";
+constexpr char kMachineLearningServicePath[] = "/org/chromium/MachineLearning";
+constexpr char kMachineLearningInterfaceName[] = "org.chromium.MachineLearning";
+// Methods
+constexpr char kBootstrapMojoConnectionMethod[] = "BootstrapMojoConnection";
+// Token identifying the primordial Mojo pipe passed to BootstrapMojoConnection.
+constexpr char kBootstrapMojoConnectionChannelToken[] = "ml-service-bootstrap";
+// Deprecated, use longer names above:
+constexpr char kMlServiceName[] = "org.chromium.MachineLearning";
+constexpr char kMlServicePath[] = "/org/chromium/MachineLearning";
+constexpr char kMlInterfaceName[] = "org.chromium.MachineLearning";
+} // namespace ml
+
+namespace virtual_file_provider {
+constexpr char kVirtualFileProviderServiceName[] =
+ "org.chromium.VirtualFileProvider";
+constexpr char kVirtualFileProviderServicePath[] =
+ "/org/chromium/VirtualFileProvider";
+constexpr char kVirtualFileProviderInterface[] =
+ "org.chromium.VirtualFileProvider";
+// Methods
+constexpr char kOpenFileMethod[] = "OpenFile";
+} // namespace virtual_file_provider
+
+namespace crosdns {
+constexpr char kCrosDnsServiceName[] = "org.chromium.CrosDns";
+constexpr char kCrosDnsServicePath[] = "/org/chromium/CrosDns";
+constexpr char kCrosDnsInterfaceName[] = "org.chromium.CrosDns";
+// Methods
+constexpr char kSetHostnameIpMappingMethod[] = "SetHostnameIpMapping";
+constexpr char kRemoveHostnameIpMappingMethod[] = "RemoveHostnameIpMapping";
+}
+
+namespace arc {
+
+namespace obb_mounter {
+// D-Bus service constants.
+constexpr char kArcObbMounterInterface[] =
+ "org.chromium.ArcObbMounterInterface";
+constexpr char kArcObbMounterServicePath[] = "/org/chromium/ArcObbMounter";
+constexpr char kArcObbMounterServiceName[] = "org.chromium.ArcObbMounter";
+
+// Method names.
+constexpr char kMountObbMethod[] = "MountObb";
+constexpr char kUnmountObbMethod[] = "UnmountObb";
+} // namespace obb_mounter
+
+namespace appfuse {
+// D-Bus service constants.
+constexpr char kArcAppfuseProviderInterface[] =
+ "org.chromium.ArcAppfuseProvider";
+constexpr char kArcAppfuseProviderServicePath[] =
+ "/org/chromium/ArcAppfuseProvider";
+constexpr char kArcAppfuseProviderServiceName[] =
+ "org.chromium.ArcAppfuseProvider";
+
+// Method names.
+constexpr char kMountMethod[] = "Mount";
+constexpr char kUnmountMethod[] = "Unmount";
+constexpr char kOpenFileMethod[] = "OpenFile";
+} // namespace appfuse
+
+} // namespace arc
+
+namespace anomaly_collector {
+const char kAnomalyEventServiceName[] = "org.chromium.AnomalyEventService";
+const char kAnomalyEventServicePath[] = "/org/chromium/AnomalyEventService";
+const char kAnomalyEventServiceInterface[] =
+ "org.chromium.AnomalyEventServiceInterface";
+const char kAnomalyEventSignalName[] = "AnomalyEvent";
+} // namespace anomaly_collector
+
+#endif // SYSTEM_API_DBUS_SERVICE_CONSTANTS_H_
diff --git a/dbus/shill/dbus-constants.h b/dbus/shill/dbus-constants.h
new file mode 100644
index 0000000..73bb4ad
--- /dev/null
+++ b/dbus/shill/dbus-constants.h
@@ -0,0 +1,769 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
+
+// TODO(benchan): Reorganize shill constants and remove deprecated ones.
+namespace shill {
+// Flimflam D-Bus service identifiers.
+const char kFlimflamManagerInterface[] = "org.chromium.flimflam.Manager";
+const char kFlimflamServiceName[] = "org.chromium.flimflam";
+const char kFlimflamServicePath[] = "/"; // crosbug.com/20135
+const char kFlimflamServiceInterface[] = "org.chromium.flimflam.Service";
+const char kFlimflamIPConfigInterface[] = "org.chromium.flimflam.IPConfig";
+const char kFlimflamDeviceInterface[] = "org.chromium.flimflam.Device";
+const char kFlimflamProfileInterface[] = "org.chromium.flimflam.Profile";
+const char kFlimflamNetworkInterface[] = "org.chromium.flimflam.Network";
+const char kFlimflamThirdPartyVpnInterface[] =
+ "org.chromium.flimflam.ThirdPartyVpn";
+
+// Flimflam function names.
+const char kGetPropertiesFunction[] = "GetProperties";
+const char kSetPropertyFunction[] = "SetProperty";
+const char kClearPropertyFunction[] = "ClearProperty";
+const char kConnectFunction[] = "Connect";
+const char kDisconnectFunction[] = "Disconnect";
+const char kRequestScanFunction[] = "RequestScan";
+const char kGetServiceFunction[] = "GetService";
+const char kRemoveServiceFunction[] = "Remove";
+const char kEnableTechnologyFunction[] = "EnableTechnology";
+const char kDisableTechnologyFunction[] = "DisableTechnology";
+const char kRemoveConfigFunction[] = "Remove";
+const char kGetEntryFunction[] = "GetEntry";
+const char kDeleteEntryFunction[] = "DeleteEntry";
+const char kActivateCellularModemFunction[] = "ActivateCellularModem";
+const char kRequirePinFunction[] = "RequirePin";
+const char kEnterPinFunction[] = "EnterPin";
+const char kUnblockPinFunction[] = "UnblockPin";
+const char kChangePinFunction[] = "ChangePin";
+const char kRegisterFunction[] = "Register";
+const char kConfigureServiceFunction[] = "ConfigureService";
+const char kConfigureWifiServiceFunction[] = "ConfigureWifiService";
+const char kFindMatchingServiceFunction[] = "FindMatchingService";
+const char kSetNetworkThrottlingFunction[] = "SetNetworkThrottlingStatus";
+
+// Flimflam Service property names.
+const char kSecurityProperty[] = "Security";
+const char kPriorityProperty[] = "Priority";
+const char kPassphraseProperty[] = "Passphrase";
+const char kIdentityProperty[] = "Identity";
+const char kAuthorityPathProperty[] = "AuthorityPath";
+const char kPassphraseRequiredProperty[] = "PassphraseRequired";
+const char kSaveCredentialsProperty[] = "SaveCredentials";
+const char kSignalStrengthProperty[] = "Strength";
+const char kNameProperty[] = "Name";
+const char kGuidProperty[] = "GUID";
+const char kStateProperty[] = "State";
+const char kTypeProperty[] = "Type";
+const char kDeviceProperty[] = "Device";
+const char kProfileProperty[] = "Profile";
+const char kConnectivityStateProperty[] = "ConnectivityState";
+const char kConnectableProperty[] = "Connectable";
+const char kAutoConnectProperty[] = "AutoConnect";
+const char kIsActiveProperty[] = "IsActive";
+const char kModeProperty[] = "Mode";
+const char kErrorProperty[] = "Error";
+const char kProviderProperty[] = "Provider";
+const char kHostProperty[] = "Host";
+const char kDomainProperty[] = "Domain";
+const char kProxyConfigProperty[] = "ProxyConfig";
+const char kCheckPortalProperty[] = "CheckPortal";
+const char kSSIDProperty[] = "SSID";
+const char kConnectedProperty[] = "Connected";
+const char kUIDataProperty[] = "UIData";
+const char kConnectionIdProperty[] = "ConnectionId";
+const char kVisibleProperty[] = "Visible";
+const char kDnsAutoFallbackProperty[] = "DNSAutoFallback";
+const char kPortalDetectionFailedPhaseProperty[] =
+ "PortalDetectionFailedPhase";
+const char kPortalDetectionFailedStatusProperty[] =
+ "PortalDetectionFailedStatus";
+const char kSavedIPConfigProperty[] = "SavedIPConfig";
+const char kStaticIPConfigProperty[] = "StaticIPConfig";
+const char kLinkMonitorDisableProperty[] = "LinkMonitorDisable";
+const char kSecurityClassProperty[] = "SecurityClass";
+
+// Flimflam provider property names.
+const char kProviderHostProperty[] = "Provider.Host";
+const char kProviderNameProperty[] = "Provider.Name";
+const char kProviderTypeProperty[] = "Provider.Type";
+
+// Flimflam Wifi Service property names.
+const char kWifiBSsid[] = "WiFi.BSSID";
+const char kWifiHexSsid[] = "WiFi.HexSSID";
+const char kWifiFrequency[] = "WiFi.Frequency";
+const char kWifiHiddenSsid[] = "WiFi.HiddenSSID";
+const char kWifiPhyMode[] = "WiFi.PhyMode";
+const char kWifiAuthMode[] = "WiFi.AuthMode";
+const char kWifiChannelProperty[] = "WiFi.Channel";
+const char kWifiPreferredDeviceProperty[] = "WiFi.PreferredDevice";
+const char kWifiRoamThresholdProperty[] = "WiFi.RoamThreshold";
+const char kWifiFTEnabled[] = "WiFi.FTEnabled";
+
+// Flimflam EAP property names.
+const char kEapIdentityProperty[] = "EAP.Identity";
+const char kEapMethodProperty[] = "EAP.EAP";
+const char kEapPhase2AuthProperty[] = "EAP.InnerEAP";
+const char kEapTLSVersionMaxProperty[] = "EAP.TLSVersionMax";
+const char kEapAnonymousIdentityProperty[] = "EAP.AnonymousIdentity";
+const char kEapClientCertProperty[] = "EAP.ClientCert";
+const char kEapCertIdProperty[] = "EAP.CertID";
+const char kEapClientCertNssProperty[] = "EAP.ClientCertNSS";
+const char kEapPrivateKeyProperty[] = "EAP.PrivateKey";
+const char kEapPrivateKeyPasswordProperty[] = "EAP.PrivateKeyPassword";
+const char kEapKeyIdProperty[] = "EAP.KeyID";
+const char kEapCaCertProperty[] = "EAP.CACert";
+const char kEapCaCertIdProperty[] = "EAP.CACertID";
+const char kEapCaCertNssProperty[] = "EAP.CACertNSS";
+const char kEapUseSystemCasProperty[] = "EAP.UseSystemCAs";
+const char kEapUseProactiveKeyCachingProperty[] = "EAP.UseProactiveKeyCaching";
+const char kEapPinProperty[] = "EAP.PIN";
+const char kEapPasswordProperty[] = "EAP.Password";
+const char kEapKeyMgmtProperty[] = "EAP.KeyMgmt";
+const char kEapUseLoginPasswordProperty[] = "EAP.UseLoginPassword";
+
+// Flimflam Cellular Service property names.
+const char kTechnologyFamilyProperty[] = "Cellular.Family";
+const char kActivationStateProperty[] = "Cellular.ActivationState";
+const char kNetworkTechnologyProperty[] = "Cellular.NetworkTechnology";
+const char kRoamingStateProperty[] = "Cellular.RoamingState";
+const char kOperatorNameProperty[] = "Cellular.OperatorName";
+const char kOperatorCodeProperty[] = "Cellular.OperatorCode";
+const char kServingOperatorProperty[] = "Cellular.ServingOperator";
+const char kPaymentPortalProperty[] = "Cellular.Olp";
+const char kUsageURLProperty[] = "Cellular.UsageUrl";
+const char kCellularApnProperty[] = "Cellular.APN";
+const char kCellularLastGoodApnProperty[] = "Cellular.LastGoodAPN";
+const char kCellularApnListProperty[] = "Cellular.APNList";
+
+// Flimflam Manager property names.
+const char kProfilesProperty[] = "Profiles";
+const char kServicesProperty[] = "Services";
+const char kServiceWatchListProperty[] = "ServiceWatchList";
+const char kAvailableTechnologiesProperty[] = "AvailableTechnologies";
+const char kEnabledTechnologiesProperty[] = "EnabledTechnologies";
+const char kConnectedTechnologiesProperty[] = "ConnectedTechnologies";
+const char kDefaultTechnologyProperty[] = "DefaultTechnology";
+const char kOfflineModeProperty[] = "OfflineMode";
+const char kActiveProfileProperty[] = "ActiveProfile";
+const char kDevicesProperty[] = "Devices";
+const char kCheckPortalListProperty[] = "CheckPortalList";
+const char kArpGatewayProperty[] = "ArpGateway";
+const char kCountryProperty[] = "Country";
+const char kPortalURLProperty[] = "PortalURL";
+const char kConnectionStateProperty[] = "ConnectionState";
+const char kClaimedDevicesProperty[] = "ClaimedDevices";
+
+// Flimflam Profile property names.
+const char kEntriesProperty[] = "Entries";
+
+// Flimflam Device property names.
+const char kScanningProperty[] = "Scanning";
+const char kPoweredProperty[] = "Powered";
+const char kScanIntervalProperty[] = "ScanInterval";
+const char kBgscanMethodProperty[] = "BgscanMethod";
+const char kBgscanShortIntervalProperty[] = "BgscanShortInterval";
+const char kRoamThresholdProperty[] = "RoamThreshold";
+const char kDBusObjectProperty[] = "DBus.Object";
+const char kDBusServiceProperty[] = "DBus.Service";
+const char kBgscanSignalThresholdProperty[] = "BgscanSignalThreshold";
+const char kWakeToScanPeriodSecondsProperty[] = "WakeToScanPeriodSeconds";
+const char kNetDetectScanPeriodSecondsProperty[] = "NetDetectScanPeriodSeconds";
+const char kForceWakeToScanTimerProperty[] = "ForceWakeToScanTimer";
+// The name of the network interface, ie. wlan0, eth0, etc.
+const char kInterfaceProperty[] = "Interface";
+const char kSelectedServiceProperty[] = "SelectedService";
+const char kIPConfigsProperty[] = "IPConfigs";
+const char kMACAddressRandomizationSupportedProperty[] =
+ "MACAddressRandomizationSupported";
+const char kMACAddressRandomizationEnabledProperty[] =
+ "MACAddressRandomizationEnabled";
+
+// Flimflam Cellular Device property names.
+const char kCarrierProperty[] = "Cellular.Carrier";
+const char kCellularAllowRoamingProperty[] = "Cellular.AllowRoaming";
+const char kHomeProviderProperty[] = "Cellular.HomeProvider";
+const char kMeidProperty[] = "Cellular.MEID";
+const char kImeiProperty[] = "Cellular.IMEI";
+const char kIccidProperty[] = "Cellular.ICCID";
+const char kImsiProperty[] = "Cellular.IMSI";
+const char kEsnProperty[] = "Cellular.ESN";
+const char kMdnProperty[] = "Cellular.MDN";
+const char kMinProperty[] = "Cellular.MIN";
+const char kModelIdProperty[] = "Cellular.ModelID";
+const char kEquipmentIdProperty[] = "Cellular.EquipmentID";
+const char kManufacturerProperty[] = "Cellular.Manufacturer";
+const char kFirmwareRevisionProperty[] = "Cellular.FirmwareRevision";
+const char kHardwareRevisionProperty[] = "Cellular.HardwareRevision";
+const char kDeviceIdProperty[] = "Cellular.DeviceID";
+const char kPRLVersionProperty[] = "Cellular.PRLVersion";
+const char kSelectedNetworkProperty[] = "Cellular.SelectedNetwork";
+const char kSupportNetworkScanProperty[] = "Cellular.SupportNetworkScan";
+const char kFoundNetworksProperty[] = "Cellular.FoundNetworks";
+
+// Flimflam state options.
+const char kStateIdle[] = "idle";
+const char kStateCarrier[] = "carrier";
+const char kStateAssociation[] = "association";
+const char kStateConfiguration[] = "configuration";
+const char kStateReady[] = "ready";
+const char kStatePortal[] = "portal";
+const char kStateOffline[] = "offline";
+const char kStateOnline[] = "online";
+const char kStateDisconnect[] = "disconnect";
+const char kStateFailure[] = "failure";
+const char kStateActivationFailure[] = "activation-failure";
+
+// Flimflam portal phase and status.
+const char kPortalDetectionPhaseConnection[] = "Connection";
+const char kPortalDetectionPhaseDns[] = "DNS";
+const char kPortalDetectionPhaseHttp[] = "HTTP";
+const char kPortalDetectionPhaseContent[] = "Content";
+const char kPortalDetectionPhaseUnknown[] = "Unknown";
+const char kPortalDetectionStatusFailure[] = "Failure";
+const char kPortalDetectionStatusTimeout[] = "Timeout";
+const char kPortalDetectionStatusSuccess[] = "Success";
+
+// Flimflam property names for SIMLock status.
+const char kSIMLockStatusProperty[] = "Cellular.SIMLockStatus";
+const char kSIMLockTypeProperty[] = "LockType";
+const char kSIMLockRetriesLeftProperty[] = "RetriesLeft";
+const char kSIMLockEnabledProperty[] = "LockEnabled";
+
+// Flimflam property names for Cellular.FoundNetworks.
+const char kLongNameProperty[] = "long_name";
+const char kStatusProperty[] = "status";
+const char kShortNameProperty[] = "short_name";
+const char kTechnologyProperty[] = "technology";
+const char kNetworkIdProperty[] = "network_id";
+
+// Flimflam SIMLock status types.
+const char kSIMLockPin[] = "sim-pin";
+const char kSIMLockPuk[] = "sim-puk";
+
+// APN info property names.
+const char kApnProperty[] = "apn";
+const char kApnNetworkIdProperty[] = "network_id";
+const char kApnUsernameProperty[] = "username";
+const char kApnPasswordProperty[] = "password";
+const char kApnNameProperty[] = "name";
+const char kApnLocalizedNameProperty[] = "localized_name";
+const char kApnLanguageProperty[] = "language";
+const char kApnAuthenticationProperty[] = "authentication";
+
+// APN authentication property values (as expected by ModemManager).
+const char kApnAuthenticationPap[] = "pap";
+const char kApnAuthenticationChap[] = "chap";
+
+// Payment Portal property names.
+const char kPaymentPortalURL[] = "url";
+const char kPaymentPortalMethod[] = "method";
+const char kPaymentPortalPostData[] = "postdata";
+
+// Operator info property names.
+const char kOperatorNameKey[] = "name";
+const char kOperatorCodeKey[] = "code";
+const char kOperatorCountryKey[] = "country";
+const char kOperatorUuidKey[] = "uuid";
+
+// Flimflam network technology options.
+const char kNetworkTechnology1Xrtt[] = "1xRTT";
+const char kNetworkTechnologyEvdo[] = "EVDO";
+const char kNetworkTechnologyGsm[] = "GSM";
+const char kNetworkTechnologyGprs[] = "GPRS";
+const char kNetworkTechnologyEdge[] = "EDGE";
+const char kNetworkTechnologyUmts[] = "UMTS";
+const char kNetworkTechnologyHspa[] = "HSPA";
+const char kNetworkTechnologyHspaPlus[] = "HSPA+";
+const char kNetworkTechnologyLte[] = "LTE";
+const char kNetworkTechnologyLteAdvanced[] = "LTE Advanced";
+
+// Flimflam roaming state options
+const char kRoamingStateHome[] = "home";
+const char kRoamingStateRoaming[] = "roaming";
+const char kRoamingStateUnknown[] = "unknown";
+
+// Flimflam activation state options
+const char kActivationStateActivated[] = "activated";
+const char kActivationStateActivating[] = "activating";
+const char kActivationStateNotActivated[] = "not-activated";
+const char kActivationStatePartiallyActivated[] = "partially-activated";
+const char kActivationStateUnknown[] = "unknown";
+
+// Flimflam EAP method options.
+const char kEapMethodPEAP[] = "PEAP";
+const char kEapMethodTLS[] = "TLS";
+const char kEapMethodTTLS[] = "TTLS";
+const char kEapMethodLEAP[] = "LEAP";
+
+// Flimflam EAP phase 2 auth options.
+const char kEapPhase2AuthPEAPMD5[] = "auth=MD5";
+const char kEapPhase2AuthPEAPMSCHAPV2[] = "auth=MSCHAPV2";
+const char kEapPhase2AuthPEAPGTC[] = "auth=GTC";
+const char kEapPhase2AuthTTLSMD5[] = "autheap=MD5"; // crosbug/26822
+const char kEapPhase2AuthTTLSEAPMD5[] = "autheap=MD5";
+const char kEapPhase2AuthTTLSEAPMSCHAPV2[] = "autheap=MSCHAPV2";
+const char kEapPhase2AuthTTLSMSCHAPV2[] = "auth=MSCHAPV2";
+const char kEapPhase2AuthTTLSMSCHAP[] = "auth=MSCHAP";
+const char kEapPhase2AuthTTLSPAP[] = "auth=PAP";
+const char kEapPhase2AuthTTLSCHAP[] = "auth=CHAP";
+const char kEapPhase2AuthTTLSGTC[] = "auth=GTC";
+const char kEapPhase2AuthTTLSEAPGTC[] = "autheap=GTC";
+
+// Flimflam EAP TLS versions.
+const char kEapTLSVersion1p0[] = "1.0";
+const char kEapTLSVersion1p1[] = "1.1";
+const char kEapTLSVersion1p2[] = "1.2";
+
+// Flimflam VPN provider types.
+const char kProviderL2tpIpsec[] = "l2tpipsec";
+const char kProviderOpenVpn[] = "openvpn";
+const char kProviderThirdPartyVpn[] = "thirdpartyvpn";
+const char kProviderArcVpn[] = "arcvpn";
+
+// Flimflam VPN service properties
+const char kVPNDomainProperty[] = "VPN.Domain";
+
+// Flimflam monitored properties
+const char kMonitorPropertyChanged[] = "PropertyChanged";
+
+// Flimflam type options.
+const char kTypeEthernet[] = "ethernet";
+const char kTypeWifi[] = "wifi";
+const char kTypeWimax[] = "wimax";
+const char kTypeBluetooth[] = "bluetooth";
+const char kTypeCellular[] = "cellular";
+const char kTypeVPN[] = "vpn";
+const char kTypePPPoE[] = "pppoe";
+
+// Flimflam mode options.
+const char kModeManaged[] = "managed";
+const char kModeAdhoc[] = "adhoc";
+
+// Flimflam security options.
+const char kSecurityWpa[] = "wpa";
+const char kSecurityWep[] = "wep";
+const char kSecurityRsn[] = "rsn";
+const char kSecurity8021x[] = "802_1x";
+const char kSecurityPsk[] = "psk";
+const char kSecurityNone[] = "none";
+
+// Flimflam L2TPIPsec property names.
+const char kL2tpIpsecAuthenticationType[] = "L2TPIPsec.AuthenticationType";
+const char kL2tpIpsecCaCertNssProperty[] = "L2TPIPsec.CACertNSS";
+const char kL2tpIpsecClientCertIdProperty[] = "L2TPIPsec.ClientCertID";
+const char kL2tpIpsecClientCertSlotProperty[] = "L2TPIPsec.ClientCertSlot";
+const char kL2tpIpsecIkeVersion[] = "L2TPIPsec.IKEVersion";
+const char kL2tpIpsecPinProperty[] = "L2TPIPsec.PIN";
+const char kL2tpIpsecPskProperty[] = "L2TPIPsec.PSK";
+const char kL2tpIpsecPskRequiredProperty[] = "L2TPIPsec.PSKRequired";
+const char kL2tpIpsecUserProperty[] = "L2TPIPsec.User";
+const char kL2tpIpsecPasswordProperty[] = "L2TPIPsec.Password";
+
+// Flimflam OpenVPN property names.
+const char kOpenVPNAuthNoCacheProperty[] = "OpenVPN.AuthNoCache";
+const char kOpenVPNAuthProperty[] = "OpenVPN.Auth";
+const char kOpenVPNAuthRetryProperty[] = "OpenVPN.AuthRetry";
+const char kOpenVPNAuthUserPassProperty[] = "OpenVPN.AuthUserPass";
+const char kOpenVPNCaCertProperty[] = "OpenVPN.CACert";
+const char kOpenVPNCaCertNSSProperty[] = "OpenVPN.CACertNSS";
+const char kOpenVPNClientCertIdProperty[] = "OpenVPN.Pkcs11.ID";
+const char kOpenVPNClientCertSlotProperty[] = "OpenVPN.Pkcs11.Slot";
+const char kOpenVPNCipherProperty[] = "OpenVPN.Cipher";
+const char kOpenVPNCompLZOProperty[] = "OpenVPN.CompLZO";
+const char kOpenVPNCompNoAdaptProperty[] = "OpenVPN.CompNoAdapt";
+const char kOpenVPNIgnoreDefaultRouteProperty[] = "OpenVPN.IgnoreDefaultRoute";
+const char kOpenVPNKeyDirectionProperty[] = "OpenVPN.KeyDirection";
+const char kOpenVPNMgmtEnableProperty[] = "OpenVPN.Mgmt.Enable";
+const char kOpenVPNNsCertTypeProperty[] = "OpenVPN.NsCertType";
+const char kOpenVPNOTPProperty[] = "OpenVPN.OTP";
+const char kOpenVPNPasswordProperty[] = "OpenVPN.Password";
+const char kOpenVPNPinProperty[] = "OpenVPN.Pkcs11.PIN";
+const char kOpenVPNPortProperty[] = "OpenVPN.Port";
+const char kOpenVPNProtoProperty[] = "OpenVPN.Proto";
+const char kOpenVPNProviderProperty[] = "OpenVPN.Pkcs11.Provider";
+const char kOpenVPNPushPeerInfoProperty[] = "OpenVPN.PushPeerInfo";
+const char kOpenVPNRemoteCertEKUProperty[] = "OpenVPN.RemoteCertEKU";
+const char kOpenVPNRemoteCertKUProperty[] = "OpenVPN.RemoteCertKU";
+const char kOpenVPNRemoteCertTLSProperty[] = "OpenVPN.RemoteCertTLS";
+const char kOpenVPNRenegSecProperty[] = "OpenVPN.RenegSec";
+const char kOpenVPNServerPollTimeoutProperty[] = "OpenVPN.ServerPollTimeout";
+const char kOpenVPNShaperProperty[] = "OpenVPN.Shaper";
+const char kOpenVPNStaticChallengeProperty[] = "OpenVPN.StaticChallenge";
+const char kOpenVPNTLSAuthContentsProperty[] = "OpenVPN.TLSAuthContents";
+const char kOpenVPNTLSRemoteProperty[] = "OpenVPN.TLSRemote";
+const char kOpenVPNUserProperty[] = "OpenVPN.User";
+
+// Flimflam ARCVPN property names.
+const char kArcVpnTunnelChromeProperty[] = "ArcVpn.TunnelChrome";
+
+// FlimFlam PPPoE property names.
+const char kPPPoEUsernameProperty[] = "PPPoE.Username";
+const char kPPPoEPasswordProperty[] = "PPPoE.Password";
+const char kPPPoELCPEchoIntervalProperty[] = "PPPoE.LCPEchoInterval";
+const char kPPPoELCPEchoFailureProperty[] = "PPPoE.LCPEchoFailure";
+const char kPPPoEMaxAuthFailureProperty[] = "PPPoE.MaxAuthFailure";
+
+// FlimFlam technology family options
+const char kTechnologyFamilyCdma[] = "CDMA";
+const char kTechnologyFamilyGsm[] = "GSM";
+
+// IPConfig property names.
+const char kMethodProperty[] = "Method";
+const char kAddressProperty[] = "Address";
+const char kMtuProperty[] = "Mtu";
+const char kPrefixlenProperty[] = "Prefixlen";
+const char kBroadcastProperty[] = "Broadcast";
+const char kPeerAddressProperty[] = "PeerAddress";
+const char kGatewayProperty[] = "Gateway";
+const char kDomainNameProperty[] = "DomainName";
+const char kAcceptedHostnameProperty[] = "AcceptedHostname";
+const char kNameServersProperty[] = "NameServers";
+const char kSearchDomainsProperty[] = "SearchDomains";
+const char kDhcpv6AddressesProperty[] = "Dhcpv6Addresses";
+const char kDhcpv6DelegatedPrefixesProperty[] = "Dhcpv6DelegatedPrefixes";
+const char kLeaseDurationSecondsProperty[] = "LeaseDurationSeconds";
+const char kVendorEncapsulatedOptionsProperty[] = "VendorEncapsulatedOptions";
+const char kWebProxyAutoDiscoveryUrlProperty[] = "WebProxyAutoDiscoveryUrl";
+// DHCP Option for iSNS (RFC 4174)
+const char kiSNSOptionDataProperty[] = "iSNSOptionData";
+const char kIncludedRoutesProperty[] = "IncludedRoutes";
+const char kExcludedRoutesProperty[] = "ExcludedRoutes";
+
+// These constants are deprecated in favor of kDhcpv6DelegatedPrefixesProperty.
+// TODO(tjennison): Remove when shill no longer uses them b/26778228
+const char kDelegatedPrefixProperty[] = "DelegatedPrefix";
+const char kDelegatedPrefixLengthProperty[] = "DelegatedPrefixLength";
+
+// IPConfig DHCPv6 address/prefix property names.
+const char kDhcpv6AddressProperty[] = "Address";
+const char kDhcpv6LengthProperty[] = "Length";
+const char kDhcpv6LeaseDurationSecondsProperty[] = "LeaseDurationSeconds";
+const char kDhcpv6PreferredLeaseDurationSecondsProperty[] =
+ "PreferredLeaseDurationSeconds";
+
+// IPConfig type options.
+const char kTypeIPv4[] = "ipv4";
+const char kTypeIPv6[] = "ipv6";
+const char kTypeDHCP[] = "dhcp";
+const char kTypeBOOTP[] = "bootp";
+const char kTypeZeroConf[] = "zeroconf";
+const char kTypeDHCP6[] = "dhcp6";
+const char kTypePPP[] = "ppp";
+
+// Flimflam error options.
+const char kError4WayTimeout[] = "4way-handshake-timeout";
+const char kErrorAaaFailed[] = "aaa-failed";
+const char kErrorActivationFailed[] = "activation-failed";
+const char kErrorBadPassphrase[] = "bad-passphrase";
+const char kErrorBadWEPKey[] = "bad-wepkey";
+const char kErrorConnectFailed[] = "connect-failed";
+const char kErrorDNSLookupFailed[] = "dns-lookup-failed";
+const char kErrorDhcpFailed[] = "dhcp-failed";
+const char kErrorHTTPGetFailed[] = "http-get-failed";
+const char kErrorInternal[] = "internal-error";
+const char kErrorInvalidFailure[] = "invalid-failure";
+const char kErrorIpsecCertAuthFailed[] = "ipsec-cert-auth-failed";
+const char kErrorIpsecPskAuthFailed[] = "ipsec-psk-auth-failed";
+const char kErrorNeedEvdo[] = "need-evdo";
+const char kErrorNeedHomeNetwork[] = "need-home-network";
+const char kErrorNoFailure[] = "no-failure";
+const char kErrorNotAssociated[] = "not-associated";
+const char kErrorNotAuthenticated[] = "not-authenticated";
+const char kErrorOtaspFailed[] = "otasp-failed";
+const char kErrorOutOfRange[] = "out-of-range";
+const char kErrorPinMissing[] = "pin-missing";
+const char kErrorPppAuthFailed[] = "ppp-auth-failed";
+const char kErrorTooManySTAs[] = "too-many-stas";
+const char kErrorUnknownFailure[] = "unknown-failure";
+
+// Flimflam error result codes.
+const char kErrorResultSuccess[] = "org.chromium.flimflam.Error.Success";
+const char kErrorResultFailure[] = "org.chromium.flimflam.Error.Failure";
+const char kErrorResultAlreadyConnected[] =
+ "org.chromium.flimflam.Error.AlreadyConnected";
+const char kErrorResultAlreadyExists[] =
+ "org.chromium.flimflam.Error.AlreadyExists";
+const char kErrorResultIncorrectPin[] =
+ "org.chromium.flimflam.Error.IncorrectPin";
+const char kErrorResultInProgress[] = "org.chromium.flimflam.Error.InProgress";
+const char kErrorResultInternalError[] =
+ "org.chromium.flimflam.Error.InternalError";
+const char kErrorResultInvalidApn[] = "org.chromium.flimflam.Error.InvalidApn";
+const char kErrorResultInvalidArguments[] =
+ "org.chromium.flimflam.Error.InvalidArguments";
+const char kErrorResultInvalidNetworkName[] =
+ "org.chromium.flimflam.Error.InvalidNetworkName";
+const char kErrorResultInvalidPassphrase[] =
+ "org.chromium.flimflam.Error.InvalidPassphrase";
+const char kErrorResultInvalidProperty[] =
+ "org.chromium.flimflam.Error.InvalidProperty";
+const char kErrorResultNoCarrier[] = "org.chromium.flimflam.Error.NoCarrier";
+const char kErrorResultNotConnected[] =
+ "org.chromium.flimflam.Error.NotConnected";
+const char kErrorResultNotFound[] = "org.chromium.flimflam.Error.NotFound";
+const char kErrorResultNotImplemented[] =
+ "org.chromium.flimflam.Error.NotImplemented";
+const char kErrorResultNotOnHomeNetwork[] =
+ "org.chromium.flimflam.Error.NotOnHomeNetwork";
+const char kErrorResultNotRegistered[] =
+ "org.chromium.flimflam.Error.NotRegistered";
+const char kErrorResultNotSupported[] =
+ "org.chromium.flimflam.Error.NotSupported";
+const char kErrorResultOperationAborted[] =
+ "org.chromium.flimflam.Error.OperationAborted";
+const char kErrorResultOperationInitiated[] =
+ "org.chromium.flimflam.Error.OperationInitiated";
+const char kErrorResultOperationTimeout[] =
+ "org.chromium.flimflam.Error.OperationTimeout";
+const char kErrorResultPassphraseRequired[] =
+ "org.chromium.flimflam.Error.PassphraseRequired";
+const char kErrorResultPermissionDenied[] =
+ "org.chromium.flimflam.Error.PermissionDenied";
+const char kErrorResultPinBlocked[] = "org.chromium.flimflam.Error.PinBlocked";
+const char kErrorResultPinRequired[] =
+ "org.chromium.flimflam.Error.PinRequired";
+const char kErrorResultWrongState[] = "org.chromium.flimflam.Error.WrongState";
+
+const char kUnknownString[] = "UNKNOWN";
+
+// Function names.
+const char kClearPropertiesFunction[] = "ClearProperties";
+const char kCompleteCellularActivationFunction[] = "CompleteCellularActivation";
+const char kConfigureServiceForProfileFunction[] = "ConfigureServiceForProfile";
+const char kConnectToBestServicesFunction[] = "ConnectToBestServices";
+const char kCreateConnectivityReportFunction[] = "CreateConnectivityReport";
+const char kAddWakeOnPacketConnectionFunction[] = "AddWakeOnPacketConnection";
+const char kAddWakeOnPacketOfTypesFunction[] = "AddWakeOnPacketOfTypes";
+const char kRemoveWakeOnPacketConnectionFunction[] =
+ "RemoveWakeOnPacketConnection";
+const char kRemoveWakeOnPacketOfTypesFunction[] = "RemoveWakeOnPacketOfTypes";
+const char kRemoveAllWakeOnPacketConnectionsFunction[] =
+ "RemoveAllWakeOnPacketConnections";
+const char kGetLoadableProfileEntriesFunction[] = "GetLoadableProfileEntries";
+const char kGetNetworksForGeolocation[] = "GetNetworksForGeolocation";
+const char kPerformTDLSOperationFunction[] = "PerformTDLSOperation";
+const char kRefreshFunction[] = "Refresh";
+const char kResetFunction[] = "Reset";
+const char kSetCarrierFunction[] = "SetCarrier";
+const char kSetPropertiesFunction[] = "SetProperties";
+const char kVerifyAndEncryptCredentialsFunction[] =
+ "VerifyAndEncryptCredentials";
+const char kVerifyAndEncryptDataFunction[] = "VerifyAndEncryptData";
+const char kVerifyDestinationFunction[] = "VerifyDestination";
+
+// ThirdPartyVpn functions.
+const char kSetParametersFunction[] = "SetParameters";
+const char kSendPacketFunction[] = "SendPacket";
+const char kUpdateConnectionStateFunction[] = "UpdateConnectionState";
+const char kOnPacketReceivedFunction[] = "OnPacketReceived";
+const char kOnPlatformMessageFunction[] = "OnPlatformMessage";
+
+// Device property names.
+const char kEapAuthenticationCompletedProperty[] = "EapAuthenticationCompleted";
+const char kEapAuthenticatorDetectedProperty[] = "EapAuthenticatorDetected";
+const char kLinkMonitorResponseTimeProperty[] = "LinkMonitorResponseTime";
+const char kLinkUpProperty[] = "Ethernet.LinkUp";
+const char kProviderRequiresRoamingProperty[] =
+ "Cellular.ProviderRequiresRoaming";
+const char kPPPoEProperty[] = "Ethernet.PPPoE";
+const char kReceiveByteCountProperty[] = "ReceiveByteCount";
+const char kSIMPresentProperty[] = "Cellular.SIMPresent";
+const char kSupportedCarriersProperty[] = "Cellular.SupportedCarriers";
+const char kTransmitByteCountProperty[] = "TransmitByteCount";
+const char kWifiSupportedFrequenciesProperty[] = "WiFi.SupportedFrequencies";
+
+// Technology types (augments "Flimflam type options" above).
+const char kTypeEthernetEap[] = "etherneteap";
+
+// Error strings.
+const char kErrorEapAuthenticationFailed[] = "eap-authentication-failed";
+const char kErrorEapLocalTlsFailed[] = "eap-local-tls-failed";
+const char kErrorEapRemoteTlsFailed[] = "eap-remote-tls-failed";
+
+// Manager property names.
+const char kAlwaysOnVpnPackageProperty[] = "AlwaysOnVpnPackage";
+const char kDefaultServiceProperty[] = "DefaultService";
+const char kDhcpPropertyHostnameProperty[] = "DHCPProperty.Hostname";
+const char kDhcpPropertyVendorClassProperty[] = "DHCPProperty.VendorClass";
+const char kDisableWiFiVHTProperty[] = "DisableWiFiVHT";
+const char kIgnoredDNSSearchPathsProperty[] = "IgnoredDNSSearchPaths";
+const char kLinkMonitorTechnologiesProperty[] =
+ "LinkMonitorTechnologies";
+const char kNoAutoConnectTechnologiesProperty[] = "NoAutoConnectTechnologies";
+const char kPortalCheckIntervalProperty[] = "PortalCheckInterval";
+const char kProhibitedTechnologiesProperty[] = "ProhibitedTechnologies";
+const char kServiceCompleteListProperty[] = "ServiceCompleteList";
+const char kShortDNSTimeoutTechnologiesProperty[] =
+ "ShortDNSTimeoutTechnologies";
+const char kUninitializedTechnologiesProperty[] = "UninitializedTechnologies";
+const char kWakeOnLanEnabledProperty[] = "WakeOnLanEnabled";
+const char kWakeOnWiFiFeaturesEnabledProperty[] = "WakeOnWiFiFeaturesEnabled";
+
+// Service property names.
+const char kActivationTypeProperty[] = "Cellular.ActivationType";
+const char kDiagnosticsDisconnectsProperty[] = "Diagnostics.Disconnects";
+const char kDiagnosticsMisconnectsProperty[] = "Diagnostics.Misconnects";
+const char kEapRemoteCertificationProperty[] = "EAP.RemoteCertification";
+const char kEapCaCertPemProperty[] = "EAP.CACertPEM";
+const char kEapSubjectMatchProperty[] = "EAP.SubjectMatch";
+const char kErrorDetailsProperty[] = "ErrorDetails";
+const char kKeyManagementIEEE8021X[] = "IEEE8021X";
+const char kIPConfigProperty[] = "IPConfig";
+const char kL2tpIpsecCaCertPemProperty[] = "L2TPIPsec.CACertPEM";
+const char kL2tpIpsecTunnelGroupProperty[] = "L2TPIPsec.TunnelGroup";
+const char kL2tpIpsecXauthPasswordProperty[] = "L2TPIPsec.XauthPassword";
+const char kL2tpIpsecXauthUserProperty[] = "L2TPIPsec.XauthUser";
+const char kL2tpIpsecLcpEchoDisabledProperty[] = "L2TPIPsec.LCPEchoDisabled";
+const char kManagedCredentialsProperty[] = "ManagedCredentials";
+const char kOpenVPNCaCertPemProperty[] = "OpenVPN.CACertPEM";
+const char kOpenVPNCertProperty[] = "OpenVPN.Cert";
+const char kOpenVPNExtraCertPemProperty[] = "OpenVPN.ExtraCertPEM";
+const char kOpenVPNExtraHostsProperty[] = "OpenVPN.ExtraHosts";
+const char kOpenVPNKeyProperty[] = "OpenVPN.Key";
+const char kOpenVPNPingProperty[] = "OpenVPN.Ping";
+const char kOpenVPNPingExitProperty[] = "OpenVPN.PingExit";
+const char kOpenVPNPingRestartProperty[] = "OpenVPN.PingRestart";
+const char kOpenVPNTLSAuthProperty[] = "OpenVPN.TLSAuth";
+const char kOpenVPNTLSVersionMinProperty[] = "OpenVPN.TLSVersionMin";
+const char kOpenVPNTokenProperty[] = "OpenVPN.Token";
+const char kOpenVPNVerbProperty[] = "OpenVPN.Verb";
+const char kOpenVPNVerifyHashProperty[] = "OpenVPN.VerifyHash";
+const char kOpenVPNVerifyX509NameProperty[] = "OpenVPN.VerifyX509Name";
+const char kOpenVPNVerifyX509TypeProperty[] = "OpenVPN.VerifyX509Type";
+const char kOutOfCreditsProperty[] = "Cellular.OutOfCredits";
+const char kPhysicalTechnologyProperty[] = "PhysicalTechnology";
+const char kPreviousErrorProperty[] = "PreviousError";
+const char kPreviousErrorSerialNumberProperty[] = "PreviousErrorSerialNumber";
+const char kStaticIPAddressProperty[] = "StaticIP.Address";
+const char kStaticIPGatewayProperty[] = "StaticIP.Gateway";
+const char kStaticIPMtuProperty[] = "StaticIP.Mtu";
+const char kStaticIPNameServersProperty[] = "StaticIP.NameServers";
+const char kStaticIPPeerAddressProperty[] = "StaticIP.PeerAddress";
+const char kStaticIPPrefixlenProperty[] = "StaticIP.Prefixlen";
+const char kSavedIPAddressProperty[] = "SavedIP.Address";
+const char kSavedIPGatewayProperty[] = "SavedIP.Gateway";
+const char kSavedIPMtuProperty[] = "SavedIP.Mtu";
+const char kSavedIPNameServersProperty[] = "SavedIP.NameServers";
+const char kSavedIPPeerAddressProperty[] = "SavedIP.PeerAddress";
+const char kSavedIPPrefixlenProperty[] = "SavedIP.Prefixlen";
+const char kTetheringProperty[] = "Tethering";
+const char kVPNMTUProperty[] = "VPN.MTU";
+const char kWifiFrequencyListProperty[] = "WiFi.FrequencyList";
+const char kWifiVendorInformationProperty[] = "WiFi.VendorInformation";
+const char kWifiProtectedManagementFrameRequiredProperty[] =
+ "WiFi.ProtectedManagementFrameRequired";
+
+// Profile property names.
+const char kUserHashProperty[] = "UserHash";
+
+// Service Tethering property values.
+const char kTetheringNotDetectedState[] = "NotDetected";
+const char kTetheringSuspectedState[] = "Suspected";
+const char kTetheringConfirmedState[] = "Confirmed";
+
+// WiFi Service Vendor Information dictionary properties.
+const char kVendorWPSManufacturerProperty[] = "Manufacturer";
+const char kVendorWPSModelNameProperty[] = "ModelName";
+const char kVendorWPSModelNumberProperty[] = "ModelNumber";
+const char kVendorWPSDeviceNameProperty[] = "DeviceName";
+const char kVendorOUIListProperty[] = "OUIList";
+
+// WiFi Device link property names.
+const char kLinkStatisticsProperty[] = "LinkStatistics";
+const char kAverageReceiveSignalDbmProperty[] = "AverageReceiveSignalDbm";
+const char kInactiveTimeMillisecondsProperty[] =
+ "InactiveTimeMilliseconds";
+const char kLastReceiveSignalDbmProperty[] = "LastReceiveSignalDbm";
+const char kPacketReceiveSuccessesProperty[] = "PacketReceiveSuccesses";
+const char kPacketTransmitFailuresProperty[] = "PacketTransmitFailures";
+const char kPacketTransmitSuccessesProperty[] = "PacketTrasmitSuccesses";
+const char kTransmitBitrateProperty[] = "TransmitBitrate";
+const char kTransmitRetriesProperty[] = "TransmitRetries";
+
+// WiFi TDLS operations.
+const char kTDLSDiscoverOperation[] = "Discover";
+const char kTDLSSetupOperation[] = "Setup";
+const char kTDLSStatusOperation[] = "Status";
+const char kTDLSTeardownOperation[] = "Teardown";
+
+// WiFi TDLS states.
+const char kTDLSConnectedState[] = "Connected";
+const char kTDLSDisabledState[] = "Disabled";
+const char kTDLSDisconnectedState[] = "Disconnected";
+const char kTDLSNonexistentState[] = "Nonexistent";
+const char kTDLSUnknownState[] = "Unknown";
+
+// Wake on WiFi features.
+const char kWakeOnWiFiFeaturesEnabledPacket[] = "packet";
+const char kWakeOnWiFiFeaturesEnabledDarkConnect[] = "darkconnect";
+const char kWakeOnWiFiFeaturesEnabledPacketDarkConnect[] =
+ "packet_and_darkconnect";
+const char kWakeOnWiFiFeaturesEnabledNone[] = "none";
+const char kWakeOnWiFiFeaturesEnabledNotSupported[] = "not_supported";
+
+// Wake on WiFi Packet Type Constants.
+const char kWakeOnTCP[] = "TCP";
+const char kWakeOnUDP[] = "UDP";
+const char kWakeOnIDP[] = "IDP";
+const char kWakeOnIPIP[] = "IPIP";
+const char kWakeOnIGMP[] = "IGMP";
+const char kWakeOnICMP[] = "ICMP";
+const char kWakeOnIP[] = "IP";
+
+// Cellular service carriers.
+const char kCarrierGenericUMTS[] = "Generic UMTS";
+const char kCarrierSprint[] = "Sprint";
+const char kCarrierVerizon[] = "Verizon Wireless";
+
+// Cellular activation types.
+const char kActivationTypeNonCellular[] = "NonCellular"; // For future use
+const char kActivationTypeOMADM[] = "OMADM"; // For future use
+const char kActivationTypeOTA[] = "OTA";
+const char kActivationTypeOTASP[] = "OTASP";
+
+// Geolocation property field names.
+// Reference:
+// https://devsite.googleplex.com/maps/documentation/business/geolocation/
+// Top level properties for a Geolocation request.
+const char kGeoHomeMobileCountryCodeProperty[] = "homeMobileCountryCode";
+const char kGeoHomeMobileNetworkCodeProperty[] = "homeMobileNetworkCode";
+const char kGeoRadioTypePropertyProperty[] = "radioType";
+const char kGeoCellTowersProperty[] = "cellTowers";
+const char kGeoWifiAccessPointsProperty[] = "wifiAccessPoints";
+// Cell tower object property names.
+const char kGeoCellIdProperty[] = "cellId";
+const char kGeoLocationAreaCodeProperty[] = "locationAreaCode";
+const char kGeoMobileCountryCodeProperty[] = "mobileCountryCode";
+const char kGeoMobileNetworkCodeProperty[] = "mobileNetworkCode";
+const char kGeoTimingAdvanceProperty[] = "timingAdvance";
+// WiFi access point property names.
+const char kGeoMacAddressProperty[] = "macAddress";
+const char kGeoChannelProperty[] = "channel";
+const char kGeoSignalToNoiseRatioProperty[] = "signalToNoiseRatio";
+// Common property names for geolocation objects.
+const char kGeoAgeProperty[] = "age";
+const char kGeoSignalStrengthProperty[] = "signalStrength";
+// ThirdPartyVpn parameters, properties and constants.
+const char kAddressParameterThirdPartyVpn[] = "address";
+const char kBroadcastAddressParameterThirdPartyVpn[] = "broadcast_address";
+const char kGatewayParameterThirdPartyVpn[] = "gateway";
+const char kBypassTunnelForIpParameterThirdPartyVpn[] = "bypass_tunnel_for_ip";
+const char kSubnetPrefixParameterThirdPartyVpn[] = "subnet_prefix";
+const char kMtuParameterThirdPartyVpn[] = "mtu";
+const char kDomainSearchParameterThirdPartyVpn[] = "domain_search";
+const char kDnsServersParameterThirdPartyVpn[] = "dns_servers";
+const char kInclusionListParameterThirdPartyVpn[] = "inclusion_list";
+const char kExclusionListParameterThirdPartyVpn[] = "exclusion_list";
+const char kReconnectParameterThirdPartyVpn[] = "reconnect";
+const char kObjectPathSuffixProperty[] = "ObjectPathSuffix";
+const char kExtensionNameProperty[] = "ExtensionName";
+const char kConfigurationNameProperty[] = "ConfigurationName";
+const char kObjectPathBase[] = "/thirdpartyvpn/";
+const char kNonIPDelimiter = ':';
+const char kIPDelimiter = ' ';
+} // namespace shill
+
+#endif // SYSTEM_API_DBUS_SHILL_DBUS_CONSTANTS_H_
diff --git a/dbus/smbprovider/dbus-constants.h b/dbus/smbprovider/dbus-constants.h
new file mode 100644
index 0000000..b5cb760
--- /dev/null
+++ b/dbus/smbprovider/dbus-constants.h
@@ -0,0 +1,42 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_SMBPROVIDER_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_SMBPROVIDER_DBUS_CONSTANTS_H_
+
+namespace smbprovider {
+
+// General
+const char kSmbProviderInterface[] = "org.chromium.SmbProvider";
+const char kSmbProviderServicePath[] = "/org/chromium/SmbProvider";
+const char kSmbProviderServiceName[] = "org.chromium.SmbProvider";
+
+// Methods
+const char kMountMethod[] = "Mount";
+const char kUnmountMethod[] = "Unmount";
+const char kReadDirectoryMethod[] = "ReadDirectory";
+const char kGetMetadataEntryMethod[] = "GetMetadataEntry";
+const char kOpenFileMethod[] = "OpenFile";
+const char kCloseFileMethod[] = "CloseFile";
+const char kReadFileMethod[] = "ReadFile";
+const char kDeleteEntryMethod[] = "DeleteEntry";
+const char kCreateFileMethod[] = "CreateFile";
+const char kTruncateMethod[] = "Truncate";
+const char kWriteFileMethod[] = "WriteFile";
+const char kCreateDirectoryMethod[] = "CreateDirectory";
+const char kMoveEntryMethod[] = "MoveEntry";
+const char kCopyEntryMethod[] = "CopyEntry";
+const char kGetDeleteListMethod[] = "GetDeleteList";
+const char kGetSharesMethod[] = "GetShares";
+const char kRemountMethod[] = "Remount";
+const char kSetupKerberosMethod[] = "SetupKerberos";
+const char kParseNetBiosPacketMethod[] = "ParseNetBiosPacket";
+const char kStartCopyMethod[] = "StartCopy";
+const char kContinueCopyMethod[] = "ContinueCopy";
+const char kStartReadDirectoryMethod[] = "StartReadDirectory";
+const char kContinueReadDirectoryMethod[] = "ContinueReadDirectory";
+
+} // namespace smbprovider
+
+#endif // SYSTEM_API_DBUS_SMBPROVIDER_DBUS_CONSTANTS_H_
diff --git a/dbus/smbprovider/directory_entry.proto b/dbus/smbprovider/directory_entry.proto
new file mode 100644
index 0000000..940c185
--- /dev/null
+++ b/dbus/smbprovider/directory_entry.proto
@@ -0,0 +1,244 @@
+// Copyright 2017 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.
+
+syntax = "proto2";
+
+option optimize_for = LITE_RUNTIME;
+
+package smbprovider;
+
+// ErrorType matches 1:1 to FileSystemProvider#ProviderError in Chromium up
+// until ERROR_PROVIDER_ERROR_COUNT. The ErrorTypes past that are specific to
+// SmbProvider.
+enum ErrorType {
+ ERROR_NONE = 0;
+ ERROR_OK = 1;
+ ERROR_FAILED = 2;
+ ERROR_IN_USE = 3;
+ ERROR_EXISTS = 4;
+ ERROR_NOT_FOUND = 5;
+ ERROR_ACCESS_DENIED = 6;
+ ERROR_TOO_MANY_OPENED = 7;
+ ERROR_NO_MEMORY = 8;
+ ERROR_NO_SPACE = 9;
+ ERROR_NOT_A_DIRECTORY = 10;
+ ERROR_INVALID_OPERATION = 11;
+ ERROR_SECURITY = 12;
+ ERROR_ABORT = 13;
+ ERROR_NOT_A_FILE = 14;
+ ERROR_NOT_EMPTY = 15;
+ ERROR_INVALID_URL = 16;
+ ERROR_IO = 17;
+ // Count of ProviderError.
+ ERROR_PROVIDER_ERROR_COUNT = 18;
+ // The following errors are not ProviderErrors, instead they are specific to
+ // SmbProvider. The jump in int value is to account for possible future
+ // additions to ProviderError.
+ ERROR_DBUS_PARSE_FAILED = 50;
+ ERROR_COPY_PENDING = 51;
+ ERROR_COPY_FAILED = 52;
+ ERROR_SMB1_UNSUPPORTED = 53;
+ ERROR_OPERATION_PENDING = 54;
+ ERROR_OPERATION_FAILED = 55;
+}
+
+message DirectoryEntryProto {
+ optional bool is_directory = 1;
+ optional string name = 2;
+ // Size in bytes.
+ optional int64 size = 3;
+ // Seconds since unix epoch.
+ optional int64 last_modified_time = 4;
+}
+
+// DirectoryEntryListProto is included in responses to ReadDirectory D-Bus
+// method calls.
+message DirectoryEntryListProto { repeated DirectoryEntryProto entries = 1; }
+
+// Used for passing inputs into SmbProvider.Mount().
+message MountOptionsProto {
+ // Path of the share to be mounted. (e.g. "smb://qnap/testshare")
+ optional string path = 1;
+
+ // Authentication parameters.
+ optional string workgroup = 2;
+ optional string username = 3;
+
+ // Mount options set by the client.
+ optional MountConfigProto mount_config = 4;
+}
+
+message MountConfigProto {
+ // Boolean indication whether or not to enable NTLM protocol. False
+ // disables the NTLM protocol.
+ optional bool enable_ntlm = 1;
+}
+
+// Used for passing inputs into SmbProvider.Unmount().
+message UnmountOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+}
+
+// Used for passing inputs into SmbProvider.ReadDirectory().
+message ReadDirectoryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the directory to be read. The paths are relative to the mount root.
+ // (e.g. "/testfolder")
+ optional string directory_path = 2;
+}
+
+// Used for passing inputs into SmbProvider.GetMetadataEntry().
+message GetMetadataEntryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the entry to be read. This can be a file or directory path.
+ // The paths are relative to the mount root. (e.g. "/testfolder/dog.jpg")
+ optional string entry_path = 2;
+}
+
+// Used for passing inputs into SmbProvider.OpenFile().
+message OpenFileOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the file to be opened. This must be a file path.
+ // Paths are relative to the mount root, e.g. "/animals/dog.jpg".
+ optional string file_path = 2;
+ // Boolean indicating write status. False indicates read only.
+ optional bool writeable = 3;
+}
+
+// Used for passing inputs into SmbProvider.CloseFile().
+message CloseFileOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // ID of the file returned from OpenFile().
+ optional int32 file_id = 2;
+}
+
+// Used for passing inputs into SmbProvider.ReadFile().
+message ReadFileOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // ID of the file returned from OpenFile().
+ optional int32 file_id = 2;
+ // Offset of the file to be read.
+ optional int64 offset = 3;
+ // Length in bytes to be read.
+ optional int32 length = 4;
+}
+
+// Used for passing inputs into SmbProvider.DeleteEntry().
+message DeleteEntryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the entry to be deleted. This can be a file or directory path.
+ // The paths are relative to the mount root. (e.g. "/testfolder/dog.jpg")
+ optional string entry_path = 2;
+ // Boolean indicating whether the delete should be recursive for directories.
+ optional bool recursive = 3;
+}
+
+// Used for passing inputs into SmbProvider.CreateFile().
+message CreateFileOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the file to be created. Paths are relative to the mount root,
+ // e.g. "/animals/dog.jpg".
+ optional string file_path = 2;
+}
+
+// Used for passing inputs into SmbProvider.Truncate().
+message TruncateOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the file to be truncated. Paths are relative to the mount root,
+ // e.g. "/animals/dog.jpg".
+ optional string file_path = 2;
+ // New desired length of the file.
+ optional int64 length = 3;
+}
+
+// Used for passing inputs into SmbProvider.WriteFile().
+message WriteFileOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // ID of the file returned from OpenFile().
+ optional int32 file_id = 2;
+ // Offset of the file for the write.
+ optional int64 offset = 3;
+ // Length of data being written.
+ optional int32 length = 4;
+}
+
+// Used for passing inputs into SmbProvider.CreateDirectory().
+message CreateDirectoryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Path of the directory to be created. Paths are relative to the mount root.
+ // (e.g. "/testfolder/dogs")
+ optional string directory_path = 2;
+ // Boolean indicating whether the create should be recursive, meaning the
+ // parent directories will also be created if they currently don't exist.
+ optional bool recursive = 3;
+}
+
+// Used for passing inputs into SmbProvider.MoveEntry().
+message MoveEntryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Source path of the entry to be moved. This can be a file or directory path.
+ // Paths are relative to the mount root. (e.g. "/testfolder/dog.jpg")
+ optional string source_path = 2;
+ // Destination path for the entry to be moved to. This must be a non-existent
+ // file or directory path. Paths are relative to the mount
+ // root. (e.g. "/testfolder/dog.jpg")
+ optional string target_path = 3;
+}
+
+// Used for passing inputs into SmbProvider.CopyEntry().
+message CopyEntryOptionsProto {
+ // ID of the mount returned from Mount().
+ optional int32 mount_id = 1;
+ // Source path of the entry to be copied. This can be a file or directory
+ // path. Paths are relative to the mount root. (e.g. "/testfolder/dog.jpg")
+ optional string source_path = 2;
+ // Destination path for the entry to be copied to. This must be a non-existent
+ // file or directory path. Paths are relative to the mount root.
+ // (e.g. "/testfolder/dog.jpg")
+ optional string target_path = 3;
+}
+
+message GetDeleteListOptionsProto {
+ optional int32 mount_id = 1;
+ optional string entry_path = 2;
+}
+
+message DeleteListProto {
+ repeated string entries = 1;
+}
+
+// Used for passing inputs into SmbProvider.GetShares().
+message GetSharesOptionsProto {
+ // Url of the server containing the shares. (e.g. "smb://192.168.0.1")
+ optional string server_url = 1;
+}
+
+// Used for passing inputs into SmbProvider.Remount().
+message RemountOptionsProto {
+ // Path of the share to be remounted. (e.g. "smb://192.168.0.1/testshare")
+ optional string path = 1;
+ // ID to assign to the mount.
+ optional int32 mount_id = 2;
+
+ // Authentication parameters.
+ optional string workgroup = 3;
+ optional string username = 4;
+}
+
+// Used for returning a list of hostnames from a parsed NetBios response packet.
+message HostnamesProto {
+ repeated string hostnames = 1;
+}
\ No newline at end of file
diff --git a/dbus/update_engine/dbus-constants.h b/dbus/update_engine/dbus-constants.h
new file mode 100644
index 0000000..9551b41
--- /dev/null
+++ b/dbus/update_engine/dbus-constants.h
@@ -0,0 +1,66 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_UPDATE_ENGINE_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_UPDATE_ENGINE_DBUS_CONSTANTS_H_
+
+namespace update_engine {
+const char kUpdateEngineInterface[] = "org.chromium.UpdateEngineInterface";
+const char kUpdateEngineServicePath[] = "/org/chromium/UpdateEngine";
+const char kUpdateEngineServiceName[] = "org.chromium.UpdateEngine";
+
+// Generic UpdateEngine D-Bus error.
+const char kUpdateEngineServiceErrorFailed[] =
+ "org.chromium.UpdateEngine.Error.Failed";
+
+// Methods.
+const char kAttemptUpdate[] = "AttemptUpdate";
+const char kGetLastAttemptError[] = "GetLastAttemptError";
+const char kGetStatus[] = "GetStatus";
+const char kRebootIfNeeded[] = "RebootIfNeeded";
+const char kSetChannel[] = "SetChannel";
+const char kGetChannel[] = "GetChannel";
+const char kAttemptRollback[] = "AttemptRollback";
+const char kCanRollback[] = "CanRollback";
+const char kGetEolStatus[] = "GetEolStatus";
+const char kSetUpdateOverCellularPermission[] =
+ "SetUpdateOverCellularPermission";
+const char kSetUpdateOverCellularTarget[] =
+ "SetUpdateOverCellularTarget";
+
+// Signals.
+const char kStatusUpdate[] = "StatusUpdate";
+
+// Flags used in the AttemptUpdateWithFlags() D-Bus method.
+typedef enum {
+ kAttemptUpdateFlagNonInteractive = (1 << 0)
+} AttemptUpdateFlags;
+
+// End of Life status used in the GetEolStatus() D-Bus method.
+typedef enum {
+ kSupported = 0,
+ kSecurityOnly = 1,
+ kEol = 2,
+} EndOfLifeStatus;
+
+// Operations contained in StatusUpdate signals.
+const char kUpdateStatusIdle[] = "UPDATE_STATUS_IDLE";
+const char kUpdateStatusCheckingForUpdate[] =
+ "UPDATE_STATUS_CHECKING_FOR_UPDATE";
+const char kUpdateStatusUpdateAvailable[] = "UPDATE_STATUS_UPDATE_AVAILABLE";
+const char kUpdateStatusDownloading[] = "UPDATE_STATUS_DOWNLOADING";
+const char kUpdateStatusVerifying[] = "UPDATE_STATUS_VERIFYING";
+const char kUpdateStatusFinalizing[] = "UPDATE_STATUS_FINALIZING";
+const char kUpdateStatusUpdatedNeedReboot[] =
+ "UPDATE_STATUS_UPDATED_NEED_REBOOT";
+const char kUpdateStatusReportingErrorEvent[] =
+ "UPDATE_STATUS_REPORTING_ERROR_EVENT";
+const char kUpdateStatusAttemptingRollback[] =
+ "UPDATE_STATUS_ATTEMPTING_ROLLBACK";
+const char kUpdateStatusDisabled[] = "UPDATE_STATUS_DISABLED";
+const char kUpdateStatusNeedPermissionToUpdate[] =
+ "UPDATE_STATUS_NEED_PERMISSION_TO_UPDATE";
+} // namespace update_engine
+
+#endif // SYSTEM_API_DBUS_UPDATE_ENGINE_DBUS_CONSTANTS_H_
diff --git a/dbus/vm_applications/apps.proto b/dbus/vm_applications/apps.proto
new file mode 100644
index 0000000..31054fc
--- /dev/null
+++ b/dbus/vm_applications/apps.proto
@@ -0,0 +1,80 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+option optimize_for = LITE_RUNTIME;
+
+package vm_tools.apps;
+
+// Corresponds to a .desktop file from the Desktop Entry Spec:
+// https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/
+message App {
+ // A "localestring". Entries with a locale should set the |locale| field to
+ // the value inside the [] and the default entry should leave it empty. The
+ // browser is responsible for mapping this to something it can use.
+ message LocaleString {
+ message Entry {
+ string locale = 1;
+ string value = 2;
+ }
+ repeated Entry values = 1;
+ }
+
+ string desktop_file_id = 1;
+
+ // These fields map directly to keys from the Desktop Entry spec.
+ LocaleString name = 2;
+ LocaleString comment = 3;
+ repeated string mime_types = 4;
+ bool no_display = 5;
+ string startup_wm_class = 6;
+ bool startup_notify = 7;
+
+ // If set, the package_id of the installed package that owns this .desktop
+ // file. If not set, the .desktop file is not owned by an installed package.
+ string package_id = 8;
+}
+
+message ApplicationList {
+ repeated App apps = 1;
+
+ string vm_name = 2;
+ string container_name = 3;
+
+ // The owner of the vm and container.
+ string owner_id = 4;
+}
+
+// Used by the container to request that the host launches a new Terminal
+// application.
+message TerminalParams {
+ // Extra parameters to use when launching a terminal application that allow
+ // executing a command inside the terminal.
+ repeated string params = 1;
+
+ // Name of the VM to launch the terminal in.
+ string vm_name = 2;
+
+ // Name of the container within the VM to launch the terminal in.
+ string container_name = 3;
+
+ // The owner of the VM and container.
+ string owner_id = 4;
+}
+
+// MIME type mapping information internal to the container.
+message MimeTypes {
+ // MIME type mappings with file extension as the key without a period prefix
+ // and MIME type as the value.
+ map<string, string> mime_type_mappings = 1;
+
+ // Name of the VM this came from.
+ string vm_name = 2;
+
+ // Name of the container this came from.
+ string container_name = 3;
+
+ // The owner of the VM and container.
+ string owner_id = 4;
+}
diff --git a/dbus/vm_applications/dbus-constants.h b/dbus/vm_applications/dbus-constants.h
new file mode 100644
index 0000000..2e36178
--- /dev/null
+++ b/dbus/vm_applications/dbus-constants.h
@@ -0,0 +1,22 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_VM_APPLICATIONS_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_VM_APPLICATIONS_DBUS_CONSTANTS_H_
+
+namespace vm_tools {
+namespace apps {
+
+const char kVmApplicationsServiceName[] = "org.chromium.VmApplicationsService";
+const char kVmApplicationsServicePath[] = "/org/chromium/VmApplicationsService";
+const char kVmApplicationsServiceInterface[] = "org.chromium.VmApplicationsService";
+
+const char kVmApplicationsServiceUpdateApplicationListMethod[] = "UpdateApplicationList";
+const char kVmApplicationsServiceLaunchTerminalMethod[] = "LaunchTerminal";
+const char kVmApplicationsServiceUpdateMimeTypesMethod[] = "UpdateMimeTypes";
+
+} // namespace apps
+} // namespace vm_tools
+
+#endif // SYSTEM_API_DBUS_VM_APPLICATIONS_DBUS_CONSTANTS_H_
diff --git a/dbus/vm_cicerone/cicerone_service.proto b/dbus/vm_cicerone/cicerone_service.proto
new file mode 100644
index 0000000..bb0f622
--- /dev/null
+++ b/dbus/vm_cicerone/cicerone_service.proto
@@ -0,0 +1,565 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+option optimize_for = LITE_RUNTIME;
+
+// This file defines messages used for interacting directly with containers
+// running inside of a VM.
+package vm_tools.cicerone;
+option go_package = "vm_cicerone_proto";
+
+// Message sent to cicerone when a VM has started up. This is just for
+// tracking purposes by cicerone.
+message NotifyVmStartedRequest {
+ // Name of the VM.
+ string vm_name = 1;
+
+ // The owner of the VM.
+ string owner_id = 2;
+
+ // The IPv4 subnet for containers within the VM in network byte order.
+ uint32 container_ipv4_subnet = 3;
+
+ // The netmask for the IPv4 subnet for containers within the VM in network
+ // byte order.
+ uint32 container_ipv4_netmask = 4;
+
+ // The IPv4 address of the VM in network byte order.
+ uint32 ipv4_address = 5;
+
+ // The virtual socket context id assigned to the VM.
+ uint32 cid = 6;
+}
+
+// Message sent to cicerone when a VM stopped or failed to complete startup.
+// This is just for tracking purposes by cicerone.
+message NotifyVmStoppedRequest {
+ // Name of the VM.
+ string vm_name = 1;
+
+ // The owner of the VM.
+ string owner_id = 2;
+}
+
+// Message sent to cicerone when requesting a token for linking to a container
+// that is going to be started for a VM.
+message ContainerTokenRequest {
+ // Name of the VM.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM.
+ string owner_id = 3;
+}
+
+// Reply to the GetContainerToken method.
+message ContainerTokenResponse {
+ // A token that should be passed into the container to identify itself. This
+ // token will be the empty string if the request was invalid.
+ string container_token = 1;
+}
+
+// Message sent to cicerone to check whether or not a specific container is
+// currently running.
+message IsContainerRunningRequest {
+ // Name of the VM.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM.
+ string owner_id = 3;
+}
+
+// Reply to the IsContainerRunning method.
+message IsContainerRunningResponse {
+ // True if the container is running, false otherwise.
+ bool container_running = 1;
+}
+
+// Message used in the signal for when tremplin has started.
+message TremplinStartedSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // The owner of the VM.
+ string owner_id = 2;
+}
+
+// Message used in the signal for when a container has started up.
+message ContainerStartedSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+}
+
+// Message used in the signal for when a container has shut down.
+message ContainerShutdownSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+}
+
+// Request to launch on application in the specified VM/container. Used with the
+// LaunchContainerApplication D-Bus message into vm_concierge.
+message LaunchContainerApplicationRequest {
+ // Display scaling of the app windows.
+ enum DisplayScaling {
+ // Default scaling.
+ UNSCALED = 0;
+ // Windows scaled. Used to scale up older app windows that don't show well
+ // with HiDPI display otherwise.
+ SCALED = 1;
+ }
+
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target, if empty the default
+ // container name will be used.
+ string container_name = 2;
+
+ // ID of the application to launch, should map to the desktop_file_id that
+ // is in the application list sent back from the container.
+ string desktop_file_id = 3;
+
+ // The owner of the vm and container.
+ string owner_id = 4;
+
+ // Files to pass as arguments when launching the application, if any, given
+ // as absolute paths within the container's filesystem.
+ repeated string files = 5;
+
+ // Display scaling requested.
+ DisplayScaling display_scaling = 6;
+}
+
+// Response sent back by vm_concierge when it receives a
+// LaunchContainerApplication D-Bus message.
+message LaunchContainerApplicationResponse {
+ // If true, the requested application launched successfully.
+ bool success = 1;
+
+ // The failure_reason if the requested application could not be started.
+ string failure_reason = 2;
+}
+
+// Request to get application icons in the specified VM/container. Used with the
+// GetContainerAppIcon D-Bus message into vm_concierge.
+message ContainerAppIconRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target, if empty the default
+ // container name will be used.
+ string container_name = 2;
+
+ // IDs of the application to get icons for, should map to the desktop_file_id
+ // that is in the application list sent back from the container.
+ repeated string desktop_file_ids = 3;
+
+ // The icon size with both its height and width equal to this number.
+ int32 size = 4;
+
+ // The target scale of this icon. This is the scale factor at which this icon
+ // is designed to be used.
+ int32 scale = 5;
+
+ // The owner of the VM and container.
+ string owner_id = 6;
+}
+
+// One desktop file ID with its icon.
+message DesktopIcon {
+ string desktop_file_id = 1;
+ bytes icon = 2;
+}
+
+// Response sent back by vm_concierge when it receives a
+// GetContainerAppIcon D-Bus message.
+// Some desktop_file_id may not have an icon.
+message ContainerAppIconResponse {
+ repeated DesktopIcon icons = 1;
+}
+
+// Launch vshd request.
+message LaunchVshdRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target.
+ string container_name = 2;
+
+ // The port for vshd to connect to.
+ uint32 port = 3;
+
+ // The owner of the VM and container.
+ string owner_id = 4;
+}
+
+// Response sent back by vm_cicerone when it receives a LaunchVshd
+// call.
+message LaunchVshdResponse {
+ bool success = 1;
+
+ string failure_reason = 2;
+}
+
+// Request to get information about a Linux package file in the container.
+message LinuxPackageInfoRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ // Path to the package file (e.g. .deb) in the container's filesystem.
+ string file_path = 4;
+}
+
+// Response sent back from a GetLinuxPackageInfo call.
+message LinuxPackageInfoResponse {
+ // True if the file was successfully parsed and the other fields are valid.
+ bool success = 1;
+
+ // Contains a textual reason for the failure in case success is false.
+ string failure_reason = 2;
+
+ // The package identifier is in the form of a semicolon delimited string of
+ // the format: name;version;arch;data
+ // name, version and arch are as expected. data is somewhat variant and refers
+ // to the state of the package as well as potentially remote repository
+ // information.
+ string package_id = 3;
+
+ // The license associated with the package. So far only the value of
+ // 'unknown' has been observed for this field.
+ string license = 4;
+
+ // The description of the package, can be a multi-line text string.
+ string description = 5;
+
+ // The URL for the homepage of the project.
+ string project_url = 6;
+
+ // Size of the package file in bytes.
+ uint64 size = 7;
+
+ // Usually more of a title for a package, but sometimes less descriptive
+ // than that.
+ string summary = 8;
+}
+
+// Request to install a Linux package file in the container.
+message InstallLinuxPackageRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ // Path to the package file (e.g. .deb) in the container's filesystem.
+ string file_path = 4;
+}
+
+// Response sent back from a InstallLinuxPackage call.
+message InstallLinuxPackageResponse {
+ enum Status {
+ // Install process was successfully started, all further updates will be
+ // sent via the InstallLinuxPackageProgress signal.
+ STARTED = 0;
+
+ // Failed to start up for a general reason, specific details are given in
+ // failure_reason.
+ FAILED = 1;
+
+ // Indicates another install is already in process, this one will not be
+ // started.
+ INSTALL_ALREADY_ACTIVE = 2;
+ }
+ Status status = 1;
+
+ // Contains a textual reason for the failure in case of a FAILED status.
+ string failure_reason = 2;
+}
+
+// Message used in a signal for updates on Linux package installations.
+message InstallLinuxPackageProgressSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ enum Status {
+ // Install has completed and was successful. No further signals will be
+ // sent after this one.
+ SUCCEEDED = 0;
+
+ // Install failed to complete, the specific reason will be in
+ // failure_details. No further signals will be sent after this one.
+ FAILED = 1;
+
+ // This is sent periodically while packages are being downloaded.
+ DOWNLOADING = 2;
+
+ // This is sent periodically during the general installation phase for
+ // package and dependency installation.
+ INSTALLING = 3;
+ }
+
+ // Current status of the installation progress.
+ Status status = 4;
+
+ // Overall percentage progress.
+ uint32 progress_percent = 5;
+
+ // Details relating to the failure state. This can be a multi-line string in
+ // some cases (that's how it comes out of PackageKit, for example in the case
+ // of an unsatisfiable dependency).
+ string failure_details = 6;
+}
+
+
+// Request for creating an LXD container.
+message CreateLxdContainerRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container to start within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ // LXD image server URL. Only simplestreams is supported for now.
+ string image_server = 4;
+
+ // LXD image alias.
+ string image_alias = 5;
+}
+
+// Response for creating an LXD container.
+message CreateLxdContainerResponse {
+ enum Status {
+ // The status of creating the container is unknown.
+ UNKNOWN = 0;
+
+ // The container is now being created. An LxdContainerCreated signal will
+ // relay the final result.
+ CREATING = 1;
+
+ // A container with this name already exists.
+ EXISTS = 2;
+
+ // The container could not be created.
+ FAILED = 3;
+ }
+
+ // Container creation status.
+ Status status = 1;
+
+ // The failure_reason if the container could not be created.
+ string failure_reason = 2;
+}
+
+// Message used in the LxdContainerCreated signal for the outcome of an
+// LxdCreateContainer message.
+message LxdContainerCreatedSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ enum Status {
+ // The container creation status is unknown.
+ UNKNOWN = 0;
+
+ // The container was successfully created.
+ CREATED = 1;
+
+ // The container download timed out.
+ DOWNLOAD_TIMED_OUT = 2;
+
+ // The container creation was cancelled.
+ CANCELLED = 3;
+
+ // The container creation failed for an unspecified reason.
+ FAILED = 4;
+ }
+
+ // Container creation status.
+ Status status = 4;
+
+ // The failure_reason if the container was not successfully created.
+ string failure_reason = 5;
+}
+
+// Message used in the signal for when a container is downloading.
+message LxdContainerDownloadingSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ // Container download progress, as a percentage.
+ int32 download_progress = 4;
+}
+
+// Request for starting an LXD container.
+message StartLxdContainerRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container to start within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+}
+
+// Response for starting an LXD container.
+message StartLxdContainerResponse {
+ enum Status {
+ // The status of starting the container is unknown.
+ UNKNOWN = 0;
+
+ // The container has started.
+ STARTED = 1;
+
+ // The container was already running.
+ RUNNING = 2;
+
+ // The container could not be started.
+ FAILED = 3;
+ }
+
+ // Container startup status.
+ Status status = 1;
+
+ // The failure_reason if the container could not be started.
+ string failure_reason = 2;
+}
+
+// Request for getting the primary user for an LXD container.
+message GetLxdContainerUsernameRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container to get the primary user for.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+}
+
+// Response for getting the primary user for an LXD container.
+message GetLxdContainerUsernameResponse {
+ enum Status {
+ // The status is unknown.
+ UNKNOWN = 0;
+
+ // The primary username is stored in the username field.
+ SUCCESS = 1;
+
+ // A container with the specified name doesn't exist.
+ CONTAINER_NOT_FOUND = 2;
+
+ // The container is not running, so the username could not be found.
+ CONTAINER_NOT_RUNNING = 3;
+
+ // The primary user doesn't exist.
+ USER_NOT_FOUND = 4;
+
+ // Some part of the operation failed.
+ FAILED = 5;
+ }
+
+ // Status of getting the primary username.
+ Status status = 1;
+
+ // The primary username of the container, if successful.
+ string username = 2;
+
+ // The failure_reason if the username could not be retrieved.
+ string failure_reason = 3;
+}
+// Request for setting up the user for an LXD container.
+message SetUpLxdContainerUserRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container to start within the VM.
+ string container_name = 2;
+
+ // The owner of the VM and container.
+ string owner_id = 3;
+
+ // Username for the first user in the container.
+ string container_username = 4;
+}
+
+// Response for setting up the user on an LXD container.
+message SetUpLxdContainerUserResponse {
+ enum Status {
+ // The status of setting up the user is unknown.
+ UNKNOWN = 0;
+
+ // The user has been set up sucessfully.
+ SUCCESS = 1;
+
+ // The user already exists.
+ EXISTS = 2;
+
+ // Setting up the user failed.
+ FAILED = 3;
+ }
+
+ // Status of setting up the user.
+ Status status = 1;
+
+ // The failure_reason if the user was not set up successfully.
+ string failure_reason = 2;
+}
+
+// Request for debug information about virtual machine and container state.
+message GetDebugInformationRequest {
+}
+
+// Response for debug information about virtual machine and container state.
+message GetDebugInformationResponse {
+ // Debug information about virtual machine and container state in arbitrary format.
+ string debug_information = 1;
+}
diff --git a/dbus/vm_cicerone/dbus-constants.h b/dbus/vm_cicerone/dbus-constants.h
new file mode 100644
index 0000000..7b42b8a
--- /dev/null
+++ b/dbus/vm_cicerone/dbus-constants.h
@@ -0,0 +1,48 @@
+// Copyright 2018 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_VM_CICERONE_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_VM_CICERONE_DBUS_CONSTANTS_H_
+
+namespace vm_tools {
+namespace cicerone {
+
+const char kVmCiceroneInterface[] = "org.chromium.VmCicerone";
+const char kVmCiceroneServicePath[] = "/org/chromium/VmCicerone";
+const char kVmCiceroneServiceName[] = "org.chromium.VmCicerone";
+
+// Methods to be called from vm_concierge.
+const char kNotifyVmStartedMethod[] = "NotifyVmStarted";
+const char kNotifyVmStoppedMethod[] = "NotifyVmStopped";
+const char kGetContainerTokenMethod[] = "GetContainerToken";
+const char kIsContainerRunningMethod[] = "IsContainerRunning";
+
+// Methods to be called from Chrome.
+const char kLaunchContainerApplicationMethod[] = "LaunchContainerApplication";
+const char kGetContainerAppIconMethod[] = "GetContainerAppIcon";
+const char kLaunchVshdMethod[] = "LaunchVshd";
+const char kGetLinuxPackageInfoMethod[] = "GetLinuxPackageInfo";
+const char kInstallLinuxPackageMethod[] = "InstallLinuxPackage";
+const char kCreateLxdContainerMethod[] = "CreateLxdContainer";
+const char kStartLxdContainerMethod[] = "StartLxdContainer";
+const char kGetLxdContainerUsernameMethod[] = "GetLxdContainerUsername";
+const char kSetUpLxdContainerUserMethod[] = "SetUpLxdContainerUser";
+
+// Methods to be called from debugd.
+const char kGetDebugInformation[] = "GetDebugInformation";
+
+// Signals.
+const char kContainerStartedSignal[] = "ContainerStarted";
+const char kContainerShutdownSignal[] = "ContainerShutdown";
+const char kInstallLinuxPackageProgressSignal[] =
+ "InstallLinuxPackageProgress";
+const char kLxdContainerCreatedSignal[] = "LxdContainerCreated";
+const char kLxdContainerDownloadingSignal[] = "LxdContainerDownloading";
+const char kTremplinStartedSignal[] = "TremplinStarted";
+
+} // namespace cicerone
+} // namespace vm_tools
+
+
+#endif // SYSTEM_API_DBUS_VM_CICERONE_DBUS_CONSTANTS_H_
diff --git a/dbus/vm_concierge/dbus-constants.h b/dbus/vm_concierge/dbus-constants.h
new file mode 100644
index 0000000..1867d60
--- /dev/null
+++ b/dbus/vm_concierge/dbus-constants.h
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_VM_CONCIERGE_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_VM_CONCIERGE_DBUS_CONSTANTS_H_
+
+namespace vm_tools {
+namespace concierge {
+
+const char kVmConciergeInterface[] = "org.chromium.VmConcierge";
+const char kVmConciergeServicePath[] = "/org/chromium/VmConcierge";
+const char kVmConciergeServiceName[] = "org.chromium.VmConcierge";
+
+const char kStartVmMethod[] = "StartVm";
+const char kStopVmMethod[] = "StopVm";
+const char kStopAllVmsMethod[] = "StopAllVms";
+const char kGetVmInfoMethod[] = "GetVmInfo";
+const char kCreateDiskImageMethod[] = "CreateDiskImage";
+const char kDestroyDiskImageMethod[] = "DestroyDiskImage";
+const char kExportDiskImageMethod[] = "ExportDiskImage";
+const char kListVmDisksMethod[] = "ListVmDisks";
+const char kStartContainerMethod[] = "StartContainer";
+const char kGetContainerSshKeysMethod[] = "GetContainerSshKeys";
+
+const char kContainerStartupFailedSignal[] = "ContainerStartupFailed";
+
+} // namespace concierge
+} // namespace vm_tools
+
+
+#endif // SYSTEM_API_DBUS_VM_CONCIERGE_DBUS_CONSTANTS_H_
diff --git a/dbus/vm_concierge/service.proto b/dbus/vm_concierge/service.proto
new file mode 100644
index 0000000..c3dc590
--- /dev/null
+++ b/dbus/vm_concierge/service.proto
@@ -0,0 +1,410 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto3";
+option optimize_for = LITE_RUNTIME;
+
+// This file defines messages used for starting, stopping, and managing VMs.
+package vm_tools.concierge;
+option go_package = "vm_concierge_proto";
+
+// Specification of the key components of a VM.
+message VirtualMachineSpec {
+ // Path to the kernel that should be used for the VM.
+ string kernel = 1;
+
+ // Path to the disk image that should be used as the root file system for
+ // the VM.
+ string rootfs = 2;
+}
+
+// The type of disk image.
+enum DiskImageType {
+ // A raw file.
+ DISK_IMAGE_RAW = 0;
+
+ // A qcow2-compatible disk image.
+ DISK_IMAGE_QCOW2 = 1;
+}
+
+// Describes any additional disk images that should be mounted inside the VM.
+message DiskImage {
+ // Path to the disk image on the host.
+ string path = 1;
+
+ // Path where this disk image will be mounted inside the VM.
+ string mount_point = 2;
+
+ // The file system type for this disk image.
+ string fstype = 3;
+
+ // Any special flags to be used when mounting the file system. Specified the
+ // same way as in mount(2).
+ uint64 flags = 4;
+
+ // Any additional data associated with the mount.
+ string data = 5;
+
+ // If true, the disk image will be mounted writable.
+ bool writable = 6;
+
+ // If true, the disk image will be mounted.
+ bool do_mount = 7;
+
+ // Image type of the disk.
+ DiskImageType image_type = 8;
+}
+
+// Information about a particular VM.
+message VmInfo {
+ // The IPv4 address assigned to the VM, in network byte order.
+ fixed32 ipv4_address = 1;
+
+ // The process ID of the main crosvm process for the VM.
+ int32 pid = 2;
+
+ // The virtual socket context id assigned to the VM.
+ int64 cid = 3;
+
+ // The handle to a 9p server managed by the seneschal system service. Use
+ // this handle when making requests to that service to manage the files shared
+ // with this VM.
+ uint64 seneschal_server_handle = 4;
+}
+
+// Information that must be included with every StartVm dbus message.
+message StartVmRequest {
+ // The VM that should be started. This is ignored if starting a termina VM,
+ // which will always use the latest component from imageloader.
+ VirtualMachineSpec vm = 1;
+
+ // Any additional disks that should be mounted inside the VM.
+ repeated DiskImage disks = 2;
+
+ // Path to a shared directory that will be mounted via NFS inside the VM.
+ // DEPRECATED: The server never did anything with this field. Instead callers
+ // should use the |shared_dir_handle| field of the VmInfo message to get a
+ // server handle that can be used in requests to the seneschal system service.
+ string shared_directory = 3 [deprecated = true];
+
+ // The human-readable name to be assigned to this VM.
+ string name = 4;
+
+ // If true, concierge should also perform termina-specific setup.
+ bool start_termina = 5;
+
+ // If true, a file descriptor must be passed along with the message and that
+ // file descriptor will be used for storage.
+ // Ignored unless |start_termina| is true.
+ bool use_fd_for_storage = 6;
+
+ // The owner of the vm.
+ string owner_id = 7;
+}
+
+enum VmStatus {
+ // Unknown status.
+ VM_STATUS_UNKNOWN = 0;
+
+ // The VM is already running.
+ VM_STATUS_RUNNING = 1;
+
+ // The VM is currently starting up.
+ VM_STATUS_STARTING = 2;
+
+ // The VM failed to startup.
+ VM_STATUS_FAILURE = 3;
+}
+
+// Information sent back by vm_concierge in response to a StartVm dbus message.
+message StartVmResponse {
+ // If true, the VM was started successfully. |vm_info| will have non-default
+ // values only if this is true.
+ bool success = 1;
+
+ // If the VM failed to start, the reason for the failure.
+ string failure_reason = 2;
+
+ // Information about the VM that was started, if successful.
+ VmInfo vm_info = 3;
+
+ // Status of the VM. If VM_STATUS_RUNNING, it is not necessary to wait for a
+ // TremplinStartedSignal before starting a container in the VM.
+ VmStatus status = 4;
+}
+
+// Information that must be included with every StopVm dbus message.
+message StopVmRequest {
+ // The name of the VM to be stopped.
+ string name = 1;
+
+ // The owner of the vm.
+ string owner_id = 2;
+}
+
+// Response sent back by vm_concierge when it receives a StopVm dbus message.
+message StopVmResponse {
+ // If true, the requested VM was stopped.
+ bool success = 1;
+
+ // The failure_reason if the requested VM could not be stopped.
+ string failure_reason = 2;
+}
+
+// Request for information about the VM.
+message GetVmInfoRequest {
+ // The name of the VM to query.
+ string name = 1;
+
+ // The owner of the vm.
+ string owner_id = 2;
+}
+
+// Response sent back by vm_concierge for a GetVmInfo dbus message.
+message GetVmInfoResponse {
+ // If true, the requested VM exists and info was returned.
+ bool success = 1;
+
+ // Information about the VM that was requested.
+ VmInfo vm_info = 2;
+}
+
+// The type of storage location for a disk image.
+enum StorageLocation {
+ // Subdirectory under /home/root/<id>/crosvm.
+ STORAGE_CRYPTOHOME_ROOT = 0;
+
+ // The user's Downloads directory, under /home/user/<id>/Downloads.
+ STORAGE_CRYPTOHOME_DOWNLOADS = 1;
+}
+
+enum DiskImageStatus {
+ // Unknown status.
+ DISK_STATUS_UNKNOWN = 0;
+
+ // The disk image was created.
+ DISK_STATUS_CREATED = 1;
+
+ // The disk already existed.
+ DISK_STATUS_EXISTS = 2;
+
+ // Unable to create the disk image.
+ DISK_STATUS_FAILED = 3;
+
+ // Specified Disk does not exist.
+ DISK_STATUS_DOES_NOT_EXIST = 4;
+
+ // The specified disk was destroyed.
+ DISK_STATUS_DESTROYED = 5;
+}
+
+// Request to concierge to create a disk image.
+message CreateDiskImageRequest {
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 1;
+
+ // The path to the disk image. This must be a relative path, and any
+ // directories must already exist.
+ string disk_path = 2;
+
+ // The logical size of the new disk image, in bytes.
+ uint64 disk_size = 3;
+
+ // The type of disk image to be created.
+ DiskImageType image_type = 4;
+
+ // The storage location for the disk image.
+ StorageLocation storage_location = 5;
+}
+
+// Response to a CreateDiskImageRequest.
+message CreateDiskImageResponse {
+ // If true, the disk image has been successfully created.
+ DiskImageStatus status = 1;
+
+ // The absolute path to the created disk image, if it was successfully
+ // created or already existed.
+ string disk_path = 2;
+
+ // The failure reason if the disk image could not be created or doesn't exist.
+ string failure_reason = 3;
+}
+
+// Request to concierge to destroy a disk image.
+message DestroyDiskImageRequest {
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 1;
+
+ // The path to the disk image. This must be a relative path.
+ string disk_path = 2;
+
+ // The storage location for the disk image.
+ StorageLocation storage_location = 3;
+}
+
+// Response to a DestroyDiskImageRequest.
+message DestroyDiskImageResponse {
+ // If DISK_STATUS_DESTROYED, the disk image has been successfully destroyed.
+ // If DISK_STATUS_DOES_NOT_EXIST, the disk image had already been removed.
+ DiskImageStatus status = 1;
+
+ // The failure reason if the disk image could not be destroyed or doesn't exist.
+ string failure_reason = 3;
+}
+
+// Request to concierge to export a disk image.
+// Must be accompanied by an FD. The contents of `disk_path` will be written to
+// the passed FD.
+message ExportDiskImageRequest {
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 1;
+
+ // The path to the disk image. This must be a relative path.
+ string disk_path = 2;
+}
+
+// Response to a ExportDiskImageRequest.
+message ExportDiskImageResponse {
+ // If DISK_STATUS_CREATED, the disk image has been successfully exported.
+ DiskImageStatus status = 1;
+
+ // The failure reason if the disk image could not be exported.
+ string failure_reason = 2;
+}
+
+// Request to list all VM disk images in the given storage area.
+message ListVmDisksRequest {
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 1;
+
+ // The storage location to check.
+ StorageLocation storage_location = 2;
+}
+
+// Response to ListVmDisks {
+message ListVmDisksResponse {
+ // If true, the images array is valid.
+ bool success = 1;
+
+ // List of disk images.
+ repeated string images = 2;
+
+ // The failure reason if the disks could not be listed.
+ string failure_reason = 3;
+
+ // The total size in bytes on disk of the disk images in the response.
+ uint64 total_size = 4;
+}
+
+// Message used in the signal for when a container has failed to start up.
+message ContainerStartedSignal {
+ // Name of the VM the container is in.
+ string vm_name = 1;
+
+ // Name of the container within the VM.
+ string container_name = 2;
+
+ // The owner of the vm and container.
+ string owner_id = 3;
+}
+
+// Request to start a specified container image within a VM. If the container
+// does not exist in the VM it will be created. Used with the StartContainer
+// D-Bus message into vm_concierge.
+message StartContainerRequest {
+ // Name of the VM to start the container in.
+ string vm_name = 1;
+
+ // Name of the container to start within the VM. If empty, the default
+ // container name will be used.
+ string container_name = 2;
+
+ // Username for the default user in the container. This is only used if the
+ // container has not been created yet.
+ string container_username = 3;
+
+ // Async mode is always used now.
+ bool async = 4 [deprecated=true];
+
+ // The cryptohome id for the user's encrypted storage. This is used for SSH
+ // key storage.
+ string cryptohome_id = 5;
+}
+
+enum ContainerStatus {
+ // Unknown status.
+ CONTAINER_STATUS_UNKNOWN = 0;
+
+ // The container is already running.
+ CONTAINER_STATUS_RUNNING = 1;
+
+ // The container is currently starting up.
+ CONTAINER_STATUS_STARTING = 2;
+
+ // The container failed to startup.
+ CONTAINER_STATUS_FAILURE = 3;
+}
+
+// Response sent back by vm_concierge when it receives a StartContaienr D-Bus
+// message.
+message StartContainerResponse {
+ // Use the status field instead.
+ bool success = 1 [deprecated=true];
+
+ // The failure_reason if the status is CONTAINER_STATUS_FAILURE.
+ string failure_reason = 2;
+
+ // The status of the container as a result of the StartContainer call. If the
+ // status is CONTAINER_STATUS_STARTING then a D-Bus signal will be sent to
+ // indicate whether success or failure occurred. The signal should be
+ // registered for before the StartContainer call is made because it may be
+ // sent before the call returns.
+ ContainerStatus status = 3;
+}
+
+// Request to get the SSH keys associated with the host and a specific
+// container for the GetContainerSshKeys call. These keys will be generated
+// when StartContainer is called the first time for a container, so this should
+// not be called until after that call is invoked.
+message ContainerSshKeysRequest {
+ // Name of the VM to target.
+ string vm_name = 1;
+
+ // Name of the container within the VM to target, if empty the default
+ // container name will be used.
+ string container_name = 2;
+
+ // The cryptohome id for the user's encrypted storage.
+ string cryptohome_id = 3;
+}
+
+// Response sent back by vm_concierge when it receives a GetContainerSshKeys
+// call. If either of the keys do not exist, the empty string will be set for
+// that value.
+message ContainerSshKeysResponse {
+ // Public key of the container for verification of it as a known host. This
+ // will be a single line string equivalent to the contents in the ssh-keygen
+ // generated file.
+ string container_public_key = 1;
+
+ // Private key for the host, counterpart to the public key which is stored in
+ // the container as an authorized host. This will be a multiline string that
+ // is equivalent to the contents in the ssh-keygen generated file. This will
+ // be the same for all VMs/containers.
+ string host_private_key = 2;
+
+ // The hostname of the container.
+ string hostname = 3;
+
+ // Public key of the host for verification of it as a known host. This
+ // will be a single line string equivalent to the contents in the ssh-keygen
+ // generated file.
+ string host_public_key = 4;
+
+ // Private key for the container, counterpart to the public key which is
+ // stored in the container. This will be a multiline string that
+ // is equivalent to the contents in the ssh-keygen generated file. This is
+ // unique for each container.
+ string container_private_key = 5;
+}
diff --git a/switches/chrome_switches.h b/switches/chrome_switches.h
new file mode 100644
index 0000000..61d1363
--- /dev/null
+++ b/switches/chrome_switches.h
@@ -0,0 +1,23 @@
+// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SWITCHES_CHROME_SWITCHES_H_
+#define SWITCHES_CHROME_SWITCHES_H_
+
+// This file defines switches that are used both by Chrome and login_manager.
+
+namespace chromeos {
+namespace switches {
+
+// Sentinel switches for policy injected flags.
+const char kPolicySwitchesBegin[] = "policy-switches-begin";
+const char kPolicySwitchesEnd[] = "policy-switches-end";
+
+// Flag passed to the browser if the system is running in dev-mode.
+const char kSystemInDevMode[] = "system-developer-mode";
+
+} // namespace switches
+} // namespace chromeos
+
+#endif // SWITCHES_CHROME_SWITCHES_H_
diff --git a/switches/modemfwd_switches.h b/switches/modemfwd_switches.h
new file mode 100644
index 0000000..0322c71
--- /dev/null
+++ b/switches/modemfwd_switches.h
@@ -0,0 +1,21 @@
+// Copyright 2017 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SWITCHES_MODEMFWD_SWITCHES_H_
+#define SWITCHES_MODEMFWD_SWITCHES_H_
+
+// This file defines switches that are used by modemfwd.
+// See its README.md file for more information about what each one does.
+
+namespace modemfwd {
+
+const char kGetFirmwareInfo[] = "get_fw_info";
+const char kPrepareToFlash[] = "prepare_to_flash";
+const char kFlashMainFirmware[] = "flash_main_fw";
+const char kFlashCarrierFirmware[] = "flash_carrier_fw";
+const char kReboot[] = "reboot";
+
+} // namespace modemfwd
+
+#endif // SWITCHES_MODEMFWD_SWITCHES_H_
diff --git a/system_api.gyp b/system_api.gyp
new file mode 100644
index 0000000..a29cf4a
--- /dev/null
+++ b/system_api.gyp
@@ -0,0 +1,382 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'system_api-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus',
+ 'proto_out_dir': 'include/system_api/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/mtp_storage_info.proto',
+ '<(proto_in_dir)/mtp_file_entry.proto',
+ '<(proto_in_dir)/field_trial_list.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/system_api/proto_bindings/mtp_storage_info.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/system_api/proto_bindings/mtp_file_entry.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/system_api/proto_bindings/field_trial_list.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-power_manager-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/power_manager',
+ 'proto_out_dir': 'include/power_manager/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/backlight.proto',
+ '<(proto_in_dir)/idle.proto',
+ '<(proto_in_dir)/input_event.proto',
+ '<(proto_in_dir)/peripheral_battery_status.proto',
+ '<(proto_in_dir)/policy.proto',
+ '<(proto_in_dir)/power_supply_properties.proto',
+ '<(proto_in_dir)/suspend.proto',
+ '<(proto_in_dir)/switch_states.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-power_manager-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-power_manager-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/backlight.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/idle.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/input_event.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/peripheral_battery_status.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/policy.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/power_supply_properties.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/suspend.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/power_manager/proto_bindings/switch_states.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-cryptohome-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/cryptohome',
+ 'proto_out_dir': 'include/cryptohome/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/key.proto',
+ '<(proto_in_dir)/rpc.proto',
+ '<(proto_in_dir)/signed_secret.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-cryptohome-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-cryptohome-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/cryptohome/proto_bindings/key.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/cryptohome/proto_bindings/rpc.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/cryptohome/proto_bindings/signed_secret.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-authpolicy-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/authpolicy',
+ 'proto_out_dir': 'include/authpolicy/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/active_directory_info.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-authpolicy-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-authpolicy-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/authpolicy/proto_bindings/active_directory_info.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-biod-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/biod',
+ 'proto_out_dir': 'include/biod/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/constants.proto',
+ '<(proto_in_dir)/messages.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-biod-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-biod-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/biod/proto_bindings/constants.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/biod/proto_bindings/messages.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-login_manager-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/login_manager',
+ 'proto_out_dir': 'include/login_manager/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/arc.proto',
+ '<(proto_in_dir)/policy_descriptor.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-login_manager-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-login_manager-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/login_manager/proto_bindings/arc.pb.cc',
+ '<(SHARED_INTERMEDIATE_DIR)/include/login_manager/proto_bindings/policy_descriptor.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-chaps-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/chaps',
+ 'proto_out_dir': 'include/chaps/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/ck_structs.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-chaps-protos',
+ 'type': 'static_library',
+ # system_api-chaps-protos' is used by a shared_library
+ # object, so we need to build it with '-fPIC' instead of '-fPIE'.
+ 'cflags!': ['-fPIE'],
+ 'cflags': ['-fPIC'],
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-chaps-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/chaps/proto_bindings/ck_structs.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-metrics_event-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/metrics_event',
+ 'proto_out_dir': 'include/metrics_event/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/metrics_event.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-metrics_event-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-metrics_event-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/metrics_event/proto_bindings/metrics_event.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-smbprovider-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/smbprovider',
+ 'proto_out_dir': 'include/smbprovider/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/directory_entry.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-smbprovider-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-smbprovider-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/smbprovider/proto_bindings/directory_entry.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-vm_cicerone-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/vm_cicerone',
+ 'proto_out_dir': 'include/vm_cicerone/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/cicerone_service.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-vm_cicerone-goprotos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'gen_go': 1,
+ 'proto_in_dir': 'dbus/vm_cicerone',
+ 'proto_out_dir': 'go/src/chromiumos/system_api/vm_cicerone_proto',
+ },
+ 'sources': [
+ '<(proto_in_dir)/cicerone_service.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-vm_cicerone-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-vm_cicerone-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/vm_cicerone/proto_bindings/cicerone_service.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-vm_concierge-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/vm_concierge',
+ 'proto_out_dir': 'include/vm_concierge/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/service.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-vm_concierge-goprotos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'gen_go': 1,
+ 'proto_in_dir': 'dbus/vm_concierge',
+ 'proto_out_dir': 'go/src/chromiumos/system_api/vm_concierge_proto',
+ },
+ 'sources': [
+ '<(proto_in_dir)/service.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-vm_concierge-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-vm_concierge-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/vm_concierge/proto_bindings/service.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-vm_applications-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/vm_applications',
+ 'proto_out_dir': 'include/vm_applications/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/apps.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-vm_applications-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-vm_applications-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/vm_applications/proto_bindings/apps.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-seneschal-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/seneschal',
+ 'proto_out_dir': 'include/seneschal/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/seneschal_service.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-seneschal-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-seneschal-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/seneschal/proto_bindings/seneschal_service.pb.cc',
+ ]
+ },
+ {
+ 'target_name': 'system_api-oobe_config-protos-gen',
+ 'type': 'none',
+ 'variables': {
+ 'proto_in_dir': 'dbus/oobe_config',
+ 'proto_out_dir': 'include/oobe_config/proto_bindings',
+ },
+ 'sources': [
+ '<(proto_in_dir)/oobe_config.proto',
+ ],
+ 'includes': ['../../platform2/common-mk/protoc.gypi'],
+ },
+ {
+ 'target_name': 'system_api-oobe_config-protos',
+ 'type': 'static_library',
+ 'standalone_static_library': 1,
+ 'dependencies': [
+ 'system_api-oobe_config-protos-gen',
+ ],
+ 'sources': [
+ '<(SHARED_INTERMEDIATE_DIR)/include/oobe_config/proto_bindings/oobe_config.pb.cc',
+ ]
+ },
+ ],
+}
diff --git a/system_api.pc b/system_api.pc
new file mode 100644
index 0000000..777cc35
--- /dev/null
+++ b/system_api.pc
@@ -0,0 +1,4 @@
+Name: system_api
+Description: Protobuffers and headers shared by Chromium OS and Chromium.
+Version: 0.1
+Libs: -lsystem_api-power_manager-protos -lsystem_api-cryptohome-protos -lsystem_api-authpolicy-protos -lsystem_api-biod-protos -lsystem_api-protos -lsystem_api-login_manager-protos -lsystem_api-chaps-protos -lsystem_api-smbprovider-protos -lsystem_api-vm_concierge-protos -lsystem_api-vm_applications-protos -lsystem_api-vm_cicerone-protos -lsystem_api-seneschal-protos -lsystem_api-oobe_config-protos