;##########################################################
;	.inc version of pfhook.h
;	created by van 22.10.2003
;     contact: coderaider@yandex.ru
;##########################################################
option expr32
option casemap:none

INVALID_PF_IF_INDEX	EQU	0ffffffffh

ZERO_PF_IP_ADDR		EQU	0t
PF_FORWARD		EQU	0t
PF_DROP			EQU	1t
PF_PASS			EQU	2t
PF_ICMP_ON_DROP		EQU	3t

;############################################################################

PF_FORWARD_ACTION		TYPEDEF	SWORD

@proto_0			TYPEDEF	PROTO C :PTR IPHeader, :PTR BYTE, :WORD, :WORD, :WORD, :DWORD, :DWORD

PacketFilterExtensionPtr	TYPEDEF	 PTR @proto_0

;#############################################################################
_PF_SET_EXTENSION_HOOK_INFO	STRUCT 2t

	    ExtensionPointer	PacketFilterExtensionPtr	?

_PF_SET_EXTENSION_HOOK_INFO	ENDS
;#############################################################################

PF_SET_EXTENSION_HOOK_INFO	TYPEDEF	_PF_SET_EXTENSION_HOOK_INFO

PPF_SET_EXTENSION_HOOK_INFO	TYPEDEF	PTR _PF_SET_EXTENSION_HOOK_INFO

;#############################################################################
IPHeader 	STRUCT

	iph_verlen	BYTE	?;Version and length 
	iph_tos		BYTE	?;Type of service 
	iph_length	WORD	?;Total datagram length 
	iph_id		WORD	?;Identification 
	iph_offset	WORD	?;Flags, fragment offset 
	iph_ttl		BYTE	?;Time to live 
	iph_protocol	BYTE	?;Protocol 
	iph_xsum	WORD	?;Header checksum 
	iph_src		DWORD	?;Source address 
	iph_dest	DWORD	?;Destination address 

IPHeader	ENDS

;                      Comments:
;
;#    iph_verlen 
;
;Specifies the version and length for the packet. 
;
;#    iph_tos 
;
;Specifies the type of service for the packet. 
;
;#   iph_length 
;
;Size, in bytes, of the packet. 
;
;#   iph_id 
;
;Specifies the identity of the packet. 
;
;#   iph_offset 
;
;Specifies flags and fragment offset for the packet. 
;
;#   iph_ttl 
;
;Specifies the time to live (TTL) for the packet. 
;TTL is a value in the range 0 through 255 that defines
;the scope within which packets should be sent over a network
;using IP. The scope is defined in terms of how local or remote
;a packet's destination is. Each router decrements the TTL by
;one. When the TTL reaches a predefined lower limit, the router
;throws the packet away. 
;
;#   iph_protocol 
;
;Specifies the protocol for the packet. 
;
;#   iph_xsum 
;
;Specifies the header checksum for the packet. 
;
;#   iph_src 
;
;Specifies the IP address of a computer that is the source 
;for the packet. 
;
;#  iph_dest 
;
;Specifies the IP address of a computer that is the destination
;for the packet. 
;DD_IPFLTRDRVR_DEVICE_NAME equ "\\Device\\IPFILTERDRIVER",0
FSCTL_IPFLTRDRVR_BASE		EQU	FILE_DEVICE_NETWORK

_IPFLTRDRVR_CTL_CODE 		macro 	function,method,access
	 EXITM%(CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access))
endm
				
IOCTL_PF_SET_EXTENSION_POINTER 	macro
        EXITM%(_IPFLTRDRVR_CTL_CODE (22,METHOD_BUFFERED, FILE_WRITE_ACCESS))
endm