Esempio n. 1
0
        public void Parse(BinaryReader binaryReader)
        {
            try
            {
                VersionMajor = binaryReader.ReadUInt16();
                VersionMinor = binaryReader.ReadUInt16();
                ThisZone     = binaryReader.ReadUInt32();
                SigFigs      = binaryReader.ReadUInt32();
                SnapLen      = binaryReader.ReadUInt32();
                Network      = binaryReader.ReadUInt32();

                ulong packetNumber = 1;

                while (binaryReader.BaseStream.Position != binaryReader.BaseStream.Length)
                {
                    var record = new PCapRecord(binaryReader, packetNumber++);
                    if (!raiseEvents)
                    {
                        Records.Add(record);
                    }
                    else
                    {
                        PacketRead?.Invoke(this, new PacketReadEventArgs(record));
                    }
                }
            }
            catch (EndOfStreamException)
            {
            }
        }
 internal unsafe void RaisePacketReadEvent(AVPacket *packet, AVFormatContext *context) =>
 PacketRead?.Invoke(this, new PacketReadEventArgs(packet, context));
Esempio n. 3
0
 private void File_PacketRead(object sender, PacketReadEventArgs e)
 {
     PacketRead?.Invoke(this, e);
 }