2020-01-17 21:05:03 +08:00
|
|
|
// Copyright 2019 Google LLC
|
2019-03-19 00:21:48 +08:00
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
// A proto for serializing the sandbox2::MountTree class
|
|
|
|
|
|
|
|
syntax = "proto2";
|
2019-11-14 19:51:01 +08:00
|
|
|
|
2019-03-19 00:21:48 +08:00
|
|
|
package sandbox2;
|
|
|
|
|
|
|
|
// The MountTree maps path components to mount operations (bind/tmpfs). The path
|
|
|
|
// is encoded in the key of the entries map, with the root node representing /.
|
|
|
|
// To get the full path of a node, you will need to assemble the keys starting
|
|
|
|
// at the root node.
|
|
|
|
message MountTree {
|
|
|
|
// FileNode represents a bind mount for a regular file using "outside" as the
|
|
|
|
// source.
|
|
|
|
message FileNode {
|
|
|
|
required string outside = 2;
|
|
|
|
required bool is_ro = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DirNode is like FileNode but for directories.
|
|
|
|
message DirNode {
|
|
|
|
required string outside = 2;
|
|
|
|
required bool is_ro = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// TmpfsNode mounts a tmpfs with given options.
|
|
|
|
message TmpfsNode {
|
|
|
|
required string tmpfs_options = 1;
|
|
|
|
}
|
|
|
|
|
2019-11-14 19:51:01 +08:00
|
|
|
// RootNode is as special node for root of the MountTree
|
|
|
|
message RootNode {
|
|
|
|
required bool is_ro = 3;
|
|
|
|
}
|
|
|
|
|
2019-03-19 00:21:48 +08:00
|
|
|
message Node {
|
|
|
|
oneof node {
|
|
|
|
FileNode file_node = 1;
|
|
|
|
DirNode dir_node = 2;
|
|
|
|
TmpfsNode tmpfs_node = 3;
|
2019-11-14 19:51:01 +08:00
|
|
|
RootNode root_node = 4;
|
2019-03-19 00:21:48 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// The entries are mappings from the next path component to the subtree.
|
|
|
|
map<string, MountTree> entries = 1;
|
|
|
|
|
|
|
|
// The node of the current path. If not set, we'll just create a directory at
|
|
|
|
// this position.
|
|
|
|
optional Node node = 2;
|
|
|
|
}
|