blob: 0e47802020c46968f03bce46245dcbd38a73e56b [file] [log] [blame]
// Copyright 2022 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.experimental;
using fuchsia.lowpan;
using zx;
/// Protocol for connecting to [`TelemetryProvider`] on a LoWPAN interface.
@discoverable
protocol TelemetryProviderConnector {
/// Connects to the [`TelemetryProvider`] protocol on the named LoWPAN interface.
///
/// The name of the interface can be learned by calling [`fuchsia.lowpan/Lookup.GetDevices`].
///
/// If there is an error in processing this request the given channel is closed and an epitaph
/// code used to describe the reason for the failure:
///
/// * `ZX_ERR_INVALID_ARGUMENT`: The given interface name was not formatted correctly or
/// otherwise invalid.
/// * `ZX_ERR_NOT_FOUND`: No interface was found with the given name.
/// * `ZX_ERR_NOT_SUPPORTED`: The interface exists but does not support this protocol.
Connect(resource struct {
name fuchsia.lowpan.InterfaceName;
server_end server_end:TelemetryProvider;
});
};
/// Provides telemetry data for an individual interface to the LoWPAN service.
protocol TelemetryProvider {
/// Returns a snapshot the telemetry information table.
GetTelemetry() -> (struct {
telemetry Telemetry;
});
};
/// Counters associated with border routing.
type BorderRoutingCounters = table {
/// The number of packets associated with inbound unicast messages.
///
/// Required.
1: inbound_unicast_packets uint64;
/// The number of bytes associated with inbound unicast messages.
///
/// Required.
2: inbound_unicast_bytes uint64;
/// The number of packets associated with inbound multicast messages.
///
/// Required.
3: inbound_multicast_packets uint64;
/// The number of bytes associated with inbound multicast messages.
///
/// Required.
4: inbound_multicast_bytes uint64;
/// The number of packets associated with outbound unicast messages.
///
/// Required.
5: outbound_unicast_packets uint64;
/// The number of bytes associated with outbound unicast messages.
///
/// Required.
6: outbound_unicast_bytes uint64;
/// The number of packets associated with outbound multicast messages.
///
/// Required.
7: outbound_multicast_packets uint64;
/// The number of bytes associated with outbound multicast messages.
///
/// Required.
8: outbound_multicast_bytes uint64;
/// The number of received RA packets.
///
/// Required.
9: ra_rx uint32;
/// The number of RA packets successfully transmitted.
///
/// Required.
10: ra_tx_success uint32;
/// The number of RA packets failed to transmit.
///
/// Required.
11: ra_tx_failure uint32;
/// The number of received RS packets.
///
/// Required.
12: rs_rx uint32;
/// The number of RS packets successfully transmitted.
///
/// Required.
13: rs_tx_success uint32;
/// The number of RS packets failed to transmit.
///
/// Required.
14: rs_tx_failure uint32;
};
/// Counters associated with the DNS-SD server.
type DnssdCounters = table {
/// The number of successful responses.
///
/// Required.
1: success_response uint32;
/// The number of 'server failure' responses.
///
/// Required.
2: server_failure_response uint32;
/// The number of 'format error' responses.
///
/// Required.
3: format_error_response uint32;
/// The number of 'name error' responses.
///
/// Required.
4: name_error_response uint32;
/// The number of 'not implemented' responses.
///
/// Required.
5: not_implemented_response uint32;
/// The number of 'other' responses.
///
/// Required.
6: other_response uint32;
/// The number of queries completely resolved by the local SRP server.
///
/// Required.
7: resolved_by_srp uint32;
};
/// Registration information about the SRP server.
type SrpServerRegistration = table {
/// Number of hosts/services that have not been deleted.
///
/// Required.
1: fresh_count uint32;
/// Number of hosts/services that have been deleted.
///
/// Required.
2: deleted_count uint32;
/// Total lease time.
///
/// Required.
3: lease_time_total zx.duration;
/// Total key lease time.
///
/// Required.
4: key_lease_time_total zx.duration;
/// Total remaining lease time.
///
/// Required.
5: remaining_lease_time_total zx.duration;
/// Total remaining key lease time.
///
/// Required.
6: remaining_key_lease_time_total zx.duration;
};
/// State information about the SRP server.
type SrpServerInfo = table {
/// The operational state of the SRP server.
///
/// Required.
1: state @generated_name("SrpServerState") strict enum {
/// The server is disabled.
DISABLED = 1;
/// The server is enabled and running.
RUNNING = 2;
/// The server is enabled, but stopped.
STOPPED = 3;
};
/// The port the SRP server is listening to.
///
/// Optional. The port may be omitted when `state` is `DISABLED`.
2: port uint16;
/// The address mode of the SRP server.
///
/// Required.
3: address_mode @generated_name("SrpServerAddressMode") strict enum {
/// Thread network data is published as unicast addresses.
UNICAST = 1;
/// Thread network data is published as anycast addresses.
ANYCAST = 2;
};
/// The response counters of the SRP server.
///
/// Required.
4: response_counters @generated_name("SrpServerResponseCounters") table {
/// The number of successful responses.
///
/// Required.
1: success_response uint32;
/// The number of 'server failure' responses.
///
/// Required.
2: server_failure_response uint32;
/// The number of 'format error' responses.
///
/// Required.
3: format_error_response uint32;
/// The number of 'name exists' responses.
///
/// Required.
4: name_exists_response uint32;
/// The number of 'refused' responses.
///
/// Required.
5: refused_response uint32;
/// The number of 'other' responses.
///
/// Required.
6: other_response uint32;
};
/// The registration information of SRP hosts.
///
/// Required.
5: hosts_registration SrpServerRegistration;
/// The registration information of SRP services.
///
/// Required.
6: services_registration SrpServerRegistration;
};
/// Node information for Thread network leaders.
type LeaderData = table {
/// The network partition ID of the leader.
///
/// Required.
1: partition_id uint32;
/// The weight of this leader on the network.
///
/// Required.
2: weight uint8;
/// The full network data version.
///
/// Required.
3: network_data_version uint8;
/// The stable network data version.
///
/// Required.
4: stable_network_data_version uint8;
/// The router ID of the leader.
///
/// Required.
5: router_id uint8;
};
/// LoWPAN Interface Telemetry Information.
///
/// The fields in this table are used for providing low-level telemetry and information about the
/// LoWPAN interface for debugging and statistics purposes.
///
/// All fields are optional.
type Telemetry = table {
/// The current RSSI of the radio.
1: rssi fuchsia.lowpan.PowerDbm;
/// The configured transmit power of the radio.
2: tx_power fuchsia.lowpan.PowerDbm;
/// The current channel index of the radio.
3: channel_index fuchsia.lowpan.ChannelIndex;
/// The partition ID of the currently associated network partition.
4: partition_id uint32;
/// The version string describing the underlying mesh stack.
5: stack_version string:256;
/// The version string describing the underlying radio control firmware.
6: rcp_version string:256;
/// Thread link mode byte.
///
/// Only present on Thread networks.
///
/// Defined by section 4.5.2 of the Thread 1.1.1 specification ("Mode TLV").
7: thread_link_mode uint8;
/// The router ID of this device in the currently associated network.
///
/// Only present on Thread networks.
8: thread_router_id uint8;
/// The current RLOC16 address of this node.
///
/// Only present on Thread networks.
9: thread_rloc uint16;
/// The full network data version.
///
/// Only present on Thread networks.
10: thread_network_data_version uint8;
/// The stable network data version.
///
/// Only present on Thread networks.
11: thread_stable_network_data_version uint8;
/// The current Thread network data, in raw binary form, as defined in section 5.13 of
/// the Thread 1.1.1 specification.
///
/// Only present on Thread networks.
12: thread_network_data vector<uint8>:255;
/// The current Thread stable network data, in raw binary form, as defined in section 5.13 of
/// the Thread 1.1.1 specification.
///
/// Only present on Thread networks.
13: thread_stable_network_data vector<uint8>:255;
/// The counters associated with border routing messages.
///
/// Only present on Thread networks.
14: thread_border_routing_counters BorderRoutingCounters;
/// The SRP server information.
///
/// Only present on Thread networks.
15: srp_server_info SrpServerInfo;
/// The DNS-SD server counters.
///
/// Only present on Thread networks.
16: dnssd_counters DnssdCounters;
/// The data associated with the leader of the currently associated Thread network.
///
/// Only present on Thread networks.
17: leader_data LeaderData;
/// The uptime of the current instance.
///
/// Required.
18: uptime zx.duration;
};