Packet.Net

LGPL
C# .NET
Windows
2010-01-26
红薯

Packet.Net 是一个.NET程序包,提供了剖析和构建网络数据包的功能。可以通过类的属性来调整各种数据包的参数。

示例代码:

using PacketDotNet;

// open the capture file
SharpPcap.LivePcapDevice dev = new SharpPcap.LivePcapDevice("SomeCapturedPackets.pcap");

// read a raw packet
rawPacket = dev.GetNextRawPacket();

// parse the packet
Packet p = Packet.ParsePacket((LinkLayers)rawPacket.LinkLayerType,
new PosixTimeval(rawPacket.Timeval.Seconds,
rawPacket.Timeval.MicroSeconds),
rawPacket.Data);

// print out the packet contents
Console.WriteLine(p);

输出信息:

[EthernetPacket: 00234D5BF88B -> 00183F7775D1 proto=IpV4 (0x800) 
l=14][IPv4Packet: 192.168.1.76 -> 72.14.204.83 HeaderLength=5
Protocol=TCP TimeToLive=64][TCPPacket: SourcePort: 59038 ->
DestinationPort: 443 ack[218134930 (0xd007992)]]
加载中

评论(0)

暂无评论

暂无资讯

暂无问答

Tigase 发送消息的流程源码分析

XMPP 的<message/>节是使用基本的”push”方法来从一个地方到另一个地方得到消息。因为消息通常是不告知的,它们是一种”fire-and-forget”(发射后自寻目的)的机制来从一个地方到另一个地方快...

10/31 21:10
4
0
Tigase组件 – Packet过滤

Tigase组件 – Packet过滤

2014/03/20 11:25
845
0
Network Broadcast

Introduction The term "Broadcast" is used very frequently in the networking world . You will see it in most networking books and articles, or see it happening on your hub/switch...

2012/06/05 16:45
53
0
tigase内部处理(2):packet流转

tigase内部处理(2):packet流转

2014/06/07 15:36
1K
0
PHP运行时出现Error while sending QUERY packet的错误

#### 问题: PHP运行时出现Error while sending QUERY packet的错误 #### 原因: - 在mysql中运行 show VARIABLES LIKE 'max_allowed_packet'; - 查看max_allowed_packet值大小,如果max_all...

06/14 13:14
5
0
FFmpeg结构体彻底分析——AVPacket

/** * This structure stores compressed data. It is typically exported by demuxers * and then passed as input to decoders, or received as output from encoders and * then passed t...

2014/12/17 17:11
71
0
hadoop--HDFS之读写流程

HDFS的读写流程

2016/12/20 18:25
129
0
IPC研究(3) -- pipe续

续上篇IPC-Pipes 上篇的example3中,我用named pipe(FIFO)来实现client和server的通信。 由于client每次发完一个包后,都会sleep(2),所以几乎没有资源冲突和同步的问题。 但是,如果将sleep...

2012/04/24 22:16
472
0
mysql5中大数据错误:Packet for query is too large (***>***). You can change this value on the ser

mysql5数据,插入或更新字段有大数据时(大于1M),会出现如下错误: SEVERE: Servlet.service() for servlet [webs] in context with path [] threw exception [Request processing failed;...

2016/05/08 17:46
45
2

没有更多内容

加载失败,请刷新页面

返回顶部
顶部