res_comp.c (269867) | res_comp.c (284229) |
---|---|
1/* 2 * Copyright (c) 1985, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 55 unchanged lines hidden (view full) --- 64 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 65 */ 66 67#if defined(LIBC_SCCS) && !defined(lint) 68static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; 69static const char rcsid[] = "$Id: res_comp.c,v 1.5 2005/07/28 06:51:50 marka Exp $"; 70#endif /* LIBC_SCCS and not lint */ 71#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1985, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 55 unchanged lines hidden (view full) --- 64 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 65 */ 66 67#if defined(LIBC_SCCS) && !defined(lint) 68static const char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93"; 69static const char rcsid[] = "$Id: res_comp.c,v 1.5 2005/07/28 06:51:50 marka Exp $"; 70#endif /* LIBC_SCCS and not lint */ 71#include <sys/cdefs.h> |
72__FBSDID("$FreeBSD: head/lib/libc/resolv/res_comp.c 269867 2014-08-12 12:36:06Z ume $"); | 72__FBSDID("$FreeBSD: head/lib/libc/resolv/res_comp.c 284229 2015-06-10 16:15:22Z ume $"); |
73 74#include "port_before.h" 75#include <sys/types.h> 76#include <sys/param.h> 77#include <netinet/in.h> 78#include <arpa/nameser.h> 79#include <ctype.h> 80#include <resolv.h> --- 61 unchanged lines hidden (view full) --- 142#define bslashchar(c) ((c) == 0x5c) 143#define underscorechar(c) ((c) == 0x5f) 144#define periodchar(c) ((c) == PERIOD) 145#define asterchar(c) ((c) == 0x2a) 146#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ 147 || ((c) >= 0x61 && (c) <= 0x7a)) 148#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) 149 | 73 74#include "port_before.h" 75#include <sys/types.h> 76#include <sys/param.h> 77#include <netinet/in.h> 78#include <arpa/nameser.h> 79#include <ctype.h> 80#include <resolv.h> --- 61 unchanged lines hidden (view full) --- 142#define bslashchar(c) ((c) == 0x5c) 143#define underscorechar(c) ((c) == 0x5f) 144#define periodchar(c) ((c) == PERIOD) 145#define asterchar(c) ((c) == 0x2a) 146#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ 147 || ((c) >= 0x61 && (c) <= 0x7a)) 148#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) 149 |
150#define borderchar(c) (alphachar(c) || digitchar(c)) | |
151#ifdef RES_ENFORCE_RFC1034 | 150#ifdef RES_ENFORCE_RFC1034 |
152#define middlechar(c) (borderchar(c) || hyphenchar(c)) | 151#define borderchar(c) (alphachar(c) || digitchar(c)) |
153#else | 152#else |
154#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c)) | 153#define borderchar(c) (alphachar(c) || digitchar(c) || underscorechar(c)) |
155#endif | 154#endif |
155#define middlechar(c) (borderchar(c) || hyphenchar(c)) |
|
156#define domainchar(c) ((c) > 0x20 && (c) < 0x7f) 157 158int 159res_hnok(const char *dn) { 160 int pch = PERIOD, ch = *dn++; 161 162 while (ch != '\0') { 163 int nch = *dn++; --- 114 unchanged lines hidden --- | 156#define domainchar(c) ((c) > 0x20 && (c) < 0x7f) 157 158int 159res_hnok(const char *dn) { 160 int pch = PERIOD, ch = *dn++; 161 162 while (ch != '\0') { 163 int nch = *dn++; --- 114 unchanged lines hidden --- |