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.

69 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. pfhook.h
  5. Abstract:
  6. Header file for Packet Filter driver extension hook.
  7. --*/
  8. #ifndef _PF_EXTEND_DEFS_H_
  9. #define _PF_EXTEND_DEFS_H_
  10. #define INVALID_PF_IF_INDEX 0xffffffff
  11. #define ZERO_PF_IP_ADDR 0
  12. //
  13. // Enumeration constants for values that may be returned by an extension
  14. // routine.
  15. //
  16. typedef enum _PF_FORWARD_ACTION
  17. {
  18. PF_FORWARD = 0,
  19. PF_DROP = 1,
  20. PF_PASS = 2,
  21. PF_ICMP_ON_DROP = 3
  22. } PF_FORWARD_ACTION;
  23. //
  24. // Definiton for a filter routine callout.
  25. //
  26. typedef PF_FORWARD_ACTION (*PacketFilterExtensionPtr)(
  27. unsigned char *PacketHeader,
  28. unsigned char *Packet,
  29. unsigned int PacketLength,
  30. unsigned int RecvInterfaceIndex,
  31. unsigned int SendInterfaceIndex,
  32. IPAddr RecvLinkNextHop,
  33. IPAddr SendLinkNextHop
  34. );
  35. //
  36. // Structure to be passed to the IOCTL_PF_SET_EXTENSION_POINTER call
  37. //
  38. typedef struct _PF_SET_EXTENSION_HOOK_INFO
  39. {
  40. PacketFilterExtensionPtr ExtensionPointer;
  41. } PF_SET_EXTENSION_HOOK_INFO, *PPF_SET_EXTENSION_HOOK_INFO;
  42. #define DD_IPFLTRDRVR_DEVICE_NAME L"\\Device\\IPFILTERDRIVER"
  43. #define FSCTL_IPFLTRDRVR_BASE FILE_DEVICE_NETWORK
  44. #define _IPFLTRDRVR_CTL_CODE(function, method, access) \
  45. CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access)
  46. #define IOCTL_PF_SET_EXTENSION_POINTER \
  47. _IPFLTRDRVR_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  48. #endif // _PF_EXTEND_DEFS_H_