summaryrefslogtreecommitdiff
path: root/network.h
blob: 012bc8a55e00b171e8c91de5ddc7902258749b63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (c) 2004 Security Architects Corporation. All rights reserved.
 *
 * Module Name:
 *
 *		network.h
 *
 * Abstract:
 *
 *		This module defines various types used by the Transport Driver Interface (TDI) network hooking routines.
 *
 * Author:
 *
 *		Eugene Tsyrklevich 12-Mar-2004
 *
 * Revision History:
 *
 *		None.
 */


#ifndef __NETWORK_H__
#define __NETWORK_H__



#define	NET_DEVICE_TYPE_TCP	1
#define	NET_DEVICE_TYPE_UDP	2
#define	NET_DEVICE_TYPE_IP	3


typedef struct _TDI_CALLBACK
{
	PIO_COMPLETION_ROUTINE	Routine;
	PVOID					Context;

} TDI_CALLBACK, *PTDI_CALLBACK;


typedef int (*TDI_IOCTL_PFUNC) (IN PIRP pIrp, IN PIO_STACK_LOCATION pIrpStack, OUT PTDI_CALLBACK pCompletion, IN ULONG DeviceType);

typedef struct _TDI_IOCTL
{
	UCHAR					MinorFunction;
	PCHAR					Description;
	TDI_IOCTL_PFUNC			pfRoutine;

} TDI_IOCTL, PTDI_IOCTL;


BOOLEAN	 TDIDispatch(PDEVICE_OBJECT pDeviceObject, PIRP pIrp, NTSTATUS *status);
NTSTATUS TDICreate(IN PDEVICE_OBJECT pDeviceObject, IN PIRP pIrp, IN PIO_STACK_LOCATION pIrpStack, OUT PTDI_CALLBACK pCompletion);
NTSTATUS InstallNetworkHooks(PDRIVER_OBJECT pDriverObject);
void	 RemoveNetworkHooks(PDRIVER_OBJECT pDriverObject);


#endif	/* __NETWORK_H__ */