bin/trema in trema-0.8.3 vs bin/trema in trema-0.8.4

- old
+ new

@@ -47,11 +47,11 @@ c.action do |global_options, options, args| Phut.pid_dir = options[:pid_dir] Phut.log_dir = options[:log_dir] Phut.socket_dir = options[:socket_dir] - Pio::OpenFlow.switch_version 'OpenFlow13' if options[:openflow13] + Pio::OpenFlow.switch_version('OpenFlow13') if options[:openflow13] require 'trema/switch' Trema::Command.new.run(args, global_options.merge(options)) end end @@ -99,24 +99,24 @@ c.action do |_global_options, options, args| help_now!('host is required') if args.empty? stats = Phut::VhostDaemon.process(args[0], options[:socket_dir]).stats - dests = stats[:tx].map { |each| each.ip_destination_address.to_s }.uniq + dests = stats[:tx].map { |each| each.destination_ip_address.to_s }.uniq txstats = dests.map do |each| - all = stats[:tx].select { |pkt| pkt.ip_destination_address == each } - "#{all.first.ip_source_address} -> #{each} = " \ + all = stats[:tx].select { |pkt| pkt.destination_ip_address == each } + "#{all.first.source_ip_address} -> #{each} = " \ "#{all.size} packet#{all.size > 1 ? 's' : ''}" end unless txstats.empty? puts 'Packets sent:' txstats.each { |each| puts " #{each}" } end - sources = stats[:rx].map { |each| each.ip_source_address.to_s }.uniq + sources = stats[:rx].map { |each| each.source_ip_address.to_s }.uniq rxstats = sources.map do |each| - all = stats[:rx].select { |pkt| pkt.ip_source_address == each } - "#{each} -> #{all.first.ip_destination_address} = " \ + all = stats[:rx].select { |pkt| pkt.source_ip_address == each } + "#{each} -> #{all.first.destination_ip_address} = " \ "#{all.size} packet#{all.size > 1 ? 's' : ''}" end unless rxstats.empty? puts 'Packets received:' rxstats.each { |each| puts " #{each}" }