2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * This file includes the functions to query for host name 2N/A * information via Multicast DNS (mDNS). The function 2N/A * _nss_mdns_queryrecord queries for the host information via 2N/A * Multicast DNS. _nss_mdns_querybyname and _nss_mdns_querybyaddr 2N/A * query for host IP address and hostname by querying for A/AAAA 2N/A * and PTR DNS resource records respectively. DNSServiceQueryRecord 2N/A * in libdns_sd sends a request to the mDNS daemon (mdnsd) to place 2N/A * the DNS query via multicast and return the results. 2N/A * backend module getXbyY functions: getbyname and getbyaddr. 2N/A * query for host information via mDNS. 2N/A * Configuration for mdns is stored in SMF and is accessed using 2N/A * includes the list of valid DNS domains checked before querying host 2N/A * information via mDNS and the search list to use for host lookup via 2N/A * mDNS. The default valid domain list in the mDNS service supports host 2N/A * lookups for hostnames in the ".local" domain and hostname queries 2N/A * for link-local IPv4 and IPv6 addresses. _nss_mdns_loadsmfcfg 2N/A * loads the nss_mdns configuration from SMF and the function 2N/A * _nss_mdns_updatecfg checks for any updates in nss_mdns configuration. 2N/A /* Wait until response received from mDNS daemon */ 2N/A/* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* Return in file format */ 2N/A/* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* LINTED E_FUNC_ARG_UNUSED */ 2N/A /* Return in file format */ 2N/A/* LINTED E_FUNC_ARG_UNUSED */ 2N/A * Converts the encoded name in RData returned 2N/A * by mDNS query to name in file format 2N/A /* first byte is len */ 2N/A * Check if we copied entire domain str. and 2N/A * if space is still remaining for '.' separator 2N/A * If there is a trailing dot in the query 2N/A * name, do not perform any additional queries 2N/A * with search domains. 2N/A * If there is a trailing dot in the query 2N/A * or atleast one dot in the query name then 2N/A * perform a query as-is once first. 2N/A * This function determines if the domain name in the query 2N/A * matches any of the valid & search domains in the nss_mdns 2N/A /* Remove any trailing and leading dots in the name */ 2N/A /* Compare with search domains */ 2N/A /* Compare with valid domains */ 2N/A * Update configuration if current svc state timestamp 2N/A * is different from last known svc state timestamp 2N/A " service timestamp");
2N/A /* Remove beginning & trailing '.' chars */ 2N/A * Performs lookup for IP address by hostname via mDNS and returns 2N/A * results along with the TTL value from the mDNS resource records. 2N/A * Called by nscd wth a ptr to packed buffer and packed buffer size. 2N/A * Retrieve withttl buffer and size from the passed packed buffer. 2N/A * Results are returned along with ttl in this buffer. 2N/A /* Zero out the withttl buffer prior to use */ 2N/A /* Return ttl in the packed buffer at ext_off */