wiki:Old/Documentation/OTG/ScriptsRepository/OtrAppdef

Orbit > OTG > Scripts Repository > otr.rb

require 'handler/appDefinition'

a = AppDefinition.create('test:app:otr')
a.name = "otr"
a.version(1, 1, 2)
a.shortDescription = "Programmable traffic generator"
a.description = <<TEXT
otr is a configurable traffic sink. It contains port to receive 
packet streams via various transport options, such as TCP and UDP.
TEXT

#addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
a.addProperty('protocol', 'Protocol to use [udp|tcp]', nil, String, false)
a.addProperty('hostname', 'My own ID', nil, String, false)
a.addProperty('port', 'transport port number of listen on', nil, "xsd:int", false)
a.addProperty('rxdev', 'Device Name of local host to receive',nil, String, false)	
a.addProperty('dstfilter','filter packets with IP destination address',nil, String, false)


a.addMeasurement("receiverport", nil, [
  ['pkt_seqno', 'long', 'Packet sequence id of the stream'],
  ['flow_no', 'int','id of receiving flow'],
  ['rcvd_pkt_size', 'long', 'Payload size'],    
  ['rx_timestamp', 'long', 'Time when packet has been received'],
  ['rssi', 'int', 'rssi of received packet'] ,
  ['xmitrate','int','channel rate of received packet']
])

a.addMeasurement("flow", nil, [
  ['flow_no', 'int', 'id of the flow'],
  ['sender_port', 'int', 'port number of sender socket']
])

#a.aptName = 'orbit-otr'

a.path = "/usr/local/bin/otr"

if $0 == __FILE__
  require 'stringio'
  require 'rexml/document'
  include REXML
    
  sio = StringIO.new()
  a.to_xml.write($stdout, 2)
end
Last modified 18 years ago Last modified on Apr 4, 2006, 9:12:27 PM
Note: See TracWiki for help on using the wiki.