mbed OS5
Fork of UIPEthernet by
utility/util.h@1:01c2344f98a3, 2014-11-20 (annotated)
- Committer:
- hudakz
- Date:
- Thu Nov 20 21:26:54 2014 +0000
- Revision:
- 1:01c2344f98a3
- Parent:
- uitility/util.h@0:5350a66d5279
rev. 01
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hudakz | 0:5350a66d5279 | 1 | #ifndef UTIL_H |
hudakz | 0:5350a66d5279 | 2 | #define UTIL_H |
hudakz | 0:5350a66d5279 | 3 | |
hudakz | 0:5350a66d5279 | 4 | #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) ) |
hudakz | 0:5350a66d5279 | 5 | #define ntohs(x) htons(x) |
hudakz | 0:5350a66d5279 | 6 | |
hudakz | 0:5350a66d5279 | 7 | #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ |
hudakz | 0:5350a66d5279 | 8 | ((x)<< 8 & 0x00FF0000UL) | \ |
hudakz | 0:5350a66d5279 | 9 | ((x)>> 8 & 0x0000FF00UL) | \ |
hudakz | 0:5350a66d5279 | 10 | ((x)>>24 & 0x000000FFUL) ) |
hudakz | 0:5350a66d5279 | 11 | #define ntohl(x) htonl(x) |
hudakz | 0:5350a66d5279 | 12 | |
hudakz | 0:5350a66d5279 | 13 | #endif |