aboutsummaryrefslogtreecommitdiff
path: root/example/ipsec_api
diff options
context:
space:
mode:
authorAakash Sasidharan <asasidharan@marvell.com>2021-01-06 02:44:46 +0000
committerPetri Savolainen <petri.savolainen@nokia.com>2021-02-04 14:54:44 +0200
commitafd39af41057246799275caa90d92f3a564670e8 (patch)
tree93bff734d3a7bca9288ec2e8daca0caccbcb1547 /example/ipsec_api
parent2010f8f62a58d032c3f1ec3987200e5101284eb1 (diff)
example: ipsec: use comma as separator in args
As part of -i option, interface name could be in PCI Domain Bus Device Function (DBDF) format to represent the device. Application will throw error during argument parsing as DBDF format itself contains colon(:). So updating parsing logic to use comma(,) as a separator instead of colon(:). Also updating MAC address representation to use colons as colon is no longer reserved for field separation. Signed-off-by: Aakash Sasidharan <asasidharan@marvell.com> Reviewed-by: Janne Peltonen <janne.peltonen@nokia.com>
Diffstat (limited to 'example/ipsec_api')
-rw-r--r--example/ipsec_api/README12
-rw-r--r--example/ipsec_api/odp_ipsec.c20
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_ah_in.sh8
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_ah_out.sh8
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_ah_tun_in.sh10
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_ah_tun_out.sh10
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_esp_in.sh10
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_esp_out.sh10
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_esp_tun_in.sh12
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_esp_tun_out.sh10
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_live.sh16
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_router.sh4
-rwxr-xr-xexample/ipsec_api/odp_ipsec_api_run_simple.sh4
13 files changed, 67 insertions, 67 deletions
diff --git a/example/ipsec_api/README b/example/ipsec_api/README
index b391a6bfd..f7ea93e59 100644
--- a/example/ipsec_api/README
+++ b/example/ipsec_api/README
@@ -81,12 +81,12 @@ ONBOOT=yes
The application is launched on VM1 with the following command:
$ sudo ./odp_ipsec_api -i p7p1,p8p1 \
--r 192.168.111.2/32:p7p1:08.00.27.76.B5.E0 \
--r 192.168.222.2/32:p8p1:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:esp \
--e 192.168.111.2:192.168.222.2:3des:201:656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
--p 192.168.222.0/24:192.168.111.0/24:in:esp \
--e 192.168.222.2:192.168.111.2:3des:301:c966199f24d095f3990a320d749056401e82b26570320292 \
+-r 192.168.111.2/32,p7p1,08:00:27:76:B5:E0 \
+-r 192.168.222.2/32,p8p1,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,esp \
+-e 192.168.111.2,192.168.222.2,3des,201,656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
+-p 192.168.222.0/24,192.168.111.0/24,in,esp \
+-e 192.168.222.2,192.168.111.2,3des,301,c966199f24d095f3990a320d749056401e82b26570320292 \
-c 2 -m 0
4.3 VM2 configuration
diff --git a/example/ipsec_api/odp_ipsec.c b/example/ipsec_api/odp_ipsec.c
index e6a3716be..98e31d6ce 100644
--- a/example/ipsec_api/odp_ipsec.c
+++ b/example/ipsec_api/odp_ipsec.c
@@ -1325,26 +1325,26 @@ static void usage(char *progname)
" Default: 1: ASYNC api mode\n"
"\n"
"Routing / IPSec OPTIONS:\n"
- " -r, --route SubNet:Intf:NextHopMAC\n"
- " -p, --policy SrcSubNet:DstSubNet:(in|out):(ah|esp)\n"
- " -e, --esp SrcIP:DstIP:(3des|null):SPI:Key192\n"
- " -a, --ah SrcIP:DstIP:(sha256|md5|null):SPI:Key(256|128)\n"
+ " -r, --route SubNet,Intf,NextHopMAC\n"
+ " -p, --policy SrcSubNet,DstSubNet,(in|out),(ah|esp)\n"
+ " -e, --esp SrcIP,DstIP,(3des|null),SPI,Key192\n"
+ " -a, --ah SrcIP,DstIP,(sha256|md5|null),SPI,Key(256|128)\n"
"\n"
- " Where: NextHopMAC is raw hex/dot notation, i.e. 03.BA.44.9A.CE.02\n"
+ " Where: NextHopMAC is raw hex/colon notation, i.e. 03:BA:44:9A:CE:02\n"
" IP is decimal/dot notation, i.e. 192.168.1.1\n"
" SubNet is decimal/dot/slash notation, i.e 192.168.0.0/16\n"
" SPI is raw hex, 32 bits\n"
" KeyXXX is raw hex, XXX bits long\n"
"\n"
" Examples:\n"
- " -r 192.168.222.0/24:p8p1:08.00.27.F5.8B.DB\n"
- " -p 192.168.111.0/24:192.168.222.0/24:out:esp\n"
- " -e 192.168.111.2:192.168.222.2:3des:201:656c8523255ccc23a66c1917aa0cf30991fce83532a4b224\n"
- " -a 192.168.111.2:192.168.222.2:md5:201:a731649644c5dee92cbd9c2e7e188ee6\n"
+ " -r 192.168.222.0/24,p8p1,08:00:27:F5:8B:DB\n"
+ " -p 192.168.111.0/24,192.168.222.0/24,out,esp\n"
+ " -e 192.168.111.2,192.168.222.2,3des,201,656c8523255ccc23a66c1917aa0cf30991fce83532a4b224\n"
+ " -a 192.168.111.2,192.168.222.2,md5,201,a731649644c5dee92cbd9c2e7e188ee6\n"
"\n"
"Optional OPTIONS\n"
" -c, --count <number> CPU count, 0=all available, default=1\n"
- " -s, --stream SrcIP:DstIP:InIntf:OutIntf:Count:Length\n"
+ " -s, --stream SrcIP,DstIP,InIntf,OutIntf,Count,Length\n"
" -h, --help Display help and exit.\n"
" environment variables: ODP_IPSEC_USE_POLL_QUEUES\n"
" to enable use of poll queues instead of scheduled (default)\n"
diff --git a/example/ipsec_api/odp_ipsec_api_run_ah_in.sh b/example/ipsec_api/odp_ipsec_api_run_ah_in.sh
index 4f92849b2..22a56f380 100755
--- a/example/ipsec_api/odp_ipsec_api_run_ah_in.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_ah_in.sh
@@ -5,8 +5,8 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.111.2/32:loop1:08.00.27.76.B5.E0 \
--p 192.168.222.0/24:192.168.111.0/24:in:ah \
--a 192.168.222.2:192.168.111.2:md5:300:27f6d123d7077b361662fc6e451f65d8 \
--s 192.168.222.2:192.168.111.2:loop2:loop1:10:100 \
+-r 192.168.111.2/32,loop1,08:00:27:76:B5:E0 \
+-p 192.168.222.0/24,192.168.111.0/24,in,ah \
+-a 192.168.222.2,192.168.111.2,md5,300,27f6d123d7077b361662fc6e451f65d8 \
+-s 192.168.222.2,192.168.111.2,loop2,loop1,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_ah_out.sh b/example/ipsec_api/odp_ipsec_api_run_ah_out.sh
index 67dff4c32..8194485a4 100755
--- a/example/ipsec_api/odp_ipsec_api_run_ah_out.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_ah_out.sh
@@ -5,8 +5,8 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.222.2/32:loop2:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:ah \
--a 192.168.111.2:192.168.222.2:md5:200:a731649644c5dee92cbd9c2e7e188ee6 \
--s 192.168.111.2:192.168.222.2:loop1:loop2:10:100 \
+-r 192.168.222.2/32,loop2,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,ah \
+-a 192.168.111.2,192.168.222.2,md5,200,a731649644c5dee92cbd9c2e7e188ee6 \
+-s 192.168.111.2,192.168.222.2,loop1,loop2,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_ah_tun_in.sh b/example/ipsec_api/odp_ipsec_api_run_ah_tun_in.sh
index fa33f260c..89331bbea 100755
--- a/example/ipsec_api/odp_ipsec_api_run_ah_tun_in.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_ah_tun_in.sh
@@ -5,9 +5,9 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.111.2/32:loop1:08.00.27.76.B5.E0 \
--p 192.168.222.0/24:192.168.111.0/24:in:ah \
--a 192.168.222.2:192.168.111.2:md5:300:27f6d123d7077b361662fc6e451f65d8 \
--t 192.168.222.2:192.168.111.2:10.0.222.2:10.0.111.2 \
--s 192.168.222.2:192.168.111.2:loop2:loop1:10:100 \
+-r 192.168.111.2/32,loop1,08:00:27:76:B5:E0 \
+-p 192.168.222.0/24,192.168.111.0/24,in,ah \
+-a 192.168.222.2,192.168.111.2,md5,300,27f6d123d7077b361662fc6e451f65d8 \
+-t 192.168.222.2,192.168.111.2,10.0.222.2,10.0.111.2 \
+-s 192.168.222.2,192.168.111.2,loop2,loop1,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_ah_tun_out.sh b/example/ipsec_api/odp_ipsec_api_run_ah_tun_out.sh
index acc25e8b2..bd15f5956 100755
--- a/example/ipsec_api/odp_ipsec_api_run_ah_tun_out.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_ah_tun_out.sh
@@ -5,9 +5,9 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.222.2/32:loop2:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:ah \
--a 192.168.111.2:192.168.222.2:md5:200:a731649644c5dee92cbd9c2e7e188ee6 \
--t 192.168.111.2:192.168.222.2:10.0.111.2:10.0.222.2 \
--s 192.168.111.2:192.168.222.2:loop1:loop2:10:100 \
+-r 192.168.222.2/32,loop2,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,ah \
+-a 192.168.111.2,192.168.222.2,md5,200,a731649644c5dee92cbd9c2e7e188ee6 \
+-t 192.168.111.2,192.168.222.2,10.0.111.2,10.0.222.2 \
+-s 192.168.111.2,192.168.222.2,loop1,loop2,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_esp_in.sh b/example/ipsec_api/odp_ipsec_api_run_esp_in.sh
index d71c6f567..61873bf76 100755
--- a/example/ipsec_api/odp_ipsec_api_run_esp_in.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_esp_in.sh
@@ -5,9 +5,9 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.111.2/32:loop1:08.00.27.76.B5.E0 \
--p 192.168.222.0/24:192.168.111.0/24:in:esp \
--e 192.168.222.2:192.168.111.2:\
-3des:301:c966199f24d095f3990a320d749056401e82b26570320292 \
--s 192.168.222.2:192.168.111.2:loop2:loop1:10:100 \
+-r 192.168.111.2/32,loop1,08:00:27:76:B5:E0 \
+-p 192.168.222.0/24,192.168.111.0/24,in,esp \
+-e 192.168.222.2,192.168.111.2,\
+3des,301,c966199f24d095f3990a320d749056401e82b26570320292 \
+-s 192.168.222.2,192.168.111.2,loop2,loop1,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_esp_out.sh b/example/ipsec_api/odp_ipsec_api_run_esp_out.sh
index e846dfbec..834daa4cc 100755
--- a/example/ipsec_api/odp_ipsec_api_run_esp_out.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_esp_out.sh
@@ -10,9 +10,9 @@ IPSEC_EXAMPLE_PATH=.
fi
${IPSEC_EXAMPLE_PATH}/odp_ipsec_api -i loop1,loop2 \
--r 192.168.222.2/32:loop2:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:esp \
--e 192.168.111.2:192.168.222.2:\
-3des:201:656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
--s 192.168.111.2:192.168.222.2:loop1:loop2:10:100 \
+-r 192.168.222.2/32,loop2,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,esp \
+-e 192.168.111.2,192.168.222.2,\
+3des,201,656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
+-s 192.168.111.2,192.168.222.2,loop1,loop2,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_esp_tun_in.sh b/example/ipsec_api/odp_ipsec_api_run_esp_tun_in.sh
index def6f6abd..42be4559f 100755
--- a/example/ipsec_api/odp_ipsec_api_run_esp_tun_in.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_esp_tun_in.sh
@@ -5,10 +5,10 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.111.2/32:loop1:08.00.27.76.B5.E0 \
--p 192.168.222.0/24:192.168.111.0/24:in:esp \
--e 192.168.222.2:192.168.111.2:\
-3des:301:c966199f24d095f3990a320d749056401e82b26570320292 \
--t 192.168.222.2:192.168.111.2:10.0.222.2:10.0.111.2 \
--s 192.168.222.2:192.168.111.2:loop2:loop1:10:100 \
+-r 192.168.111.2/32,loop1,08:00:27:76:B5:E0 \
+-p 192.168.222.0/24,192.168.111.0/24,in,esp \
+-e 192.168.222.2,192.168.111.2,\
+3des,301,c966199f24d095f3990a320d749056401e82b26570320292 \
+-t 192.168.222.2,192.168.111.2,10.0.222.2,10.0.111.2 \
+-s 192.168.222.2,192.168.111.2,loop2,loop1,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_esp_tun_out.sh b/example/ipsec_api/odp_ipsec_api_run_esp_tun_out.sh
index d5dc6e0e6..7b0c42bcb 100755
--- a/example/ipsec_api/odp_ipsec_api_run_esp_tun_out.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_esp_tun_out.sh
@@ -5,9 +5,9 @@
# - 10 packets
# - Specify API mode on command line
./odp_ipsec_api -i loop1,loop2 \
--r 192.168.222.2/32:loop2:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:esp \
--e 192.168.111.2:192.168.222.2:\
-3des:201:656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
--s 192.168.111.2:192.168.222.2:loop1:loop2:10:100 \
+-r 192.168.222.2/32,loop2,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,esp \
+-e 192.168.111.2,192.168.222.2,\
+3des,201,656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
+-s 192.168.111.2,192.168.222.2,loop1,loop2,10,100 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_live.sh b/example/ipsec_api/odp_ipsec_api_run_live.sh
index 3af05d110..318e640fe 100755
--- a/example/ipsec_api/odp_ipsec_api_run_live.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_live.sh
@@ -4,12 +4,12 @@
# - 2 interfaces interfaces
# - Specify API mode on command line
sudo ./odp_ipsec_api -i p7p1,p8p1 \
--r 192.168.111.2/32:p7p1:08.00.27.76.B5.E0 \
--r 192.168.222.2/32:p8p1:08.00.27.F5.8B.DB \
--p 192.168.111.0/24:192.168.222.0/24:out:esp \
--e 192.168.111.2:192.168.222.2:\
-3des:201:656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
--p 192.168.222.0/24:192.168.111.0/24:in:esp \
--e 192.168.222.2:192.168.111.2:\
-3des:301:c966199f24d095f3990a320d749056401e82b26570320292 \
+-r 192.168.111.2/32,p7p1,08:00:27:76:B5:E0 \
+-r 192.168.222.2/32,p8p1,08:00:27:F5:8B:DB \
+-p 192.168.111.0/24,192.168.222.0/24,out,esp \
+-e 192.168.111.2,192.168.222.2,\
+3des,201,656c8523255ccc23a66c1917aa0cf30991fce83532a4b224 \
+-p 192.168.222.0/24,192.168.111.0/24,in,esp \
+-e 192.168.222.2,192.168.111.2,\
+3des,301,c966199f24d095f3990a320d749056401e82b26570320292 \
-c 2 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_router.sh b/example/ipsec_api/odp_ipsec_api_run_router.sh
index 34573d47f..2cdbd2272 100755
--- a/example/ipsec_api/odp_ipsec_api_run_router.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_router.sh
@@ -4,6 +4,6 @@
# - 2 interfaces interfaces
# - Specify API mode on command line
sudo ./odp_ipsec_api -i p7p1,p8p1 \
--r 192.168.111.2/32:p7p1:08.00.27.76.B5.E0 \
--r 192.168.222.2/32:p8p1:08.00.27.F5.8B.DB \
+-r 192.168.111.2/32,p7p1,08:00:27:76:B5:E0 \
+-r 192.168.222.2/32,p8p1,08:00:27:F5:8B:DB \
-c 1 "$@"
diff --git a/example/ipsec_api/odp_ipsec_api_run_simple.sh b/example/ipsec_api/odp_ipsec_api_run_simple.sh
index 8b9b9d7b9..56c022291 100755
--- a/example/ipsec_api/odp_ipsec_api_run_simple.sh
+++ b/example/ipsec_api/odp_ipsec_api_run_simple.sh
@@ -10,6 +10,6 @@ IPSEC_EXAMPLE_PATH=.
fi
${IPSEC_EXAMPLE_PATH}/odp_ipsec_api -i loop1,loop2 \
--r 192.168.222.2/32:loop2:08.00.27.F5.8B.DB \
--s 192.168.111.2:192.168.222.2:loop1:loop2:10:100 \
+-r 192.168.222.2/32,loop2,08:00:27:F5:8B:DB \
+-s 192.168.111.2,192.168.222.2,loop1,loop2,10,100 \
-c 2 "$@"