Parse tokens for indirect action destroy command. */
| 7843 | |
| 7844 | /** Parse tokens for indirect action destroy command. */ |
| 7845 | static int |
| 7846 | parse_ia_destroy(struct context *ctx, const struct token *token, |
| 7847 | const char *str, unsigned int len, |
| 7848 | void *buf, unsigned int size) |
| 7849 | { |
| 7850 | struct buffer *out = buf; |
| 7851 | uint32_t *action_id; |
| 7852 | |
| 7853 | /* Token name must match. */ |
| 7854 | if (parse_default(ctx, token, str, len, NULL, 0) < 0) |
| 7855 | return -1; |
| 7856 | /* Nothing else to do if there is no buffer. */ |
| 7857 | if (!out) |
| 7858 | return len; |
| 7859 | if (!out->command || out->command == INDIRECT_ACTION) { |
| 7860 | if (ctx->curr != INDIRECT_ACTION_DESTROY) |
| 7861 | return -1; |
| 7862 | if (sizeof(*out) > size) |
| 7863 | return -1; |
| 7864 | out->command = ctx->curr; |
| 7865 | ctx->objdata = 0; |
| 7866 | ctx->object = out; |
| 7867 | ctx->objmask = NULL; |
| 7868 | out->args.ia_destroy.action_id = |
| 7869 | (void *)RTE_ALIGN_CEIL((uintptr_t)(out + 1), |
| 7870 | sizeof(double)); |
| 7871 | return len; |
| 7872 | } |
| 7873 | action_id = out->args.ia_destroy.action_id |
| 7874 | + out->args.ia_destroy.action_id_n++; |
| 7875 | if ((uint8_t *)action_id > (uint8_t *)out + size) |
| 7876 | return -1; |
| 7877 | ctx->objdata = 0; |
| 7878 | ctx->object = action_id; |
| 7879 | ctx->objmask = NULL; |
| 7880 | return len; |
| 7881 | } |
| 7882 | |
| 7883 | /** Parse tokens for indirect action commands. */ |
| 7884 | static int |
nothing calls this directly
no test coverage detected