#############################################################
# You should edit the parameters below for your site
-SOURCE= 172.18.45.35/0:4:76:1a:92:13
-DEST= 172.18.45.6/0:04:76:1A:8F:C6
+SOURCE= 130.233.5.88/00:0D:60:89:9F:AC
+DEST= 193.201.200.170/00:0B:45:B3:78:40
UNIQUE=
# set UNIQUE to something random for less observability
# You shouldn't need to edit anything beyond this point.
#############################################################
-FEW_TARGETS= on-dest.sh \
+SCRIPT_TARGETS= on-dest.sh monitor.sh
+
+FEW_TARGETS= $(SCRIPT_TARGETS) \
send-1.pcap send-1.log send-1.why
TARGETS= $(FEW_TARGETS) \
AN_BASES= $(basename $(wildcard recv-*.pcap))
AN_LOGS= $(addsuffix .log,$(AN_BASES))
AN_DIFFS= $(addsuffix .diff,$(AN_BASES))
-AN_TARGETS= $(AN_LOGS) $(AN_DIFFS)
+AN_MDIFFS= $(addsuffix .mdiff,$(AN_BASES))
+AN_SUMMARIES= $(addsuffix .summary,$(AN_BASES))
+AN_TARGETS= $(AN_LOGS) $(AN_DIFFS) $(AN_MDIFFS) $(AN_SUMMARIES)
INFORM= @echo ' GENERATED THESE FILES:'; \
echo ' $^'
+SOURCE_IP= $(shell expr $(SOURCE) : '\([0-9.]*\)/')
+DEST_IP= $(shell expr $(DEST) : '\([0-9.]*\)/')
+
all: $(TARGETS)
$(INFORM)
few: $(FEW_TARGETS)
$(INFORM)
+scripts: $(SCRIPT_TARGETS)
+ $(INFORM)
+
anal analyse: $(AN_TARGETS)
$(INFORM)
-send-all.pcap: $(A_PCAPS) Makefile
+send-all.pcap: $(A_PCAPS)
rm -f $@
dd if=$< ibs=24 count=1 of=$@
set -e; for f in $(A_PCAPS); do \
nl -bp'^ ? ? ?[0-9]' <$@.1.tmp >$@.2.tmp
@mv -f $@.2.tmp $@
-send-%.pcap send-%.why: ./make-probes.tcl Makefile
+send-%.pcap send-%.why: ./make-probes.tcl
./make-probes.tcl --write $@ --mtu $(MTU) --upto $(PERPART) \
--source $(SOURCE) \
- --dest $(DEST) \
+ --dest $(DEST) \
--xseed "$* $(UNIQUE)" >send-$*.why
-%.log: %.pcap lnumber-tcpdump.pl Makefile
- tcpdump -tnxvvs$$(($(MTU)+500)) -r $< >$@.1.tmp
- ./lnumber-tcpdump.pl <$@.1.tmp >$@.2.tmp
- @mv -f $@.2.tmp $@
+%.log: %.pcap Makefile \
+ lnumber-tcpdump.pl blank-ttl-ipcsum.pl tcpdump-nomultiline.pl
+ tcpdump -tnxvvs$$(($(MTU)+500)) -r $< >$@.2.tmp
+ ./tcpdump-nomultiline.pl <$@.2.tmp >$@.3.tmp
+ ./blank-ttl-ipcsum.pl <$@.3.tmp >$@.4.tmp
+ ./lnumber-tcpdump.pl <$@.4.tmp >$@.5.tmp
+ @mv -f $@.5.tmp $@
recv-%.diff: send-%.log recv-%.log
diff -uI'^[0-9]' $^ >$@ || test $$? == 1
-on-dest.sh: Makefile
- @rm -f $@
- echo >$@ "#!/bin/sh"
- @echo >>$@ "# run this script on $(DEST) as root, saying:"
- @echo >>$@ "# ./on-dest.sh PART"
- @echo >>$@ "# where PART ranges from 1 to $(PARTS)"
- @echo >>$@ "if ! [ \$$# = 1 ]; then echo >&2 'PART?'; exit 1; fi"
- @echo >>$@ "exec tcpdump -s$$(($(MTU)+500)) -w recv-\$$1.pcap \\"
- @echo >>$@ " src host $(SOURCE) and dst host $(DEST)"
- chmod +x $@
+recv-%.mdiff: send-%.log recv-%.log
+ diff -U 1 -I'^[0-9]\|^ [ ][ ]' $^ >$@ \
+ || test $$? == 1
+
+recv-%.summary: recv-%.mdiff mdiff-summarise.pl
+ ./mdiff-summarise.pl <$< >$@.1.tmp
+ sort -t : +1 <$@.1.tmp >$@.2.tmp
+ @mv -f $@.2.tmp $@
+
+%.sh: %.template Makefile
+ sed <$< >$@.tmp -e ' \
+ s/@@M/'$$(($(MTU)+500))'/; \
+ s/@@S/$(SOURCE_IP)/; \
+ s/@@D/$(DEST_IP)/'
+ chmod +x $@.tmp
+ @mv -f $@.tmp $@
clean:
rm -f *.tmp *~ t u v