From 4fee12b4b0a837b4d34d21be99cda8185563f784 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 31 Mar 2009 04:14:26 +0200 Subject: 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 --- src/evaluate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/evaluate.c') 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); } -- cgit v1.2.3