阅读:2518回复:1
关于TDIFW开源防火墙中获取数据包内容的问题!!
最近研究tdifw的源代码,但是其中只涉及到了对包头信息的获取,对于数据包的内容的获取有点疑惑,经过调试初步判断:
tcp数据发送在tdi_send函数中 udp数据发送在tdi_send函数中 现在的问题是: tcp数据接受在tdi_receive函数中还是在tdi_receive_complete函数中能够读取数据包的内容呢? 具体如何读取数据包的内容呢? 比如: int tdi_send(PIRP irp, PIO_STACK_LOCATION irps, struct completion *completion) { TDI_REQUEST_KERNEL_SEND *param = (TDI_REQUEST_KERNEL_SEND *)(&irps->Parameters); struct ot_entry *ote_conn; KIRQL irql; __asm int 3; KdPrint(("[tdi_fw] tdi_send: connobj: 0x%x; SendLength: %u; SendFlags: 0x%x\n", irps->FileObject, param->SendLength, param->SendFlags)); ote_conn = ot_find_fileobj(irps->FileObject, &irql); if (ote_conn != NULL) { ULONG bytes = param->SendLength; ote_conn->bytes_out += bytes; // traffic stats KeAcquireSpinLockAtDpcLevel(&g_traffic_guard); g_traffic[TRAFFIC_TOTAL_OUT] += bytes; if (ote_conn->log_disconnect) g_traffic[TRAFFIC_COUNTED_OUT] += bytes; KeReleaseSpinLockFromDpcLevel(&g_traffic_guard); KeReleaseSpinLock(&g_ot_hash_guard, irql); } // TODO: process TDI_SEND_AND_DISCONNECT flag (used by IIS for example) return FILTER_ALLOW; } 数据包内容的长度是param->SendLength,哪数据包的内容在什么地方呢? |
|
沙发#
发布于:2008-03-10 16:16
顶一下,怕沉了,在线等。。。
|
|