From 59e69bf9106e6f085f90cb33ac7241e3ded41767 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Tue, 26 Jul 2016 22:35:07 +0300 Subject: trafgen: proto: Reference to packet from struct proto_hdr Using of current_packet() is not possible for dynamically updated fields so we need to keep the packet index in proto_hdr struct to reference the correct packet. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- trafgen_proto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'trafgen_proto.h') diff --git a/trafgen_proto.h b/trafgen_proto.h index 72cd9f7..d2fde62 100644 --- a/trafgen_proto.h +++ b/trafgen_proto.h @@ -30,6 +30,8 @@ enum proto_layer { PROTO_L4, }; +struct proto_hdr; + struct proto_field { uint32_t id; size_t len; @@ -40,6 +42,7 @@ struct proto_field { bool is_set; uint16_t pkt_offset; + struct proto_hdr *hdr; }; struct proto_hdr { @@ -49,6 +52,7 @@ struct proto_hdr { struct proto_hdr *next; struct proto_ctx *ctx; uint16_t pkt_offset; + uint32_t pkt_id; struct proto_field *fields; size_t fields_count; size_t len; -- cgit v1.2.3-54-g00ecf