1 #ifndef _ARPA_NAMESER_H_ 2 3 #include <resolv/arpa/nameser.h> 4 5 # ifndef _ISOMAC 6 7 /* If the machine allows unaligned access we can do better than using 8 the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the 9 installed header. */ 10 #include <string.h> 11 #include <stdint.h> 12 #include <netinet/in.h> 13 14 extern const struct _ns_flagdata _ns_flagdata[] attribute_hidden; 15 16 #if _STRING_ARCH_unaligned 17 18 # undef NS_GET16 19 # define NS_GET16(s, cp) \ 20 do { \ 21 const uint16_t *t_cp = (const uint16_t *) (cp); \ 22 (s) = ntohs (*t_cp); \ 23 (cp) += NS_INT16SZ; \ 24 } while (0) 25 26 # undef NS_GET32 27 # define NS_GET32(l, cp) \ 28 do { \ 29 const uint32_t *t_cp = (const uint32_t *) (cp); \ 30 (l) = ntohl (*t_cp); \ 31 (cp) += NS_INT32SZ; \ 32 } while (0) 33 34 # undef NS_PUT16 35 # define NS_PUT16(s, cp) \ 36 do { \ 37 uint16_t *t_cp = (uint16_t *) (cp); \ 38 *t_cp = htons (s); \ 39 (cp) += NS_INT16SZ; \ 40 } while (0) 41 42 # undef NS_PUT32 43 # define NS_PUT32(l, cp) \ 44 do { \ 45 uint32_t *t_cp = (uint32_t *) (cp); \ 46 *t_cp = htonl (l); \ 47 (cp) += NS_INT32SZ; \ 48 } while (0) 49 50 #endif 51 52 extern unsigned int __ns_get16 (const unsigned char *) __THROW; 53 extern unsigned long __ns_get32 (const unsigned char *) __THROW; 54 int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW; 55 int __ns_name_unpack (const unsigned char *, const unsigned char *, 56 const unsigned char *, unsigned char *, size_t) __THROW; 57 58 #define ns_msg_getflag(handle, flag) \ 59 (((handle)._flags & _ns_flagdata[flag].mask) >> _ns_flagdata[flag].shift) 60 61 libresolv_hidden_proto (ns_get16) 62 libresolv_hidden_proto (ns_get32) 63 libresolv_hidden_proto (ns_put16) 64 libresolv_hidden_proto (ns_put32) 65 libresolv_hidden_proto (ns_initparse) 66 libresolv_hidden_proto (ns_skiprr) 67 libresolv_hidden_proto (ns_parserr) 68 libresolv_hidden_proto (ns_sprintrr) 69 libresolv_hidden_proto (ns_sprintrrf) 70 libresolv_hidden_proto (ns_samedomain) 71 libresolv_hidden_proto (ns_format_ttl) 72 73 extern __typeof (ns_makecanon) __libc_ns_makecanon; 74 libc_hidden_proto (__libc_ns_makecanon) 75 extern __typeof (ns_name_compress) __ns_name_compress; 76 libc_hidden_proto (__ns_name_compress) 77 extern __typeof (ns_name_ntop) __ns_name_ntop; 78 libc_hidden_proto (__ns_name_ntop) 79 extern __typeof (ns_name_pack) __ns_name_pack; 80 libc_hidden_proto (__ns_name_pack) 81 extern __typeof (ns_name_pton) __ns_name_pton; 82 libc_hidden_proto (__ns_name_pton) 83 extern __typeof (ns_name_skip) __ns_name_skip; 84 libc_hidden_proto (__ns_name_skip) 85 extern __typeof (ns_name_uncompress) __ns_name_uncompress; 86 libc_hidden_proto (__ns_name_uncompress) 87 extern __typeof (ns_name_unpack) __ns_name_unpack; 88 libc_hidden_proto (__ns_name_unpack) 89 extern __typeof (ns_samename) __libc_ns_samename; 90 libc_hidden_proto (__libc_ns_samename) 91 92 # endif /* !_ISOMAC */ 93 #endif 94