aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-08-30 10:02:49 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-08-30 10:02:49 +0200
commit78b1a4f0e49064e5dfb686c7cd87bd4df2640b29 (patch)
treebe976bf8d066d0242eb737678c97dd939a5dab0f /include
parent394085a34d25a51513019a4dc411acd3527fbd33 (diff)
downloadglibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.zip
glibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.tar.gz
glibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.tar.bz2
resolv: Add internal __ns_name_length_uncompressed function
This function is useful for checking that the question name is uncompressed (as it should be). Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'include')
-rw-r--r--include/arpa/nameser.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h
index bb1dede..6e4808f 100644
--- a/include/arpa/nameser.h
+++ b/include/arpa/nameser.h
@@ -95,5 +95,13 @@ libc_hidden_proto (__ns_name_unpack)
extern __typeof (ns_samename) __libc_ns_samename;
libc_hidden_proto (__libc_ns_samename)
+/* Packet parser helper functions. */
+
+/* Verify that P points to an uncompressed domain name in wire format.
+ On success, return the length of the encoded name, including the
+ terminating null byte. On failure, return -1 and set errno. EOM
+ must point one past the last byte in the packet. */
+int __ns_name_length_uncompressed (const unsigned char *p,
+ const unsigned char *eom) attribute_hidden;
# endif /* !_ISOMAC */
#endif