• 大小: 1.02MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-30
  • 语言: C#
  • 标签: c#  读取  wireshark  pcap文件  

资源简介

官方源码 来源于github,解析tcp ,udp等数据包

资源截图

代码片段和文件信息

using System;

namespace PcapDotNet.base
{
    /// 
    /// Useful functions for sequences of bits.
    /// 

    public static class BitSequence
    {
        /// 
        /// Casts a bit to a byte.
        /// True becomes 1 and false becomes 0.
        /// 

        /// Bit 7 of the byte.
        /// 1 for true 0 for false.
        public static byte ToByte(this bool value)
        {
            return value ? (byte)1 : (byte)0;
        }

        /// 
        /// Merges 2 bits to a byte.
        /// Bits should be arranged from the most significant to the least.
        /// 

        /// Bit 6 of the byte.
        /// Bit 7 of the byte.
        /// A byte with the 2 least significant bits determined by the input.
        public static byte Merge(bool value1 bool value2)
        {
            return (byte)((value1.ToByte() << 1) | value2.ToByte());
        }

        /// 
        /// Merges 3 bits to a byte.
        /// Bits should be arranged from the most significant to the least.
        /// 

        /// Bit 5 of the byte.
        /// Bit 6 of the byte.
        /// Bit 7 of the byte.
        /// A byte with the 3 least significant bits determined by the input.
        public static byte Merge(bool value1 bool value2 bool value3)
        {
            return (byte)((Merge(value1 value2) << 1) | value3.ToByte());
        }

        /// 
        /// Merges 4 bits to a byte.
        /// Bits should be arranged from the most significant to the least.
        /// 

        /// Bit 4 of the byte.
        /// Bit 5 of the byte.
        /// Bit 6 of the byte.
        /// Bit 7 of the byte.
        /// A byte with the 4 least significant bits determined by the input.
        [System.Diagnostics.CodeAnalysis.SuppressMessage(“Microsoft.Design“ “CA1025:ReplaceRepetitiveArgumentsWithParamsArray“)]
        public static byte Merge(bool value1 bool value2 bool value3 bool value4)
        {
            return (byte)((Merge(value1 value2 value3) << 1) | value4.ToByte());
        }

        /// 
        /// Merges 5 bits to a byte.
        /// Bits should be arranged from the most significant to the least.
        /// 

        /// Bit 3 of the byte.
        /// Bit 4 of the byte.
        /// Bit 5 of the byte.
        /// Bit 6 of the byte.
        /// Bit 7 of the byte.
 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-02-06 13:07  Pcap.Net-master\
     文件         345  2016-02-06 13:07  Pcap.Net-master\.gitignore
     目录           0  2016-02-06 13:07  Pcap.Net-master\BuildProcessTemplates\
     文件       59198  2016-02-06 13:07  Pcap.Net-master\BuildProcessTemplates\DefaultTemplate.11.1.xaml
     文件       22647  2016-02-06 13:07  Pcap.Net-master\BuildProcessTemplates\LabDefaultTemplate.11.xaml
     文件        7014  2016-02-06 13:07  Pcap.Net-master\BuildProcessTemplates\UpgradeTemplate.xaml
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\
     文件        4964  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\CaptureInvalidPackets.csproj
     文件         257  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\CaptureInvalidPackets.csproj.vspscc
     文件        3841  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\Program.cs
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\Properties\
     文件        1437  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\Properties\AssemblyInfo.cs
     文件         144  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CaptureInvalidPackets\app.config
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\
     文件        5275  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\CapturingThePacketsWithoutTheCallback.csproj
     文件         257  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\CapturingThePacketsWithoutTheCallback.csproj.vspscc
     文件        3254  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\Program.cs
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\Properties\
     文件        1469  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\Properties\AssemblyInfo.cs
     文件         144  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\CapturingThePacketsWithoutTheCallback\app.config
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\
     文件        4711  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\GatheringStatisticsOnTheNetworkTraffic.csproj
     文件         257  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\GatheringStatisticsOnTheNetworkTraffic.csproj.vspscc
     文件        3545  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\Program.cs
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\Properties\
     文件        1471  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\Properties\AssemblyInfo.cs
     文件         144  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\GatheringStatisticsOnTheNetworkTraffic\app.config
     目录           0  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\InterpretingThePackets\
     文件        5245  2016-02-06 13:07  Pcap.Net-master\PcapDotNet.DevelopersPack\src\InterpretingThePackets\InterpretingThePackets.csproj
............此处省略820个文件信息

评论

共有 条评论