Parse flow command, initialize output buffer for subsequent tokens. */
| 7753 | |
| 7754 | /** Parse flow command, initialize output buffer for subsequent tokens. */ |
| 7755 | static int |
| 7756 | parse_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. */ |
| 7781 | static int |
nothing calls this directly
no test coverage detected