in reply to Re: Getting ethernet type using NetPacket
in thread Getting ethernet type using NetPacket

Wow... I will take a look , should be something to help me
  • Comment on Re^2: Getting ethernet type using NetPacket

Replies are listed 'Best First'.
Re^3: Getting ethernet type using NetPacket
by merrittr (Novice) on Jul 22, 2011 at 18:29 UTC

    I couldn't get that code running

    just wondering if I need to dig into eth_obj->(data) more to pull out what this packets and its roll is at the application layer?

    my $ip_obj = NetPacket::IP->decode($eth_obj->{data})
      What part did you have trouble with ? Any error messages ?

      If you un-comment the lines below, it will print packets as they arrive.

      #print("RcvPkt Totlen(PacketLen) $hdr->{len}($hdr->{caplen})" . # "\t Time.Usec=$hour:$min:$sec.$hdr->{tv_usec}\n");
      If you capture packets, you can control-feed them into the program (read pcap docs), and run the "perl -d <program>" debugger, and examine data as you go.

                  "XML is like violence: if it doesn't solve your problem, use more."

        Hi NetWhallah

        I can run the code however it doesn't like my interfaces

        root@robm-desktop:/scripts/pcap# ./netpkt.pl eth0 No description available vmnet1 No description available usbmon1 USB bus number 1 usbmon2 USB bus number 2 eth3 No description available usbmon3 USB bus number 3 usbmon4 USB bus number 4 usbmon5 USB bus number 5 usbmon6 USB bus number 6 usbmon7 USB bus number 7 vmnet8 No description available usbmon8 USB bus number 8 any Pseudo-device that captures on all interfaces lo Loopback device Found device intel Found Net net 0.0.0.0 mask 0.0.0.0 Net::Pcap::open_live returned error SIOCGIFHWADDR: No such device