PfBindInterfaceToIndex(hIF,pipaddrtable->table[2].dwIndex,PF_IPV4,(PBYTE)&ip))
改调用为何不起作用,看起来与PfBindInterfaceToIPAddress并无区别?

解决方案 »

  1.   

    hehe,我,没经验的来参观一下
      

  2.   

    PF_FILTER_DESCRIPTOR
    The PF_FILTER_DESCRIPTOR structure contains the information that defines a packet filter.typedef struct _PF_FILTER_DESCRIPTOR {
      DWORD          dwFilterFlags;    // see below
      DWORD          dwRule;           // copied into the log when appropriate
      PFADDRESSTYPE  pfatType;
      PBYTE          SrcAddr;
      PBYTE          SrcMask;
      PBYTE          DstAddr;
      PBYTE          DstMask;
      DWORD          dwProtocol;
      DWORD          fLateBound;
      WORD           wSrcPort;
      WORD           wDstPort;
      WORD           wSrcPortHighRange;
      WORD           wDstPortHighRange;
    } PF_FILTER_DESCRIPTOR, *PPF_FILTER_DESCRIPTOR;
    Members
    dwFilterFlags 
    Currently only a single flag is supported for this member: 
    FD_FLAGS_NOSYN dwRule 
    Specifies the rule for the filter. 
    pfatType 
    Specifies the address type for the filter. This member is of type PFADDRESSTYPE. 
    SrcAddr 
    Specifies the source address of the packets to filter. 
    SrcMask 
    Specifies the subnet mask for the source address. 
    DstAddr 
    Specifies the destination address of the packets to filter. 
    DstMask 
    Specifies the subnet mask for the destination address. 
    dwProtocol 
    Specifies the protocols to filter. This member can be one of the following values. Value Meaning 
    FILTER_PROTO_ANY  All protocols 
    FILTER_PROTO_ICMP Internet Control Message Protocol 
    FILTER_PROTO_TCP  Transmission Control Protocol 
    FILTER_PROTO_UDP  User Datagram Protocol 
    fLateBound 
    Specifies the address information that should be updated when the filter is rebound. This member can be any combination of the following flags: 
    LB_SRC_ADDR_USE_SRCADDR_FLAG
    LB_SRC_ADDR_USE_DSTADDR_FLAG
    LB_DST_ADDR_USE_SRCADDR_FLAG
    LB_DST_ADDR_USE_DSTADDR_FLAG wSrcPort 
    Specifies the source port of the packets to filter. 
    wDstPort 
    Specifies the destination port of the packets to filter. 
    wSrcPortHighRange 
    Specifies the high range of the source port of packets to filter. 
    wDstPortHighRange 
    Specifies the high range of the destination port of packets to filter. 
    Requirements 
      Windows NT/2000 or later: Requires Windows 2000 or later.
      Header: Declared in Fltdefs.h.好像还是比较详细的嘛