2N/A * Copyright (c) 2000, Boris Popov 2N/A * All rights reserved. 2N/A * Redistribution and use in source and binary forms, with or without 2N/A * modification, are permitted provided that the following conditions 2N/A * 1. Redistributions of source code must retain the above copyright 2N/A * notice, this list of conditions and the following disclaimer. 2N/A * 2. Redistributions in binary form must reproduce the above copyright 2N/A * notice, this list of conditions and the following disclaimer in the 2N/A * documentation and/or other materials provided with the distribution. 2N/A * 3. All advertising materials mentioning features or use of this software 2N/A * must display the following acknowledgement: 2N/A * This product includes software developed by Boris Popov. 2N/A * 4. Neither the name of the author nor the names of any co-contributors 2N/A * may be used to endorse or promote products derived from this software 2N/A * without specific prior written permission. 2N/A * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 2N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 2N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2N/A * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. 2N/A * Call NetBIOS name lookup and return a result in the 2N/A * same form as getaddrinfo(3) returns. Return code is 2N/A * zero or one of the EAI_xxx codes like getaddrinfo. 2N/A * Try NetBIOS name lookup. 2N/A /* Note: this returns an NBERROR value. */ 2N/A "nbns_resolvename: %s"),
2N/A /* Note: sap allocated */ 2N/A * Build the addrinfo struct to return. 2N/A * The type of this is really sockaddr_in, 2N/A * but is returned in the generic form. 2N/A * See nbns_resolvename. 2N/A * Pad the name with blanks, but 2N/A * leave the "type" byte NULL. 2N/A * smbfs_nb_name_encode adds the type. 2N/A * Not an authoritative answer. Query again 2N/A * using the NS address in the 2nd record. 2N/A * Solaris sockaddr_in doesn't a sin_len field. 2N/A * dest->sin_len = len; 2N/A * NB: system, workgroup are both NB_NAMELEN 2N/A * Darwin had a loop here, allowing redirect, etc. 2N/A * but we only handle point-to-point for node status. 2N/A /* Compiler didn't like cast on lvalue++ */ 2N/A /* Terminate the string: */ 2N/A /* Strip off trailing spaces */ 2N/A * Track at least ONE name, in case 2N/A * no server name is found 2N/A * Keep the first NBT_SERVER name. 2N/A * Extract resource record from the packet. Assume that there is only 2N/A * When looked into the ethereal trace, 'nmblookup' command sets this 2N/A * flag. We will also set. 2N/A /* Turn on the broadcast bit. */ 2N/A /* Turn the broadcast bit back off. */ 2N/A * Minor hack: If nr_dest is set, send there only. 2N/A * Used by _getnodestatus, _resolvname redirects. 2N/A "nbns error %d sending to %s"),
2N/A "nbns error %d sending to wins1"),
2N/A "nbns error %d sending to wins2"),
2N/A * If broadcast is enabled, start broadcasting 2N/A * only after wins servers fail to respond, or 2N/A * immediately if no WINS servers configured. 2N/A "nbns error %d sending broadcast"),
2N/A * Wait for responses from ANY of the above. 2N/A "nbns recv error %d"),