diff options
author | James Crayne <jim.crayne@gmail.com> | 2019-09-28 13:43:29 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2020-01-01 19:27:53 -0500 |
commit | 11987749fc6e6d3e53ea737d46d5ab13a16faeb8 (patch) | |
tree | 5716463275c2d3e902889db619908ded2a73971c /vnet | |
parent | add2c76bced51fde5e9917e7449ef52be70faf87 (diff) |
Factor out some new libraries
word64-map:
Data.Word64Map
network-addr:
Network.Address
tox-crypto:
Crypto.Tox
lifted-concurrent:
Control.Concurrent.Lifted.Instrument
Control.Concurrent.Async.Lifted.Instrument
psq-wrap:
Data.Wrapper.PSQInt
Data.Wrapper.PSQ
minmax-psq:
Data.MinMaxPSQ
tasks:
Control.Concurrent.Tasks
kad:
Network.Kademlia
Network.Kademlia.Bootstrap
Network.Kademlia.Routing
Network.Kademlia.CommonAPI
Network.Kademlia.Persistence
Network.Kademlia.Search
Diffstat (limited to 'vnet')
-rwxr-xr-x | vnet/build.sh | 93 | ||||
-rwxr-xr-x | vnet/clean.sh | 49 | ||||
-rwxr-xr-x | vnet/everywhere.sh | 8 | ||||
-rwxr-xr-x | vnet/mkroutes.sh | 20 | ||||
-rwxr-xr-x | vnet/run.sh | 45 | ||||
-rwxr-xr-x | vnet/screen-everywhere.sh | 21 | ||||
-rwxr-xr-x | vnet/screen-shell.sh | 14 | ||||
-rwxr-xr-x | vnet/show-links.sh | 2 |
8 files changed, 0 insertions, 252 deletions
diff --git a/vnet/build.sh b/vnet/build.sh deleted file mode 100755 index 5354969a..00000000 --- a/vnet/build.sh +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | |||
4 | wire() { | ||
5 | ip link add $1 \ | ||
6 | type veth \ | ||
7 | peer name $2 | ||
8 | } | ||
9 | |||
10 | set -x | ||
11 | |||
12 | # Not using this... | ||
13 | buildhub() { | ||
14 | wire hub0 ep0 | ||
15 | wire hub1 ep1 | ||
16 | wire hub2 ep2 | ||
17 | wire hub3 ep3 | ||
18 | wire hub4 ep4 | ||
19 | wire hub5 ep5 | ||
20 | wire hub6 ep6 | ||
21 | wire hub7 ep7 | ||
22 | |||
23 | wire hub8 ep8 | ||
24 | wire hub9 ep9 | ||
25 | wire hubA epA | ||
26 | wire hubB epB | ||
27 | wire hubC epC | ||
28 | wire hubD epD | ||
29 | wire hubE epE | ||
30 | wire hubF epF | ||
31 | |||
32 | brctl addbr hub | ||
33 | brctl addif hub hub0 | ||
34 | brctl addif hub hub1 | ||
35 | brctl addif hub hub2 | ||
36 | brctl addif hub hub3 | ||
37 | brctl addif hub hub4 | ||
38 | brctl addif hub hub5 | ||
39 | brctl addif hub hub6 | ||
40 | brctl addif hub hub7 | ||
41 | brctl addif hub hub8 | ||
42 | brctl addif hub hub9 | ||
43 | brctl addif hub hubA | ||
44 | brctl addif hub hubB | ||
45 | brctl addif hub hubC | ||
46 | brctl addif hub hubD | ||
47 | brctl addif hub hubE | ||
48 | brctl addif hub hubF | ||
49 | |||
50 | ip addr add 222.0.0.1 dev hub | ||
51 | } | ||
52 | |||
53 | # This is simpler... | ||
54 | buildtaps() { | ||
55 | ip tuntap add ep0 mode tap | ||
56 | ip tuntap add ep1 mode tap | ||
57 | ip tuntap add ep2 mode tap | ||
58 | ip tuntap add ep3 mode tap | ||
59 | ip tuntap add ep4 mode tap | ||
60 | ip tuntap add ep5 mode tap | ||
61 | ip tuntap add ep6 mode tap | ||
62 | ip tuntap add ep7 mode tap | ||
63 | ip tuntap add ep8 mode tap | ||
64 | ip tuntap add ep9 mode tap | ||
65 | ip tuntap add epA mode tap | ||
66 | ip tuntap add epB mode tap | ||
67 | ip tuntap add epC mode tap | ||
68 | ip tuntap add epD mode tap | ||
69 | ip tuntap add epE mode tap | ||
70 | ip tuntap add epF mode tap | ||
71 | } | ||
72 | |||
73 | buildtaps | ||
74 | |||
75 | num=$(ip addr show wlan0 | sed -n '/\s\+inet 192/ s/\s\+inet 192\.168\.[0-9]*\.\([0-9]*\).*$/\1/ p') | ||
76 | num=${num:-88} | ||
77 | |||
78 | ip addr add 80.$num.99.99 dev ep0 | ||
79 | ip addr add 81.$num.99.99 dev ep1 | ||
80 | ip addr add 82.$num.99.99 dev ep2 | ||
81 | ip addr add 83.$num.99.99 dev ep3 | ||
82 | ip addr add 84.$num.99.99 dev ep4 | ||
83 | ip addr add 85.$num.99.99 dev ep5 | ||
84 | ip addr add 86.$num.99.99 dev ep6 | ||
85 | ip addr add 87.$num.99.99 dev ep7 | ||
86 | ip addr add 88.$num.99.99 dev ep8 | ||
87 | ip addr add 89.$num.99.99 dev ep9 | ||
88 | ip addr add 90.$num.99.99 dev epA | ||
89 | ip addr add 91.$num.99.99 dev epB | ||
90 | ip addr add 92.$num.99.99 dev epC | ||
91 | ip addr add 93.$num.99.99 dev epD | ||
92 | ip addr add 94.$num.99.99 dev epE | ||
93 | ip addr add 95.$num.99.99 dev epF | ||
diff --git a/vnet/clean.sh b/vnet/clean.sh deleted file mode 100755 index 3e0af1bd..00000000 --- a/vnet/clean.sh +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cleanhub() { | ||
4 | brctl delbr hub | ||
5 | |||
6 | ip link del hub0 | ||
7 | ip link del hub1 | ||
8 | ip link del hub2 | ||
9 | ip link del hub3 | ||
10 | ip link del hub4 | ||
11 | ip link del hub5 | ||
12 | ip link del hub6 | ||
13 | ip link del hub7 | ||
14 | |||
15 | ip link del hub8 | ||
16 | ip link del hub9 | ||
17 | ip link del hubA | ||
18 | ip link del hubB | ||
19 | ip link del hubC | ||
20 | ip link del hubD | ||
21 | ip link del hubE | ||
22 | ip link del hubF | ||
23 | } | ||
24 | |||
25 | cleantaps() | ||
26 | { | ||
27 | ip link del ep0 | ||
28 | ip link del ep1 | ||
29 | ip link del ep2 | ||
30 | ip link del ep3 | ||
31 | ip link del ep4 | ||
32 | ip link del ep5 | ||
33 | ip link del ep6 | ||
34 | ip link del ep7 | ||
35 | |||
36 | ip link del ep8 | ||
37 | ip link del ep9 | ||
38 | ip link del epA | ||
39 | ip link del epB | ||
40 | ip link del epC | ||
41 | ip link del epD | ||
42 | ip link del epE | ||
43 | ip link del epF | ||
44 | } | ||
45 | |||
46 | cleantaps | ||
47 | |||
48 | rm -rf ep0 ep1 ep2 ep3 ep4 ep5 ep6 ep7 \ | ||
49 | ep8 ep9 epA epB epC epD epE epF | ||
diff --git a/vnet/everywhere.sh b/vnet/everywhere.sh deleted file mode 100755 index ebd4ca38..00000000 --- a/vnet/everywhere.sh +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | cmd="$@" | ||
3 | for ep in ep? | ||
4 | do | ||
5 | ( cd $ep | ||
6 | $cmd | ||
7 | ) | ||
8 | done | ||
diff --git a/vnet/mkroutes.sh b/vnet/mkroutes.sh deleted file mode 100755 index 8b13faaa..00000000 --- a/vnet/mkroutes.sh +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | host=$1 | ||
3 | num=${1#*.*.*.} | ||
4 | ip route add 80.$num.99.99/32 via $host | ||
5 | ip route add 80.$num.99.99/32 via $host | ||
6 | ip route add 81.$num.99.99/32 via $host | ||
7 | ip route add 82.$num.99.99/32 via $host | ||
8 | ip route add 83.$num.99.99/32 via $host | ||
9 | ip route add 84.$num.99.99/32 via $host | ||
10 | ip route add 85.$num.99.99/32 via $host | ||
11 | ip route add 86.$num.99.99/32 via $host | ||
12 | ip route add 87.$num.99.99/32 via $host | ||
13 | ip route add 88.$num.99.99/32 via $host | ||
14 | ip route add 89.$num.99.99/32 via $host | ||
15 | ip route add 90.$num.99.99/32 via $host | ||
16 | ip route add 91.$num.99.99/32 via $host | ||
17 | ip route add 92.$num.99.99/32 via $host | ||
18 | ip route add 93.$num.99.99/32 via $host | ||
19 | ip route add 94.$num.99.99/32 via $host | ||
20 | ip route add 95.$num.99.99/32 via $host | ||
diff --git a/vnet/run.sh b/vnet/run.sh deleted file mode 100755 index 0189b6b7..00000000 --- a/vnet/run.sh +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | [ -L ./dhtd ] || ( echo "Missing symbolic link to your build: ./dhtd" ; exit 1 ) | ||
4 | |||
5 | mkdir -p ep0 ep1 ep2 ep3 ep4 ep5 ep6 ep7 \ | ||
6 | ep8 ep9 epA epB epC epD epE epF | ||
7 | |||
8 | rm -f window-count | ||
9 | echo detach > detached | ||
10 | |||
11 | screen -S test -s ./screen-shell.sh -c detached | ||
12 | sleep 0.5 | ||
13 | screen -S test -X screen | ||
14 | sleep 0.5 | ||
15 | screen -S test -X screen | ||
16 | sleep 0.5 | ||
17 | screen -S test -X screen | ||
18 | sleep 0.5 | ||
19 | |||
20 | screen -S test -X screen | ||
21 | sleep 0.5 | ||
22 | screen -S test -X screen | ||
23 | sleep 0.5 | ||
24 | screen -S test -X screen | ||
25 | sleep 0.5 | ||
26 | screen -S test -X screen | ||
27 | sleep 0.5 | ||
28 | |||
29 | screen -S test -X screen | ||
30 | sleep 0.5 | ||
31 | screen -S test -X screen | ||
32 | sleep 0.5 | ||
33 | screen -S test -X screen | ||
34 | sleep 0.5 | ||
35 | screen -S test -X screen | ||
36 | sleep 0.5 | ||
37 | |||
38 | screen -S test -X screen | ||
39 | sleep 0.5 | ||
40 | screen -S test -X screen | ||
41 | sleep 0.5 | ||
42 | screen -S test -X screen | ||
43 | sleep 0.5 | ||
44 | screen -S test -X screen | ||
45 | sleep 0.5 | ||
diff --git a/vnet/screen-everywhere.sh b/vnet/screen-everywhere.sh deleted file mode 100755 index e4f75374..00000000 --- a/vnet/screen-everywhere.sh +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | cmd="$@" | ||
3 | echo "$cmd" > /tmp/screen-exchange | ||
4 | screen -S test -X eval readbuf \ | ||
5 | "select 15" "paste ." \ | ||
6 | "select 14" "paste ." \ | ||
7 | "select 13" "paste ." \ | ||
8 | "select 12" "paste ." \ | ||
9 | "select 11" "paste ." \ | ||
10 | "select 10" "paste ." \ | ||
11 | "select 9" "paste ." \ | ||
12 | "select 8" "paste ." \ | ||
13 | "select 7" "paste ." \ | ||
14 | "select 6" "paste ." \ | ||
15 | "select 5" "paste ." \ | ||
16 | "select 5" "paste ." \ | ||
17 | "select 4" "paste ." \ | ||
18 | "select 3" "paste ." \ | ||
19 | "select 2" "paste ." \ | ||
20 | "select 1" "paste ." \ | ||
21 | "select 0" "paste ." | ||
diff --git a/vnet/screen-shell.sh b/vnet/screen-shell.sh deleted file mode 100755 index fa420b9d..00000000 --- a/vnet/screen-shell.sh +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | ifaddr() { | ||
3 | ip -o address show dev $1 | sed -n 's#.* inet \([^ /]*\).*#\1#p' | ||
4 | } | ||
5 | touch window-count | ||
6 | count=$(cat window-count) | ||
7 | count=${count:-(-1)} | ||
8 | count=$(( $count + 1 )) | ||
9 | echo $count > window-count | ||
10 | digit=$(printf '%X' $count) | ||
11 | cd ep$digit | ||
12 | port=$(( 33400 + $count )) | ||
13 | pwd | ||
14 | ../dhtd tox=$(ifaddr ep$digit):$port,bt=,xmpp= | ||
diff --git a/vnet/show-links.sh b/vnet/show-links.sh deleted file mode 100755 index d7115a0b..00000000 --- a/vnet/show-links.sh +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | ip -o link | sed 's/\([^:]*:[^:]*:*\).*/\1/' | ||