#############################################################
# You should edit the parameters below for your site
-SOURCE= 172.18.45.35/00:04:76:1A:92:13
-DEST= 172.18.45.6/00:04:76:1A:8F:C6
+SOURCE= 172.18.45.35/0:4:76:1a:92:13
+DEST= 172.18.45.6/0:04:76:1A:8F:C6
UNIQUE=
# set UNIQUE to something random for less observability
send-%.pcap send-%.why: ./make-probes.tcl Makefile
./make-probes.tcl --write $@ --mtu $(MTU) --upto $(PERPART) \
- --source $(SOURCE) --dest $(DEST) --xseed "$* $(UNIQUE)" \
- >send-$*.why
+ --source $(SOURCE) \
+ --dest $(DEST) \
+ --xseed "$* $(UNIQUE)" >send-$*.why
%.log: %.pcap lnumber-tcpdump.pl Makefile
tcpdump -tnxvvs$$(($(MTU)+500)) -r $< >$@.1.tmp
1. Generate the test data.
* Edit this Makefile.
- You /must/ change SOURCE and DEST; they must be IPv4 addresses.
+ You /must/ change SOURCE and DEST (or override them on
+ the `make' command line, if you prefer); they must be
+ <IPv4-address>/<ethernet-address>
You may also change PARTS, PERPART or MTU if you like.
* Say `make -j2 all'. This will generate the test data sets.
This will take a while. Vary the -j for your system.
}
return [format 0x%02x%02x%02x%02x $a $b $c $d]
}
+proc get-config/linkaddr {val} {
+ return $val
+}
proc get-config {variable def kind args} {
# args currently ignored
proc link/ether/defaddr {} { return 00:00:00:00:00:00 }
proc link/ether/procaddr {input sd} {
set v [string tolower $input]
- if {[regexp {^([0-9a-f]{2}\:){5}[0-9a-f]{2}$} $v]} {
- set v [string map {: {}} $v]
+ if {[regexp {^([0-9a-f]{1,2}\:){6}$} $v:]} {
+ set o {}
+ foreach b [split $v :] { append o [format %02x 0x$b] }
+ set v $o
}
- if {![regexp -nocase {^[0-9]{12}$} $v]} {
+ if {![regexp -nocase {^[0-9a-f]{12}$} $v]} {
error "invalid $sd ethernet addr $input ($v)"
}
return $v
proc link/ether/linkencap {packet} {
global link_source link_dest
set llpkt {}
- append llpkt $link_source $link_dest 0800
+ append llpkt $link_dest $link_source 0800
append llpkt $packet
return $llpkt
}
proc nextarg_num {} { return [expr {[nextarg] + 0}] }
proc nextarg_il {} {
set a [nextarg]
- if {![regexp -nocase {^([0-9.]+)/([0-9a-f:]+)$} $a dummy i l]} {
+ if {![regexp -nocase {^([0-9.]+)/(.+)$} $a dummy i l]} {
error "--source/--dest needs <ip-addr>/<link-addr>"
}
- return [list $i [string map {: {}} $l]]
+ return [list $i $l]
}
set debug_level 0
-set mtu 576
+set mtu 100
set upto {}
set xseed {}
set linktypename ether
--mtu { set mtu [nextarg_num] }
--xseed { set xseed [nextarg] }
--linktype { set linktypename [nextarg] }
- --source { manyset [nextarg_ih] config/ip-source config/link-source }
- --dest { manyset [nextarg_ih] config/ip-dest config/link-dest }
+ --source { manyset [nextarg_il] config/ip-source config/link-source }
+ --dest { manyset [nextarg_il] config/ip-dest config/link-dest }
default { error "bad option $o" }
}
}
proc process_linkaddr {sd} {
global linktypename
upvar #0 link_$sd l
- link/$linktypename/linktype
get-for link
get-config $sd [link/$linktypename/defaddr] linkaddr
set l [link/$linktypename/procaddr [set $sd] $sd]