summaryrefslogtreecommitdiffstats
path: root/src/evaluate.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-03-31 04:14:26 +0200
committerPatrick McHardy <kaber@trash.net>2009-03-31 04:14:26 +0200
commit4fee12b4b0a837b4d34d21be99cda8185563f784 (patch)
tree129d65c66938c3851be3a3a35eb6523e5fef8791 /src/evaluate.c
parent53fc2c7a799877c5859298bd16b578711af9cca2 (diff)
datatype: maintain table of all datatypes and add registration/lookup function
Add a table containing all available datatypes and registration/lookup functions. This will be used to associate a stand-alone set in the kernel with the correct type without parsing the entire ruleset. Additionally it would now be possible to remove the global declarations for the core types. Not done yet though. Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'src/evaluate.c')
-rw-r--r--src/evaluate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/evaluate.c b/src/evaluate.c
index cf3ff7f7..c8625bbc 100644
--- a/src/evaluate.c
+++ b/src/evaluate.c
@@ -219,7 +219,7 @@ static int expr_evaluate_prefix(struct eval_ctx *ctx, struct expr **expr)
if (expr_basetype(base)->type != TYPE_INTEGER)
return expr_error(ctx, prefix,
"Prefix expression is undefined for "
- "%s types", base->dtype->name);
+ "%s types", base->dtype->desc);
if (prefix->prefix_len > base->len)
return expr_error(ctx, prefix,
@@ -259,7 +259,7 @@ static int expr_evaluate_range_expr(struct eval_ctx *ctx,
if (expr_basetype(*expr)->type != TYPE_INTEGER)
return expr_binary_error(ctx, *expr, range,
"Range expression is undefined for "
- "%s types", (*expr)->dtype->name);
+ "%s types", (*expr)->dtype->desc);
if (!expr_is_constant(*expr))
return expr_binary_error(ctx, *expr, range,
"Range is not constant");
@@ -449,7 +449,7 @@ static int expr_evaluate_binop(struct eval_ctx *ctx, struct expr **expr)
return expr_binary_error(ctx, left, op,
"Binary operation (%s) is undefined "
"for %s types",
- sym, left->dtype->name);
+ sym, left->dtype->desc);
if (expr_is_constant(left) && !expr_is_singleton(left))
return expr_binary_error(ctx, left, op,
@@ -527,7 +527,7 @@ static int expr_evaluate_list(struct eval_ctx *ctx, struct expr **expr)
if (i->dtype->basetype->type != TYPE_BITMASK)
return expr_error(ctx, i,
"Basetype of type %s is not bitmask",
- i->dtype->name);
+ i->dtype->desc);
mpz_ior(val, val, i->value);
}