public void Get() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[40] }; ipv4Packet.SetByte(6, 0b_0101_1011); ipv4Packet.SetByte(7, 0b_0101_1011); ipv4Packet.FragmentOffset.Should().Be(0b_1_1011_0101_1011); }
public void Get() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[32] }; ipv4Packet.SetByte(6, 0b_0010_0000); ipv4Packet.FlagMF.Should().Be(true); }
public void Get() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[32] }; ipv4Packet.SetByte(8, 0x7B); ipv4Packet.TTL.Should().Be(123); }
public void Get() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[40] }; ipv4Packet.SetByte(1, 0b_0101_1011); ipv4Packet.DSCP.Should().Be(0b_0101_10); }
public void Get(Byte input, IPPacketType expected) { var ipv4Packet = new IPv4Packet { Bytes = new Byte[32] }; ipv4Packet.SetByte(9, input); ipv4Packet.Type.Should().Be(expected); }
public void Get() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[32] }; ipv4Packet.SetByte(0, 0x45); ipv4Packet.Version.Should().Be(IPVersion.IPv4); ipv4Packet.HeaderLength.Should().Be(5); }
public void Set() { var ipv4Packet = new IPv4Packet { Bytes = new Byte[40] }; ipv4Packet.SetByte(1, 0b_010110_00); ipv4Packet.ECN = 0b_101110_11; ipv4Packet.GetByte(1).Should().Be(0b_010110_11); }
public void Set(Byte input) { var ipv4Packet = new IPv4Packet { Bytes = new Byte[32] }; ipv4Packet.SetByte(0, 0x05); ipv4Packet.Version = (IPVersion)input; ipv4Packet.GetByte(0).Should().Be(0x45); ipv4Packet.Version.Should().Be(IPVersion.IPv4); ipv4Packet.HeaderLength.Should().Be(5); }