break;
case EXPR_RANGE:
case EXPR_PREFIX:
+ case EXPR_RANGE_VALUE:
/* allowed on RHS (e.g. th dport . mark { 1-65535 . 42 }
* ~~~~~~~~ allowed
* but not on LHS (e.g 1-4 . mark { ...}
case EXPR_SET_REF:
case EXPR_MAPPING:
case EXPR_SET_ELEM_CATCHALL:
- case EXPR_RANGE_VALUE:
case EXPR_RANGE_SYMBOL:
return expr_error(ctx->msgs, i,
"cannot use %s in concatenation",
switch (elem->key->etype) {
case EXPR_PREFIX:
case EXPR_RANGE:
+ case EXPR_RANGE_VALUE:
key = elem->key;
goto err_missing_flag;
case EXPR_CONCAT:
switch (key->etype) {
case EXPR_PREFIX:
case EXPR_RANGE:
+ case EXPR_RANGE_VALUE:
goto err_missing_flag;
default:
break;
left = range->left;
right = range->right;
- /* concatenation and maps need more work to use constant_range_expr. */
+ /* maps need more work to use constant_range_expr. */
if (ctx->set && !set_is_map(ctx->set->flags) &&
- set_is_non_concat_range(ctx->set) &&
left->etype == EXPR_VALUE &&
right->etype == EXPR_VALUE) {
constant_range = constant_range_expr_alloc(&expr->location,
byteorder_switch_expr_value(value, expr);
i = expr;
+ break;
+ case EXPR_RANGE_VALUE:
+ if (flags & EXPR_F_INTERVAL_END)
+ mpz_init_set(value, i->range.high);
+ else
+ mpz_init_set(value, i->range.low);
+
+ if (expr_basetype(i)->type == TYPE_INTEGER &&
+ i->byteorder == BYTEORDER_HOST_ENDIAN)
+ byteorder_switch_expr_value(value, i);
+
break;
case EXPR_PREFIX:
if (flags & EXPR_F_INTERVAL_END) {