| 1421 | " cpu <cpu_id>\n"; |
| 1422 | |
| 1423 | static void |
| 1424 | cmd_pipeline(char **tokens, |
| 1425 | uint32_t n_tokens, |
| 1426 | char *out, |
| 1427 | size_t out_size) |
| 1428 | { |
| 1429 | struct pipeline_params p; |
| 1430 | char *name; |
| 1431 | struct pipeline *pipeline; |
| 1432 | |
| 1433 | if (n_tokens != 8) { |
| 1434 | snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]); |
| 1435 | return; |
| 1436 | } |
| 1437 | |
| 1438 | name = tokens[1]; |
| 1439 | |
| 1440 | if (strcmp(tokens[2], "period") != 0) { |
| 1441 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "period"); |
| 1442 | return; |
| 1443 | } |
| 1444 | |
| 1445 | if (parser_read_uint32(&p.timer_period_ms, tokens[3]) != 0) { |
| 1446 | snprintf(out, out_size, MSG_ARG_INVALID, "timer_period_ms"); |
| 1447 | return; |
| 1448 | } |
| 1449 | |
| 1450 | if (strcmp(tokens[4], "offset_port_id") != 0) { |
| 1451 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "offset_port_id"); |
| 1452 | return; |
| 1453 | } |
| 1454 | |
| 1455 | if (parser_read_uint32(&p.offset_port_id, tokens[5]) != 0) { |
| 1456 | snprintf(out, out_size, MSG_ARG_INVALID, "offset_port_id"); |
| 1457 | return; |
| 1458 | } |
| 1459 | |
| 1460 | if (strcmp(tokens[6], "cpu") != 0) { |
| 1461 | snprintf(out, out_size, MSG_ARG_NOT_FOUND, "cpu"); |
| 1462 | return; |
| 1463 | } |
| 1464 | |
| 1465 | if (parser_read_uint32(&p.cpu_id, tokens[7]) != 0) { |
| 1466 | snprintf(out, out_size, MSG_ARG_INVALID, "cpu_id"); |
| 1467 | return; |
| 1468 | } |
| 1469 | |
| 1470 | pipeline = pipeline_create(name, &p); |
| 1471 | if (pipeline == NULL) { |
| 1472 | snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]); |
| 1473 | return; |
| 1474 | } |
| 1475 | } |
| 1476 | |
| 1477 | static const char cmd_pipeline_port_in_help[] = |
| 1478 | "pipeline <pipeline_name> port in\n" |
no test coverage detected