package require Tclx
+load chiark_tcl_hbytes-1.so
+
set netlink(inside) {
local-address "172.18.232.9";
secnet-address "172.18.232.10";
if {!$pid} {
execl ./secnet $argl
}
- puts -nonewline $netlinkfh($which.t) "\xc0"
+ puts -nonewline $netlinkfh($which.t) [hbytes h2raw c0]
}
proc netlink-readable {which} {
exit 1
}
+proc sendpkt {} {
+ global netlinkfh
+ set p {
+ 4500 0054 ed9d 4000 4001 24da ac12 e809
+ ac12 e802 0800 1de4 2d96 0001 f1d4 a05d
+ 0000 0000 507f 0b00 0000 0000 1011 1213
+ 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
+ 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
+ 3435 3637
+ }
+ puts -nonewline $netlinkfh(inside.t) \
+ [hbytes h2raw c0[join $p ""]c0]
+}
+
spawn-secnet inside
spawn-secnet outside
+after 500 sendpkt
+after 1000 sendpkt
+
vwait ok