<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nlmsg_parse(nlh, hdrlen, tb, maxtype, policy):
 """Parse attributes of a Netlink message. https://github.com/thom311/libnl/blob/libnl3_2_25/lib/msg.c#L213 Positional arguments: nlh -- Netlink message header (nlmsghdr class instance). hdrlen -- length of family specific header (integer). tb -- dictionary of nlattr instances (length of maxtype+1). maxtype -- maximum attribute type to be expected (integer). policy -- validation policy (nla_policy class instance). Returns: 0 on success or a negative error code. """

    if not nlmsg_valid_hdr(nlh, hdrlen):
        return -NLE_MSG_TOOSHORT
    return nla_parse(tb, maxtype, nlmsg_attrdata(nlh, hdrlen), nlmsg_attrlen(nlh, hdrlen), policy)