示例#1
0
        public SectionHeaderBlock(string overrideComment, Int64 overrideSectionLen = -1)
        {
            comment = new CommentBlock(overrideComment ?? "Pcapng file converted using EtlToCap software.");

            startBlock               = new HeaderBlockStart();
            startBlock.blockType     = 0x0A0D0D0A;
            startBlock.blockLength   = (uint)comment.totalByteLength + 28;
            startBlock.magicNumber   = 0x1A2B3C4D;
            startBlock.majorVersion  = 0x1;
            startBlock.minorVersion  = 0x0;
            startBlock.sectionLength = overrideSectionLen; //Initial value
        }
示例#2
0
        public InterfaceDescriptionBlock(UInt32 maxPacketSize, UInt16 linkType = 1)
        {
            string linkStringName = "Ethernet";

            switch (linkType)
            {
            case 105:
                linkStringName = "802.11";
                break;
            }
            comment = new CommentBlock(String.Format("Etl packet capture converted assuming {0} frames.", linkStringName));

            startBlock             = new InterfaceBlockStart();
            startBlock.blockType   = 0x00000001;
            startBlock.blockLength = (uint)comment.totalByteLength + 20;
            startBlock.linkType    = linkType;
            startBlock.reserved    = 0x0;
            startBlock.snapLen     = maxPacketSize;
        }