From 394085a34d25a51513019a4dc411acd3527fbd33 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 30 Aug 2022 10:02:49 +0200 Subject: resolv: Add the __ns_samebinaryname function During packet parsing, only the binary name is available. If the name equality check is performed before conversion to text, we can sometimes skip the last step. Reviewed-by: Siddhesh Poyarekar --- include/arpa/nameser.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index 53f1dbc..bb1dede 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -55,6 +55,12 @@ int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW; int __ns_name_unpack (const unsigned char *, const unsigned char *, const unsigned char *, unsigned char *, size_t) __THROW; +/* Like ns_samename, but for uncompressed binary names. Return true + if the two arguments compare are equal as case-insensitive domain + names. */ +_Bool __ns_samebinaryname (const unsigned char *, const unsigned char *) + attribute_hidden; + #define ns_msg_getflag(handle, flag) \ (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift) -- cgit v1.1