blob: 4377b440cb3d73b9d275ed58c6af60554bafe9ea [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.sys2;
using fuchsia.io2;
using fuchsia.component;
/// Declares a capability exposed to either a component's containing realm or to the framework.
/// For example, a legacy service exposed by the component at runtime.
flexible union ExposeDecl {
1: ExposeServiceDecl service;
2: ExposeProtocolDecl protocol;
3: ExposeDirectoryDecl directory;
4: ExposeRunnerDecl runner;
5: ExposeResolverDecl resolver;
};
/// Declares a service exposed to a component's containing realm, such as a
/// service exposed by the component or one of its children at runtime.
///
/// To learn more about services, see:
/// https://fuchsia.dev/fuchsia-src/glossary#service
table ExposeServiceDecl {
/// The provider of the capability relative to the component itself. Must
/// be `self` or `child`.
1: Ref source;
/// Name identifying the service, by which it was presented to this
/// component.
2: fuchsia.component.name source_name;
/// The destination to which the service is exposed: either the component's realm or the
/// framework.
3: Ref target;
/// The name by which the capability is being exposed.
4: fuchsia.component.name target_name;
};
/// Declares a protocol exposed to a component's containing realm, such as
/// a protocol exposed by the component or one of its children at runtime.
///
/// To learn more about protocols, see:
/// https://fuchsia.dev/fuchsia-src/glossary#protocol
table ExposeProtocolDecl {
/// The provider of the capability relative to the component itself. Must
/// be `self` or `child`.
1: Ref source;
/// Path identifying the protocol, by which it was presented to this
/// component.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
/// The destination to which the protocol is exposed: either the component's
/// realm or the framework.
3: Ref target;
/// The path by which the capability is being exposed.
///
/// Must be an absolute path starting with /.
4: string:fuchsia.component.MAX_PATH_LENGTH target_path;
};
/// Declares a directory exposed to a component's containing realm, such as a
/// directory exposed by the component or one of its children at runtime.
table ExposeDirectoryDecl {
/// The provider of the capability relative to the component itself. Must
/// be `self` or `child`.
1: Ref source;
/// Path identifying the directory, by which it was presented to this
/// component.
2: string:fuchsia.component.MAX_PATH_LENGTH source_path;
/// The destination to which the directory is exposed: either the component's realm or the
/// framework.
3: Ref target;
/// The path by which the capability is being exposed.
///
/// Must be an absolute path starting with /.
4: string:fuchsia.component.MAX_PATH_LENGTH target_path;
/// The maximum rights that can be set by a component using this directory,
/// required iff `source == self`.
5: fuchsia.io2.Rights rights;
/// The subdirectory of this directory to expose instead of the root. Optional.
6: string:fuchsia.component.MAX_PATH_LENGTH subdir;
};
/// Declares a runner exposed to a component's containing realm, such as a
/// runner exposed by the component or one of its children at runtime.
table ExposeRunnerDecl {
/// The provider of the capability relative to the component itself. Must
/// be `self` or `child`.
1: Ref source;
/// The name of the runner, by which it was presented to this component.
2: fuchsia.component.name source_name;
/// The destination to which the runner is exposed: either the component's realm or the
/// framework.
3: Ref target;
/// The name by which the capability is being exposed.
4: fuchsia.component.name target_name;
};
/// Declares a resolver exposed to a component's containing realm, such as a
/// resolver exposed by the component or one of its children at runtime.
table ExposeResolverDecl {
/// The provider of the capability relative to the component itself. Must
/// be `self` or `child`.
1: Ref source;
/// The name of the resolver, by which it was presented to this component.
2: fuchsia.component.name source_name;
/// The destination to which the resolver is exposed: either the component's realm or the
/// framework.
3: Ref target;
/// The name by which the capability is being exposed.
4: fuchsia.component.name target_name;
};