• Home
  • Raw
  • Download

Lines Matching refs:ematch

149 void rtnl_ematch_unlink(struct rtnl_ematch *ematch)  in rtnl_ematch_unlink()  argument
151 NL_DBG(2, "unlinked ematch %p from any lists\n", ematch); in rtnl_ematch_unlink()
153 if (!nl_list_empty(&ematch->e_childs)) in rtnl_ematch_unlink()
155 ematch); in rtnl_ematch_unlink()
157 nl_list_del(&ematch->e_list); in rtnl_ematch_unlink()
158 nl_init_list_head(&ematch->e_list); in rtnl_ematch_unlink()
161 void rtnl_ematch_free(struct rtnl_ematch *ematch) in rtnl_ematch_free() argument
163 NL_DBG(2, "freed ematch %p\n", ematch); in rtnl_ematch_free()
164 rtnl_ematch_unlink(ematch); in rtnl_ematch_free()
165 free(ematch->e_data); in rtnl_ematch_free()
166 free(ematch); in rtnl_ematch_free()
169 int rtnl_ematch_set_ops(struct rtnl_ematch *ematch, struct rtnl_ematch_ops *ops) in rtnl_ematch_set_ops() argument
171 if (ematch->e_ops) in rtnl_ematch_set_ops()
174 ematch->e_ops = ops; in rtnl_ematch_set_ops()
175 ematch->e_kind = ops->eo_kind; in rtnl_ematch_set_ops()
178 ematch->e_data = calloc(1, ops->eo_datalen); in rtnl_ematch_set_ops()
179 if (!ematch->e_data) in rtnl_ematch_set_ops()
182 ematch->e_datalen = ops->eo_datalen; in rtnl_ematch_set_ops()
188 int rtnl_ematch_set_kind(struct rtnl_ematch *ematch, uint16_t kind) in rtnl_ematch_set_kind() argument
192 if (ematch->e_kind) in rtnl_ematch_set_kind()
195 ematch->e_kind = kind; in rtnl_ematch_set_kind()
198 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_set_kind()
203 int rtnl_ematch_set_name(struct rtnl_ematch *ematch, const char *name) in rtnl_ematch_set_name() argument
207 if (ematch->e_kind) in rtnl_ematch_set_name()
213 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_set_name()
218 void rtnl_ematch_set_flags(struct rtnl_ematch *ematch, uint16_t flags) in rtnl_ematch_set_flags() argument
220 ematch->e_flags |= flags; in rtnl_ematch_set_flags()
223 void rtnl_ematch_unset_flags(struct rtnl_ematch *ematch, uint16_t flags) in rtnl_ematch_unset_flags() argument
225 ematch->e_flags &= ~flags; in rtnl_ematch_unset_flags()
228 uint16_t rtnl_ematch_get_flags(struct rtnl_ematch *ematch) in rtnl_ematch_get_flags() argument
230 return ematch->e_flags; in rtnl_ematch_get_flags()
233 void *rtnl_ematch_data(struct rtnl_ematch *ematch) in rtnl_ematch_data() argument
235 return ematch->e_data; in rtnl_ematch_data()
355 struct rtnl_ematch *ematch) in rtnl_ematch_tree_add() argument
357 nl_list_add_tail(&ematch->e_list, &tree->et_list); in rtnl_ematch_tree_add()
360 static inline uint32_t container_ref(struct rtnl_ematch *ematch) in container_ref() argument
362 return *((uint32_t *) rtnl_ematch_data(ematch)); in container_ref()
368 struct rtnl_ematch *ematch; in link_tree() local
372 ematch = index[i]; in link_tree()
374 nl_list_add_tail(&ematch->e_list, root); in link_tree()
376 if (ematch->e_kind == TCF_EM_CONTAINER) in link_tree()
377 link_tree(index, nmatches, container_ref(ematch), in link_tree()
378 &ematch->e_childs); in link_tree()
380 if (!(ematch->e_flags & TCF_EM_REL_MASK)) in link_tree()
449 struct rtnl_ematch *ematch; in rtnl_ematch_parse_attr() local
484 if (!(ematch = rtnl_ematch_alloc())) { in rtnl_ematch_parse_attr()
489 ematch->e_id = hdr->matchid; in rtnl_ematch_parse_attr()
490 ematch->e_kind = hdr->kind; in rtnl_ematch_parse_attr()
491 ematch->e_flags = hdr->flags; in rtnl_ematch_parse_attr()
495 rtnl_ematch_free(ematch); in rtnl_ematch_parse_attr()
500 rtnl_ematch_set_ops(ematch, ops); in rtnl_ematch_parse_attr()
503 (err = ops->eo_parse(ematch, data, len)) < 0) { in rtnl_ematch_parse_attr()
504 rtnl_ematch_free(ematch); in rtnl_ematch_parse_attr()
509 NL_DBG(3, "index[%d] = %p\n", nmatches, ematch); in rtnl_ematch_parse_attr()
510 index[nmatches++] = ematch; in rtnl_ematch_parse_attr()