From 94db2dc83fcd92489a5363e168ff8915314944d8 Mon Sep 17 00:00:00 2001 From: lsanchez-r7 Date: Mon, 8 Jul 2013 17:52:24 -0500 Subject: [PATCH] updating list_interfaces for windows, this should work? --- tools/list_interfaces.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/list_interfaces.rb b/tools/list_interfaces.rb index 4fabb6529f..a4b5032f3d 100755 --- a/tools/list_interfaces.rb +++ b/tools/list_interfaces.rb @@ -29,17 +29,19 @@ if RUBY_PLATFORM == "i386-mingw32" exit end - unless (Pcap.respond_to?(:lookupaddrs) and - Pcap.respond_to?(:interfaces) and - Pcap.respond_to?(:addresses)) - $stderr.puts "Error: Looks like you are not running the latest version of pcaprub" + unless ( + NetworkInterface.respond_to?(:interfaces) and + NetworkInterface.respond_to?(:addresses) and + NetworkInterface.respond_to?(:interface_info) + ) + $stderr.puts "Error: Looks like you are not running the latest version of NetworkInterface" exit end found = false - Pcap.interfaces.each_with_index do |iface, i| + NetworkInterface.interfaces.each_with_index do |iface, i| found = true - detail = Pcap.interface_info(iface) - addr = Pcap.addresses(iface) + detail = NetworkInterface.interface_info(iface) + addr = NetworkInterface.addresses(iface) puts "#" * 70 puts "" puts "INDEX : " + (i + 1).to_s