summaryrefslogtreecommitdiff
path: root/trafgen_proto.h
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-07-26 22:35:07 +0300
committerTobias Klauser <tklauser@distanz.ch>2016-08-02 16:11:19 +0200
commit59e69bf9106e6f085f90cb33ac7241e3ded41767 (patch)
tree95d82ae7f5205972ff8b74f7f1f4b258138d3e88 /trafgen_proto.h
parenta378db32a6e88a04d839bf2c2f27f62d81986186 (diff)
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 <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_proto.h')
-rw-r--r--trafgen_proto.h4
1 files changed, 4 insertions, 0 deletions
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;