| | 1 | {{{ |
| | 2 | |
| | 3 | # |
| | 4 | # Define a prototype |
| | 5 | # |
| | 6 | require 'handler/prototype' |
| | 7 | require 'handler/filter' |
| | 8 | require 'handler/appDefinition' |
| | 9 | |
| | 10 | p = Prototype.create("test:proto:iperfudpsender") |
| | 11 | p.name = "Iperf UDP Sender" |
| | 12 | p.description = "Nodes which send a stream of packets" |
| | 13 | p.defProperty('use_udp', 'Protocol to use') |
| | 14 | p.defProperty('client', 'Host to send packets to') |
| | 15 | p.defProperty('sender_rate', 'Number of bits per second', 100000) |
| | 16 | #p.defProperty('port', 'Port to send packets to') |
| | 17 | p.defProperty('len', 'Size of packets') |
| | 18 | p.defProperty('time', 'Experiment duration (sec)', 10) |
| | 19 | |
| | 20 | iperfs = p.addApplication(:iperfs, "test:app:iperfs") |
| | 21 | iperfs.bindProperty('udp','use_udp') |
| | 22 | iperfs.bindProperty('client') |
| | 23 | iperfs.bindProperty('bandwidth','sender_rate') |
| | 24 | iperfs.bindProperty('len') |
| | 25 | iperfs.bindProperty('time') |
| | 26 | #iperfs.bindProperty('port') |
| | 27 | |
| | 28 | |
| | 29 | if $0 == __FILE__ |
| | 30 | p.to_xml.write($stdout, 2) |
| | 31 | puts |
| | 32 | end |
| | 33 | |
| | 34 | }}} |