| | 1 | {{{ |
| | 2 | |
| | 3 | # |
| | 4 | # Define a prototype |
| | 5 | # |
| | 6 | |
| | 7 | require 'handler/prototype' |
| | 8 | require 'handler/filter' |
| | 9 | require 'handler/appDefinition' |
| | 10 | |
| | 11 | p = Prototype.create("test:proto:raw_receiver") |
| | 12 | p.name = "RAW Receiver" |
| | 13 | p.description = "Nodes which receive packets" |
| | 14 | p.defProperty('protocol', 'Protocol to use', 'udp') |
| | 15 | p.defProperty('rxdev', 'rx dev interface') |
| | 16 | p.defProperty('dstfilter', 'dst ip address as filter') |
| | 17 | |
| | 18 | otr= p.addApplication('otr', "test:app:otr") |
| | 19 | otr.bindProperty('protocol') |
| | 20 | otr.bindProperty('rxdev') |
| | 21 | otr.bindProperty('dstfilter') |
| | 22 | |
| | 23 | otr.addMeasurement('receiverport',Filter::TIME, |
| | 24 | {Filter::SAMPLE_SIZE => 1}, |
| | 25 | [ |
| | 26 | ['pkt_seqno'], |
| | 27 | ['flow_no'], |
| | 28 | ['rcvd_pkt_size', Filter::SUM], |
| | 29 | ['rx_timestamp'], |
| | 30 | ['rssi'], |
| | 31 | ['xmitrate'] |
| | 32 | ] |
| | 33 | ) |
| | 34 | |
| | 35 | otr.addMeasurement('flow', Filter::SAMPLE, |
| | 36 | {Filter::SAMPLE_SIZE => 1}, |
| | 37 | [ |
| | 38 | ['flow_no'], |
| | 39 | ['sender_port'] |
| | 40 | ] |
| | 41 | ) |
| | 42 | |
| | 43 | if $0 == __FILE__ |
| | 44 | p.to_xml.write($stdout, 2) |
| | 45 | puts |
| | 46 | end |
| | 47 | |
| | 48 | |
| | 49 | }}} |