MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cmd_pipeline_selector_group_delete

Function cmd_pipeline_selector_group_delete

dpdk/examples/pipeline/cli.c:1237–1284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1235"pipeline <pipeline_name> selector <selector_name> group delete <group_id>\n";
1236
1237static void
1238cmd_pipeline_selector_group_delete(char **tokens,
1239 uint32_t n_tokens,
1240 char *out,
1241 size_t out_size,
1242 void *obj __rte_unused)
1243{
1244 struct rte_swx_ctl_pipeline *ctl;
1245 char *pipeline_name, *selector_name;
1246 uint32_t group_id;
1247 int status;
1248
1249 if (n_tokens != 7) {
1250 snprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);
1251 return;
1252 }
1253
1254 pipeline_name = tokens[1];
1255 ctl = rte_swx_ctl_pipeline_find(pipeline_name);
1256 if (!ctl) {
1257 snprintf(out, out_size, MSG_ARG_INVALID, "pipeline_name");
1258 return;
1259 }
1260
1261 if (strcmp(tokens[2], "selector") != 0) {
1262 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "selector");
1263 return;
1264 }
1265
1266 selector_name = tokens[3];
1267
1268 if (strcmp(tokens[4], "group") ||
1269 strcmp(tokens[5], "delete")) {
1270 snprintf(out, out_size, MSG_ARG_NOT_FOUND, "group delete");
1271 return;
1272 }
1273
1274 if (parser_read_uint32(&group_id, tokens[6]) != 0) {
1275 snprintf(out, out_size, MSG_ARG_INVALID, "group_id");
1276 return;
1277 }
1278
1279 status = rte_swx_ctl_pipeline_selector_group_delete(ctl,
1280 selector_name,
1281 group_id);
1282 if (status)
1283 snprintf(out, out_size, MSG_CMD_FAIL, tokens[0]);
1284}
1285
1286#define GROUP_MEMBER_INFO_TOKENS_MAX 6
1287

Callers 1

cli_processFunction · 0.85

Calls 5

snprintfFunction · 0.85
strcmpFunction · 0.85
parser_read_uint32Function · 0.70

Tested by

no test coverage detected