byte[] chaddr = decodeBytes( buffer, 16 );
String sname = decodeString( buffer, 64 );
String file = decodeString( buffer, 128 );
OptionsField options = decodeOptions( buffer );
// message type option: may be null if option isn't set (BOOTP)
DhcpMessageType mto = ( DhcpMessageType ) options.get( DhcpMessageType.class );
return new DhcpMessage( null != mto ? mto.getType() : null, op, new HardwareAddress( htype, hlen, chaddr ),
hops, xid, secs, flags, ciaddr, yiaddr, siaddr, giaddr, sname, file, options );
}