* table_action ::= * * action * fwd * drop * | port * | meta * | table * [balance ... ] * [meter * tc0 meter policer g y r * [tc1 meter policer g y r * tc2 meter policer g y r * tc3 meter <meter
| 3042 | * <pa> ::= g | y | r | drop |
| 3043 | */ |
| 3044 | static uint32_t |
| 3045 | parse_table_action_fwd(char **tokens, |
| 3046 | uint32_t n_tokens, |
| 3047 | struct table_rule_action *a) |
| 3048 | { |
| 3049 | if ((n_tokens == 0) || (strcmp(tokens[0], "fwd") != 0)) |
| 3050 | return 0; |
| 3051 | |
| 3052 | tokens++; |
| 3053 | n_tokens--; |
| 3054 | |
| 3055 | if (n_tokens && (strcmp(tokens[0], "drop") == 0)) { |
| 3056 | a->fwd.action = RTE_PIPELINE_ACTION_DROP; |
| 3057 | a->action_mask |= 1 << RTE_TABLE_ACTION_FWD; |
| 3058 | return 1 + 1; |
| 3059 | } |
| 3060 | |
| 3061 | if (n_tokens && (strcmp(tokens[0], "port") == 0)) { |
| 3062 | uint32_t id; |
| 3063 | |
| 3064 | if ((n_tokens < 2) || |
| 3065 | parser_read_uint32(&id, tokens[1])) |
| 3066 | return 0; |
| 3067 | |
| 3068 | a->fwd.action = RTE_PIPELINE_ACTION_PORT; |
| 3069 | a->fwd.id = id; |
| 3070 | a->action_mask |= 1 << RTE_TABLE_ACTION_FWD; |
| 3071 | return 1 + 2; |
| 3072 | } |
| 3073 | |
| 3074 | if (n_tokens && (strcmp(tokens[0], "meta") == 0)) { |
| 3075 | a->fwd.action = RTE_PIPELINE_ACTION_PORT_META; |
| 3076 | a->action_mask |= 1 << RTE_TABLE_ACTION_FWD; |
| 3077 | return 1 + 1; |
| 3078 | } |
| 3079 | |
| 3080 | if (n_tokens && (strcmp(tokens[0], "table") == 0)) { |
| 3081 | uint32_t id; |
| 3082 | |
| 3083 | if ((n_tokens < 2) || |
| 3084 | parser_read_uint32(&id, tokens[1])) |
| 3085 | return 0; |
| 3086 | |
| 3087 | a->fwd.action = RTE_PIPELINE_ACTION_TABLE; |
| 3088 | a->fwd.id = id; |
| 3089 | a->action_mask |= 1 << RTE_TABLE_ACTION_FWD; |
| 3090 | return 1 + 2; |
| 3091 | } |
| 3092 | |
| 3093 | return 0; |
| 3094 | } |
| 3095 | |
| 3096 | static uint32_t |
| 3097 | parse_table_action_balance(char **tokens, |
no test coverage detected