Orbit > OTG > Scripts Repository > receiver.rb
#
# Define a prototype
#
require 'handler/prototype'
require 'handler/filter'
require 'handler/appDefinition'
p = Prototype.create("test:proto:receiver")
p.name = "Receiver"
p.description = "Nodes which receive packets"
p.defProperty('protocol', 'Protocol to use', 'udp')
p.defProperty('port', 'Port to listen on', 4000)
p.defProperty('hostname', 'My own ID for libmac filter', 'localhost')
otr = p.addApplication('otr', "test:app:otr")
otr.bindProperty('protocol')
otr.bindProperty('port')
otr.bindProperty('hostname')
otr.addMeasurement('receiverport',Filter::TIME,
  {Filter::SAMPLE_SIZE => 1},
  [
    ['pkt_seqno'],
    ['flow_no'],
    ['rcvd_pkt_size', Filter::SUM],
    ['rx_timestamp'],
    ['rssi'],
    ['xmitrate']
  ]
)
otr.addMeasurement('flow', Filter::SAMPLE,
 {Filter::SAMPLE_SIZE => 1},
 [
   ['flow_no'],
   ['sender_port']
 ]
)
if $0 == __FILE__
  p.to_xml.write($stdout, 2)
  puts
end
          
            Last modified
 20 years ago          
          
            Last modified on Apr 4, 2006, 9:13:18 PM
          
        
      
  Note:
 See   TracWiki
 for help on using the wiki.
    