示例#1
0
 public void Extract(byte[] arr)
 {
     pcp       = (byte)BitHelper.ExtractBits(arr, offset * 8, 3);
     cfi       = BitHelper.ExtractBit(arr, offset * 8 + 3);
     vid       = BitHelper.ExtractBits(arr, offset * 8 + 4, 12);
     ethertype = BitHelper.Extract16(arr, offset + 2);
 }
示例#2
0
 public void Extract(byte[] arr)
 {
     up1       = BitHelper.Extract8(arr, offset);
     up2       = BitHelper.Extract8(arr, offset + 1);
     down1     = BitHelper.Extract8(arr, offset + 2);
     down2     = BitHelper.Extract8(arr, offset + 3);
     ethertype = BitHelper.Extract16(arr, offset + 4);
 }
示例#3
0
 public override void Parse(byte[] data, uint offset)
 {
     offset   *= 8;
     dstAddr   = BitHelper.Extract48(data, offset + 0);
     srcAddr   = BitHelper.Extract48(data, offset + 48);
     etherType = BitHelper.Extract16(data, offset + 96);
     length    = 112;
     setValid();
 }
示例#4
0
 public override void Extract(byte[] arr, uint offset)
 {
     version        = (bit4)BitHelper.ExtractBits(arr, offset * 8, 4);
     ihl            = (bit4)BitHelper.ExtractBits(arr, offset * 8 + 4, 4);
     diffserv       = BitHelper.Extract8(arr, offset + 1);
     totalLen       = BitHelper.Extract16(arr, offset + 2);
     identification = BitHelper.Extract16(arr, offset + 4);
     flags          = (bit3)BitHelper.ExtractBits(arr, offset + 48, 3);
     fragOffset     = BitHelper.ExtractBits(arr, offset + 51, 13);
     ttl            = BitHelper.Extract8(arr, offset + 8);
     protocol       = BitHelper.Extract8(arr, offset + 9);
     hdrChecksum    = BitHelper.Extract16(arr, offset + 10);
     srcAddr        = BitHelper.Extract32(arr, offset + 12);
     dstAddr        = BitHelper.Extract32(arr, offset + 16);
 }
示例#5
0
 public void Extract(byte[] arr)
 {
     version        = (byte)BitHelper.ExtractBits(arr, offset * 8, 4);
     ihl            = (byte)BitHelper.ExtractBits(arr, offset * 8 + 4, 4);
     diffserv       = BitHelper.Extract8(arr, offset + 1);
     totalLen       = BitHelper.Extract16(arr, offset + 2);
     identification = BitHelper.Extract16(arr, offset + 4);
     flags          = (byte)BitHelper.ExtractBits(arr, offset + 48, 3);
     fragOffset     = BitHelper.ExtractBits(arr, offset + 51, 13);
     ttl            = BitHelper.Extract8(arr, offset + 8);
     protocol       = BitHelper.Extract8(arr, offset + 9);
     hdrChecksum    = BitHelper.Extract16(arr, offset + 10);
     srcAddr        = BitHelper.Extract32(arr, offset + 12);
     dstAddr        = BitHelper.Extract32(arr, offset + 16);
     options        = BitHelper.ExtractBytes(arr, offset + 20, length - 20);
 }
示例#6
0
 public override void Parse(byte[] data, uint offset)
 {
     offset        *= 8;
     version        = BitHelper.Extract4(data, offset + 0);
     ihl            = BitHelper.Extract4(data, offset + 4);
     diffserv       = BitHelper.Extract8(data, offset + 8);
     totalLen       = BitHelper.Extract16(data, offset + 16);
     identification = BitHelper.Extract16(data, offset + 32);
     flags          = BitHelper.ExtractN(data, offset + 48, 3);
     fragOffset     = BitHelper.ExtractN(data, offset + 51, 13);
     ttl            = BitHelper.Extract8(data, offset + 64);
     protocol       = BitHelper.Extract8(data, offset + 72);
     hdrChecksum    = BitHelper.Extract16(data, offset + 80);
     srcAddr        = BitHelper.Extract32(data, offset + 96);
     dstAddr        = BitHelper.Extract32(data, offset + 128);
     length         = 160;
     setValid();
 }
示例#7
0
 public void Extract(byte[] data)
 {
     dstAddr   = BitHelper.Extract48(data, offset);
     srcAddr   = BitHelper.Extract48(data, offset + 5);
     etherType = BitHelper.Extract16(data, offset + 10);
 }