Skip to content

Instantly share code, notes, and snippets.

@hideo55
Created May 19, 2011 17:10
Show Gist options
  • Save hideo55/981246 to your computer and use it in GitHub Desktop.
Save hideo55/981246 to your computer and use it in GitHub Desktop.
tcpdump like implementation of Perl
#!/usr/bin/env perl -w
use strict;
use Net::Frame::Dump::Online2;
use Net::Frame::Simple;
my $d = Net::Frame::Dump::Online2->new( dev => 'en1', );
$d->start;
while (1) {
if ( my $f = $d->next ) {
print Net::Frame::Simple->newFromDump($f)->print, "\n";
}
}
$d->stop;
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment