From: Jelte Jansen Date: Tue, 26 Jul 2005 09:47:59 +0000 (+0000) Subject: ok removed them again X-Git-Tag: release-0.70~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9eaf98f86c43b6bf4bf07b84c90d13adfe05b33f;p=thirdparty%2Fldns.git ok removed them again --- diff --git a/ldns/str2host.h b/ldns/str2host.h index 107863da..004a083d 100644 --- a/ldns/str2host.h +++ b/ldns/str2host.h @@ -19,16 +19,6 @@ #include #include -/** - * Returns true if the given string represent an IPv4 address - */ -bool ldns_is_ipv4_addr(const char *str); - -/** - * Returns true if the given string represent an IPv6 address - */ -bool ldns_is_ipv6_addr(const char *str); - /** * convert a byte into wireformat * \param[in] rd the rdf where to put the data diff --git a/str2host.c b/str2host.c index 79c8b39f..847ca649 100644 --- a/str2host.c +++ b/str2host.c @@ -24,60 +24,6 @@ #include #endif -bool -ldns_is_ipv4_addr(const char *str) -{ - int a, i; - const char *dot = str; - - if (strlen(str) < 7 || strlen(str) > 16) { - return false; - } - - for (i = 0; i < 3; i++) { - a = atoi(dot); - if (a < 0 || a > 255) { - return false; - } - dot = strchr(dot, '.'); - if (!dot) { - return false; - } - } - a = atoi(dot); - if (a < 0 || a > 255) { - return false; - } - - return true; -} - -/* todo: check for more errors (like ffffff:f etc) */ -bool -ldns_is_ipv6_addr(const char *str) -{ - int a; - size_t i; - const char *dot = str; - - if (strlen(str) < 3 || strlen(str) > 40) { - return false; - } - - for (i = 0; i < strlen(str); i++) { - if (str[i] != ':' && - ldns_hexdigit_to_int(str[i]) < 0) { - return false; - } - } - a = atoi(dot); - if (a < 0 || a > 255) { - return false; - } - - return true; -} - ldns_status ldns_str2rdf_int16(ldns_rdf **rd, const char *shortstr) {