internal DhcpMessage(byte[] messageData)
        {
            if (messageData.Length < 244)
            {
                throw new InvalidDataException("Message is not long enough to be a valid DHCP message.");
            }

            OpCode = (DhcpOpcode)messageData[0];
            HardwareAddressType   = (DhcpHardwareType)messageData[1];
            HardwareAddressLength = messageData[2];
            HardwareOptions       = messageData[3];
            TransactionID         = ReadUInt32(messageData, 4);
            SecondsElapsed        = ReadUInt16(messageData, 8);
            Flags               = ReadUInt16(messageData, 10);
            ClientIPAddress     = ReadIPAddress(messageData, 12);
            YourClientIPAddress = ReadIPAddress(messageData, 16);
            NextServerIPAddress = ReadIPAddress(messageData, 20);
            RelayAgentIPAddress = ReadIPAddress(messageData, 24);
            ClientMacAddress    = ReadPhysicalAddress(messageData, 28);
            ServerHostName      = ReadNullTerminatedString(messageData, 44, 64);
            BootFileName        = ReadNullTerminatedString(messageData, 108, 128);

            var magicCookie = ReadIPAddress(messageData, 236);

            if (!BootPMagicCookieValue.Equals(magicCookie))
            {
                throw new InvalidDataException($"Wrong magic cookie value. Expected: {BootPMagicCookieValue}, Received: {magicCookie}");
            }

            Options = new DhcpOptionCollection(messageData);
        }
 internal DhcpMessage(DhcpOpcode opCode, DhcpMessageType messageType)
 {
     OpCode  = opCode;
     Options = new DhcpOptionCollection(messageType);
 }