Updated to fedora-glibc-20060511T1325
[glibc.git] / include / arpa / nameser.h
blob449f5b452e2ab0b249e99a1e67fe973e2380dea3
1 #include <resolv/arpa/nameser.h>
3 /* If the machine allows unaligned access we can do better than using
4 the NS_GET16, NS_GET32, NS_PUT16, and NS_PUT32 macros from the
5 installed header. */
6 #include <string.h>
7 #include <stdint.h>
8 #include <netinet/in.h>
10 #if _STRING_ARCH_unaligned
12 # undef NS_GET16
13 # define NS_GET16(s, cp) \
14 do { \
15 uint16_t *t_cp = (uint16_t *) (cp); \
16 (s) = ntohs (*t_cp); \
17 (cp) += NS_INT16SZ; \
18 } while (0)
20 # undef NS_GET32
21 # define NS_GET32(l, cp) \
22 do { \
23 uint32_t *t_cp = (uint32_t *) (cp); \
24 (l) = ntohl (*t_cp); \
25 (cp) += NS_INT32SZ; \
26 } while (0)
28 # undef NS_PUT16
29 # define NS_PUT16(s, cp) \
30 do { \
31 uint16_t *t_cp = (uint16_t *) (cp); \
32 *t_cp = htons (s); \
33 (cp) += NS_INT16SZ; \
34 } while (0)
36 # undef NS_PUT32
37 # define NS_PUT32(l, cp) \
38 do { \
39 uint32_t *t_cp = (uint32_t *) (cp); \
40 *t_cp = htonl (l); \
41 (cp) += NS_INT32SZ; \
42 } while (0)
44 #endif