From 2b2e73e28864f954880f7a8eac1d523d01f6774f Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 2 Sep 2007 15:32:03 +0000 Subject: Add ntohs&l() and htons&l git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@324 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/net/uip/uip.h | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'nuttx/include/net') diff --git a/nuttx/include/net/uip/uip.h b/nuttx/include/net/uip/uip.h index d0ed0dd3f..043d6d377 100644 --- a/nuttx/include/net/uip/uip.h +++ b/nuttx/include/net/uip/uip.h @@ -50,6 +50,7 @@ #include #include +#include #include /**************************************************************************** @@ -1125,37 +1126,6 @@ struct uip_udp_conn *uip_udp_new(uip_ipaddr_t *ripaddr, uint16 rport); #define uip_ipaddr4(addr) (htons(((uint16 *)(addr))[1]) & 0xff) -/* Convert 16-bit quantity from host byte order to network byte order. - * - * This macro is primarily used for converting constants from host - * byte order to network byte order. For converting variables to - * network byte order, use the htons() function instead. - */ - -#ifndef HTONS -# if UIP_BYTE_ORDER == UIP_BIG_ENDIAN -# define HTONS(n) (n) -# else /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */ -# define HTONS(n) (uint16)((((uint16) (n)) << 8) | (((uint16) (n)) >> 8)) -# endif /* UIP_BYTE_ORDER == UIP_BIG_ENDIAN */ -#else -#error "HTONS already defined!" -#endif /* HTONS */ - -/* Convert 16-bit quantity from host byte order to network byte order. - * - * This function is primarily used for converting variables from host - * byte order to network byte order. For converting constants to - * network byte order, use the HTONS() macro instead. - */ - -#ifndef htons -uint16 htons(uint16 val); -#endif /* htons */ -#ifndef ntohs -#define ntohs htons -#endif - /* This function is called user code to set up the wait */ #define uip_event_wait(waitflags) uip_event_timedwait(waitflags,0) -- cgit v1.2.3