Http://www.cnblogs.com/TianFang/archive/2007/11/26/972681.html
Winpcap programming 1 -- Introduction
What is Winpcap?
Winpcap is an open-source database based on Win32 platform for capturing and analyzing network data packets.
Most network applications access the network through widely used operating system components, such as sockets.
This is a simple implementation method, because the operating system has properly handled the underlying implementation details (such as protocol processing, encapsulation of data packets, and so on), and provides a class similar to reading and writing files, familiar interfaces.
However, in some cases, this "Simple Method" cannot meet the task requirements, because some applications need to directly access packets in the network. That is to say, those applications need to access the original data packets, that is, the data packets that have not been processed by the operating system using the network protocol.
The purpose of Winpcap is to provide this access method for Win32 applications. Winpcap provides the following functions:
- Capture the original data packet, whether it is sent to a machine or exchanged on other devices (shared media)
- Filters data packets based on user-specified rules before they are sent to an application.
- Send original data packets over the network
- Collect and collect Network Traffic Information
The above functions can be implemented only by using the network device driver installed in the Win32 kernel, coupled with several dynamic link library DLL.
All these functions can be presented through a powerful programming interface, which is 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 program examples.
WhatThe program is using Winpcap
Winpcap can be used to create network analysis and monitoring tools. Some typical applications based on Winpcap include:
- Network and Protocol analyzers)
- Network monitors)
- Network Traffic recorder (Traffic loggers)
- Network Traffic Generator (Traffic generators)
- User-level bridges and Routers)
- Network Intrusion Detection Systems (NIDS ))
- Network Scanners)
- Security Tools)
What does Winpcap do?
Winpcap capabilityIndependentSend and accept data through the host protocol, just like TCP/IP. This means that Winpcap cannot block, filter, or manipulate the communication of other applications on the same machine: it can simply "Monitor" packets transmitted over the network. Therefore, it cannot provide support such as network traffic control, service quality scheduling, and personal firewall.
What is Winpcap?
Winpcap is an open-source database based on Win32 platform for capturing and analyzing network data packets.
Most network applications access the network through widely used operating system components, such as sockets.
This is a simple implementation method, because the operating system has properly handled the underlying implementation details (such as protocol processing, encapsulation of data packets, and so on), and provides a class similar to reading and writing files, familiar interfaces.
However, in some cases, this "Simple Method" cannot meet the task requirements, because some applications need to directly access packets in the network. That is to say, those applications need to access the original data packets, that is, the data packets that have not been processed by the operating system using the network protocol.
The purpose of Winpcap is to provide this access method for Win32 applications. Winpcap provides the following functions:
- Capture the original data packet, whether it is sent to a machine or exchanged on other devices (shared media)
- Filters data packets based on user-specified rules before they are sent to an application.
- Send original data packets over the network
- Collect and collect Network Traffic Information
The above functions can be implemented only by using the network device driver installed in the Win32 kernel, coupled with several dynamic link library DLL.
All these functions can be presented through a powerful programming interface, which is 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 program examples.
WhatThe program is using Winpcap
Winpcap can be used to create network analysis and monitoring tools. Some typical applications based on Winpcap include:
- Network and Protocol analyzers)
- Network monitors)
- Network Traffic recorder (Traffic loggers)
- Network Traffic Generator (Traffic generators)
- User-level bridges and Routers)
- Network Intrusion Detection Systems (NIDS ))
- Network Scanners)
- Security Tools)
What does Winpcap do?
Winpcap capabilityIndependentSend and accept data through the host protocol, just like TCP/IP. This means that Winpcap cannot block, filter, or manipulate the communication of other applications on the same machine: it can simply "Monitor" packets transmitted over the network. Therefore, it cannot provide support such as network traffic control, service quality scheduling, and personal firewall.