aboutsummaryrefslogtreecommitdiffstats
path: root/com32/include/netinet/in.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-04-02 21:08:54 -0700
committerH. Peter Anvin <hpa@zytor.com>2013-04-02 21:13:53 -0700
commit8e927a77d83e5182baff3ab152696065c3b50345 (patch)
tree5a15955fdc4d03426c2991097eb1e7ab3c92449e /com32/include/netinet/in.h
parent01408738c1aafbcf669b289b85795c3aa9dbec2a (diff)
downloadsyslinux-8e927a77d83e5182baff3ab152696065c3b50345.tar.gz
syslinux-8e927a77d83e5182baff3ab152696065c3b50345.tar.xz
syslinux-8e927a77d83e5182baff3ab152696065c3b50345.zip
Generic facilities for byteswapping and unaligned references
For future portability, add functions to access both littleendian and bigendian numbers, and to perform unaligned memory references. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32/include/netinet/in.h')
-rw-r--r--com32/include/netinet/in.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/com32/include/netinet/in.h b/com32/include/netinet/in.h
index b24f8046..0a0049fd 100644
--- a/com32/include/netinet/in.h
+++ b/com32/include/netinet/in.h
@@ -8,12 +8,12 @@
#include <stdint.h>
#include <byteswap.h>
-#define htons(x) bswap_16(x)
-#define ntohs(x) bswap_16(x)
-#define htonl(x) bswap_32(x)
-#define ntohl(x) bswap_32(x)
-#define htonq(x) bswap_64(x)
-#define ntohq(x) bswap_64(x)
+#define htons(x) cpu_to_be16(x)
+#define ntohs(x) be16_to_cpu(x)
+#define htonl(x) cpu_to_be32(x)
+#define ntohl(x) be32_to_cpu(x)
+#define htonq(x) cpu_to_be64(x)
+#define ntohq(x) be64_to_cpu(x)
typedef uint32_t in_addr_t;
typedef uint16_t in_port_t;