aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/scripts')
-rw-r--r--src/charon/scripts/alice-key.derbin0 -> 1190 bytes
-rw-r--r--src/charon/scripts/alice.derbin0 -> 764 bytes
-rw-r--r--src/charon/scripts/bob-key.derbin0 -> 1187 bytes
-rw-r--r--src/charon/scripts/bob.derbin0 -> 759 bytes
-rw-r--r--src/charon/scripts/complex1.derbin0 -> 934 bytes
-rw-r--r--src/charon/scripts/complex2.derbin0 -> 956 bytes
-rwxr-xr-xsrc/charon/scripts/daemon-loop.sh13
-rwxr-xr-xsrc/charon/scripts/deleteline9
-rwxr-xr-xsrc/charon/scripts/replace9
-rwxr-xr-xsrc/charon/scripts/to-alice.sh27
-rwxr-xr-xsrc/charon/scripts/to-bob.sh27
11 files changed, 85 insertions, 0 deletions
diff --git a/src/charon/scripts/alice-key.der b/src/charon/scripts/alice-key.der
new file mode 100644
index 000000000..5a8aef6cb
--- /dev/null
+++ b/src/charon/scripts/alice-key.der
Binary files differ
diff --git a/src/charon/scripts/alice.der b/src/charon/scripts/alice.der
new file mode 100644
index 000000000..8154defd9
--- /dev/null
+++ b/src/charon/scripts/alice.der
Binary files differ
diff --git a/src/charon/scripts/bob-key.der b/src/charon/scripts/bob-key.der
new file mode 100644
index 000000000..f944dec9f
--- /dev/null
+++ b/src/charon/scripts/bob-key.der
Binary files differ
diff --git a/src/charon/scripts/bob.der b/src/charon/scripts/bob.der
new file mode 100644
index 000000000..401611888
--- /dev/null
+++ b/src/charon/scripts/bob.der
Binary files differ
diff --git a/src/charon/scripts/complex1.der b/src/charon/scripts/complex1.der
new file mode 100644
index 000000000..ba460cbee
--- /dev/null
+++ b/src/charon/scripts/complex1.der
Binary files differ
diff --git a/src/charon/scripts/complex2.der b/src/charon/scripts/complex2.der
new file mode 100644
index 000000000..160b21f47
--- /dev/null
+++ b/src/charon/scripts/complex2.der
Binary files differ
diff --git a/src/charon/scripts/daemon-loop.sh b/src/charon/scripts/daemon-loop.sh
new file mode 100755
index 000000000..9a361e012
--- /dev/null
+++ b/src/charon/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/src/charon/scripts/deleteline b/src/charon/scripts/deleteline
new file mode 100755
index 000000000..9f529dccc
--- /dev/null
+++ b/src/charon/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/src/charon/scripts/replace b/src/charon/scripts/replace
new file mode 100755
index 000000000..adfc8e09a
--- /dev/null
+++ b/src/charon/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/src/charon/scripts/to-alice.sh b/src/charon/scripts/to-alice.sh
new file mode 100755
index 000000000..01ba27f5b
--- /dev/null
+++ b/src/charon/scripts/to-alice.sh
@@ -0,0 +1,27 @@
+#!/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
+OTHER_ADDR=192.168.0.1 # Address of remote peer
+MY_ID="C=CH, O=Linux strongSwan, CN=bob" # ID of local peer
+OTHER_ID="C=CH, O=Linux strongSwan, CN=alice" # ID of 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_ID" "$OTHER_ID" $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/src/charon/scripts/to-bob.sh b/src/charon/scripts/to-bob.sh
new file mode 100755
index 000000000..df30bd893
--- /dev/null
+++ b/src/charon/scripts/to-bob.sh
@@ -0,0 +1,27 @@
+#!/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
+OTHER_ADDR=192.168.0.2 # Address of remote peer
+MY_ID="C=CH, O=Linux strongSwan, CN=alice" # ID of local peer
+OTHER_ID="C=CH, O=Linux strongSwan, CN=bob" # ID of 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_ID" "$OTHER_ID" $MY_ADDR $OTHER_ADDR $MY_NET $OTHER_NET $MY_BITS $OTHER_BITS
+
+# initiate
+i=0
+LIMIT=0
+
+while [ "$i" -lt "$LIMIT" ]
+do
+ bin/stroke up $CONN_NAME
+ let "i += 1"
+done