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


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

Legend:

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

    v1 v1  
     1{{{
     2
     3#
     4# Define a prototype
     5#
     6
     7require 'handler/prototype'
     8require 'handler/filter'
     9require 'handler/appDefinition'
     10
     11p = Prototype.create("test:proto:raw_receiver")
     12p.name = "RAW Receiver"
     13p.description = "Nodes which receive packets"
     14p.defProperty('protocol', 'Protocol to use', 'udp')
     15p.defProperty('rxdev', 'rx dev interface')
     16p.defProperty('dstfilter', 'dst ip address as filter')
     17
     18otr= p.addApplication('otr', "test:app:otr")
     19otr.bindProperty('protocol')
     20otr.bindProperty('rxdev')
     21otr.bindProperty('dstfilter')
     22
     23otr.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}}}