Skip to content

Commit 94db2dc

Browse files
author
lsanchez-r7
committed
updating list_interfaces for windows, this should work?
1 parent 4541a9e commit 94db2dc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

tools/list_interfaces.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,19 @@
2929
exit
3030
end
3131

32-
unless (Pcap.respond_to?(:lookupaddrs) and
33-
Pcap.respond_to?(:interfaces) and
34-
Pcap.respond_to?(:addresses))
35-
$stderr.puts "Error: Looks like you are not running the latest version of pcaprub"
32+
unless (
33+
NetworkInterface.respond_to?(:interfaces) and
34+
NetworkInterface.respond_to?(:addresses) and
35+
NetworkInterface.respond_to?(:interface_info)
36+
)
37+
$stderr.puts "Error: Looks like you are not running the latest version of NetworkInterface"
3638
exit
3739
end
3840
found = false
39-
Pcap.interfaces.each_with_index do |iface, i|
41+
NetworkInterface.interfaces.each_with_index do |iface, i|
4042
found = true
41-
detail = Pcap.interface_info(iface)
42-
addr = Pcap.addresses(iface)
43+
detail = NetworkInterface.interface_info(iface)
44+
addr = NetworkInterface.addresses(iface)
4345
puts "#" * 70
4446
puts ""
4547
puts "INDEX : " + (i + 1).to_s

0 commit comments

Comments
 (0)