Created
November 15, 2017 20:10
-
-
Save picatz/8f5d772b274210931c4f94dd6a8a3ea6 to your computer and use it in GitHub Desktop.
Using pcap_lookupdev binding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
err = LibPcap::PCAP_ERRBUF_SIZE.dup | |
dev = LibPcap.pcap_lookupdev(pointerof(err)) | |
raise Exception.new("Couldn't find a default interface: #{err}") if dev.null? | |
puts String.new(dev) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment