The first two patches introduce new rules to deduplicate the code for parsing `limit rate` expressions and make it easier to extend the syntax. The third patch extends the syntax to handle expressions like `limit rate 1 mbytes / second`, which are not currently supported. Changes since v1: * add patches 1 & 2 in order to simplify the new rule added in patch 3. Jeremy Sowden (3): parser: add new `limit_bytes` rule parser: add `limit_rate_pkts` and `limit_rate_bytes` rules parser: extend limit syntax include/datatype.h | 4 + src/parser_bison.y | 141 ++++++++++++++++++----------------- tests/py/any/limit.t | 5 ++ tests/py/any/limit.t.json | 39 ++++++++++ tests/py/any/limit.t.payload | 13 ++++ 5 files changed, 134 insertions(+), 68 deletions(-) -- 2.33.0