| // 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.net.mdns; |
| |
| /// Discoverable protocol for subscribing to address changes for given host names. |
| @available(added=9) |
| @discoverable |
| protocol HostNameSubscriber { |
| /// Gets the addresses for the specified host. |
| /// |
| /// + request `host` the simple name of the host. |
| /// + request `options` options to be applied to the subscription. |
| /// + request `listener` client end of the `HostNameSubscriptionListener` channel. |
| SubscribeToHostName(resource struct { |
| host host_name; |
| options HostNameSubscriptionOptions; |
| listener client_end:HostNameSubscriptionListener; |
| }); |
| }; |
| |
| /// Options for `HostNameSubscriber.SubscribeToHostName`. |
| @available(added=9) |
| type HostNameSubscriptionOptions = table { |
| /// The media (wired, wireless, both) of the interfaces on which the host name should be |
| /// subscribed to. The default is both wired and wireless media. |
| 1: media Media; |
| |
| /// The IP versions (V4, V6, both) with which the host name should subscribe to. The default |
| /// value is both IPv4 and IPv6. |
| 2: ip_versions IpVersions; |
| |
| // Whether to exclude the local host from the subscription. The default value is false. |
| 3: exclude_local bool; |
| |
| // Whether to exclude local proxies from the subscription. The default value is false. |
| 4: exclude_local_proxies bool; |
| }; |
| |
| /// Client-implemented interface for subscribers. Method replies are used to |
| /// throttle traffic. The service won't necessarily wait for a reply before |
| /// calling another method. |
| @available(added=9) |
| protocol HostNameSubscriptionListener { |
| /// Notifies the subscriber that the addresses associated with a host name have changed. |
| OnAddressesChanged(struct { |
| addresses vector<HostAddress>:MAX_ADDRESSES; |
| }) -> (); |
| }; |