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
14extern 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
52extern unsigned int __ns_get16 (const unsigned char *) __THROW;
53extern unsigned long __ns_get32 (const unsigned char *) __THROW;
54int __ns_name_ntop (const unsigned char *, char *, size_t) __THROW;
55int __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
61libresolv_hidden_proto (ns_get16)
62libresolv_hidden_proto (ns_get32)
63libresolv_hidden_proto (ns_put16)
64libresolv_hidden_proto (ns_put32)
65libresolv_hidden_proto (ns_initparse)
66libresolv_hidden_proto (ns_skiprr)
67libresolv_hidden_proto (ns_parserr)
68libresolv_hidden_proto (ns_sprintrr)
69libresolv_hidden_proto (ns_sprintrrf)
70libresolv_hidden_proto (ns_samedomain)
71libresolv_hidden_proto (ns_format_ttl)
72
73extern __typeof (ns_makecanon) __libc_ns_makecanon;
74libc_hidden_proto (__libc_ns_makecanon)
75extern __typeof (ns_name_compress) __ns_name_compress;
76libc_hidden_proto (__ns_name_compress)
77extern __typeof (ns_name_ntop) __ns_name_ntop;
78libc_hidden_proto (__ns_name_ntop)
79extern __typeof (ns_name_pack) __ns_name_pack;
80libc_hidden_proto (__ns_name_pack)
81extern __typeof (ns_name_pton) __ns_name_pton;
82libc_hidden_proto (__ns_name_pton)
83extern __typeof (ns_name_skip) __ns_name_skip;
84libc_hidden_proto (__ns_name_skip)
85extern __typeof (ns_name_uncompress) __ns_name_uncompress;
86libc_hidden_proto (__ns_name_uncompress)
87extern __typeof (ns_name_unpack) __ns_name_unpack;
88libc_hidden_proto (__ns_name_unpack)
89extern __typeof (ns_samename) __libc_ns_samename;
90libc_hidden_proto (__libc_ns_samename)
91
92# endif /* !_ISOMAC */
93#endif
94