Skip to content

Instantly share code, notes, and snippets.

@picatz
Created November 15, 2017 20:10
Show Gist options
  • Save picatz/8f5d772b274210931c4f94dd6a8a3ea6 to your computer and use it in GitHub Desktop.
Save picatz/8f5d772b274210931c4f94dd6a8a3ea6 to your computer and use it in GitHub Desktop.
Using pcap_lookupdev binding
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