def print_hdr(ofd, msg):
nlh = nlmsg_hdr(msg)<EOL>buf = bytearray()<EOL>ofd('<STR_LIT>', nlh.nlmsg_len)<EOL>ops = nl_cache_ops_associate_safe(msg.nm_protocol, nlh.nlmsg_type)<EOL>if ops:<EOL><INDENT>mt = nl_msgtype_lookup(ops, nlh.nlmsg_type)<EOL>if not mt:<EOL><INDENT>raise BUG<EOL><DEDENT>buf.extend('<STR_LIT>'.format(ops.co_name, mt.mt_name).encode('<STR_LIT:ascii>'))<EOL><DEDENT>else:<EOL><INDENT>nl_nlmsgtype2str(nlh.nlmsg_type, buf, <NUM_LIT>)<EOL><DEDENT>ofd('<STR_LIT>', nlh.nlmsg_type, buf.decode('<STR_LIT:ascii>'))<EOL>ofd('<STR_LIT>', nlh.nlmsg_flags, nl_nlmsg_flags2str(nlh.nlmsg_flags, buf, <NUM_LIT>).decode('<STR_LIT:ascii>'))<EOL>ofd('<STR_LIT>', nlh.nlmsg_seq)<EOL>ofd('<STR_LIT>', nlh.nlmsg_pid)<EOL>
https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L793.

    Positional arguments:
    ofd -- function to call with arguments similar to `logging.debug`.
    msg -- message to print (nl_msg class instance).