Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

  1. /*******************************************************************
  2. *
  3. * Copyright (c) 1998-1999 Microsoft Corporation
  4. *
  5. * DESCRIPTION: CTDIOS.H - Commond TDI layer, for NT specific
  6. *
  7. * AUTHOR: Stan Adermann (StanA)
  8. *
  9. * DATE:9/29/1998
  10. *
  11. *******************************************************************/
  12. #ifndef CTDIOS_H
  13. #define CTDIOS_H
  14. #include <tdi.h>
  15. #include <tdikrnl.h>
  16. #include <tdiinfo.h>
  17. #include <ipinfo.h>
  18. #include <ntddip.h>
  19. #include <ntddtcp.h>
  20. // Borrow some defines from WINSOCK.
  21. #define AF_INET 2 /* internetwork: UDP, TCP, etc. */
  22. #define SOCK_STREAM 1 /* stream socket */
  23. #define SOCK_DGRAM 2 /* datagram socket */
  24. #define SOCK_RAW 3 /* raw-protocol interface */
  25. // Winsock-ish host/network byte order converters for short and long integers.
  26. //
  27. #if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
  28. #define htons(x) _byteswap_ushort((USHORT)(x))
  29. #define htonl(x) _byteswap_ulong((ULONG)(x))
  30. #else
  31. #define htons( a ) ((((a) & 0xFF00) >> 8) |\
  32. (((a) & 0x00FF) << 8))
  33. #define htonl( a ) ((((a) & 0xFF000000) >> 24) | \
  34. (((a) & 0x00FF0000) >> 8) | \
  35. (((a) & 0x0000FF00) << 8) | \
  36. (((a) & 0x000000FF) << 24))
  37. #endif
  38. #define ntohs( a ) htons(a)
  39. #define ntohl( a ) htonl(a)
  40. #endif // CTDIOS_H