diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-08-30 10:02:49 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-08-30 10:02:49 +0200 |
commit | 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29 (patch) | |
tree | be976bf8d066d0242eb737678c97dd939a5dab0f /include | |
parent | 394085a34d25a51513019a4dc411acd3527fbd33 (diff) | |
download | glibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.tar.gz glibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.tar.xz glibc-78b1a4f0e49064e5dfb686c7cd87bd4df2640b29.zip |
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index bb1dede187..6e4808f00d 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 |