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


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

Legend:

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

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:OTG OTG] > [wiki:OTG/ScriptsRepository Scripts Repository] > otr.rb
     2
     3{{{
     4require 'handler/appDefinition'
     5
     6a = AppDefinition.create('test:app:otr')
     7a.name = "otr"
     8a.version(1, 1, 2)
     9a.shortDescription = "Programmable traffic generator"
     10a.description = <<TEXT
     11otr is a configurable traffic sink. It contains port to receive
     12packet streams via various transport options, such as TCP and UDP.
     13TEXT
     14
     15#addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
     16a.addProperty('protocol', 'Protocol to use [udp|tcp]', nil, String, false)
     17a.addProperty('hostname', 'My own ID', nil, String, false)
     18a.addProperty('port', 'transport port number of listen on', nil, "xsd:int", false)
     19a.addProperty('rxdev', 'Device Name of local host to receive',nil, String, false)       
     20a.addProperty('dstfilter','filter packets with IP destination address',nil, String, false)
     21
     22
     23a.addMeasurement("receiverport", nil, [
     24  ['pkt_seqno', 'long', 'Packet sequence id of the stream'],
     25  ['flow_no', 'int','id of receiving flow'],
     26  ['rcvd_pkt_size', 'long', 'Payload size'],   
     27  ['rx_timestamp', 'long', 'Time when packet has been received'],
     28  ['rssi', 'int', 'rssi of received packet'] ,
     29  ['xmitrate','int','channel rate of received packet']
     30])
     31
     32a.addMeasurement("flow", nil, [
     33  ['flow_no', 'int', 'id of the flow'],
     34  ['sender_port', 'int', 'port number of sender socket']
     35])
     36
     37#a.aptName = 'orbit-otr'
     38
     39a.path = "/usr/local/bin/otr"
     40
     41if $0 == __FILE__
     42  require 'stringio'
     43  require 'rexml/document'
     44  include REXML
     45   
     46  sio = StringIO.new()
     47  a.to_xml.write($stdout, 2)
     48end
     49}}}