diff options
author | Patrick McHardy <kaber@trash.net> | 2013-04-15 00:36:36 +0200 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2013-04-18 15:28:46 +0200 |
commit | 84cf34938294e404fd7e9ebe1a630fe868ae22da (patch) | |
tree | 040ef41daf17fee350c294ed19d409d1a651a299 /include/datatype.h | |
parent | a711ab22a58504e52c33f5fd939643002d7e6a81 (diff) |
expr: fix concat expression type propagation
Dynamically instantiate a data type to represent all types of a concatenation
and use that for type propagation.
Diffstat (limited to 'include/datatype.h')
-rw-r--r-- | include/datatype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/datatype.h b/include/datatype.h index 53889934..8a123631 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -117,6 +117,12 @@ extern struct error_record *symbol_parse(const struct expr *sym, struct expr **res); extern void datatype_print(const struct expr *expr); +static inline bool datatype_equal(const struct datatype *d1, + const struct datatype *d2) +{ + return d1->type == d2->type; +} + /** * struct symbolic_constant - symbol <-> constant mapping * @@ -168,4 +174,7 @@ extern const struct datatype inet_service_type; extern const struct datatype mark_type; extern const struct datatype time_type; +extern const struct datatype *concat_type_alloc(const struct expr *expr); +extern void concat_type_destroy(const struct datatype *dtype); + #endif /* NFTABLES_DATATYPE_H */ |