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

htons.c

Go to the documentation of this file.
00001 /*
00002  * Written by J.T. Conklin .
00003  * Public domain.
00004  *
00005  * CHANGELOG: this file has been modified by Sergio Perez Alcañiz <serpeal@disca.upv.es> 
00006  *            Departamento de Informática de Sistemas y Computadores          
00007  *            Universidad Politécnica de Valencia                             
00008  *            Valencia (Spain)    
00009  *            Date: March 2003                                          
00010  *            
00011  */
00012 
00013 #undef htons
00014 
00015 /*  */
00016 /* htons */
00017 in_port_t
00018 htons(x)
00019         in_port_t x;
00020 {
00021 #if BYTE_ORDER == LITTLE_ENDIAN
00022         u_char *s = (u_char *) &x;
00023         return (in_port_t)(s[0] << 8 | s[1]);
00024 #else
00025         return x;
00026 #endif
00027 }

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