Pavel S / UIPEthernet

Fork of UIPEthernet by Zoltan Hudak

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers util.h Source File

util.h

00001 #ifndef UTIL_H
00002 #define UTIL_H
00003 
00004 #define htons(x)    (u16_t) ((((u16_t) (x)) << 8) | (((u16_t) (x)) >> 8))
00005 //#define ntohs(x)    htons(x)
00006 #define htonl(x)    (((x) << 24 & 0xFF000000UL) | ((x) << 8 & 0x00FF0000UL) | ((x) >> 8 & 0x0000FF00UL) | ((x) >> 24 & 0x000000FFUL))
00007 #define ntohl(x)    htonl(x)
00008 #endif