Monitor Ethernet (1) Packet32 Package description

Source: Internet
Author: User
Tags error handling

Briefly:

Listening to all the data on the network is a more interesting topic. A wide range of listening programs, all using a more famous development package Packet32. For example, Ntsniff, Ethernetspy, Ntpacket, and so on, there are famous WinPcap. It allows the application to set the operating mode of the network card, read and write data directly on the network card, and so on.

General use of the Packet32 version of the implementation, is Microsoft's packet32.c and Packet32.h. This version is relatively simple to write.

The Packet32 in the WinPcap development package is Politecnico di Torino rewrite, adding a lot of error handling, and the annotations are informative and worth reading.

In http://winpcap.polito.it/default.htm, the WinPcap development package is described as: WinPcap is a architecture for packet capture and network Analysis for the WIN32 platforms. It includes a Kernel-level packet filter, a low-level dynamic link library (Packet.dll), and a high-level and SYSTEM-INDEP Endent Library (Wpcap.dll, based on libpcap version 0.6.2).

Here is a description of the implementation version of Packet32, modeled after the Microsft SDK style.

The contents are in sequence:

Contents of Packet32 Package

Functions in the Packet32 package

Packetgetadapternames

Packetopenadapter, etc.

Data structure in the Packet32 package

Example 1: Use Packet32 to set the NIC to promiscuous mode and monitor all packets.

Contents of Packet32 Package

Packet Driver: Oemsetup.inf installation information files, Packet.sys system files, the use of PACKET32 package to develop network monitoring procedures, the need to use these two files to install Packet driver. Packet32 Program Development Library: Packet32.lib static link library, Packet32.dll dynamic link library, users can operate the network card directly by calling functions in the library.

The function description in the Packet32 package:

No.1. Packetgetadapternames (read the network card name from the registry)

Get a list of existing network adapters and their descriptions.

BOOLEAN Packetgetadapternames (

Ptstr Pstr,

Pulong buffersize

);

Parameters:

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.