package/libs/libnl-tiny/src/genl_mngt.c
/**
 * Register generic netlink operations
 * @arg ops		cache operations
 */
Register generic netlink operations
@arg ops             cache operations
Register generic netlink operations @arg ops cache operations
int genl_register(struct nl_cache_ops *ops)
{
	int err;
	if (ops->co_protocol != NETLINK_GENERIC) {
		err = -NLE_PROTO_MISMATCH;
		goto errout;
	}
	if (ops->co_hdrsize < GENL_HDRSIZE(0)) {
		err = -NLE_INVAL;
		goto errout;
	}
	if (ops->co_genl == NULL) {
		err = -NLE_INVAL;
		goto errout;
	}
	ops->co_genl->o_cache_ops = ops;
	ops->co_genl->o_name = ops->co_msgtypes[0].mt_name;
	ops->co_genl->o_family = ops->co_msgtypes[0].mt_id;
	ops->co_msg_parser = genl_msg_parser;
	nl_list_add_tail(&ops->co_genl->o_list, &genl_ops_list);
	err = nl_cache_mngt_register(ops);
errout:
	return err;
}
int genl_register ( struct nl_cache_ops * ops ) { int err ; if ( ops -> co_protocol != NETLINK_GENERIC ) { err = - NLE_PROTO_MISMATCH ; goto errout ; } if ( ops -> co_hdrsize < GENL_HDRSIZE ( 0 ) ) { err = - NLE_INVAL ; goto errout ; } if ( ops -> co_genl == NULL ) { err = - NLE_INVAL ; goto errout ; } ops -> co_genl -> o_cache_ops = ops ; ops -> co_genl -> o_name = ops -> co_msgtypes [ 0 ] . mt_name ; ops -> co_genl -> o_family = ops -> co_msgtypes [ 0 ] . mt_id ; ops -> co_msg_parser = genl_msg_parser ; nl_list_add_tail ( & ops -> co_genl -> o_list , & genl_ops_list ) ; err = nl_cache_mngt_register ( ops ) ; errout : return err ; }
Register generic netlink operations
 @arg ops             cache operations
Register generic netlink operations @arg ops cache operations
/* FIXME: check for dup */