Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now when i send a 5550 byte packet, I get this:#!/usr/usc/perl/5.6.1/bin/perl use strict; use warnings; $|++; my $dev = shift @ARGV; $dev ||= 'eth1'; my $filter_string = 'dst port 111'; #my $filter_string = 'udp'; my $snaplen = 65500; my $promisc = 0; my $timeout = 0; my $count = -1; use Net::Pcap; my $err = ''; my $cap_dev; my $filter = ''; my $net = -256; $cap_dev = Net::Pcap::open_live($dev, $snaplen, $promisc, $timeout, \$ +err); die "$err\n" if $err; Net::Pcap::compile($cap_dev, \$filter, $filter_string, 0, -256) and die "compile: $err\n"; Net::Pcap::setfilter($cap_dev, $filter); Net::Pcap::loop($cap_dev, $count, \&callback, 'woot'); Net::Pcap::close($cap_dev); exit 0; sub callback { my ($user_data, $hdr, $pkt) = @_; warn "packet!\n"; my %header = %$hdr; process_packet(\%header, $pkt); my $len = length $pkt; warn "$header{len} $header{caplen} $len\n"; } sub process_packet { my ($hdr, $pkt) = @_; my $len = length $pkt; warn "$hdr->{len} $hdr->{caplen} $len\n"; }
I have the snaplen high in the script, and TCPdump pics up the packet fine:root@a05s24:~/scanner# perl dn3.pl packet! 1514 1514 1514 1514 1514 1514
At this point im pretty stumped :( Anyone with Pcap experience please help me on this little error.23:27:26.508174 IP 37.X.X.X.57114 > a05s24.sunrpc: UDP, length 5550
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting packets over 1500 Bytes pcap.
by NetWallah (Canon) on May 25, 2014 at 15:09 UTC | |
by Anonymous Monk on May 25, 2014 at 23:59 UTC | |
by NetWallah (Canon) on May 26, 2014 at 05:02 UTC | |
by no_slogan (Deacon) on May 26, 2014 at 13:41 UTC | |
by no_slogan (Deacon) on May 26, 2014 at 04:31 UTC | |
|
Re: Getting packets over 1500 Bytes pcap.
by Anonymous Monk on May 26, 2014 at 00:06 UTC |