コード例 #1
0
        public void Get()
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[40]
            };

            ipv6Packet.SetByte(0, 0b_0000_1010);
            ipv6Packet.SetByte(1, 0b_0101_0000);

            ipv6Packet.TrafficClass.Should().Be(0b_1010_0101);
        }
コード例 #2
0
        public void Get()
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[40]
            };

            ipv6Packet.SetByte(0, 0b_1111_1111);
            ipv6Packet.SetByte(1, 0b_1111_1010);
            ipv6Packet.SetByte(2, 0b_1010_1010);
            ipv6Packet.SetByte(3, 0b_0101_0101);

            ipv6Packet.FlowLabel.Should().Be(0b_1010_1010_1010_0101_0101);
        }
コード例 #3
0
        public void Get()
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[40]
            };

            ipv6Packet.SetByte(7, 0xff);

            ipv6Packet.HopLimit.Should().Be(255);
        }
コード例 #4
0
        public void Get()
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[40]
            };

            ipv6Packet.SetByte(6, 0x00);

            ipv6Packet.NextHeader.Should().Be(0);
        }
コード例 #5
0
        public void Get()
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[60]
            };

            ipv6Packet.SetByte(0, 0x65);

            ipv6Packet.Version.Should().Be(IPVersion.IPv6);
        }
コード例 #6
0
        public void Set(Byte input)
        {
            var ipv6Packet = new IPv6Packet
            {
                Bytes = new Byte[40]
            };

            ipv6Packet.SetByte(0, 0x05);

            ipv6Packet.Version = (IPVersion)input;

            ipv6Packet.GetByte(0).Should().Be(0x65);
            ipv6Packet.Version.Should().Be(IPVersion.IPv6);
        }