transform eax-serpent { }, serpent256-cbc { };
}
+ set pubkeys $tmp/$site.pubkeys
+ file delete -force $pubkeys
+ exec cp -rl $builddir/test-example/pubkeys $pubkeys
+
set f [open $builddir/test-example/sites.conf r]
+ while {[gets $f l] >= 0} {
+ regsub {\"[^\"]*test-example/pubkeys/} $l "\"$pubkeys/" l
+ append cfg $l "\n"
+ }
set sites [read $f]
close $f
append cfg $sites
append cfg {
sites map(site,all-sites);
}
+
return $cfg
}
global netlinkfh
global env
global pidmap
+ global readbuf
upvar #0 pids($site) pid
+ set readbuf($site) {}
set cf $tmp/$site.conf
set ch [open $cf w]
puts $ch [mkconf $location $site]
proc netlink-readable {location site} {
global ok
+ upvar #0 readbuf($site) buf
upvar #0 netlinkfh($site.r) fh
- read $fh; # empty the buffer
+ while 1 {
+ set x [read $fh]
+ set h [hbytes raw2h $x]
+ if {![hbytes length $h]} return
+ append buf $h
+ #puts "READABLE $site buf=$buf"
+ while {[regexp {^((?:..)*?)c0(.*)$} $buf dummy now buf]} {
+ #puts "READABLE $site now=$now (buf=$buf)"
+ regsub -all {^((?:..)*?)dbdc} $now {\1c0} now
+ regsub -all {^((?:..)*?)dbdd} $now {\1db} now
+ puts "netlink-got-packet $location $site $now"
+ netlink-got-packet $location $site $now
+ }
+ }
+}
+
+proc netlink-got-packet {location site data} {
+ if {![hbytes length $data]} return
switch -exact $site {
inside {
- puts OK
- finish 0
+ switch -glob $data {
+ 45000054ed9d4000fe0166d9ac12e802ac12e80900* {
+ puts "OK $data"
+ finish 0
+ }
+ * {
+ error "unexpected $site $data"
+ }
+ }
}
outside {
error "inside rx'd!"