wiki:Documentation/OtherApps/DITG/ITGReceiver
#
# Create an application representation from scratch
#
require 'handler/appDefinition'

a = AppDefinition.create('test:app:itgr')
a.name = "itgr"
a.version(0, 0, 1)
a.shortDescription = "D-ITG Receiver"
a.description = <<TEXT
D-ITG is a traffic generator for TCP and UDP traffic. It contains generators 
producing various forms of packet streams and port for sending
these packets via various transports, such as TCP and UDP.
TEXT

# addProperty(name, description, mnemonic, type, isDynamic = false, constraints = nil)
#Flow options
a.addProperty('l', 'Log file', ?l, String, false)

a.addMeasurement("receiverport", nil, [
    ['flow_no', 'int'],
    ['min_delay', Float],
    ['max_delay', Float],
    ['avg_delay', Float],
    ['avg_jitter', Float],
    ['delay_stdev', Float],
    ['avg_throughput', Float],
    ['packet_loss', Float]
 ])

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

if $0 == __FILE__
  require 'stringio'
  require 'rexml/document'
  include REXML
    
  sio = StringIO.new()
  a.to_xml.write(sio, 2)
  sio.rewind
  puts sio.read
  
  sio.rewind
  doc = Document.new(sio)
  t = AppDefinition.from_xml(doc.root)
  puts
  puts "-------------------------"
  puts
  t.to_xml.write($stdout, 2)
  
end


Last modified 18 years ago Last modified on Sep 5, 2006, 9:53:29 PM
Note: See TracWiki for help on using the wiki.