import struct


def unpack_linkmsg(data):
    """For *LINK RTNETLINK messages, unpack the body

    Discards a number of uninteresting parts.

    Returns if type, flags and remainder of message
    """
    if_family, _, if_type, index, flags, change = struct.unpack("=BBHiII",
                                                                data[:16])
    # family == AF_UNSPEC.  _ is a pad word. change is not used by kernels yet.
    return if_type, flags, data[16:]