Monitor Ethernet (4) Packet32 function SDK

Source: Internet
Author: User

The function description in the Packet32 package:

No.3. Packetsethwfilter (Set Filter)

Sets a hardware filter. For example, the filter parameter passes ndis_packet_type_promiscuous, you can set the NIC to promiscuous mode.

BOOLEAN PacketSetHwFilter(
LPADAPTER AdapterObject,
ULONG Filter
);

Parameters:

Adapterobject:

[in] A pointer to a _adapter structure.

Filter:

ID of the [in] filter.

Return Values:

Returns a value other than 0 if the execution succeeds.

Usage:

C + + Usage Sample

Lpadapter = Packetopenadapter (adapterlist[open-1]);

Packetsethwfilter (lpadapter,ndis_packet_type_promiscuous);

Remarks:

The filter is defined in Ntddndis.h. Here are some of the most common:

Ndis_packet_type_promiscuous: Set promiscuous mode. The NIC receives each packet;

ndis_packet_type_directed;

Ndis_packet_type_broadcast: Only receive broadcast packets;

Ndis_packet_type_multicast: Only receive the multicast packets, and the native NIC is a member of the receiving group;

Ndis_packet_type_all_multicast: All multicast packets are received;

Ndis_packet_type_all_local: all local packets.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.