Lines Matching refs:ops
45 int rtnl_ematch_register(struct rtnl_ematch_ops *ops) in rtnl_ematch_register() argument
47 if (rtnl_ematch_lookup_ops(ops->eo_kind)) in rtnl_ematch_register()
50 NL_DBG(1, "ematch module \"%s\" registered\n", ops->eo_name); in rtnl_ematch_register()
52 nl_list_add_tail(&ops->eo_list, &ematch_ops_list); in rtnl_ematch_register()
67 struct rtnl_ematch_ops *ops; in rtnl_ematch_lookup_ops() local
69 nl_list_for_each_entry(ops, &ematch_ops_list, eo_list) in rtnl_ematch_lookup_ops()
70 if (ops->eo_kind == kind) in rtnl_ematch_lookup_ops()
71 return ops; in rtnl_ematch_lookup_ops()
86 struct rtnl_ematch_ops *ops; in rtnl_ematch_lookup_ops_by_name() local
88 nl_list_for_each_entry(ops, &ematch_ops_list, eo_list) in rtnl_ematch_lookup_ops_by_name()
89 if (!strcasecmp(ops->eo_name, name)) in rtnl_ematch_lookup_ops_by_name()
90 return ops; in rtnl_ematch_lookup_ops_by_name()
168 int rtnl_ematch_set_ops(struct rtnl_ematch *ematch, struct rtnl_ematch_ops *ops) in rtnl_ematch_set_ops() argument
173 ematch->e_ops = ops; in rtnl_ematch_set_ops()
174 ematch->e_kind = ops->eo_kind; in rtnl_ematch_set_ops()
176 if (ops->eo_datalen) { in rtnl_ematch_set_ops()
177 ematch->e_data = calloc(1, ops->eo_datalen); in rtnl_ematch_set_ops()
181 ematch->e_datalen = ops->eo_datalen; in rtnl_ematch_set_ops()
189 struct rtnl_ematch_ops *ops; in rtnl_ematch_set_kind() local
196 if ((ops = rtnl_ematch_lookup_ops(kind))) in rtnl_ematch_set_kind()
197 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_set_kind()
204 struct rtnl_ematch_ops *ops; in rtnl_ematch_set_name() local
209 if (!(ops = rtnl_ematch_lookup_ops_by_name(name))) in rtnl_ematch_set_name()
212 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_set_name()
389 struct rtnl_ematch_ops *ops; in rtnl_ematch_parse_attr() local
435 if ((ops = rtnl_ematch_lookup_ops(hdr->kind))) { in rtnl_ematch_parse_attr()
436 if (ops->eo_minlen && len < ops->eo_minlen) { in rtnl_ematch_parse_attr()
442 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_parse_attr()
444 if (ops->eo_parse && in rtnl_ematch_parse_attr()
445 (err = ops->eo_parse(ematch, data, len)) < 0) { in rtnl_ematch_parse_attr()