-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.npf
29 lines (24 loc) · 1.01 KB
/
gen.npf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
%variables
NFLOWS=10000
PC=0
PORTS=1
PRIORITY=1
TABLE=1
RULES_ETHERNET=0
PIPELINE_SUPPORT?=0
%late_variables
GEN_LENGTH?=1500
SEED?=
RULE_FILE=ip.flows
NRULES?=
NOPRIORITY=( ( $PRIORITY!=0 and "$MODEL" != "E810") or ("$MODEL" == "E810" and $PIPELINE_SUPPORT) )
%script@client autokill=false
//Python script that generates flows and matching (or not) rules
time python3 ${NPF_TESTIE_PATH}/scripts/gen_flows.py $(("$NRULES" if "$NRULES" else "0" )) $PC --format binary $(("" if $PORTS else "--no-ports")) $(("" if $NOPRIORITY else "--no-priority")) --flows $NFLOWS $(("--seed $SEED" if "$SEED" else "")) --min-packets 100000 --length $(( int($GEN_LENGTH - 14) )) --table $TABLE $(("--no-rules" if not "$NRULES" else "")) $(("--ethernet" if $RULES_ETHERNET else ""))
if [ "$MODEL" = "E810" ] && [ "$PIPELINE_SUPPORT" = 1 ]; then
echo "E810: replacing priority of default rule"
sed -e "s/priority 2/priority 0/" -i ip.flows
fi
//Copying the rules to the folder of interest
cp ip.flows ${NICBENCH_PATH}
echo "EVENT FL_DONE"