Changes between Initial Version and Version 1 of Old/Documentation/OTG/ScriptsRepository/ProtoDefReceiver


Ignore:
Timestamp:
Sep 26, 2005, 6:39:49 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Old/Documentation/OTG/ScriptsRepository/ProtoDefReceiver

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