dnsapi: dns_ns_name_pton() is unused so remove it.

Francois Gouget fgouget at free.fr
Wed Jan 7 05:41:44 CST 2009


---

dns_ns_name_pton() has been unused since the following commit removed a 
bunch of other unused functions that were causing trouble:

   commit d1a3383d531664af984c5245c5916228322653f2
   Author: Alexandre Julliard <julliard at winehq.org>
   Date:   Wed May 31 14:25:49 2006 +0200

       dnsapi: Remove a bunch of unused functions that cause naming 
       conflicts.


 dlls/dnsapi/ns_name.c |  129 -------------------------------------------------
 1 files changed, 0 insertions(+), 129 deletions(-)

diff --git a/dlls/dnsapi/ns_name.c b/dlls/dnsapi/ns_name.c
index 9822578..c8e8187 100644
--- a/dlls/dnsapi/ns_name.c
+++ b/dlls/dnsapi/ns_name.c
@@ -140,135 +140,6 @@ dns_ns_name_ntop(const u_char *src, char *dst, size_t dstsiz) {
 	return (dn - dst);
 }
 
-/*
- * dns_ns_name_pton(src, dst, dstsiz)
- *	Convert a ascii string into an encoded domain name as per RFC1035.
- * return:
- *	-1 if it fails
- *	1 if string was fully qualified
- *	0 is string was not fully qualified
- * notes:
- *	Enforces label and domain length limits.
- */
-
-int
-dns_ns_name_pton(const char *src, u_char *dst, size_t dstsiz) {
-	u_char *label, *bp, *eom;
-	int c, n, escaped;
-	char *cp;
-
-	escaped = 0;
-	bp = dst;
-	eom = dst + dstsiz;
-	label = bp++;
-
-	while ((c = *src++) != 0) {
-		if (escaped) {
-			if ((cp = strchr(digits, c)) != NULL) {
-				n = (cp - digits) * 100;
-				if ((c = *src++) == 0 ||
-				    (cp = strchr(digits, c)) == NULL) {
-					return (-1);
-				}
-				n += (cp - digits) * 10;
-				if ((c = *src++) == 0 ||
-				    (cp = strchr(digits, c)) == NULL) {
-					return (-1);
-				}
-				n += (cp - digits);
-				if (n > 255) {
-					return (-1);
-				}
-				c = n;
-			} else if (c == '[' && label == bp - 1 && *src == 'x') {
-				/* Theoretically we would have to handle \[o
-				   as well but we do not since we do not need
-				   it internally.  */
-				*label = 0x41;
-				label = bp++;
-				++src;
-				while (isxdigit (*src)) {
-					n = *src > '9' ? *src - 'a' + 10 : *src - '0';
-					++src;
-					if (! isxdigit(*src)) {
-						return (-1);
-					}
-					n <<= 4;
-					n += *src > '9' ? *src - 'a' + 10 : *src - '0';
-					if (bp + 1 >= eom) {
-						return (-1);
-					}
-					*bp++ = n;
-					++src;
-				}
-				*label = (bp - label - 1) * 8;
-				if (*src++ != ']' || *src++ != '.') {
-					return (-1);
-				}
-				escaped = 0;
-				label = bp++;
-				if (bp >= eom) {
-					return (-1);
-				}
-				continue;
-			}
-			escaped = 0;
-		} else if (c == '\\') {
-			escaped = 1;
-			continue;
-		} else if (c == '.') {
-			c = (bp - label - 1);
-			if ((c & NS_CMPRSFLGS) != 0) {	/* Label too big. */
-				return (-1);
-			}
-			if (label >= eom) {
-				return (-1);
-			}
-			*label = c;
-			/* Fully qualified ? */
-			if (*src == '\0') {
-				if (c != 0) {
-					if (bp >= eom) {
-						return (-1);
-					}
-					*bp++ = '\0';
-				}
-				if ((bp - dst) > NS_MAXCDNAME) {
-					return (-1);
-				}
-				return (1);
-			}
-			if (c == 0 || *src == '.') {
-				return (-1);
-			}
-			label = bp++;
-			continue;
-		}
-		if (bp >= eom) {
-			return (-1);
-		}
-		*bp++ = (u_char)c;
-	}
-	c = (bp - label - 1);
-	if ((c & NS_CMPRSFLGS) != 0) {		/* Label too big. */
-		return (-1);
-	}
-	if (label >= eom) {
-		return (-1);
-	}
-	*label = c;
-	if (c != 0) {
-		if (bp >= eom) {
-			return (-1);
-		}
-		*bp++ = 0;
-	}
-	if ((bp - dst) > NS_MAXCDNAME) {	/* src too big */
-		return (-1);
-	}
-	return (0);
-}
-
 
 /*
  * dns_ns_name_unpack(msg, eom, src, dst, dstsiz)
-- 
1.5.6.5




More information about the wine-patches mailing list