aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Vicencio <allenvic@google.com>2017-10-25 19:17:41 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-11-02 11:07:14 -0700
commit5fc40ab72e45c14f5d98b3b2498224079b574ebb (patch)
treeb6a735405031361072b846dbaa27fe4b442ee8df
parent62f58901af0fbab83ac6386253a884128ae0b787 (diff)
downloadsystem_api-5fc40ab72e45c14f5d98b3b2498224079b574ebb.tar.gz
system_api: Add smbprovider D-Bus-constants and protobufs
Add dbus-constants file and DirectoryEntry and DirectoryEntryList protobufs. BUG=chromium:757625 TEST=Runs locally Change-Id: I80335bc7a1f2f941905914acb9890a9f5304de81 Reviewed-on: https://chromium-review.googlesource.com/738937 Commit-Ready: Zentaro Kavanagh <zentaro@google.com> Tested-by: Zentaro Kavanagh <zentaro@google.com> Reviewed-by: Dan Erat <derat@chromium.org>
-rw-r--r--dbus/service_constants.h1
-rw-r--r--dbus/smbprovider/dbus-constants.h23
-rw-r--r--dbus/smbprovider/directory_entry.proto24
-rw-r--r--system_api.gyp23
-rw-r--r--system_api.pc2
5 files changed, 72 insertions, 1 deletions
diff --git a/dbus/service_constants.h b/dbus/service_constants.h
index 6b3ffe6..b4f2777 100644
--- a/dbus/service_constants.h
+++ b/dbus/service_constants.h
@@ -21,6 +21,7 @@
#include "permission_broker/dbus-constants.h"
#include "power_manager/dbus-constants.h"
#include "shill/dbus-constants.h"
+#include "smbprovider/dbus-constants.h"
#include "update_engine/dbus-constants.h"
namespace dbus {
diff --git a/dbus/smbprovider/dbus-constants.h b/dbus/smbprovider/dbus-constants.h
new file mode 100644
index 0000000..d34f6f3
--- /dev/null
+++ b/dbus/smbprovider/dbus-constants.h
@@ -0,0 +1,23 @@
+// 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";
+
+} // 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..194c5be
--- /dev/null
+++ b/dbus/smbprovider/directory_entry.proto
@@ -0,0 +1,24 @@
+// 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;
+
+message DirectoryEntry {
+ 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;
+}
+
+// DirectoryEntryList is included in responses to ReadDirectory D-Bus method
+// calls.
+message DirectoryEntryList {
+ repeated DirectoryEntry entries = 1;
+}
diff --git a/system_api.gyp b/system_api.gyp
index af2c928..7150f43 100644
--- a/system_api.gyp
+++ b/system_api.gyp
@@ -189,5 +189,28 @@
'<(SHARED_INTERMEDIATE_DIR)/include/chaps/proto_bindings/ck_structs.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',
+ ]
+ },
]
}
diff --git a/system_api.pc b/system_api.pc
index 0f01f54..d521c15 100644
--- a/system_api.pc
+++ b/system_api.pc
@@ -1,4 +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
+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