资源简介
NetFilter SDK 1.4.0.0 + ProtocolFilters 1.0.8.1 - Full Sources.7z
代码片段和文件信息
//
// NetFilterSDK
// Copyright (C) 2009 Vitaly Sidorov
// All rights reserved.
//
// This file is a part of the NetFilter SDK.
// The code and information is provided “as-is“ without
// warranty of any kind either expressed or implied.
//
#include “stdinc.h“
#include “addr.h“
#include “gvars.h“
#include “mempools.h“
#include “tcpconn.h“
#include “tcprecv.h“
#include “tcpsend.h“
#include “udprecv.h“
#include “udpsend.h“
#include “packet.h“
#include “ctrlio.h“
#ifdef _WPPTRACE
#include “addr.tmh“
#endif
#define MAX_ADDR_POOL_SIZE 0
static NTSTATUS addr_setConnInfo(PNF_UDP_CONN_INFO pci PADDROBJ pAddr)
{
memset(pci 0 sizeof(NF_UDP_CONN_INFO));
pci->processId = (ULONG)pAddr->processId;
pci->ip_family = *(short*)pAddr->localAddr;
RtlCopyMemory(pci->localAddress pAddr->localAddr sizeof(pci->localAddress));
return STATUS_SUCCESS;
}
static PADDROBJ addr_alloc(PIO_STACK_LOCATION irpSp void * context int protocol PDEVICE_object pLowerDevice)
{
PADDROBJ pAddr;
pAddr = (PADDROBJ)mp_alloc(sizeof(ADDROBJ));
if (!pAddr)
{
return NULL;
}
#if DBG
g_vars.nAddr++;
KdPrint((“[counter] nAddr=%d\n“ g_vars.nAddr));
#endif
RtlZeroMemory(pAddr sizeof(ADDROBJ));
pAddr->lowerDevice = pLowerDevice;
pAddr->fileobject = (HASH_ID)irpSp->Fileobject;
pAddr->protocol = protocol;
// Assign next unique identifier
g_vars.nextAddrId++;
while ((g_vars.nextAddrId == 0) ||
ht_find_entry(g_vars.phtAddrById g_vars.nextAddrId))
{
g_vars.nextAddrId++;
}
pAddr->id = g_vars.nextAddrId;
pAddr->processId = *(ULONG*)&context;
sl_init(&pAddr->lock);
if (protocol == IPPROTO_UDP)
{
InitializeListHead(&pAddr->pendedReceivedPackets);
InitializeListHead(&pAddr->receivedPackets);
InitializeListHead(&pAddr->pendedReceiveRequests);
InitializeListHead(&pAddr->pendedSendPackets);
InitializeListHead(&pAddr->sendPackets);
InitializeListHead(&pAddr->pendedSendRequests);
InitializeListHead(&pAddr->pendedConnectRequest);
}
return pAddr;
}
void addr_free_queues(PADDROBJ pAddr)
{
PNF_PACKET pPacket;
PLIST_ENTRY pListEntry;
PIRP irp;
KIRQL irqld;
if (!pAddr)
return;
KdPrint((DPREFIX“addr_free_queues[%I64d]\n“ pAddr->id));
if (pAddr->protocol == IPPROTO_UDP)
{
sl_lock(&pAddr->lock &irqld);
while (!IsListEmpty(&pAddr->receivedPackets))
{
pPacket = (PNF_PACKET)RemoveHeadList(&pAddr->receivedPackets);
KdPrint((DPREFIX“addr_free[%I64d]: Orphan receivedPackets NF_PACKET - status=0x%8.8x bytes=%d\n“
pAddr->id pPacket->ioStatus pPacket->dataSize ));
nf_packet_free(pPacket);
}
while (!IsListEmpty(&pAddr->pendedReceivedPackets))
{
pPacket = (PNF_PACKET)RemoveHeadList(&pAddr->pendedReceivedPackets);
KdPrint((DPREFIX“addr_free[%I64d]: Orphan pendedReceivedPackets NF_PACKET - status=0x%8.8x bytes=%d\n“
相关资源
- Datastead_TVideoGrabber_Video_SDK_v10.8.1.2_fo
- TeeChart Pro v7 注册版 (图表组件)
- Delphi.7控件实用程序设计100例随书光盘
- raize5.51-1
- Delphi BusinessSkinForm 最新源码版本v11.
- nrCommLib Pro v 9.48 XE10.2_delphi10.3下可用
- Delphi BusinessSkinForm 最全皮肤库 256套皮
- 29997_bde_installer_for_rad_studio_delphi_c_bu
- EurekaLog 7.5.1.0 for delphi 10.2 Tokyo
- 洗车管理系统源码
- 精典源码Delphi054:海盗远控源码.rar
- 《Delphi 数字图像处理及高级应用》(
- delphi TeeChart8.0控件
- 户籍管理 DELPHI
- GigaSoft.ProEssentials.Pro.V9.5.0.10.Inc.Keyge
- layuiDemo增删改查动态增删组件带后台
- JustMock_2018_2_511_5_Dev_Downloadly.ir.rar
- delphi算法与数据结构
- Steema TeeChart Pro VCL FMX Source Code 2019.2
-
Remob
jects Remoting SDK for Delphi - 9.0.97 - unigui 最好的输出excel控件 TMS.FlexCel.
- 《Delphi COM深入编程》pdg电子书+书中源
- Richview13.01破解版
- Raize.6.2.3.Install.rar
- Delphi组件大全
- Delphi Handbooks (包含2007-XE)
- FastReport_4.9.32_for_d7
- Delphi数据库系统开发课程设计8个系统
- kbmmw4.93 企业版
- 精典源码Delphi095:NiceERP企业管理系统
评论
共有 条评论