Q
qsdl
Unregistered / Unconfirmed
GUEST, unregistred user!
dwSrcMask := $FFFFFFFF;
srcMask:= $FFFFFFFF;
DestAdd:=$0;
PfCreateInterface(0,
PF_ACTION_FORWARD, // PF_ACTION_DROP,
PF_ACTION_FORWARD,// PF_ACTION_FORWARD ,
FALSE,
TRUE,
hInterface);
inFilter.dwFilterFlags := FD_FLAGS_NOSYN;
inFilter.dwRule := 0;
inFilter.pfatType := PF_IPV4;
inFilter.SrcAddr :=nil;//@srcMask;
inFilter.SrcMask := @srcMask;
inFilter.wSrcPort :=FILTER_TCPUDP_PORT_ANY ;//iSrcPort;
inFilter.wSrcPortHighRange :=FILTER_TCPUDP_PORT_ANY; //iSrcPort;
inFilter.DstAddr:=@DestAdd;//nil;
inFilter.DstMask:=@DestAdd;// nil;
inFilter.wDstPort :=80
inFilter.wDstPortHighRange :=80;
inFilter.fLateBound :=LB_DST_ADDR_USE_DSTADDR_FLAG or LB_SRC_ADDR_USE_DSTADDR_FLAG;
inFilter.dwProtocol := FILTER_PROTO_ANY;
PfBindInterfaceToIPAddress(hInterface, PF_IPV4, @localIp);
PfAddFiltersToInterface(hInterface, 1, @inFilter,1, @inFilter,@fHandle);
------------
---
IPhelp 的包过滤,网上代码很多,可是实际上发现没有任何效果,
如果PfCreateInterface的PF_ACTION_FORWARD都改成DROP[?][?][?]的话,那所有的包都过滤了,下面的filter也就无效了
可是改成PF_ACTION_FORWARD 那不管下面的filter怎么设置 ,所有的包却都不会被过滤。
谁知道怎么回事?
srcMask:= $FFFFFFFF;
DestAdd:=$0;
PfCreateInterface(0,
PF_ACTION_FORWARD, // PF_ACTION_DROP,
PF_ACTION_FORWARD,// PF_ACTION_FORWARD ,
FALSE,
TRUE,
hInterface);
inFilter.dwFilterFlags := FD_FLAGS_NOSYN;
inFilter.dwRule := 0;
inFilter.pfatType := PF_IPV4;
inFilter.SrcAddr :=nil;//@srcMask;
inFilter.SrcMask := @srcMask;
inFilter.wSrcPort :=FILTER_TCPUDP_PORT_ANY ;//iSrcPort;
inFilter.wSrcPortHighRange :=FILTER_TCPUDP_PORT_ANY; //iSrcPort;
inFilter.DstAddr:=@DestAdd;//nil;
inFilter.DstMask:=@DestAdd;// nil;
inFilter.wDstPort :=80
inFilter.wDstPortHighRange :=80;
inFilter.fLateBound :=LB_DST_ADDR_USE_DSTADDR_FLAG or LB_SRC_ADDR_USE_DSTADDR_FLAG;
inFilter.dwProtocol := FILTER_PROTO_ANY;
PfBindInterfaceToIPAddress(hInterface, PF_IPV4, @localIp);
PfAddFiltersToInterface(hInterface, 1, @inFilter,1, @inFilter,@fHandle);
------------
代码:
IPhelp 的包过滤,网上代码很多,可是实际上发现没有任何效果,
如果PfCreateInterface的PF_ACTION_FORWARD都改成DROP[?][?][?]的话,那所有的包都过滤了,下面的filter也就无效了
可是改成PF_ACTION_FORWARD 那不管下面的filter怎么设置 ,所有的包却都不会被过滤。
谁知道怎么回事?