⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 util.h

📁 用Delphi实现的防火墙,可实现象天网一样的功能.
💻 H
字号:
#ifndef _UTILITY_H_
#define _UTILITY_H_

//
// Force undef of VTOOLSD For Windows 98 DDK Build
// -----------------------------------------------
// See comments in PCAIPLCE.H.
//
#ifdef NO_VTOOLSD
#undef VTOOLSD
#endif

//
// Includes For VtoolsD Build
//
#ifdef VTOOLSD
//#include <vtoolsc.h>

//
// Else Includes For Windows 98 DDK Build
//
#else
#include <ndis.h>
#endif

//#include "DDKLBLInc.h"

// Copyright And Configuration Management ----------------------------------
//
//                 Header For Utility Functions - Util.h
//      IP Link Characteristics Emulator Pseudo-Imtermediate (PIM) Driver
//
//   Copyright (c) 1989 - 2001 Printing Communications Associates, Inc.
//                               - PCAUSA -
//
//                             Thomas F. Divine
//                           4201 Brunswick Court
//                        Smyrna, Georgia 30080 USA
//                              (770) 432-4580
//                            tdivine@pcausa.com
//
// End ---------------------------------------------------------------------

#ifdef __cplusplus
extern "C" {
#endif

/////////////////////////////////////////////////////////////////////////////
//                   Network Data Access Routines Routines                 //
/////////////////////////////////////////////////////////////////////////////


void  UTIL_FreeMemory(void* p);

void*  UTIL_AllocateMemory(unsigned int size);

void UTIL_CountPacket (USHORT ptype,char direct,char action,int packsize);

int	UTIL_GetCurrentTime(void);

UCHAR	UTIL_MatchTcpRule(struct ip *pIpHeader, struct tcphdr *pTcpHeader, UCHAR Direct);

UCHAR	UTIL_MatchUdpRule(struct ip *pIpHeader, struct udphdr *pUdpHeader, UCHAR Direct);

UCHAR	UTIL_MatchIcmpRule(struct ip *pIpHeader, struct icmp *pIcmpHeader, UCHAR Direct);


UCHAR	UTIL_MatchIpRule(struct ip *pIpHeader, UCHAR Direct);

UCHAR UTIL_MatchRule(PNDIS_PACKET Packet, UCHAR Direct);


VOID UTIL_ReadOnPacket(
   PNDIS_PACKET Packet,
   PUCHAR lpBuffer,
   ULONG nNumberOfBytesToRead,
   ULONG nOffset,                // Byte Offset, Starting With MAC Header
   PULONG lpNumberOfBytesRead
   );

ULONG UTIL_htonl( ULONG hostlong );
ULONG UTIL_ntohl( ULONG netlong );

USHORT UTIL_htons( USHORT hostshort );
USHORT UTIL_ntohs( USHORT netshort );

USHORT in_cksum( PUCHAR pStartingByte, int nByteCount );

void do_nothing();

void UTIL_AddKeyword(PVOID keyword,ULONG buflen);

void UTIL_DelKeyword(void);

BOOLEAN UTIL_ExamineData(
			char	*data,
			int		datasize,
			USHORT	nSport,
			USHORT	nDport
			);


BOOLEAN UTIL_AddAllrules(struct All_Rules *pallrules);

BOOLEAN UTIL_DelAllrules(void);

#ifndef FIELD_OFFSET
#define FIELD_OFFSET(type, field)    ((LONG)&(((type *)0)->field))
#endif


/////////////////////////////////////////////////////////////////////////////
//                           Debug Routines                                //
/////////////////////////////////////////////////////////////////////////////

#ifdef DEBUG

#endif // DEBUG

#ifdef __cplusplus
}
#endif

#endif // _UTILITY_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -