res_comp.c revision 2
2N/A * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 2N/A * Use is subject to license terms. 2N/A * Copyright (c) 1985, 1993 2N/A * The Regents of the University of California. 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 the University of 2N/A * California, Berkeley and its contributors. 2N/A * 4. Neither the name of the University nor the names of its 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 REGENTS 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 REGENTS 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 * Portions Copyright (c) 1993 by Digital Equipment Corporation. 2N/A * Permission to use, copy, modify, and distribute this software for any 2N/A * purpose with or without fee is hereby granted, provided that the above 2N/A * copyright notice and this permission notice appear in all copies, and that 2N/A * the name of Digital Equipment Corporation not be used in advertising or 2N/A * publicity pertaining to distribution of the document or software without 2N/A * specific, written prior permission. 2N/A * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL 2N/A * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES 2N/A * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT 2N/A * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 2N/A * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 2N/A * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 2N/A * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 2N/A * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 2N/A * Portions Copyright (c) 1996-1999 by Internet Software Consortium. 2N/A * Permission to use, copy, modify, and distribute this software for any 2N/A * purpose with or without fee is hereby granted, provided that the above 2N/A * copyright notice and this permission notice appear in all copies. 2N/A * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 2N/A * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 2N/A * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 2N/A * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 2N/A * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 2N/A * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 2N/A * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 2N/A#
endif /* LIBC_SCCS and not lint */ 2N/A#
endif /* ORIGINAL_ISC_CODE */ 2N/A * Expand compressed domain name 'src' to full domain name. 2N/A * \li 'msg' is a pointer to the begining of the message, 2N/A * \li 'eom' points to the first location after the message, 2N/A * \li 'dst' is a pointer to a buffer of size 'dstsiz' for the result. 2N/A * \li Return size of compressed name or -1 if there was an error. 2N/A * Pack domain name 'exp_dn' in presentation form into 'comp_dn'. 2N/A * \li Return the size of the compressed name or -1. 2N/A * \li 'length' is the size of the array pointed to by 'comp_dn'. 2N/A * Skip over a compressed domain name. Return the size or -1. 2N/A * Verify that a domain name uses an acceptable character set. 2N/A * Note the conspicuous absence of ctype macros in these definitions. On 2N/A * non-ASCII hosts, we can't depend on string literals or ctype macros to 2N/A * tell us anything about network-format data. The rest of the BIND system 2N/A * is not careful about this, but for some reason, we're doing it right here. 2N/A#
endif /* SUNW_HNOK_UNDERSCORE */ 2N/A || ((c) >=
0x61 && (c) <=
0x7a))
2N/A#
endif /* SUNW_HNOK_UNDERSCORE */ 2N/A * hostname-like (A, MX, WKS) owners can have "*" as their first label 2N/A * but must otherwise be as a host name. 2N/A * SOA RNAMEs and RP RNAMEs can have any printable character in their first 2N/A * label, but the rest of the name has to look like a host name. 2N/A /* "." is a valid missing representation */ 2N/A /* otherwise <label>.<hostname> */ 2N/A * This function is quite liberal, since RFC1034's character sets are only 2N/A * This module must export the following externally-visible symbols: 2N/A * Note that one _ comes from C and the others come from us. 2N/A#
endif /* SOLARIS2 */ 2N/A#
endif /*__ultrix__*/ 2N/A#
endif /*BIND_4_COMPAT*/