Lines Matching refs:ops

93 static int genl_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
102 if (ops->co_genl == NULL)
105 for (i = 0; i < ops->co_genl->o_ncmds; i++) {
106 cmd = &ops->co_genl->o_cmds[i];
127 err = nlmsg_parse(nlh, ops->co_hdrsize, tb, cmd->c_maxattr,
132 err = cmd->c_msg_parser(ops, cmd, &info, pp);
141 struct genl_ops *ops;
144 nl_list_for_each_entry(ops, &genl_ops_list, o_list) {
145 if (ops->o_family == family) {
146 for (i = 0; i < ops->o_ncmds; i++) {
148 cmd = &ops->o_cmds[i];
170 * @arg ops cache operations
172 int genl_register(struct nl_cache_ops *ops)
176 if (ops->co_protocol != NETLINK_GENERIC) {
181 if (ops->co_hdrsize < GENL_HDRSIZE(0)) {
186 if (ops->co_genl == NULL) {
191 ops->co_genl->o_cache_ops = ops;
192 ops->co_genl->o_name = ops->co_msgtypes[0].mt_name;
193 ops->co_genl->o_family = ops->co_msgtypes[0].mt_id;
194 ops->co_msg_parser = genl_msg_parser;
198 nl_list_add_tail(&ops->co_genl->o_list, &genl_ops_list);
200 err = nl_cache_mngt_register(ops);
207 * @arg ops cache operations
209 void genl_unregister(struct nl_cache_ops *ops)
211 nl_cache_mngt_unregister(ops);
212 nl_list_del(&ops->co_genl->o_list);
222 static int __genl_ops_resolve(struct nl_cache *ctrl, struct genl_ops *ops)
226 family = genl_ctrl_search_by_name(ctrl, ops->o_name);
228 ops->o_id = genl_family_get_id(family);
237 int genl_ops_resolve(struct nl_sock *sk, struct genl_ops *ops)
245 err = __genl_ops_resolve(ctrl, ops);
255 struct genl_ops *ops;
261 nl_list_for_each_entry(ops, &genl_ops_list, o_list) {
262 err = __genl_ops_resolve(ctrl, ops);