'Unpacks a new instance of the appropriate subclass from a buffer
returns (new_offset, object)'

@staticmethod
def unpack_new(raw, offset=0, buf_len=None, prev=None):

    if (buf_len is None):
        buf_len = len(raw)
    if (buf_len < 2):
        raise TruncatedException()
    (t, l) = struct.unpack_from('BB', raw, offset)
    if (l == 0):
        raise RuntimeError('Zero-length    NDP    option')
    offset += 2
    length_bytes = ((l * 8) - 2)
    if ((buf_len - offset) < length_bytes):
        raise TruncatedException()
    c = _nd_options.get(t)
    if (c is None):
        c = NDOptionGeneric
    if ((c.LENGTH is not None) and (c.LENGTH != length_bytes)):
        raise RuntimeError('Bad    length    for    NDP    option')
    (new_off, o) = c._unpack_new(raw, offset, t, length_bytes, prev=prev)
    assert (new_off == (offset + length_bytes))
    return (new_off, o)
