Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Microsoft Visual Studio 10.0 executes WinPcap to get the code of the network setter.

Shulou Source: shulou.com Published: 2022-06-01 07:37:36 10月01日 Update

WinPcap is an open source library based on Win32 platform for capturing and analyzing network packets.

Most network applications access the network through widely used operating system components, such as sockets. This is a simple implementation because the operating system has properly handled the underlying implementation details (such as protocol processing, encapsulating packets, etc.) and provides a familiar interface similar to reading and writing files.

Sometimes, however, this "simple approach" does not meet the needs of the task, because some applications need to directly access packets in the network. In other words, those applications need to access the original packets, that is, packets that have not been processed by the operating system using network protocols.

The purpose of WinPcap is to provide this access method for Win32 applications; WinPcap provides the following functions

Capture the original packet, whether it is sent to a machine or exchanged on other devices (shared media)

Filter packets according to user-specified rules before sending them to an application

Send the original packet over the network

Collect and count network traffic information

The above functions can only be achieved with the help of the network device driver installed in the Win32 kernel, plus several dynamic link libraries DLL.

All of these functions can be demonstrated through a powerful programming interface, easy to develop, and can be used on different operating systems. The main goal of this manual is to describe the use of these programming interfaces with the help of some programming examples.

Typically, the first thing you do when writing WinPcap-based applications is to get a list of connected network adapters. Both libpcap and WinPcap provide the pcap_findalldevs_ex () function to do this: this function returns a linked list of pcap_if structures, each of which contains the details of an adapter. It is worth noting that the data fields name and description represent an adapter name and a description that people can understand.

First configure Microsoft Visual Studio 10.0

Project-- > * * attribute (alt+F7)

Configure properties-- > inventory tool-- > input and output-- > embed list-- > No

Project-- > * * attribute (alt+F7)

Configuration Properties-- > Cramp Cure colors-- > General-- > additional inclusion directories-- >

Project-- > * * attribute (alt+F7)

Configuration Properties-- > Linker-- > General-- > additional Library Directory-- >

Project-- > * * attribute (alt+F7)

Configure properties-- > linker-- > input-- > attach dependencies-- > supplement "; Packet.lib;wpcap.lib"

Project-- > * * attribute (alt+F7)

Configuration properties-- > Candlestick colors-- > preprocessor-- > preprocessor definition-- > supplement "; HAVE_REMOTE

Tags: Properties data networks programs applications applications configurations projects operating systems functions systems originals interfaces methods adapters links processing adaptations attachments information Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information macOS MariaDB Shulou Technology Shulou Tech Info