diff options
author | Patrick McHardy <kaber@trash.net> | 2014-03-06 17:03:19 +0100 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2014-03-07 10:19:04 +0100 |
commit | 7663afee1685272777d74b6c6117b71ae06bec95 (patch) | |
tree | 05ff50391a64392874ea74cc2535a433c085f8d2 /include/expression.h | |
parent | e7b43ec0c9bc244795163478aa4c3e33750b5d64 (diff) |
expr: add comparison function for singleton expressions
Singed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/expression.h')
-rw-r--r-- | include/expression.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/expression.h b/include/expression.h index 354e679c..d974131e 100644 --- a/include/expression.h +++ b/include/expression.h @@ -120,6 +120,7 @@ static inline void expr_set_context(struct expr_ctx *ctx, * @destroy: destructor, must release inner expressions * @set_type: function to promote type and byteorder of inner types * @print: function to print the expression + * @cmp: function to compare two expressions of the same types * @pctx_update:update protocol context */ struct proto_ctx; @@ -132,6 +133,8 @@ struct expr_ops { const struct datatype *dtype, enum byteorder byteorder); void (*print)(const struct expr *expr); + bool (*cmp)(const struct expr *e1, + const struct expr *e2); void (*pctx_update)(struct proto_ctx *ctx, const struct expr *expr); }; @@ -261,6 +264,7 @@ extern struct expr *expr_clone(const struct expr *expr); extern struct expr *expr_get(struct expr *expr); extern void expr_free(struct expr *expr); extern void expr_print(const struct expr *expr); +extern bool expr_cmp(const struct expr *e1, const struct expr *e2); extern void expr_describe(const struct expr *expr); extern const struct datatype *expr_basetype(const struct expr *expr); |