A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/chmorgan/sharppcap below:

GitHub - dotpcap/sharppcap: Official repository

Fully managed, cross platform (Windows, Mac, Linux) .NET library for capturing packets from live and file based devices

The official SharpPcap repository.

  1. Features
  2. Examples
  3. CI Support
  4. Releases
  5. Platform Specific Notes
  6. Migration from 5.x to 6.0

For packet dissection and creation, see Packet.Net.

See the Examples folder for a range of full example projects using SharpPcap

var devices = CaptureDeviceList.Instance;
foreach (var dev in devices)
    Console.WriteLine("{0}\n", dev.ToString());
void Device_OnPacketArrival(object s, PacketCapture e)
{
    Console.WriteLine(e.GetPacket());
}

using var device = LibPcapLiveDeviceList.Instance[0];
device.Open();
device.OnPacketArrival += Device_OnPacketArrival;
device.StartCapture();
Reading from a capture file
void Device_OnPacketArrival(object s, PacketCapture e)
{
    Console.WriteLine(e.GetPacket());
}

using var device = new CaptureFileReaderDevice("filename.pcap");
device.Open();
device.OnPacketArrival += Device_OnPacketArrival;
device.Capture();
Writing to a capture file
using var device = new CaptureFileWriterDevice("somefilename.pcap", System.IO.FileMode.Open);
var bytes = new byte[] { 1, 2, 3, 4 };
device.Write(bytes);

We have support for a number of CI systems for a few reasons:

SharpPcap is released via nuget

SharpPcap is where it is today because of a number of developers who have provided improvements and fixes and users that have provided helpful feedback through issues and feature requests.

We are especially appreciative of a number of projects we build upon (as SharpPcap is a C# wrapper):

Migration from 5.x to 6.0

We hope that you'll find the 6.x api to be cleaner and easier to use.

6.0 brings a number of cleanups that have resulted in API breakage for 5.x users.

To aid with the migration from 5.x to 6.0 here is a list of some of the changes you'll have to make to your SharpPcap usage.

The examples are also a great resource as they show working examples using the latest API.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4