# 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) \
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-%.pcap send-%.why: ./make-probes.tcl Makefile
./make-probes.tcl --write $@ --mtu $(MTU) --upto $(PERPART) \
--source $(SOURCE) \
- --dest $(DEST) \
+ --dest $(DEST) \
--xseed "$* $(UNIQUE)" >send-$*.why
%.log: %.pcap lnumber-tcpdump.pl Makefile
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 $@
+%.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