def genl_register(ops):
if ops.co_protocol != NETLINK_GENERIC:<EOL><INDENT>return -NLE_PROTO_MISMATCH<EOL><DEDENT>if ops.co_hdrsize < GENL_HDRSIZE(<NUM_LIT:0>):<EOL><INDENT>return -NLE_INVAL<EOL><DEDENT>if ops.co_genl is None:<EOL><INDENT>return -NLE_INVAL<EOL><DEDENT>ops.co_genl.o_cache_ops = ops<EOL>ops.co_genl.o_hdrsize = ops.co_hdrsize - GENL_HDRLEN<EOL>ops.co_genl.o_name = ops.co_msgtypes[<NUM_LIT:0>].mt_name<EOL>ops.co_genl.o_id = ops.co_msgtypes[<NUM_LIT:0>].mt_id<EOL>ops.co_msg_parser = genl_msg_parser<EOL>err = genl_register_family(ops.co_genl)<EOL>if err < <NUM_LIT:0>:<EOL><INDENT>return err<EOL><DEDENT>return nl_cache_mngt_register(ops)<EOL>
Register Generic Netlink family backed cache.

    https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/mngt.c#L241

    Same as genl_register_family() but additionally registers the specified cache operations using
    nl_cache_mngt_register() and associates it with the Generic Netlink family.

    Positional arguments:
    ops -- cache operations definition (nl_cache_ops class instance).

    Returns:
    0 on success or a negative error code.