def callback(msg, has_printed):
table = AsciiTable([['<STR_LIT>', '<STR_LIT>']])<EOL>gnlh = genlmsghdr(nlmsg_data(nlmsg_hdr(msg)))<EOL>tb = dict((i, None) for i in range(nl80211.NL80211_ATTR_MAX + <NUM_LIT:1>))  <EOL>nla_parse(tb, nl80211.NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, <NUM_LIT:0>), genlmsg_attrlen(gnlh, <NUM_LIT:0>), None)<EOL>if tb[nl80211.NL80211_ATTR_IFNAME]:<EOL><INDENT>table.title = nla_get_string(tb[nl80211.NL80211_ATTR_IFNAME]).decode('<STR_LIT:ascii>')<EOL><DEDENT>else:<EOL><INDENT>table.title = '<STR_LIT>'<EOL><DEDENT>if tb[nl80211.NL80211_ATTR_WIPHY]:<EOL><INDENT>wiphy_num = nla_get_u32(tb[nl80211.NL80211_ATTR_WIPHY])<EOL>wiphy = ('<STR_LIT>' if OPTIONS['<STR_LIT>'] else '<STR_LIT>').format(wiphy_num)<EOL>table.table_data.append(['<STR_LIT>', wiphy])<EOL><DEDENT>if tb[nl80211.NL80211_ATTR_MAC]:<EOL><INDENT>mac_address = '<STR_LIT::>'.join(format(x, '<STR_LIT>') for x in nla_data(tb[nl80211.NL80211_ATTR_MAC])[:<NUM_LIT:6>])<EOL>table.table_data.append(['<STR_LIT>', mac_address])<EOL><DEDENT>if tb[nl80211.NL80211_ATTR_IFINDEX]:<EOL><INDENT>table.table_data.append(['<STR_LIT>', str(nla_get_u32(tb[nl80211.NL80211_ATTR_IFINDEX]))])<EOL><DEDENT>if has_printed:<EOL><INDENT>print()<EOL><DEDENT>else:<EOL><INDENT>has_printed.append(True)<EOL><DEDENT>print(table.table)<EOL>return NL_SKIP<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.
    has_printed -- simple pseudo boolean (if list is empty) to keep track of when to print emtpy lines.

    Returns:
    An integer, value of NL_SKIP. It tells libnl to stop calling other callbacks for this message and proceed with
    processing the next kernel message.