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); }
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); }
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); }