2 * Functions to convert between host and network byte order.
4 * Copyright (C) 2003-2006 by Erik Andersen <andersen@uclibc.org>
6 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
9 #include <netinet/in.h>
16 #if __BYTE_ORDER != __BIG_ENDIAN && __BYTE_ORDER != __LITTLE_ENDIAN
17 # error "You seem to have an unsupported byteorder"
20 uint32_t ntohl (uint32_t x
)
22 #if __BYTE_ORDER == __BIG_ENDIAN
28 libc_hidden_def(ntohl
)
29 strong_alias(ntohl
,htonl
)
30 libc_hidden_def(htonl
)
32 uint16_t ntohs (uint16_t x
)
34 #if __BYTE_ORDER == __BIG_ENDIAN
40 libc_hidden_def(ntohs
)
41 strong_alias(ntohs
,htons
)
42 libc_hidden_def(htons
)