From fcf0b31fb90dd203148dab1c74b387f23fd9c95e Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Tue, 26 Mar 2019 21:50:11 -0400 Subject: [PATCH] bootloader: Add the network endianness macros to NetDefs.h. This file contains all the protocol- and interface-related definitions, so this seems to be where they belong. Required following previous commits. --- headers/private/kernel/boot/net/NetDefs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/headers/private/kernel/boot/net/NetDefs.h b/headers/private/kernel/boot/net/NetDefs.h index c46bc0e320..8363d3b7ab 100644 --- a/headers/private/kernel/boot/net/NetDefs.h +++ b/headers/private/kernel/boot/net/NetDefs.h @@ -15,6 +15,15 @@ #include +// Network endianness +#ifndef htonl +# define htonl(x) B_HOST_TO_BENDIAN_INT32(x) +# define ntohl(x) B_BENDIAN_TO_HOST_INT32(x) +# define htons(x) B_HOST_TO_BENDIAN_INT16(x) +# define ntohs(x) B_BENDIAN_TO_HOST_INT16(x) +#endif + + // Ethernet #define ETH_ALEN 6