Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

htonl.c File Reference

#include <sys/types.h>
#include <rtl_sched.h>

Include dependency graph for htonl.c:

Go to the source code of this file.

Functions

in_addr_t htonl (in_addr_t x)


Function Documentation

in_addr_t htonl in_addr_t  x  ) 
 

Definition at line 19 of file htonl.c.

References u_char.

00020 {
00021 #if BYTE_ORDER == LITTLE_ENDIAN
00022         u_char *s = (u_char *)&x;
00023         return (in_addr_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]);
00024 #else
00025         return x;
00026 #endif
00027 }


Generated on Wed Jan 14 12:59:04 2004 for RTL-lwIP-0.4 by doxygen 1.3.4