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
32 set pipefp test/$which.netlink
34 file delete $pipefp.$tr
35 exec mkfifo -m600 $pipefp.$tr
36 set netlinkfh($which.$tr) [set fh [open $pipefp.$tr r+]]
37 fconfigure $fh -blocking 0 -buffering none -translation binary
39 fileevent $netlinkfh($which.r) readable [list netlink-readable $which]
40 set fakeuf test/$which.fake-userv
41 set fakeuh [open $fakeuf w 0755]
42 puts $fakeuh "#!/bin/sh
45 cat <&3 3<&- >$pipefp.r &
55 userv-path \"$fakeuf\";
58 buffer sysbuffer(2048);
59 interface \"secnet-test-[string range $which 0 0]\";
64 foreach port $ports($which) {
68 buffer sysbuffer(4096);
74 local-name \"test-example/$which/$which\";
75 local-key rsa-private(\"test-example/$which.key\");
77 append cfg $extra($which)
81 class "info","notice","warning","error","security","fatal";
88 random randomfile("/dev/urandom",no);
89 transform eax-serpent { }, serpent256-cbc { };
90 include test-example/sites.conf
91 sites map(site,vpn/test-example/all-sites);
96 proc spawn-secnet {which} {
98 upvar #0 pids($which) pid
99 set cf test/$which.conf
101 puts $ch [mkconf $which]
103 set argl [list -dvnc $cf]
108 puts -nonewline $netlinkfh($which.t) [hbytes h2raw c0]
111 proc netlink-readable {which} {
113 upvar #0 netlinkfh($which.r) fh
114 read $fh; # empty the buffer
115 switch -exact $which {
118 set ok 1; # what a bodge
127 proc bgerror {message} {
128 global errorInfo errorCode
131 ----------------------------------------
136 ----------------------------------------