mongre has asked for the wisdom of the Perl Monks concerning the following question:

I am sniffing traffic with the Net::Pcap module and I am having a heck of a time figuring out how to turn the binary packed data into some usable (ie ip addresses, ports etc) Has anyone done this? I could sure use some tips or a code snippet, what I have found so far can get me the Hex for Ethernet Addresses but that is all I have been able to get... unpack (" H12 H12 H4 H*",$pkt) Thanks for any help you can provide.. Cheers Terrence

Replies are listed 'Best First'.
Re: Unpack and Network Packets
by Anonymous Monk on Dec 08, 2000 at 12:57 UTC
    I was just playing with pcap recently myself, I found these helpful modules:

    Net::PcapUtils
    NetPacket::Ethernet
    NetPacket::IP
    NetPacket::TCP

    Hope they help, good luck.

Re: Unpack and Network Packets
by drip (Beadle) on Mar 27, 2008 at 05:58 UTC
    and if it is UPD packet:

    NetPacket::UDP