5 load chiark_tcl_hbytes-1.so
8 local-address "172.18.232.9";
9 secnet-address "172.18.232.10";
10 remote-networks "172.18.232.0/28";
12 set netlink(outside) {
13 local-address "172.18.232.1";
14 secnet-address "172.18.232.2";
15 remote-networks "172.18.232.0/28";
18 set ports(inside) {16913 16910}
19 set ports(outside) 16900
33 set pipefp $tmp/$which.netlink
35 file delete $pipefp.$tr
36 exec mkfifo -m600 $pipefp.$tr
37 set netlinkfh($which.$tr) [set fh [open $pipefp.$tr r+]]
38 fconfigure $fh -blocking 0 -buffering none -translation binary
40 fileevent $netlinkfh($which.r) readable [list netlink-readable $which]
41 set fakeuf $tmp/$which.fake-userv
42 set fakeuh [open $fakeuf w 0755]
43 puts $fakeuh "#!/bin/sh
46 cat <&3 3<&- >$pipefp.r &
56 userv-path \"$fakeuf\";
59 buffer sysbuffer(2048);
60 interface \"secnet-test-[string range $which 0 0]\";
65 foreach port $ports($which) {
69 buffer sysbuffer(4096);
75 local-name \"test-example/$which/$which\";
76 local-key rsa-private(\"test-example/$which.key\");
78 append cfg $extra($which)
82 class "info","notice","warning","error","security","fatal";
89 random randomfile("/dev/urandom",no);
90 transform eax-serpent { }, serpent256-cbc { };
91 include test-example/sites.conf
92 sites map(site,vpn/test-example/all-sites);
97 proc spawn-secnet {which} {
100 upvar #0 pids($which) pid
101 set cf $tmp/$which.conf
103 puts $ch [mkconf $which]
105 set argl [list ./secnet -dvnc $cf]
108 execl [lindex $argl 0] [lrange $argl 1 end]
110 puts -nonewline $netlinkfh($which.t) [hbytes h2raw c0]
113 proc netlink-readable {which} {
115 upvar #0 netlinkfh($which.r) fh
116 read $fh; # empty the buffer
117 switch -exact $which {
120 set ok 1; # what a bodge
129 proc bgerror {message} {
130 global errorInfo errorCode
133 ----------------------------------------
138 ----------------------------------------
147 4500 0054 ed9d 4000 4001 24da ac12 e809
148 ac12 e802 0800 1de4 2d96 0001 f1d4 a05d
149 0000 0000 507f 0b00 0000 0000 1011 1213
150 1415 1617 1819 1a1b 1c1d 1e1f 2021 2223
151 2425 2627 2829 2a2b 2c2d 2e2f 3031 3233
154 puts -nonewline $netlinkfh(inside.t) \
155 [hbytes h2raw c0[join $p ""]c0]