blob: 7a17092eef89ba3ee90191fd6af29715eb664b64 [file] [log] [blame]
// Copyright 2020 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.lowpan.test;
using fuchsia.lowpan;
protocol DeviceTest {
/// Resets this network interface, returning
/// all volatile state to default values. Any
/// information stored in non-volatile memory
/// is preserved. If the interface was attached
/// to a network, this method will cause the
/// interface to detach. In that case, once the
/// interface has finished initialization the
/// interface will attempt to reattach to the
/// previous network.
Reset() -> ();
/// Returns the version string describing the firmware/stack
/// version that is in use.
GetNcpVersion() -> (string:256 version);
/// Returns the current RSSI measured by the radio.
GetCurrentRssi() -> (int32 rssi);
/// Returns the factory-assigned static MAC address.
GetFactoryMacAddress() -> (bytes:8 address);
/// Returns the currently used MAC address, which can
/// differ from the static factory-assigned MAC address.
GetCurrentMacAddress() -> (bytes:8 address);
/// Returns the current channel index for the radio.
GetCurrentChannel() -> (fuchsia.lowpan.ChannelIndex channel_index);
/// Returns the partition ID of the currently associated
/// network partition.
GetPartitionId() -> (uint32 pid);
GetThreadRloc16() -> (uint16 rloc);
GetThreadRouterId() -> (uint8 router_id);
/// Updates the address filter settings.
///
/// Responds once the filter settings have taken effect.
ReplaceMacAddressFilterSettings(MacAddressFilterSettings settings) -> ();
/// Returns the current address filter settings.
GetMacAddressFilterSettings() -> (MacAddressFilterSettings settings);
};
/// LoWPAN MAC address
alias MacAddress = bytes:8;
/// An item in the MAC filter list.
table MacAddressFilterItem {
/// The MAC address of the item. This field is required.
1: MacAddress mac_address;
/// Replacement RSSI value for packets received from this address.
///
/// This field is ignored unless the mode is set to `MacAddressFilterMode::ALLOW`.
///
/// This value is substituted for all received packets. This can affect
/// what the mesh topology ultimately looks like.
2: int8 rssi;
};
/// Maximum number of addresses that can be in the address filter list.
const uint16 MAX_FILTERED = 100;
table MacAddressFilterSettings {
/// Address filter mode.
///
/// This field is required. If this field is absent when passed to
/// `ReplaceMacAddressFilterSettings`, the channel will be closed with
/// the epitaph `ZX_ERR_INVALID_ARGUMENT`.
1: MacAddressFilterMode mode;
/// Addresses to be filtered.
///
/// If this field is absent it is assumed to be empty.
2: vector<MacAddressFilterItem>:MAX_FILTERED items;
};
/// Describes the address filtering mode of the interface.
enum MacAddressFilterMode : int32 {
/// Address filtering is disabled. All packets that are
/// received are processed normally.
DISABLED = 0;
/// Only packets that have addresses matching an address
/// in the filter list will be allowed to be processed.
/// All other packets are dropped as if they were never
/// received.
///
/// Additionally, if an RSSI value was associated
/// with an item, that value will be substituted for internal
/// routing considerations.
ALLOW = 1;
/// All packets from addresses in the filter list will be
/// dropped.
DENY = 2;
};