| 12297 | } |
| 12298 | |
| 12299 | int |
| 12300 | flow_parse(const char *src, void *result, unsigned int size, |
| 12301 | struct rte_flow_attr **attr, |
| 12302 | struct rte_flow_item **pattern, struct rte_flow_action **actions) |
| 12303 | { |
| 12304 | int ret; |
| 12305 | struct context saved_flow_ctx = cmd_flow_context; |
| 12306 | |
| 12307 | cmd_flow_context_init(&cmd_flow_context); |
| 12308 | do { |
| 12309 | ret = cmd_flow_parse(NULL, src, result, size); |
| 12310 | if (ret > 0) { |
| 12311 | src += ret; |
| 12312 | while (isspace(*src)) |
| 12313 | src++; |
| 12314 | } |
| 12315 | } while (ret > 0 && strlen(src)); |
| 12316 | cmd_flow_context = saved_flow_ctx; |
| 12317 | *attr = &((struct buffer *)result)->args.vc.attr; |
| 12318 | *pattern = ((struct buffer *)result)->args.vc.pattern; |
| 12319 | *actions = ((struct buffer *)result)->args.vc.actions; |
| 12320 | return (ret >= 0 && !strlen(src)) ? 0 : -1; |
| 12321 | } |
| 12322 | |
| 12323 | /** Return number of completion entries (cmdline API). */ |
| 12324 | static int |
no test coverage detected