/sirin_sniffer

Test task for Sirin Software

Primary LanguageC

Sirin Sniffer

Description

It's a test task repo for Sirin Software. The application is a packet sniffer that performs incoming packet stats collection. The sniffer is composed of daemon and CLI (for interaction with daemon and stats printing).

Building

Building the sniffer is pretty straightforward:

    $ make

Cleaning built files:

    $ make clean

Usage

"sniffcon" program is a CLI for daemon control. Usage:

    $ ./sniffcon <command/--help> ...

Possible commands:

  • start [iface] — starts the daemon on "iface" (or the current interface, if omitted)
  • stop — terminates daemon process (and flushes stats to disk)
  • show [ip] count — shows count of received packets for an IPv4 address "ip"
  • select iface [iface] — switches interface being sniffed to "iface"
  • stat [iface] — prints stats for packets on "iface" (or globally, if omitted)
  • reset — resets packets stats
  • --help — prints this message

Running daemon is also possible by just running "sniffer" executable:

    $ ./sniffer [iface]