blob: 2d5c736a4e5000eea7f7b0eb4b7d3ef3ffdd0f72 [file] [log] [blame]
// Copyright 2021 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.developer.bridge;
using fuchsia.device;
using fuchsia.net;
type TunnelError = strict enum {
/// Could not listen on the port from which we were attempting to forward.
COULD_NOT_LISTEN = 1;
/// Could not connect to the target to establish a tunnel.
TARGET_CONNECT_FAILED = 2;
};
@discoverable
protocol Tunnel {
/// Forwards a TCP port on the host to the target address, from the target node.
ForwardPort(struct {
target string:<fuchsia.device.DEVICE_NAME_MAX>;
host_address fuchsia.net.SocketAddress;
target_address fuchsia.net.SocketAddress;
}) -> (struct {}) error TunnelError;
/// Forwards a TCP port on the target to the host address, from the host.
ReversePort(struct {
target string:<fuchsia.device.DEVICE_NAME_MAX>;
host_address fuchsia.net.SocketAddress;
target_address fuchsia.net.SocketAddress;
}) -> (struct {}) error TunnelError;
};