aboutsummaryrefslogtreecommitdiffstats
path: root/Source/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'Source/scripts')
-rw-r--r--Source/scripts/alice-key.derbin0 -> 1190 bytes
-rw-r--r--Source/scripts/alice.derbin0 -> 764 bytes
-rw-r--r--Source/scripts/bob-key.derbin0 -> 1187 bytes
-rw-r--r--Source/scripts/bob.derbin0 -> 759 bytes
-rwxr-xr-xSource/scripts/daemon-loop.sh13
-rwxr-xr-xSource/scripts/deleteline9
-rwxr-xr-xSource/scripts/replace9
-rwxr-xr-xSource/scripts/to-alice.sh28
-rwxr-xr-xSource/scripts/to-bob.sh19
9 files changed, 78 insertions, 0 deletions
diff --git a/Source/scripts/alice-key.der b/Source/scripts/alice-key.der
new file mode 100644
index 000000000..5a8aef6cb
--- /dev/null
+++ b/Source/scripts/alice-key.der
Binary files differ
diff --git a/Source/scripts/alice.der b/Source/scripts/alice.der
new file mode 100644
index 000000000..8154defd9
--- /dev/null
+++ b/Source/scripts/alice.der
Binary files differ
diff --git a/Source/scripts/bob-key.der b/Source/scripts/bob-key.der
new file mode 100644
index 000000000..f944dec9f
--- /dev/null
+++ b/Source/scripts/bob-key.der
Binary files differ
diff --git a/Source/scripts/bob.der b/Source/scripts/bob.der
new file mode 100644
index 000000000..401611888
--- /dev/null
+++ b/Source/scripts/bob.der
Binary files differ
diff --git a/Source/scripts/daemon-loop.sh b/Source/scripts/daemon-loop.sh
new file mode 100755
index 000000000..9a361e012
--- /dev/null
+++ b/Source/scripts/daemon-loop.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+while [ 1 ]
+do
+ ip x p f
+ ip x s f
+ rm /var/run/charon.*
+ make
+ bin/charon
+ echo ""
+ echo "----------------------------"
+ echo ""
+done
diff --git a/Source/scripts/deleteline b/Source/scripts/deleteline
new file mode 100755
index 000000000..9f529dccc
--- /dev/null
+++ b/Source/scripts/deleteline
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+FILES=`find . -name '*.[ch]'`
+for FILE in $FILES
+do
+ TMP=${FILE}_tmp
+ sed "/$1/d" < $FILE > $TMP
+ mv $TMP $FILE
+done
diff --git a/Source/scripts/replace b/Source/scripts/replace
new file mode 100755
index 000000000..adfc8e09a
--- /dev/null
+++ b/Source/scripts/replace
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+FILES=`find . -name '*.[ch]'`
+for FILE in $FILES
+do
+ TMP=${FILE}_tmp
+ sed "s/$1/$2/g" < $FILE > $TMP
+ mv $TMP $FILE
+done
diff --git a/Source/scripts/to-alice.sh b/Source/scripts/to-alice.sh
new file mode 100755
index 000000000..fa2f84dd0
--- /dev/null
+++ b/Source/scripts/to-alice.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# enable ip forwarding for gateway
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# add connection to alice
+MY_ADDR=192.168.0.2 # Address of local peer, also used as ID
+OTHER_ADDR=192.168.0.1 # Address of remote peer, also used as ID
+MY_CERT=bob.der # own certificate
+OTHER_CERT=alice.der # certificate for remote peer
+MY_NET=10.2.0.0 # protected local subnet
+OTHER_NET=10.1.0.0 # protected remote subnet
+MY_BITS=16 # size of subnet
+OTHER_BITS=16 # size of subnet
+CONN_NAME=to-alice # connection name
+
+bin/stroke add $CONN_NAME $MY_ADDR $OTHER_ADDR $MY_CERT $OTHER_CERT \
+ $MY_ADDR $OTHER_ADDR $MY_NET $OTHER_NET $MY_BITS $OTHER_BITS
+
+# initiate
+i=0
+LIMIT=1
+
+while [ "$i" -lt "$LIMIT" ]
+do
+ bin/stroke up $CONN_NAME
+ let "i += 1"
+done
diff --git a/Source/scripts/to-bob.sh b/Source/scripts/to-bob.sh
new file mode 100755
index 000000000..012986484
--- /dev/null
+++ b/Source/scripts/to-bob.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# enable ip forwarding for gateway
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# add connection to bob
+MY_ADDR=192.168.0.1 # Address of local peer, also used as ID
+OTHER_ADDR=192.168.0.2 # Address of remote peer, also used as ID
+MY_CERT=alice.der # own certificate
+OTHER_CERT=bob.der # certificate for remote peer
+MY_NET=10.1.0.0 # protected local subnet
+OTHER_NET=10.2.0.0 # protected remote subnet
+MY_BITS=16 # size of subnet
+OTHER_BITS=16 # size of subnet
+CONN_NAME=to-bob # connection name
+
+bin/stroke add $CONN_NAME $MY_ADDR $OTHER_ADDR $MY_CERT $OTHER_CERT \
+ $MY_ADDR $OTHER_ADDR $MY_NET $OTHER_NET $MY_BITS $OTHER_BITS
+ \ No newline at end of file