Leaked source code of windows server 2003
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.

107 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. NsIcmp.h
  5. Abstract:
  6. Declarations for IpSec NAT shim ICMP management
  7. Author:
  8. Jonathan Burstein (jonburs) 11-July-2001
  9. Environment:
  10. Kernel mode
  11. Revision History:
  12. --*/
  13. #pragma once
  14. //
  15. // Structure: NS_ICMP_ENTRY
  16. //
  17. // This structure stores the information needed to process ICMP
  18. // request-response messages. An entry will be created for an
  19. // inbound request message.
  20. //
  21. // If necessary the ICMP logic will translate the ICMP identifier
  22. // to avoid conflicts.
  23. //
  24. // The timer routine removes entries from the ICMP list when they
  25. // have surpassed the inactivity threshold.
  26. //
  27. // All access to the ICMP list or entires must happen while holding
  28. // the ICMP list lock.
  29. //
  30. typedef struct _NS_ICMP_ENTRY
  31. {
  32. LIST_ENTRY Link;
  33. LONG64 l64LastAccessTime;
  34. ULONG64 ul64AddressKey;
  35. USHORT usOriginalId;
  36. USHORT usTranslatedId;
  37. PVOID pvIpSecContext;
  38. } NS_ICMP_ENTRY, *PNS_ICMP_ENTRY;
  39. //
  40. // Defines the depth of the lookaside list for allocating ICMP entries
  41. //
  42. #define NS_ICMP_LOOKASIDE_DEPTH 10
  43. //
  44. // Global Variables
  45. //
  46. extern LIST_ENTRY NsIcmpList;
  47. extern KSPIN_LOCK NsIcmpLock;
  48. extern NPAGED_LOOKASIDE_LIST NsIcmpLookasideList;
  49. //
  50. // ICMP mapping allocation macros
  51. //
  52. #define ALLOCATE_ICMP_BLOCK() \
  53. ExAllocateFromNPagedLookasideList(&NsIcmpLookasideList)
  54. #define FREE_ICMP_BLOCK(Block) \
  55. ExFreeToNPagedLookasideList(&NsIcmpLookasideList,(Block))
  56. //
  57. // Function Prototypes
  58. //
  59. NTSTATUS
  60. NsInitializeIcmpManagement(
  61. VOID
  62. );
  63. NTSTATUS
  64. FASTCALL
  65. NsProcessIncomingIcmpPacket(
  66. PNS_PACKET_CONTEXT pContext,
  67. PVOID pvIpSecContext
  68. );
  69. NTSTATUS
  70. FASTCALL
  71. NsProcessOutgoingIcmpPacket(
  72. PNS_PACKET_CONTEXT pContext,
  73. PVOID *ppvIpSecContext
  74. );
  75. VOID
  76. NsShutdownIcmpManagement(
  77. VOID
  78. );