diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-02 15:32:03 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-09-02 15:32:03 +0000 |
commit | 2b2e73e28864f954880f7a8eac1d523d01f6774f (patch) | |
tree | 38515c77a611f98613ff7683fe68fdfaae420eee /nuttx/include | |
parent | 0fb0a1d66a5408016fbca4ea5bc72fca9327aed5 (diff) | |
download | px4-nuttx-2b2e73e28864f954880f7a8eac1d523d01f6774f.tar.gz px4-nuttx-2b2e73e28864f954880f7a8eac1d523d01f6774f.tar.bz2 px4-nuttx-2b2e73e28864f954880f7a8eac1d523d01f6774f.zip |
Add ntohs&l() and htons&l
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@324 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/net/uip/uip.h | 32 | ||||
-rw-r--r-- | nuttx/include/netinet/in.h | 2 |
2 files changed, 2 insertions, 32 deletions
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 <sys/types.h> #include <nuttx/config.h> +#include <arpa/inet.h> #include <net/uip/uipopt.h> /**************************************************************************** @@ -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) diff --git a/nuttx/include/netinet/in.h b/nuttx/include/netinet/in.h index ea6a6ab51..e2ed78363 100644 --- a/nuttx/include/netinet/in.h +++ b/nuttx/include/netinet/in.h @@ -40,7 +40,7 @@ * Included Files ****************************************************************************/ -#include <sys/type.h> +#include <sys/types.h> /**************************************************************************** * Public Type Definitions |