summaryrefslogtreecommitdiff
path: root/trafgen_parser.y
diff options
context:
space:
mode:
authorVadim Kochan <vadim4j@gmail.com>2016-01-26 22:24:58 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-01-28 13:54:33 +0100
commitbc412cb595d8a06ae47ffc90602a25ecbde81e0d (patch)
treeaed70780509f07f8ffe91e47032090d7f7d1ea43 /trafgen_parser.y
parentfd8fc6f33688135b79022716727b06d78ee87fdc (diff)
trafgen: Add helper to get current packet
Add current_packet() helper for getting current used packet and make it public to other modules. It will be used by proto generation logic. Signed-off-by: Vadim Kochan <vadim4j@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'trafgen_parser.y')
-rw-r--r--trafgen_parser.y5
1 files changed, 5 insertions, 0 deletions
diff --git a/trafgen_parser.y b/trafgen_parser.y
index 49ee577..4725f7c 100644
--- a/trafgen_parser.y
+++ b/trafgen_parser.y
@@ -137,6 +137,11 @@ static void realloc_packet(void)
__init_new_csum_slot(&packet_dyn[packetd_last]);
}
+struct packet *current_packet(void)
+{
+ return &packets[packet_last];
+}
+
static void set_byte(uint8_t val)
{
struct packet *pkt = &packets[packet_last];