Created
November 4, 2017 19:07
-
-
Save picatz/2a4b33ba72c03d26da5fe87d922c68e8 to your computer and use it in GitHub Desktop.
LibPcap Crystal Binding Example: pcap_lookupdev
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
@[Link("pcap")] | |
lib LibPcap | |
PCAP_ERRBUF_SIZE = 256 | |
fun pcap_lookupdev : LibC::Char* | |
end | |
# print out the first, non-loopback interface | |
puts String.new(LibPcap.pcap_lookupdev, LibPcap::PCAP_ERRBUF_SIZE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment