diff options
author | Florian Weimer <fweimer@redhat.com> | 2022-08-30 10:02:49 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2022-09-20 12:29:27 +0200 |
commit | a333ba1d50c38d353e54f24c0ca4213494ce2ad6 (patch) | |
tree | c102c40052f33fd43bf0d81c9a8f508f55682d98 /include | |
parent | d7c22ec359ac10432fc5df769f6350f0a2365c5f (diff) | |
download | glibc-a333ba1d50c38d353e54f24c0ca4213494ce2ad6.zip glibc-a333ba1d50c38d353e54f24c0ca4213494ce2ad6.tar.gz glibc-a333ba1d50c38d353e54f24c0ca4213494ce2ad6.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>
(cherry picked from commit 78b1a4f0e49064e5dfb686c7cd87bd4df2640b29)
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 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 |