import struct


def decode_option(packet, offset):
    """Decode a navdata option."""
    id_nr, size = struct.unpack_from("HH", packet, offset)
    end_offset = offset + size
    data = packet[offset + struct.calcsize("HH"):end_offset]
    return id_nr, data, end_offset