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

Hello and g'day to all-

I've been trying to create a network monitor/logger and was wondering if there's any way to dump any and all information the NIC sends/receives using perl?

Doesn't need to set NIC into passive mode, but would need to run on both win32 & *nix. (not necessarily using exact same code)

Any ideas, hints or pointers?

Thanks in advance.
Muzz

Replies are listed 'Best First'.
Re: Perl Network Monitor
by kvale (Monsignor) on Feb 12, 2004 at 01:56 UTC
    To gather information that flows across your NIC, you might look at Net::Pcap. The docs claim that it runs under cygwin.

    This is a library for getting the raw information and sets the interface to promiscuis mode.

    -Mark

Re: Perl Network Monitor
by NetWallah (Canon) on Feb 12, 2004 at 03:47 UTC
    No need fr CygWin - Pcap runs natively under Win32. There are a few minor quirks to work around - I have some packet capture/analysis perl code that has been working well - (Caught a lot of virii in our network). /msg me with your e-mail, and I'll be glad to send it.

    FYI- The NIC does not need to be passive.

    "When you are faced with a dilemma, might as well make dilemmanade. "