def callback(msg, _):
<EOL>nlh = nlmsg_hdr(msg)<EOL>iface = ifinfomsg(nlmsg_data(nlh))<EOL>hdr = IFLA_RTA(iface)<EOL>remaining = ctypes.c_int(nlh.nlmsg_len - NLMSG_LENGTH(iface.SIZEOF))<EOL>while RTA_OK(hdr, remaining):<EOL><INDENT>if hdr.rta_type == IFLA_IFNAME:<EOL><INDENT>print('<STR_LIT>'.format(iface.ifi_index, get_string(RTA_DATA(hdr)).decode('<STR_LIT:ascii>')))<EOL><DEDENT>hdr = RTA_NEXT(hdr, remaining)<EOL><DEDENT>return NL_OK<EOL>
Callback function called by libnl upon receiving messages from the kernel.

    Positional arguments:
    msg -- nl_msg class instance containing the data sent by the kernel.

    Returns:
    An integer, value of NL_OK. It tells libnl to proceed with processing the next kernel message.