(command.CommandList children: [ (command.ShFunction name: usage body: (BraceGroup children: [ (C {<echo>} {(DQ )}) (C {<echo>} {(DQ <'Usage: '> ($ Id.VSub_Number '$0') <' [-vx] -i ethX'>)}) (C {<echo>} { (DQ <' -i : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'DEV) output interface/device (required)'> ) } ) (C {<echo>} { (DQ <' -s : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'PKT_SIZE) packet size'> ) } ) (C {<echo>} { (DQ <' -d : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'DEST_IP) destination IP'> ) } ) (C {<echo>} { (DQ <' -m : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'DST_MAC) destination MAC-addr'> ) } ) (C {<echo>} { (DQ <' -t : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'THREADS) threads to start'> ) } ) (C {<echo>} { (DQ <' -c : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'SKB_CLONE) SKB clones send before alloc new SKB'> ) } ) (C {<echo>} { (DQ <' -b : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'BURST) HW level bursting of SKBs'> ) } ) (C {<echo>} { (DQ <' -v : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'VERBOSE) verbose'> ) } ) (C {<echo>} { (DQ <' -x : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'DEBUG) debug'> ) } ) (C {<echo>} { (DQ <' -6 : ('> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'IP6) IPv6'> ) } ) (C {<echo>} {(DQ )}) ] ) ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (C {<getopts>} {(DQ <'s:i:d:m:t:c:b:vxh6'>)} {<option>}) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.Case to_match: {($ Id.VSub_DollarName '$option')} arms: [ (case_arm pat_list: [{<i>}] action: [ (C {<export>} {<Id.Lit_VarLike 'DEV='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} {(DQ <'Output device set to: DEV='> ($ Id.VSub_DollarName '$DEV'))}) ] spids: [159 160 180 -1] ) (case_arm pat_list: [{<s>}] action: [ (C {<export>} {<Id.Lit_VarLike 'PKT_SIZE='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} { (DQ <'Packet size set to: PKT_SIZE='> ($ Id.VSub_DollarName '$PKT_SIZE') <' bytes'> ) } ) ] spids: [183 184 202 -1] ) (case_arm pat_list: [{<d>}] action: [ (C {<export>} {<Id.Lit_VarLike 'DEST_IP='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} {(DQ <'Destination IP set to: DEST_IP='> ($ Id.VSub_DollarName '$DEST_IP'))} ) ] spids: [205 206 226 -1] ) (case_arm pat_list: [{<m>}] action: [ (C {<export>} {<Id.Lit_VarLike 'DST_MAC='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} {(DQ <'Destination MAC set to: DST_MAC='> ($ Id.VSub_DollarName '$DST_MAC'))} ) ] spids: [229 230 250 -1] ) (case_arm pat_list: [{<t>}] action: [ (C {<export>} {<Id.Lit_VarLike 'THREADS='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<export>} {<Id.Lit_VarLike 'CPU_THREADS='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<let>} {(DQ <'CPU_THREADS -= 1'>)}) (C {<info>} { (DQ <'Number of threads to start: '> ($ Id.VSub_DollarName '$THREADS') <' (0 to '> ($ Id.VSub_DollarName '$CPU_THREADS') <')'> ) } ) ] spids: [253 254 287 -1] ) (case_arm pat_list: [{<c>}] action: [ (C {<export>} {<Id.Lit_VarLike 'CLONE_SKB='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} {(DQ <'CLONE_SKB='> ($ Id.VSub_DollarName '$CLONE_SKB'))}) ] spids: [290 291 308 -1] ) (case_arm pat_list: [{<b>}] action: [ (C {<export>} {<Id.Lit_VarLike 'BURST='> ($ Id.VSub_DollarName '$OPTARG')}) (C {<info>} {(DQ <'SKB bursting: BURST='> ($ Id.VSub_DollarName '$BURST'))}) ] spids: [311 312 329 -1] ) (case_arm pat_list: [{<v>}] action: [ (C {<export>} {<Id.Lit_VarLike 'VERBOSE='> <yes>}) (C {<info>} {(DQ <'Verbose mode: VERBOSE='> ($ Id.VSub_DollarName '$VERBOSE'))}) ] spids: [332 333 350 -1] ) (case_arm pat_list: [{<x>}] action: [ (C {<export>} {<Id.Lit_VarLike 'DEBUG='> <yes>}) (C {<info>} {(DQ <'Debug mode: DEBUG='> ($ Id.VSub_DollarName '$DEBUG'))}) ] spids: [353 354 371 -1] ) (case_arm pat_list: [{<6>}] action: [ (C {<export>} {<Id.Lit_VarLike 'IP6='> <6>}) (C {<info>} {(DQ <'IP6: IP6='> ($ Id.VSub_DollarName '$IP6'))}) ] spids: [374 375 392 -1] ) (case_arm pat_list: [{<h>} {<Id.Lit_QMark '?'>} {<Id.Lit_Star '*'>}] action: [ (command.Sentence child: (C {<usage>}) terminator: <Id.Op_Semi _> ) (C {<err>} {<2>} {(DQ <'[ERROR] Unknown parameters!!!'>)}) ] spids: [395 400 -1 416] ) ] ) ] ) ) (C {<shift>} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$OPTIND')} right: {<Id.Lit_Digits 1>} ) ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$PKT_SIZE'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<export>} {<Id.Lit_VarLike 'PKT_SIZE='> <60>}) (C {<info>} { (DQ <'Default packet size set to: set to: '> ($ Id.VSub_DollarName '$PKT_SIZE') <' bytes'> ) } ) ] spids: [434 447] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$THREADS'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<export>} {<Id.Lit_VarLike 'CPU_THREADS='> <0>}) (C {<export>} {<Id.Lit_VarLike 'THREADS='> <1>}) ] spids: [471 484] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$DEV'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<usage>}) (C {<err>} {<2>} {(DQ <'Please specify output device'>)})] spids: [505 518] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$DST_MAC'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<warn>} {(DQ <'Missing destination MAC address'>)})] spids: [535 548] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$DEST_IP'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<warn>} {(DQ <'Missing destination IP address'>)})] spids: [560 573] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-d>} {<'/proc/net/pktgen'>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<info>} {(DQ <'Loading kernel module: pktgen'>)}) (C {<modprobe>} {<pktgen>})] spids: [585 598] ) ] ) ] )