Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report