src/SeeDll/Packet32.c
/*!
  \brief Sets a hardware filter on the incoming packets.
  \param AdapterObject Pointer to an _ADAPTER structure.
  \param Filter The identifier of the filter.
  \return If the function succeeds, the return value is nonzero.

  The filter defined with this filter is evaluated by the network card, at a level that is under the NPF
  device driver. Here is a list of the most useful hardware filters (A complete list can be found in ntddndis.h):

  - NDIS_PACKET_TYPE_PROMISCUOUS: sets promiscuous mode. Every incoming packet is accepted by the adapter. 
  - NDIS_PACKET_TYPE_DIRECTED: only packets directed to the workstation's adapter are accepted. 
  - NDIS_PACKET_TYPE_BROADCAST: only broadcast packets are accepted. 
  - NDIS_PACKET_TYPE_MULTICAST: only multicast packets belonging to groups of which this adapter is a member are accepted. 
  - NDIS_PACKET_TYPE_ALL_MULTICAST: every multicast packet is accepted. 
  - NDIS_PACKET_TYPE_ALL_LOCAL: all local packets, i.e. NDIS_PACKET_TYPE_DIRECTED + NDIS_PACKET_TYPE_BROADCAST + NDIS_PACKET_TYPE_MULTICAST 
*/
\brief Sets a hardware filter on the incoming packets.
\param AdapterObject Pointer to an _ADAPTER structure.
\param Filter The identifier of the filter.
\return If the function succeeds, the return value is nonzero.

The filter defined with this filter is evaluated by the network card, at a level that is under the NPF
device driver. Here is a list of the most useful hardware filters (A complete list can be found in ntddndis.h).

sets promiscuous mode. Every incoming packet is accepted by the adapter.
NDIS_PACKET_TYPE_DIRECTED: only packets directed to the workstation's adapter are accepted.
NDIS_PACKET_TYPE_BROADCAST: only broadcast packets are accepted.
NDIS_PACKET_TYPE_MULTICAST: only multicast packets belonging to groups of which this adapter is a member are accepted.
NDIS_PACKET_TYPE_ALL_MULTICAST: every multicast packet is accepted.
NDIS_PACKET_TYPE_ALL_LOCAL: all local packets, i.e.
\ brief Sets a hardware filter on the incoming packets . \ param AdapterObject Pointer to an _ADAPTER structure . \ param Filter The identifier of the filter . \ return If the function succeeds the return value is nonzero . The filter defined with this filter is evaluated by the network card at a level that is under the NPF device driver . Here is a list of the most useful hardware filters ( A complete list can be found in ntddndis . h ) . sets promiscuous mode . Every incoming packet is accepted by the adapter . NDIS_PACKET_TYPE_DIRECTED : only packets directed to the workstation ' s adapter are accepted . NDIS_PACKET_TYPE_BROADCAST : only broadcast packets are accepted . NDIS_PACKET_TYPE_MULTICAST : only multicast packets belonging to groups of which this adapter is a member are accepted . NDIS_PACKET_TYPE_ALL_MULTICAST : every multicast packet is accepted . NDIS_PACKET_TYPE_ALL_LOCAL : all local packets i . e .
BOOLEAN PacketSetHwFilter(LPADAPTER  AdapterObject,ULONG Filter)
{
    BOOLEAN    Status;
    ULONG      IoCtlBufferLength=(sizeof(PACKET_OID_DATA)+sizeof(ULONG)-1);
    PPACKET_OID_DATA  OidData;
#ifndef _WINNT4
	if(AdapterObject->Flags != INFO_FLAG_NDIS_ADAPTER)
		return TRUE;
#endif 
	OidData=GlobalAllocPtr(GMEM_MOVEABLE | GMEM_ZEROINIT,IoCtlBufferLength);
    if (OidData == NULL) {
        ODS("PacketSetHwFilter: GlobalAlloc Failed\n");
        return FALSE;
    }
    OidData->Oid=OID_GEN_CURRENT_PACKET_FILTER;
    OidData->Length=sizeof(ULONG);
    *((PULONG)OidData->Data)=Filter;
    Status=PacketRequest(AdapterObject,TRUE,OidData);
    GlobalFreePtr(OidData);
    return Status;
}
BOOLEAN PacketSetHwFilter ( LPADAPTER AdapterObject , ULONG Filter ) { BOOLEAN Status ; ULONG IoCtlBufferLength = ( sizeof ( PACKET_OID_DATA ) + sizeof ( ULONG ) - 1 ) ; PPACKET_OID_DATA OidData ; #ifndef _WINNT4 if ( AdapterObject -> Flags != INFO_FLAG_NDIS_ADAPTER ) return TRUE ; #endif OidData = GlobalAllocPtr ( GMEM_MOVEABLE | GMEM_ZEROINIT , IoCtlBufferLength ) ; if ( OidData == NULL ) { ODS ( " \n " ) ; return FALSE ; } OidData -> Oid = OID_GEN_CURRENT_PACKET_FILTER ; OidData -> Length = sizeof ( ULONG ) ; * ( ( PULONG ) OidData -> Data ) = Filter ; Status = PacketRequest ( AdapterObject , TRUE , OidData ) ; GlobalFreePtr ( OidData ) ; return Status ; }
\brief Sets a hardware filter on the incoming packets.
\ brief Sets a hardware filter on the incoming packets .
// _WINNT4
