diff options
author | imarom <imarom@cisco.com> | 2016-01-10 06:40:58 -0500 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-01-10 06:42:24 -0500 |
commit | 1d074bf3b198c1f160f6e636c21c16c9c833ce61 (patch) | |
tree | 97bb14bac8a3a2053529f8688cf9d58405d672d6 /src/stateless/cp/trex_stream_vm.h | |
parent | 773e9d1c67c314aca8f6f88f676b4dd2d777863d (diff) |
random packet size - uses expected packet size
instead of the value as is
Diffstat (limited to 'src/stateless/cp/trex_stream_vm.h')
-rw-r--r-- | src/stateless/cp/trex_stream_vm.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/stateless/cp/trex_stream_vm.h b/src/stateless/cp/trex_stream_vm.h index edc4f730..ca7f71c1 100644 --- a/src/stateless/cp/trex_stream_vm.h +++ b/src/stateless/cp/trex_stream_vm.h @@ -1143,16 +1143,25 @@ public: m_prefix_size=0; m_bss=0; m_pkt_size=0; + m_expected_pkt_size=0; m_cur_var_offset=0; + m_is_random_var=false; + m_is_change_pkt_size=false; + m_split_instr=NULL; m_is_compiled = false; } - uint16_t get_packet_size() const { - return ( m_pkt_size); - } + /** + * calculate the expected packet size + * might be different from regular_pkt_size + * if the VM changes the packet length (random) + * + */ + uint16_t calc_expected_pkt_size(uint16_t regular_pkt_size) const; + void set_split_instruction(StreamVmInstructionVar *instr); @@ -1227,7 +1236,7 @@ public: } - bool is_compiled() { + bool is_compiled() const { return m_is_compiled; } @@ -1285,7 +1294,10 @@ private: bool m_is_change_pkt_size; bool m_is_compiled; uint16_t m_prefix_size; + uint16_t m_pkt_size; + uint16_t m_expected_pkt_size; + uint16_t m_cur_var_offset; uint16_t m_max_field_update; /* the location of the last byte that is going to be changed in the packet */ @@ -1296,6 +1308,8 @@ private: StreamDPVmInstructions m_instructions; StreamVmInstructionVar *m_split_instr; + + }; |