reactos/drivers/network/lan/include/net_wh.h
Cameron Gutman 29fa274d6d - Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers)
 - If someone wants to delete aicom-network-fixes, they are welcome to
 - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea

svn path=/branches/aicom-network-branch/; revision=44353
2009-12-02 03:23:19 +00:00

51 lines
1.2 KiB
C

#ifndef _NET_WH_H
#define _NET_WH_H
#ifdef i386
/* DWORD network to host byte order conversion for i386 */
#define DN2H(dw) \
((((dw) & 0xFF000000L) >> 24) | \
(((dw) & 0x00FF0000L) >> 8) | \
(((dw) & 0x0000FF00L) << 8) | \
(((dw) & 0x000000FFL) << 24))
/* DWORD host to network byte order conversion for i386 */
#define DH2N(dw) \
((((dw) & 0xFF000000L) >> 24) | \
(((dw) & 0x00FF0000L) >> 8) | \
(((dw) & 0x0000FF00L) << 8) | \
(((dw) & 0x000000FFL) << 24))
/* WORD network to host order conversion for i386 */
#define WN2H(w) \
((((w) & 0xFF00) >> 8) | \
(((w) & 0x00FF) << 8))
/* WORD host to network byte order conversion for i386 */
#define WH2N(w) \
((((w) & 0xFF00) >> 8) | \
(((w) & 0x00FF) << 8))
#else /* i386 */
/* DWORD network to host byte order conversion for other architectures */
#define DN2H(dw) \
(dw)
/* DWORD host to network byte order conversion for other architectures */
#define DH2N(dw) \
(dw)
/* WORD network to host order conversion for other architectures */
#define WN2H(w) \
(w)
/* WORD host to network byte order conversion for other architectures */
#define WH2N(w) \
(w)
#endif /* i386 */
#endif/*_NET_WH_H*/