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


Ignore:
Timestamp:
Feb 2, 2006, 4:12:24 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

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

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:OTG OTG] > [wiki:OTG/ScriptsRepository Scripts Repository] > forwarder.rb
     2
     3
     4{{{
     5require 'handler/prototype'
     6require 'handler/filter'
     7require 'handler/appDefinition'
     8
     9p = Prototype.create("test:proto:forwarder")
     10p.name = "Forwarder"
     11p.description = "Nodes which forward packets"
     12p.defProperty('protocol', 'Protocol to use', 'raw')
     13p.defProperty('rxdev', 'hw interface to listen on', 'eth0')
     14p.defProperty('txdev', 'hw interaface to send', 'eth0')
     15p.defProperty('ipFilter', 'IP address of the destination', '12.0.0.6')
     16p.defProperty('nextHopMAC', 'HW (MAC) address of next-hop receiver', 'FF:FF:FF:FF:FF:FF')
     17
     18otf = p.addApplication('otf', "test:app:otf")
     19
     20otf.bindProperty('protocol')
     21otf.bindProperty('rxdev')
     22otf.bindProperty('txdev')
     23otf.bindProperty('dstfilter','ipFilter')
     24otf.bindProperty('dstmacaddr','nextHopMAC')
     25
     26otf.addMeasurement('senderport',  Filter::TIME,
     27  {Filter::SAMPLE_SIZE => 1},
     28  [
     29    ['stream_no'],
     30    ['pkt_seqno'],
     31    ['pkt_size', Filter::SUM],
     32    ['gen_timestamp'],
     33    ['tx_timestamp']
     34  ]
     35
     36otf.addMeasurement('receiverport',  Filter::TIME,
     37  {Filter::SAMPLE_SIZE => 1},
     38  [
     39    ['stream_no'],
     40    ['pkt_seqno'],
     41    ['sender_port'],    ['flow_no'],
     42    ['pkt_num_rcvd'],
     43    ['rcvd_pkt_size', Filter::SUM],
     44    ['rx_timestamp',  Filter::MEAN],
     45    ['rssi', Filter::MEAN],
     46    ['xmitrate']
     47  ]
     48)
     49
     50if $0 == __FILE__
     51  p.to_xml.write($stdout, 2)
     52  puts
     53end
     54
     55}}}