| // Copyright 2013 The Chromium Authors |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| // Use the <code>chrome.mdns</code> API to discover services over mDNS. |
| // This comprises a subset of the features of the NSD spec: |
| // http://www.w3.org/TR/discovery-api/ |
| namespace mdns { |
| |
| // Represents a mDNS/DNS-SD service. |
| dictionary MDnsService { |
| // The service name of an mDNS advertised service, |
| // <instance_name>.<service_type>. |
| DOMString serviceName; |
| |
| // The host:port pair of an mDNS advertised service. |
| DOMString serviceHostPort; |
| |
| // The IP address of an mDNS advertised service. |
| DOMString ipAddress; |
| |
| // Metadata for an mDNS advertised service. |
| DOMString[] serviceData; |
| }; |
| |
| // Callback invoked after ForceDiscovery() has started. |
| callback VoidCallback = void(); |
| |
| interface Functions { |
| // Immediately issues a multicast DNS query for all service types. |
| // |callback| is invoked immediately. At a later time, queries will be |
| // sent, and any service events will be fired. |
| [supportsPromises] static void forceDiscovery(VoidCallback callback); |
| }; |
| |
| interface Properties { |
| // The maximum number of service instances that will be included in |
| // onServiceList events. If more instances are available, they may be |
| // truncated from the onServiceList event. |
| [value=2048] static long MAX_SERVICE_INSTANCES_PER_EVENT(); |
| }; |
| |
| interface Events { |
| // Event fired to inform clients of the current complete set of known |
| // available services. Clients should only need to store the list from the |
| // most recent event. The service type that the extension is interested in |
| // discovering should be specified as the event filter with the |
| // 'serviceType' key. Not specifying an event filter will not start any |
| // discovery listeners. |
| [supportsFilters=true, maxListeners=10] static void onServiceList( |
| MDnsService[] services); |
| }; |
| }; |