summaryrefslogtreecommitdiff
path: root/vnet
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2019-09-28 13:43:29 -0400
committerJoe Crayne <joe@jerkface.net>2020-01-01 19:27:53 -0500
commit11987749fc6e6d3e53ea737d46d5ab13a16faeb8 (patch)
tree5716463275c2d3e902889db619908ded2a73971c /vnet
parentadd2c76bced51fde5e9917e7449ef52be70faf87 (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-xvnet/build.sh93
-rwxr-xr-xvnet/clean.sh49
-rwxr-xr-xvnet/everywhere.sh8
-rwxr-xr-xvnet/mkroutes.sh20
-rwxr-xr-xvnet/run.sh45
-rwxr-xr-xvnet/screen-everywhere.sh21
-rwxr-xr-xvnet/screen-shell.sh14
-rwxr-xr-xvnet/show-links.sh2
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
4wire() {
5 ip link add $1 \
6 type veth \
7 peer name $2
8}
9
10set -x
11
12# Not using this...
13buildhub() {
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...
54buildtaps() {
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
73buildtaps
74
75num=$(ip addr show wlan0 | sed -n '/\s\+inet 192/ s/\s\+inet 192\.168\.[0-9]*\.\([0-9]*\).*$/\1/ p')
76num=${num:-88}
77
78ip addr add 80.$num.99.99 dev ep0
79ip addr add 81.$num.99.99 dev ep1
80ip addr add 82.$num.99.99 dev ep2
81ip addr add 83.$num.99.99 dev ep3
82ip addr add 84.$num.99.99 dev ep4
83ip addr add 85.$num.99.99 dev ep5
84ip addr add 86.$num.99.99 dev ep6
85ip addr add 87.$num.99.99 dev ep7
86ip addr add 88.$num.99.99 dev ep8
87ip addr add 89.$num.99.99 dev ep9
88ip addr add 90.$num.99.99 dev epA
89ip addr add 91.$num.99.99 dev epB
90ip addr add 92.$num.99.99 dev epC
91ip addr add 93.$num.99.99 dev epD
92ip addr add 94.$num.99.99 dev epE
93ip 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
3cleanhub() {
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
25cleantaps()
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
46cleantaps
47
48rm -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
2cmd="$@"
3for ep in ep?
4do
5 ( cd $ep
6 $cmd
7 )
8done
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
2host=$1
3num=${1#*.*.*.}
4ip route add 80.$num.99.99/32 via $host
5ip route add 80.$num.99.99/32 via $host
6ip route add 81.$num.99.99/32 via $host
7ip route add 82.$num.99.99/32 via $host
8ip route add 83.$num.99.99/32 via $host
9ip route add 84.$num.99.99/32 via $host
10ip route add 85.$num.99.99/32 via $host
11ip route add 86.$num.99.99/32 via $host
12ip route add 87.$num.99.99/32 via $host
13ip route add 88.$num.99.99/32 via $host
14ip route add 89.$num.99.99/32 via $host
15ip route add 90.$num.99.99/32 via $host
16ip route add 91.$num.99.99/32 via $host
17ip route add 92.$num.99.99/32 via $host
18ip route add 93.$num.99.99/32 via $host
19ip route add 94.$num.99.99/32 via $host
20ip 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
5mkdir -p ep0 ep1 ep2 ep3 ep4 ep5 ep6 ep7 \
6 ep8 ep9 epA epB epC epD epE epF
7
8rm -f window-count
9echo detach > detached
10
11screen -S test -s ./screen-shell.sh -c detached
12sleep 0.5
13screen -S test -X screen
14sleep 0.5
15screen -S test -X screen
16sleep 0.5
17screen -S test -X screen
18sleep 0.5
19
20screen -S test -X screen
21sleep 0.5
22screen -S test -X screen
23sleep 0.5
24screen -S test -X screen
25sleep 0.5
26screen -S test -X screen
27sleep 0.5
28
29screen -S test -X screen
30sleep 0.5
31screen -S test -X screen
32sleep 0.5
33screen -S test -X screen
34sleep 0.5
35screen -S test -X screen
36sleep 0.5
37
38screen -S test -X screen
39sleep 0.5
40screen -S test -X screen
41sleep 0.5
42screen -S test -X screen
43sleep 0.5
44screen -S test -X screen
45sleep 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
2cmd="$@"
3echo "$cmd" > /tmp/screen-exchange
4screen -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
2ifaddr() {
3 ip -o address show dev $1 | sed -n 's#.* inet \([^ /]*\).*#\1#p'
4}
5touch window-count
6count=$(cat window-count)
7count=${count:-(-1)}
8count=$(( $count + 1 ))
9echo $count > window-count
10digit=$(printf '%X' $count)
11cd ep$digit
12port=$(( 33400 + $count ))
13pwd
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
2ip -o link | sed 's/\([^:]*:[^:]*:*\).*/\1/'