Add current_packet() helper for getting current used packet and make it public to other modules.
Signed-off-by: Vadim Kochan <vadi...@gmail.com> --- trafgen_conf.h | 2 ++ trafgen_parser.y | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/trafgen_conf.h b/trafgen_conf.h index b286810..096fd4c 100644 --- a/trafgen_conf.h +++ b/trafgen_conf.h @@ -51,4 +51,6 @@ extern void set_multi_byte(uint8_t *s, size_t len); extern void set_fill(uint8_t val, size_t len); extern void set_byte(uint8_t val); +extern struct packet *current_packet(void); + #endif /* TRAFGEN_CONF */ diff --git a/trafgen_parser.y b/trafgen_parser.y index 4719f55..249fdde 100644 --- a/trafgen_parser.y +++ b/trafgen_parser.y @@ -139,6 +139,11 @@ void realloc_packet(void) __init_new_csum_slot(&packet_dyn[packetd_last]); } +struct packet *current_packet(void) +{ + return &packets[packet_last]; +} + void set_byte(uint8_t val) { struct packet *pkt = &packets[packet_last]; -- 2.4.2 -- You received this message because you are subscribed to the Google Groups "netsniff-ng" group. To unsubscribe from this group and stop receiving emails from it, send an email to netsniff-ng+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.