SharpPcap-中文开发全攻略.doc
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《SharpPcap-中文开发全攻略.doc》由会员分享,可在线阅读,更多相关《SharpPcap-中文开发全攻略.doc(27页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、!-简介Packet capturing (or packet sniffing) is the process of collecting all packets of data that pass through a given network interface.包捕获(或数据包嗅探)是收集数据,通过特定的网络接口将所有数据包的过程。Capturing network packets in our applications is a powerful capability which lets us write network monitoring, packet analyzers a
2、nd security tools.在我们的应用程序捕获网络数据包是一个强大的能力,它可以让我们写网络监控,数据包分析器和安全工具。The libpcap library for UNIX based systems and WinPcap for Windows are the most widely used packet capture drivers that provide API for low-level network monitoring.本的libpcap库和基于UNIX系统WinPcap的用于Windows是最广泛使用的数据包捕获驱动程序监视API提供低级别的网络。Amo
3、ng the applications that use libpcap/WinPcap as its packet capture subsystem are the famous tcpdump and Wireshark .其中应用程序使用的libpcap / WinPcap的包捕获子系统为是著名的tcpdump的和Wireshark的。In this article, we will introduce the SharpPcap .NET assembly (library) for interfacing with libpcap or winpcap from your .NET
4、 application and will give you a detailed programming tutorial on how to use it.在这篇文章中,我们将介绍SharpPcap WinPcap的从您的。NET应用程序。)NET程序集(库接口与libpcap的或并会给你一个详细的方案编制教程教你如何使用。Background背景Tamir Gal started the SharpPcap project around 2004.塔米尔加尔在2004年左右开始的SharpPcap项目。He wanted to use WinPcap in a .NET applicat
5、ion while working on his final project for university.他想用在。NET应用WinPcap而在他的大学最后项目的工作。The project involved analyzing and decoding VoIP traffic and he wanted to keep coding simple with C# which has time saving features like garbage collection.该项目涉及VoIP流量分析和解码,他想继续用C编码具有省时,如垃圾收集功能简单。Accessing the WinPc
6、ap API from .NET seemed to be quite a popular requirement, and he found some useful projects on CodeProjects website that let you do just that: WinPcap的API的访问似乎从净是相当流行的要求,他发现在CodeProject上的一些网站,让您做到这一点有益的项目。: Packet Capture and Analyzer数据包捕获和分析仪 Raw Socket Capturing Using C#原始套接字捕获使用C Packet sniffing
7、 with winpcap functions ported to a .NET library与WinPcap的包嗅探功能移植到。NET库The first project is a great ethereal .NET clone that lets you capture and analyze numerous types of protocol packets.第一个项目是一个伟大的空灵。NET的克隆,让您获取和分析大量的数据包的协议类型。However, a few issues with this project make it almost impossible to be
8、shared among other .NET applications.然而,随着这个项目的几个问题使它几乎不可能得到在其他。NET应用程序共享。Firstly, the author did not provide any generic API for capturing packets that can be used by other .NET applications.首先,作者没有提供用于捕获,可以通过其他。NET应用程序中使用任何通用的API包。He didnt separate his UI code and his analyzing and capturing code,
9、 making his capturing code depend on the GUI classes such as ListView to operate.他没有单独的UI代码和他的分析和捕获的代码,使他的捕捉代码类依赖于图形用户界面,如ListView操作。Secondly, for some reason the author chose to re-implement some of WinPcaps functions in C# by himself rather than just wrapping them.其次,由于某些原因,笔者选择了重新实现在C由他本人,而不是仅仅Wi
10、nPcap的包装他们的部分职能。This means that his application cant take advantage of the new WinPcap versions since he hard coded a certain version of WinPcap in his application.这意味着他的应用程序无法利用新的WinPcap的版本的硬编码的优势,因为他在他的WinPcap的应用程序的某些版本。The second and the third articles are nice starts for wrapper projects for Win
11、Pcap, however they didnt provide some important WinPcap features such as handling offline pcap files and applying kernel-level packet filters, and most importantly they provide no parser classes for analyzing protocol packets.第二个和第三个物品的包装项目为WinPcap的好开始,但他们没有提供一些重要的WinPcap的功能,如离线pcap的文件处理和应用内核级数据包过滤器
12、,以及最重要的是他们提供了这样的分析没有协议分析器类包。Both projects didnt post their library source code together with the article in order to let other people extend their work and add new features and new packet parser classes.这两个项目没有张贴的文章,以自己的库的源代码,让其他人一起延长他们的工作和增加新功能和新的数据包分析器类。And so, Tamir decided to start his own libra
13、ry for the task.因此,塔米尔决定开始他对自己的图书馆工作。Several versions in the 1.x series were released.在1.x系列的几个版本发布。Development slowed towards mid-2007 when the last version in the 1.x series was released, SharpPcap 1.6.2.发展放缓对2007年年中时,在1.x系列的最后一个版本发布时,SharpPcap 1.6.2。Chris Morgan took over development of SharpPcap
14、 in November of 2008.克里斯摩根发生在2008年11月超过SharpPcap发展。Since then SharpPcap has had major internal rewrites and API improvements.从那时起SharpPcap主要内部已重写和API改进。In late February 2010, SharpPcap v3.0 was released. 2010年2月下旬,SharpPcap 3.0被释放。This release represents a rewrite of SharpPcaps packet parsers.此版本是一个
15、重写SharpPcap的数据包分析器。Packet parsing functionality was broken out into a new library, Packet.Net .分组分析功能被打破,进入一个新的图书馆,Packet.Net。SharpPcap takes care of interfacing with libpcap/winpcap and Packet.Net takes care of packet dissection and creation. SharpPcap注意到与libpcap的/ WinPcap的包和Packet.Net注意到接口解剖和创造护理照
16、顾。The details of Packet.Nets architecture will be discussed later in the tutorial.对Packet.Net的建筑的细节将在本教程的后面讨论。SharpPcap v3.5 was released February 1 st , 2011. SharpPcap v3.5版本发布了2月1 日,2011年。The 3.5 release contains significant API changes as well as WinPcap remote capture and AirPcap support. 3.5版本
17、包含重大的空气污染指数的变化以及WinPcap的远程采集和支持AirPcap。About SharpPcap关于SharpPcap The purpose of SharpPcap is to provide a framework for capturing, injecting and analyzing network packets for .NET applications.的目的SharpPcap是提供一个框架NET应用程序捕获,注资。和分析网络数据包。SharpPcap is openly and actively developed with its source code a
18、nd file releases hosted on SourceForge. SharpPcap是公开和积极发展同它的源代码和文件发布在SourceForge托管。Source code patches to improve or fix issues are welcome via the sharppcap developers mailing list .源代码补丁,以改善或解决问题欢迎通过sharppcap开发者邮件列表。Bug reports, feature requests and other queries are actively answered on the suppo
19、rt forums and issue trackers there so if you have any trouble with the library please feel free to ask.错误报告,功能要求和其他查询正在积极回答问题的论坛和跟踪支持,所以如果你有任何问题请与库随时问。SharpPcap is a fully managed cross platform library. SharpPcap是一个完全跨平台的库管理。The same assembly runs under Microsoft .NET as well as Mono on both 32 and
20、 64bit platforms.同一程序集运行在微软的。NET以及单在32位和64位平台。The following list illustrates the features currently supported by SharpPcap:下面的列表说明了目前SharpPcap功能支持: Single assembly for Microsoft .NET and Mono platforms on Windows (32 or 64bit) , Linux (32 or 64bit) and Mac .单一组件的Microsoft。NET和 Mono平台上的Windows(32位或64
21、位)和Linux(32或64位)和 Mac。 High performance - SharpPcap can capture fast enough to keep up with 3MB/s scp transfer rates高性能 - SharpPcap可以捕捉足够快跟上的3MB / s的传输速率高达SCP的 WinPcap extensions are partially supported:WinPcap的扩展部分支持:o Setting the kernel buffer size设置内核缓冲区大小o Injecting packets using send queues.注射用
22、的数据包发送队列。o Collecting network statistics on a given network interface收集在一个特定的网络接口的网络统计 AirPcap supportAirPcap支持 Enumerating and showing details about the physical network interface on a Windows machine.枚举和显示有关Windows机器上的物理网络接口的细节。 Capturing low-level network packets going through a given interface.捕
23、获低级别的网络数据包将通过给定的接口。 Analyzing and parsing the following protocols:分析和解析以下协议:o Ethernet以太网o SLL (Linux Cooked-Mode Capture)血清瘦素(Linux的熟食方式采集)o ARP (Address Resolution Protocol)ARP(地址解析协议)o IP (Internet Protocol) :IP(因特网协议): IPv4IPv4的 IPv6IPv6的o TCP (Transmission Control Protocol)TCP(传输控制协议)o UDP (Use
24、r Datagram Protocol)UDP(用户数据报协议)o ICMP (Internet Control Message Protocol) :ICMP协议(Internet控制消息协议): ICMPv4ICMPv4 ICMPv6ICMPv6报o IGMPv2IGMPv2的o PPPoEPPPoE协议o PTP和平之路o LLDPLLDP功能o Wake-on-LAN(WOL)唤醒局域网(网络唤醒) Injecting low-level network packets on a given interface.在给定接口注入的低级别的网络数据包。 Handling (reading
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- sharppcap 中文 开发 攻略
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内