| 987 | } |
| 988 | |
| 989 | int |
| 990 | cpfl_parser_destroy(struct cpfl_flow_js_parser *parser) |
| 991 | { |
| 992 | int i, j; |
| 993 | |
| 994 | if (!parser) |
| 995 | return 0; |
| 996 | |
| 997 | for (i = 0; i < parser->pr_size; i++) { |
| 998 | struct cpfl_flow_js_pr *pattern = &parser->patterns[i]; |
| 999 | |
| 1000 | for (j = 0; j < pattern->key.proto_size; j++) |
| 1001 | rte_free(pattern->key.protocols[j].fields); |
| 1002 | rte_free(pattern->key.protocols); |
| 1003 | rte_free(pattern->key.attributes); |
| 1004 | |
| 1005 | for (j = 0; j < pattern->actions_size; j++) { |
| 1006 | struct cpfl_flow_js_pr_action *pr_act; |
| 1007 | |
| 1008 | pr_act = &pattern->actions[j]; |
| 1009 | cpfl_parser_free_pr_action(pr_act); |
| 1010 | } |
| 1011 | rte_free(pattern->actions); |
| 1012 | } |
| 1013 | rte_free(parser->patterns); |
| 1014 | for (i = 0; i < parser->mr_size; i++) { |
| 1015 | struct cpfl_flow_js_mr *mr = &parser->modifications[i]; |
| 1016 | |
| 1017 | rte_free(mr->key.actions); |
| 1018 | } |
| 1019 | rte_free(parser->modifications); |
| 1020 | rte_free(parser); |
| 1021 | |
| 1022 | return 0; |
| 1023 | } |
| 1024 | |
| 1025 | static int |
| 1026 | cpfl_get_items_length(const struct rte_flow_item *items) |
no test coverage detected