diff options
author | Xavier Simonart <simonartxavier@gmail.com> | 2021-09-11 18:33:25 +0000 |
---|---|---|
committer | Xavier Simonart <simonartxavier@gmail.com> | 2021-09-11 18:44:33 +0000 |
commit | 8793304de2a9ec5035f632152b580ee6113b56f6 (patch) | |
tree | 303178f063acf33fa9e41e88b33187a6186875ef /VNFs/DPPD-PROX/task_init.h | |
parent | 5815cd749e9c23422e4d04bf00920e493efa4be8 (diff) |
Basic support for ranges in generator
This commit add initial support for ranges.
Ranges can now be specified using an offset and a range, in a similar
way as random. e.g.:
range=2-16001
range_offset=28
The two previous lines will range the src IP address from x.x.0.2 to
x.x.3e.81 in an IPv4 packet.
The range option will write as many bytes as the bytes needed for
the max (2 bytes in the example above), up to 4 bytes.
Runtime, the generator will iterate through the range in a linear way,
starting from the min.
No check are done whether range overlap themselves or whether they
overlap with randoms.
As of now, no support for command line or script option.
Signed-off-by: Xavier Simonart <simonartxavier@gmail.com>
Change-Id: I98a1757998955f48631a5929bd7534481975eedc
Diffstat (limited to 'VNFs/DPPD-PROX/task_init.h')
-rw-r--r-- | VNFs/DPPD-PROX/task_init.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/VNFs/DPPD-PROX/task_init.h b/VNFs/DPPD-PROX/task_init.h index 54c30304..6a14aae0 100644 --- a/VNFs/DPPD-PROX/task_init.h +++ b/VNFs/DPPD-PROX/task_init.h @@ -100,6 +100,14 @@ enum police_action { ACT_INVALID = 4 }; +struct range { + uint32_t min; + uint32_t value; + uint32_t max; + uint32_t offset; + uint8_t range_len; +}; + /* Configuration for task that is only used during startup. */ struct task_args { struct task_base *tbase; @@ -191,8 +199,10 @@ struct task_args { /* gen related*/ uint64_t rate_bps; uint32_t n_rand_str; - char rand_str[64][64]; + uint32_t n_ranges; uint32_t rand_offset[64]; + char rand_str[64][64]; + struct range range[64]; char pcap_file[256]; uint32_t accur_pos; uint32_t sig_pos; |