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

Function parse_init

dpdk/app/test-pmd/cmdline_flow.c:7755–7778  ·  view source on GitHub ↗

Parse flow command, initialize output buffer for subsequent tokens. */

Source from the content-addressed store, hash-verified

7753
7754/** Parse flow command, initialize output buffer for subsequent tokens. */
7755static int
7756parse_init(struct context *ctx, const struct token *token,
7757 const char *str, unsigned int len,
7758 void *buf, unsigned int size)
7759{
7760 struct buffer *out = buf;
7761
7762 /* Token name must match. */
7763 if (parse_default(ctx, token, str, len, NULL, 0) < 0)
7764 return -1;
7765 /* Nothing else to do if there is no buffer. */
7766 if (!out)
7767 return len;
7768 /* Make sure buffer is large enough. */
7769 if (size < sizeof(*out))
7770 return -1;
7771 /* Initialize buffer. */
7772 memset(out, 0x00, sizeof(*out));
7773 memset((uint8_t *)out + sizeof(*out), 0x22, size - sizeof(*out));
7774 ctx->objdata = 0;
7775 ctx->object = out;
7776 ctx->objmask = NULL;
7777 return len;
7778}
7779
7780/** Parse tokens for indirect action commands. */
7781static int

Callers

nothing calls this directly

Calls 2

parse_defaultFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected