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.

126 lines
2.3 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. entry.h
  5. Abstract:
  6. This module contains declarations for the NAT's driver-entry.
  7. Also included are declarations for data defined in 'entry.c'.
  8. Author:
  9. Abolade Gbadegesin (t-abolag) 13-July-1997
  10. Revision History:
  11. --*/
  12. #ifndef _NAT_ENTRY_H_
  13. #define _NAT_ENTRY_H_
  14. //
  15. // CONSTANT DECLARATIONS
  16. //
  17. #define DEFAULT_TCP_TIMEOUT (24 * 60 * 60)
  18. #define DEFAULT_UDP_TIMEOUT 60
  19. #define DEFAULT_START_PORT NTOHS(1025)
  20. #define DEFAULT_END_PORT NTOHS(3000)
  21. //
  22. // GLOBAL DATA DECLARATIONS
  23. //
  24. extern BOOLEAN AllowInboundNonUnicastTraffic;
  25. extern COMPONENT_REFERENCE ComponentReference;
  26. extern WCHAR ExternalName[];
  27. extern PDEVICE_OBJECT IpDeviceObject;
  28. extern PFILE_OBJECT IpFileObject;
  29. extern PDEVICE_OBJECT NatDeviceObject;
  30. #if NAT_WMI
  31. extern UNICODE_STRING NatRegistryPath;
  32. #endif
  33. extern USHORT ReservedPortsLowerRange;
  34. extern USHORT ReservedPortsUpperRange;
  35. extern PDEVICE_OBJECT TcpDeviceObject;
  36. extern PFILE_OBJECT TcpFileObject;
  37. extern HANDLE TcpDeviceHandle;
  38. extern ULONG TcpTimeoutSeconds;
  39. extern ULONG TraceClassesEnabled;
  40. extern ULONG UdpTimeoutSeconds;
  41. //
  42. // MACRO DEFINITIONS
  43. //
  44. //
  45. // Component-reference macros
  46. //
  47. #define REFERENCE_NAT() \
  48. REFERENCE_COMPONENT(&ComponentReference)
  49. #define REFERENCE_NAT_OR_RETURN(retcode) \
  50. REFERENCE_COMPONENT_OR_RETURN(&ComponentReference,retcode)
  51. #define DEREFERENCE_NAT() \
  52. DEREFERENCE_COMPONENT(&ComponentReference)
  53. #define DEREFERENCE_NAT_AND_RETURN(retcode) \
  54. DEREFERENCE_COMPONENT_AND_RETURN(&ComponentReference, retcode)
  55. //
  56. // Macro for composing a LONG64 from two LONGs.
  57. //
  58. #define MAKE_LONG64(lo,hi) ((lo) | ((LONG64)(hi) << 32))
  59. //
  60. // Macros for handling network-order shorts and longs
  61. //
  62. #define ADDRESS_BYTES(a) \
  63. ((a) & 0x000000FF), (((a) & 0x0000FF00) >> 8), \
  64. (((a) & 0x00FF0000) >> 16), (((a) & 0xFF000000) >> 24)
  65. //
  66. // Define a macro version of ntohs which can be applied to constants,
  67. // and which can thus be computed at compile time.
  68. //
  69. #define NTOHS(p) ((((p) & 0xFF00) >> 8) | (((UCHAR)(p) << 8)))
  70. //
  71. // FUNCTION PROTOTYPES
  72. //
  73. NTSTATUS
  74. NatInitiateTranslation(
  75. VOID
  76. );
  77. VOID
  78. NatTerminateTranslation(
  79. VOID
  80. );
  81. extern
  82. ULONG
  83. tcpxsum (
  84. IN ULONG Checksum,
  85. IN PUCHAR Source,
  86. IN ULONG Length
  87. );
  88. #endif // _NAT_ENTRY_H_