Commit 7c154d1d authored by Robert Ricci's avatar Robert Ricci

New program: pcapper

Runs on a node and uses libpcap to count packets going by. Opens a
socket, so that remote programs can connect and, say, graph its
output. The client gets to specify the interval at which it wants
counts reported. Supports multiple interfaces, and multiple clients
(with different intervals.) It can also write packet counts to a file,
for analysis later.
parent de2b1316
CPPFLAGS= -D_THREAD_SAFE -DEMULAB
CPPFLAGS_FREEBSD= $(CPPFLAGS) -I/usr/local/include/pthread/linuxthreads
CPPFLAGS_LINUX= $(CPPFLAGS) -I/usr/include/pcap
#CFLAGS=-pedantic -ansi -Wall -Werror
CFLAGS=-Wall
LDFLAGS= -lpcap -llthread -llgcc_r -L/usr/local/lib
all: pcapper
clean:
-rm pcapper pcapper.linux
pcapper: pcapper.c GNUmakefile
$(CC) $(CFLAGS) $(CPPFLAGS_FREEBSD) $(LDFLAGS) pcapper.c \
-o pcapper -lpcap
pcapper.linux: pcapper.c GNUmakefile
$(CC) $(CFLAGS) $(CPPFLAGS_LINUX) -L/usr/lib -lpthread -lpcap \
pcapper.c -o pcapper.linux -lpcap
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment