Commit a5688995 authored by Pekka Pessi's avatar Pekka Pessi
Browse files

sofia-sip/hostdomain.h: added host_is_ip6_reference().

darcs-hash:20060724202949-65a35-a8ad76188a933e78f07f08b7b9ba4567fddf6b05.gz
parent fc4b1c8b
...@@ -674,12 +674,17 @@ int host_is_ip6_address(char const *string) ...@@ -674,12 +674,17 @@ int host_is_ip6_address(char const *string)
return n > 0 && string[n] == '\0'; return n > 0 && string[n] == '\0';
} }
int host_ip6_reference(char const *string)
{
return host_is_ip6_reference(string);
}
/** Return true if @a string is valid IP6 reference, /** Return true if @a string is valid IP6 reference,
* i.e. hex notation in square brackets. * i.e. hex notation in square brackets.
* *
* E.g., [::1] is a valid IP6 reference. * E.g., [::1] is a valid IP6 reference.
*/ */
int host_ip6_reference(char const *string) int host_is_ip6_reference(char const *string)
{ {
int n = span_ip6_reference(string); int n = span_ip6_reference(string);
return n > 0 && string[n] == '\0'; return n > 0 && string[n] == '\0';
......
...@@ -43,13 +43,16 @@ SOFIA_BEGIN_DECLS ...@@ -43,13 +43,16 @@ SOFIA_BEGIN_DECLS
SOFIAPUBFUN int host_is_ip4_address(char const *string); SOFIAPUBFUN int host_is_ip4_address(char const *string);
SOFIAPUBFUN int host_is_ip6_address(char const *string); SOFIAPUBFUN int host_is_ip6_address(char const *string);
SOFIAPUBFUN int host_ip6_reference(char const *string); SOFIAPUBFUN int host_is_ip6_reference(char const *string);
SOFIAPUBFUN int host_is_ip_address(char const *string); SOFIAPUBFUN int host_is_ip_address(char const *string);
SOFIAPUBFUN int host_is_domain(char const *string); SOFIAPUBFUN int host_is_domain(char const *string);
SOFIAPUBFUN int host_is_valid(char const *string); SOFIAPUBFUN int host_is_valid(char const *string);
SOFIAPUBFUN int host_is_local(char const *string); SOFIAPUBFUN int host_is_local(char const *string);
SOFIAPUBFUN int host_has_domain_invalid(char const *string); SOFIAPUBFUN int host_has_domain_invalid(char const *string);
/** This is typo. @deprecated Use host_is_ip6_reference() instead. */
SOFIAPUBFUN int host_ip6_reference(char const *string);
SOFIA_END_DECLS SOFIA_END_DECLS
#endif /* !defined(SOFIA_SIP_HOSTDOMAIN_H) */ #endif /* !defined(SOFIA_SIP_HOSTDOMAIN_H) */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment