def genl_register_family(ops):
if not ops.o_name or (ops.o_cmds and ops.o_ncmds <= <NUM_LIT:0>):<EOL><INDENT>return -NLE_INVAL<EOL><DEDENT>if ops.o_id and lookup_family(ops.o_id):<EOL><INDENT>return -NLE_EXIST<EOL><DEDENT>if lookup_family_by_name(ops.o_name):<EOL><INDENT>return -NLE_EXIST<EOL><DEDENT>nl_list_add_tail(ops.o_list, genl_ops_list)<EOL>return <NUM_LIT:0><EOL>
Register Generic Netlink family and associated commands.

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

    Registers the specified Generic Netlink family definition together with all associated commands. After registration,
    received Generic Netlink messages can be passed to genl_handle_msg() which will validate the messages, look for a
    matching command and call the respective callback function automatically.

    Positional arguments:
    ops -- Generic Netlink family definition (genl_ops class instance).

    Returns:
    0 on success or a negative error code.