blob: e5291c670cc41fe980da63b104a55b1590bf0303 [file] [log] [blame] [edit]
// 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.net.debug;
using fuchsia.net;
using fuchsia.net.interfaces.admin;
using fuchsia.hardware.network;
/// Network interface debugging functionality.
///
/// This protocol is intended for debugging and testing only; and not meant for
/// load-bearing code.
@discoverable
protocol Interfaces {
/// Obtain administrative control over a network interface.
///
/// + request `id` identifies the interface to be controlled.
/// + request `control` grants the client administrative control over
/// the interface. Closed without a terminal event if `id` does not
/// match an existing interface.
GetAdmin(resource struct {
id fuchsia.net.InterfaceId;
control server_end:fuchsia.net.interfaces.admin.Control;
});
/// Return an interface's MAC address.
///
/// + request `id` identifies the interface whose MAC is requested.
/// - response `mac` is the interface's MAC address, if it has one.
GetMac(struct {
id fuchsia.net.InterfaceId;
}) -> (struct {
mac box<fuchsia.net.MacAddress>;
}) error strict enum {
/// `id` does not identify an interface.
NOT_FOUND = 1;
};
/// Provides access to the port backing an interface.
///
/// `port` is closed with `ZX_ERR_NOT_FOUND` if an interface referenced by
/// `id` does not exist or `ZX_ERR_NOT_SUPPORTED` if it is not backed by a
/// [`fuchsia.hardware.network/Port`].
///
/// + request `id` identifies the interface whose port is granted.
/// + request `port` grants access to the interface's device port.
GetPort(resource struct {
id fuchsia.net.InterfaceId;
port server_end:fuchsia.hardware.network.Port;
});
};