PROTOCOLS
PublicationResponder
Defined in fuchsia.net.mdns/mdns.fidl
Client-supplied publication responder interface.
OnPublication
Provides instance information for initial announcements and query
responses relating to the service instance specified in
Publisher.PublishServiceInstance
. If the publication relates to a
subtype of the service, subtype
contains the subtype, otherwise
it is null. If publication
is null, no announcement or response is
transmitted. Strings in text
are transmitted in the TXT record.
Request
Name | Type |
---|---|
publication_cause |
PublicationCause
|
subtype |
subtype_name
|
source_addresses |
vector<fuchsia.net/IpAddress>[64]
|
Response
Name | Type |
---|---|
publication |
Publication?
|
Reannounce
Initiates reannouncement of the service instance due to a change in the
instance's port number or text strings. All announcements are filtered
through OnPublication
, which replies with the new port and text
values.
Response
Name | Type |
---|
SetSubtypes
Sets the subtypes for the service instance. The specified subtypes will be announced subject to filtering through the responder. The initial subtype collection is empty.
Response
Name | Type |
---|---|
subtypes |
vector<string>[256]
|
PublicationResponder2
Defined in fuchsia.net.mdns/mdns.fidl
Client-supplied publication responder interface.
OnPublication
Provides instance information for initial announcements and query
responses relating to the service instance specified in
Publisher.PublishServiceInstance
. query
indicates whether data is
requested for an initial announcement (false) or in response to a query
(true). If the publication relates to a subtype of the service,
subtype
contains the subtype, otherwise it is null. If publication
is null, no announcement or response is transmitted. Strings in text
are transmitted in the TXT record.
Request
Name | Type |
---|---|
query |
bool
|
subtype |
subtype_name
|
source_addresses |
vector<fuchsia.net/IpAddress>[64]
|
Response
Name | Type |
---|---|
publication |
Publication?
|
Reannounce
Initiates reannouncement of the service instance due to a change in the
instance's port number or text strings. All announcements are filtered
through OnPublication
, which replies with the new port and text
values.
Response
Name | Type |
---|
SetSubtypes
Sets the subtypes for the service instance. The specified subtypes will be announced subject to filtering through the responder. The initial subtype collection is empty.
Response
Name | Type |
---|---|
subtypes |
vector<string>[256]
|
Publisher
Defined in fuchsia.net.mdns/mdns.fidl
Discoverable protocol for publishing service instances.
PublishServiceInstance
Publishes a service instance. publication_responder
is consulted via its
OnPublication
method for initial announcements and to answer queries.
The service is published until the publication_responder
channel closes. In
addition to announcements and queries for the service type, all queries
for subtypes are answered subject to filtering through the responder.
perform_probe
indicates whether a probe for a conflicting instance
should be performed before publishing the instance. This value should
be true
unless the instance name is known to be unique.
If a service with the same service and instance names is already published, the old publication will be terminated, and the responder channel for the old publication will be closed.
Request
Name | Type |
---|---|
service |
service_name
|
instance |
instance_name
|
media |
Media
|
perform_probe |
bool
|
publication_responder |
PublicationResponder
|
Response
Name | Type |
---|---|
result |
Publisher_PublishServiceInstance_Result
|
PublishServiceInstance2
Publishes a service instance. publication_responder
is consulted via its
OnPublication
method for initial announcements and to answer queries.
The service is published until the publication_responder
channel closes. In
addition to announcements and queries for the service type, all queries
for subtypes are answered subject to filtering through the responder.
perform_probe
indicates whether a probe for a conflicting instance
should be performed before publishing the instance. This value should
be true
unless the instance name is known to be unique.
If a service with the same service and instance names is already published, the old publication will be terminated, and the responder channel for the old publication will be closed.
Request
Name | Type |
---|---|
service |
service_name
|
instance |
instance_name
|
perform_probe |
bool
|
publication_responder |
PublicationResponder2
|
Response
Name | Type |
---|---|
result |
Publisher_PublishServiceInstance2_Result
|
Resolver
Defined in fuchsia.net.mdns/mdns.fidl
Discoverable protocol for resolving host names to IP addresses.
ResolveHostName
Gets the addresses for the specified host. timeout
specifies how long
the service should wait before giving up when waiting for a response to
a resolution query. In typical use, a timeout of two or three seconds
is recommended.
A successful resolution may return one or both addresses. An unsuccessful resolution is indicated when both addresses are null.
Request
Name | Type |
---|---|
host |
host_name
|
timeout |
zx/duration
|
Response
Name | Type |
---|---|
v4_address |
fuchsia.net/Ipv4Address?
|
v6_address |
fuchsia.net/Ipv6Address?
|
ServiceSubscriber
Defined in fuchsia.net.mdns/mdns.fidl
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.
OnInstanceChanged
Notifies the subscriber that addresses or text for a known service instance have changed.
Request
Name | Type |
---|---|
instance |
ServiceInstance
|
Response
Name | Type |
---|
OnInstanceDiscovered
Notifies the subscriber that a service instance has been discovered.
Request
Name | Type |
---|---|
instance |
ServiceInstance
|
Response
Name | Type |
---|
OnInstanceLost
Notifies the subscriber that a known service instance has been lost.
Request
Name | Type |
---|---|
service |
service_name
|
instance |
instance_name
|
Response
Name | Type |
---|
OnQuery
Notifies the subscriber that a PTR query has been sent.
Request
Name | Type |
---|---|
resource_type |
ResourceType
|
Response
Name | Type |
---|
ServiceSubscriber2
Defined in fuchsia.net.mdns/mdns.fidl
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.
OnInstanceChanged
Notifies the subscriber that addresses or text for a known service instance have changed.
Request
Name | Type |
---|---|
instance |
ServiceInstance2
|
Response
Name | Type |
---|
OnInstanceDiscovered
Notifies the subscriber that a service instance has been discovered.
Request
Name | Type |
---|---|
instance |
ServiceInstance2
|
Response
Name | Type |
---|
OnInstanceLost
Notifies the subscriber that a known service instance has been lost.
Request
Name | Type |
---|---|
service |
service_name
|
instance |
instance_name
|
Response
Name | Type |
---|
OnQuery
Notifies the subscriber that a PTR query has been sent.
Request
Name | Type |
---|---|
resource_type |
ResourceType
|
Response
Name | Type |
---|
Subscriber
Defined in fuchsia.net.mdns/mdns.fidl
Discoverable protocol for finding service instances.
SubscribeToService
Subscribes to a service. The subscription lasts until subscriber
is
unbound.
Request
Name | Type |
---|---|
service |
service_name
|
subscriber |
ServiceSubscriber
|
SubscribeToService2
Subscribes to a service. The subscription lasts until subscriber
is
unbound.
Request
Name | Type |
---|---|
service |
service_name
|
subscriber |
ServiceSubscriber2
|
STRUCTS
Publication
Defined in fuchsia.net.mdns/mdns.fidl
Describes an initial instance announcement or query response. In typical
use, the default SRV priority, SRV weight and TTL values should be used. TTL
values are rounded down to the nearest second. TTL values less than one
second are not permitted and will result in the PublicationResponder
channel being closed.
Name | Type | Description | Default |
---|---|---|---|
port |
uint16
|
The port at which the service instance is addressable. |
No default |
text |
vector<string>[256]
|
Text strings describing the instance. |
No default |
srv_priority |
uint16
|
The priority of the SRV resource record for this publication. See RFC6763 for details. |
DEFAULT_SRV_PRIORITY |
srv_weight |
uint16
|
The weight of the SRV resource record for this publication. See RFC6763 for details. |
DEFAULT_SRV_WEIGHT |
ptr_ttl |
zx/duration
|
Time-to-live for PTR resource records. |
DEFAULT_PTR_TTL |
srv_ttl |
zx/duration
|
Time-to-live for SRV resource records. |
DEFAULT_SRV_TTL |
txt_ttl |
zx/duration
|
Time-to-live for TXT resource records. |
DEFAULT_TXT_TTL |
Publisher_PublishServiceInstance2_Response
Defined in fuchsia.net.mdns/mdns.fidl
Name | Type | Description | Default |
---|
Publisher_PublishServiceInstance_Response
Defined in fuchsia.net.mdns/mdns.fidl
Name | Type | Description | Default |
---|
ENUMS
Error
Type: int32
Defined in fuchsia.net.mdns/mdns.fidl
Error values for instance publishing.
Name | Value | Description |
---|---|---|
INVALID_SERVICE_NAME |
1 |
The specified service name is invalid. |
INVALID_INSTANCE_NAME |
2 |
The specified instance name is invalid. |
ALREADY_PUBLISHED_ON_SUBNET |
4 |
The specified service instance is already being published by another host on the subnet. This result occurs when an initial probe discovers a conflicting instance. |
INVALID_MEDIA |
5 |
PublicationCause
Type: int32
Defined in fuchsia.net.mdns/mdns.fidl
Describes the cause of a publication.
Name | Value | Description |
---|---|---|
ANNOUNCEMENT |
1 |
Indicates the publication is part of an initial announcement. |
QUERY_MULTICAST_RESPONSE |
2 |
Indicates the publication is in response to a question that requests a multicast response. |
QUERY_UNICAST_RESPONSE |
3 |
Indicates the publication is in response to a question that requests a unicast response. |
ResourceType
Type: uint32
Defined in fuchsia.net.mdns/mdns.fidl
DNS resource types.
Name | Value | Description |
---|---|---|
PTR |
12 |
Domain name pointer. |
ANY |
255 |
Any (wildcard) type. |
TABLES
ServiceInstance
Defined in fuchsia.net.mdns/mdns.fidl
Describes a service instance.
Ordinal | Name | Type | Description |
---|---|---|---|
1 | service |
service_name
|
The name of the service. |
2 | instance |
instance_name
|
The name of the service instance. |
3 | ipv4_endpoint |
fuchsia.net/Ipv4SocketAddress
|
IPv4 socket address for the service. May be unset. |
4 | ipv6_endpoint |
fuchsia.net/Ipv6SocketAddress
|
IPv6 socket address for the service. May be unset. |
5 | text |
vector<string>[256]
|
Text strings describing the instance. |
6 | srv_priority |
uint16
|
The priority of the SRV resource record for this publication. See RFC6763 for details. |
7 | srv_weight |
uint16
|
The weight of the SRV resource record for this publication. See RFC6763 for details. |
ServiceInstance2
Defined in fuchsia.net.mdns/mdns.fidl
Describes a service instance.
Ordinal | Name | Type | Description |
---|---|---|---|
1 | service |
service_name
|
The name of the service. |
2 | instance |
instance_name
|
The name of the service instance. |
3 | ipv4_endpoint |
fuchsia.net/Ipv4SocketAddress
|
IPv4 socket address for the service. May be unset. |
4 | ipv6_endpoint |
fuchsia.net/Ipv6SocketAddress
|
IPv6 socket address for the service. May be unset. |
5 | text |
vector<string>[256]
|
Text strings describing the instance. |
6 | srv_priority |
uint16
|
The priority of the SRV resource record for this publication. See RFC6763 for details. |
7 | srv_weight |
uint16
|
The weight of the SRV resource record for this publication. See RFC6763 for details. |
UNIONS
Publisher_PublishServiceInstance2_Result
Defined in fuchsia.net.mdns/mdns.fidl
Name | Type | Description |
---|---|---|
response |
Publisher_PublishServiceInstance2_Response
|
|
err |
Error
|
Publisher_PublishServiceInstance_Result
Defined in fuchsia.net.mdns/mdns.fidl
Name | Type | Description |
---|---|---|
response |
Publisher_PublishServiceInstance_Response
|
|
err |
Error
|
BITS
Media
Type: uint32
Defined in fuchsia.net.mdns/mdns.fidl
Specifies network media on which a service instance should be published.
Name | Value | Description |
---|---|---|
WIRED | 1 | Specifies wired interfaces. |
WIRELESS | 2 | Specifies wireless interfaces. |
CONSTANTS
Name | Value | Type | Description |
---|---|---|---|
DEFAULT_PTR_TTL |
120000000000
|
int64 |
|
DEFAULT_SRV_PRIORITY |
0
|
uint16 |
|
DEFAULT_SRV_TTL |
120000000000
|
int64 |
|
DEFAULT_SRV_WEIGHT |
0
|
uint16 |
|
DEFAULT_TXT_TTL |
4500000000000
|
int64 |
|
MAX_SUBTYPES |
256
|
uint32 |
|
MAX_TEXT_STRINGS |
256
|
uint32 |
TYPE ALIASES
Name | Value | Description |
---|---|---|
host_name |
string [255 ] |
Identifies a host. Host names consist of one or more labels separated by '.'s. A host name must not end with a '.'. Labels must each be 63 characters or less (not including the separator) and are UTF-8-encoded. A complete host name, including separators, must be 255 characters or less. |
instance_name |
string [63 ] |
Identifies a specific instance of a service being published. Instance names consist of a single label, which is at most 63 characters long and which contains no '.'s. Instance names are UTF-8-encoded. |
service_name |
string [22 ] |
Identifies a (type of) service being published. Service names consist of two labels, both terminated with a '.'. The first label must start with an underscore and be 16 characters or less, including the underscore. The second label must be either '_tcp' or '_udp'. Labels do not contain '.'s. With underscores and terminators, that makes for a maximum of 22 characters. Service names are UTF-8-encoded. |
subtype_name |
string [63 ] |
Identifies a subtype of a service. Subtype names consist of a single label, which is at most 63 characters long and which contains no '.'s. Subtype names are UTF-8-encoded. |
txt_string |
string [255 ] |
Provides description relating to a service instance. In typical use, TXT strings consist of a key and value separated by '='. TXT strings must be at most 255 characters long and are UTF-8-encoded. |