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


Ignore:
Timestamp:
Feb 2, 2006, 3:54:50 PM (19 years ago)
Author:
zhibinwu
Comment:

Legend:

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

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:OTG OTG] > [wiki:OTG/ScriptsRepository Scripts Repository] > otf.rb
     2
     3{{{
     4
     5require 'handler/appDefinition'
     6
     7a = AppDefinition.create('test:app:otf')
     8a.name = "otr"
     9a.version(0, 0, 2)
     10a.shortDescription = "Programmable traffic forwarder"
     11a.description = <<TEXT
     12otf is a configurable traffic forwarder. It re-route traffice from one
     13incoming interface to another one using raw sockets
     14TEXT
     15
     16#addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     17a.addProperty('protocol', 'Protocol to use [raw|raw_libmac]', nil, String, false)
     18a.addProperty('rxdev', 'incoming interface [eth0|eth2|eth3|ath0|ath1]', nil, String, false)
     19a.addProperty('txdev', 'outgoing interface [eth0|eth2|eth3|ath0|ath1]', nil, String, false)
     20a.addProperty('dstfilter', 'packet filter using destination IP address', nil, String, false)
     21a.addProperty('dstmacaddr', 'MAC address for next-hop', nil,String, false)
     22
     23a.addMeasurement("senderport", nil, [
     24    ['stream_no', 'int'],
     25    ['pkt_seqno', 'long'],
     26    ['pkt_size', 'long'],
     27    ['gen_timestamp', 'long'],
     28    ['tx_timestamp', 'long']
     29])
     30
     31a.addMeasurement("otfreceiver", nil, [
     32  ['flow_no'],'int','id of receiving flow'],
     33  ['pkt_num_rcvd','long',' Packet Sequence id of the flow'],
     34  ['rcvd_pkt_size', 'long', 'Payload size'],
     35  ['rx_timestamp', 'long', 'Time when packet has been received'],
     36  ['rssi', 'int', 'rssi of received packet'] ,
     37  ['xmit_rate','int','channel rate of received packet']
     38])
     39
     40a.path = "/usr/local/bin/otf"
     41
     42if $0 == __FILE__
     43  require 'stringio'
     44  require 'rexml/document'
     45  include REXML
     46
     47  sio = StringIO.new()
     48  a.to_xml.write($stdout, 2)
     49end
     50
     51
     52}}}