Exemple #1
0
        public void Get()
        {
            var ipv4Packet = new IPv4Packet
            {
                Bytes = new Byte[32]
            };

            ipv4Packet.SetBytes(4, 2, new Byte[] { 0x00, 0x7B });
            ipv4Packet.Id.Should().Be(123);
        }
Exemple #2
0
        public void Get()
        {
            var ipv4Packet = new IPv4Packet
            {
                Bytes = new Byte[32]
            };

            ipv4Packet.SetBytes(10, 2, new Byte[] { 0x99, 0xA4 });

            ipv4Packet.HeaderChecksum.Should().Be(39332);
        }
        public void Get()
        {
            var ipv4Packet = new IPv4Packet
            {
                Bytes = new Byte[32]
            };

            ipv4Packet.SetBytes(12, 4, new Byte[] { 0xC0, 0xA8, 0x01, 0x02 });

            ipv4Packet.SourceIPAddress.ToString().Should().Be("192.168.1.2");
        }
Exemple #4
0
        public void Get()
        {
            var ipv4Packet = new IPv4Packet
            {
                Bytes = new Byte[32]
            };

            ipv4Packet.SetBytes(2, 2, new Byte[] { 0x00, 0x20 });

            ipv4Packet.TotalLength.Should().Be(32);
        }