about summary refs log tree commit diff
path: root/resolv/arpa
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-07-19 07:55:27 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-07-19 07:55:42 +0200
commit248dbed1187038918d79f62cd9cf631f4150c2a0 (patch)
treec522c63f3934d0efdff8b2f1fdc9ae71e43951c6 /resolv/arpa
parent191e4068266462e7e4c650fc8ce8e11328a9f4a1 (diff)
downloadglibc-248dbed1187038918d79f62cd9cf631f4150c2a0.tar.gz
glibc-248dbed1187038918d79f62cd9cf631f4150c2a0.tar.xz
glibc-248dbed1187038918d79f62cd9cf631f4150c2a0.zip
resolv: Deprecate legacy interfaces in libresolv
Debugging interfaces: p_*, fp_*, and sym_* could conceivably be
used to produce debug out, but these functions have not been
updated to parse more resource records, so they are not very useful
today.  Likewise for ns_sprintrr and ns_sprintrrf.  ns_format_ttl and
ns_parse_ttl are related to these.

Internal implementation details: res_isourserver is probably only
useful in the implementation of a stub resolver, and so is
res_nameinquery.

Unclear semantics and bad performance: ns_samedomain, ns_subdomain,
ns_makecanon, ns_samename do textual converions & copies instead of
checking equivalence of the wire format.

inet_neta cannot handle IPv6 addresses.

res_hostalias has been superseded by getaddrinfo with AI_CANONNAME.
hostalias is not thread-safe.

Some functions have int as size arguments instead of size_t, so they
do not follow current coding practices.  However, dn_expand and
b64_ntop are somewhat widely used (to name just two examples), so
deprecating them seems problematic.

Reviewed-by: Carlos O'Donell <carlos@systemhalted.org>
Diffstat (limited to 'resolv/arpa')
-rw-r--r--resolv/arpa/nameser.h33
1 files changed, 24 insertions, 9 deletions
diff --git a/resolv/arpa/nameser.h b/resolv/arpa/nameser.h
index a99d5ec508..017d7b194a 100644
--- a/resolv/arpa/nameser.h
+++ b/resolv/arpa/nameser.h
@@ -52,6 +52,12 @@
 #include <sys/types.h>
 #include <stdint.h>
 
+#ifdef _LIBC
+# define __NAMESER_DEPRECATED
+#else
+# define __NAMESER_DEPRECATED __attribute_deprecated__
+#endif
+
 /*
  * Define constants based on RFC 883, RFC 1034, RFC 1035
  */
@@ -401,14 +407,18 @@ int		ns_skiprr (const unsigned char *, const unsigned char *,
 int		ns_parserr (ns_msg *, ns_sect, int, ns_rr *) __THROW;
 int		ns_sprintrr (const ns_msg *, const ns_rr *,
 			     const char *, const char *, char *, size_t)
-     __THROW;
+  __THROW __NAMESER_DEPRECATED;
 int		ns_sprintrrf (const unsigned char *, size_t, const char *,
 			      ns_class, ns_type, unsigned long,
 			      const unsigned char *, size_t, const char *,
-			      const char *, char *, size_t) __THROW;
-int		ns_format_ttl (unsigned long, char *, size_t) __THROW;
-int		ns_parse_ttl (const char *, unsigned long *) __THROW;
-uint32_t	ns_datetosecs (const char *, int *) __THROW;
+			      const char *, char *, size_t)
+  __THROW __NAMESER_DEPRECATED;
+int		ns_format_ttl (unsigned long, char *, size_t)
+  __THROW __NAMESER_DEPRECATED;
+int		ns_parse_ttl (const char *, unsigned long *)
+  __THROW __NAMESER_DEPRECATED;
+uint32_t	ns_datetosecs (const char *, int *)
+  __THROW __NAMESER_DEPRECATED;
 int		ns_name_ntol (const unsigned char *, unsigned char *, size_t)
      __THROW;
 int		ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
@@ -431,10 +441,15 @@ int		ns_name_skip (const unsigned char **, const unsigned char *)
 void		ns_name_rollback (const unsigned char *,
 				  const unsigned char **,
 				  const unsigned char **) __THROW;
-int		ns_samedomain (const char *, const char *) __THROW;
-int		ns_subdomain (const char *, const char *) __THROW;
-int		ns_makecanon (const char *, char *, size_t) __THROW;
-int		ns_samename (const char *, const char *) __THROW;
+
+int		ns_samedomain (const char *, const char *) __THROW
+  __NAMESER_DEPRECATED;
+int		ns_subdomain (const char *, const char *) __THROW
+  __NAMESER_DEPRECATED;
+int		ns_makecanon (const char *, char *, size_t) __THROW
+  __NAMESER_DEPRECATED;
+int		ns_samename (const char *, const char *) __THROW
+  __NAMESER_DEPRECATED;
 __END_DECLS
 
 #include <arpa/nameser_compat.h>