Change __proto_field_set_bytes(...) function to take struct proto_field
instead of do looup by hdr & fid.
It is needed to able use this function with some custom
modified struct proto_field (len, pkt_offset).
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 50
Add proto_field_xxx functions to set/get value via specified
proto_field only.
It is good to have such API in case if application needs to set/get
value for some custom proto_field instance.
Signed-off-by: Vadim Kochan
---
trafgen_proto.c | 46
Used IPv6 pattern from nftables project to match valid only IPv6
address to do not mess with MAC or other syntax patterns with ':' symbol.
Signed-off-by: Vadim Kochan
---
trafgen_lexer.l | 51 +++
trafgen_parser.y | 2 +-
2
Add short note about field offset syntax with an example.
Signed-off-by: Vadim Kochan
---
trafgen.8 | 25 +
1 file changed, 25 insertions(+)
diff --git a/trafgen.8 b/trafgen.8
index 62716bb..d669c2a 100644
--- a/trafgen.8
+++ b/trafgen.8
@@ -329,6
Rename all proto_field_xxx(...) functions to proto_hdr_field(...).
It is good for 2 reasons:
1) proto_hdr_field_xxx naming is more consistent as
it is related to proto_hdr API.
2) It makes possible to introduce proto_field_xxx API
which will operate only with struct
Extend field expression with the following syntax:
[] | [:]
which allows to specify value or function at specified offset relative to the
field's offset within a header.
The trick to implement this was to use copies of proto_field instances
in the packet_dyn->fields array which allows to
Rename field_expr rule to field_value_expr to indicate the rule
relates to field value part in case if there will be added field_expr
rule to describe field expression syntax.
Signed-off-by: Vadim Kochan
---
trafgen_parser.y | 30 +++---
1 file
On Sat, Dec 17, 2016 at 4:37 PM, Vadim Kochan wrote:
> Extend field expression with the following syntax:
>
> [] | [:]
>
> which allows to specify value or function at specified offset relative to the
> field's offset within a header.
>
> The trick to implement this was to