From ba7b0169747f7f818199e499c449f07d5efc6abb Mon Sep 17 00:00:00 2001
From: Lionel Gauthier <lionel.gauthier@eurecom.fr>
Date: Tue, 26 May 2015 14:23:34 +0000
Subject: [PATCH] add wireshark trace option

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7469 818b1a75-f10b-46b9-bf7c-635c3b92a50f
---
 cmake_targets/tools/run_enb_ue_virt_noS1 | 9 +++++++++
 cmake_targets/tools/run_enb_ue_virt_s1   | 9 +++++++++
 2 files changed, 18 insertions(+)

diff --git a/cmake_targets/tools/run_enb_ue_virt_noS1 b/cmake_targets/tools/run_enb_ue_virt_noS1
index 8815ee9452..82f302ff2e 100755
--- a/cmake_targets/tools/run_enb_ue_virt_noS1
+++ b/cmake_targets/tools/run_enb_ue_virt_noS1
@@ -64,6 +64,10 @@ function help()
   echo_error "  -K, --itti-dump-file   filename         ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
   echo_error "  -m, --mscgen           directory        Generate mscgen output files in a directory"
   echo_error "  -V, --vcd                               Dump timings of processing in a GTKWave compliant file format."
+  echo_error "  -W, --wireshark-l2                      Dump MAC frames for visualization with wireshark."
+  echo_error "                                          You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
+  echo_error "                                          and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
+  echo_error "                                          or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
   echo_error "  -x, --xforms                            Run XFORMS scope windows."
 }
 
@@ -142,6 +146,11 @@ function main()
         exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
         shift ;
         ;;
+      -W | ----wireshark-l2)
+        echo "setting l2 pcap dump output"
+        exe_arguments="$exe_arguments -P wireshark"
+        shift 2;
+        ;;
       *)   
         echo "Unknown option $1"
         help
diff --git a/cmake_targets/tools/run_enb_ue_virt_s1 b/cmake_targets/tools/run_enb_ue_virt_s1
index 3aa8acb03e..6340feee66 100755
--- a/cmake_targets/tools/run_enb_ue_virt_s1
+++ b/cmake_targets/tools/run_enb_ue_virt_s1
@@ -88,6 +88,10 @@ function help()
   echo_error "  -K, --itti-dump-file   filename         ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
   echo_error "  -m, --mscgen           directory        Generate mscgen output files in a directory"
   echo_error "  -V, --vcd                               Dump timings of processing in a GTKWave compliant file format."
+  echo_error "  -W, --wireshark-l2                      Dump MAC frames for visualization with wireshark."
+  echo_error "                                          You need to open Wireshark, open the preferences, and check try heuristics for the UDP protocol, MAC-LTE, RLC-LTE,"
+  echo_error "                                          and PDCP-LTE. Then capture for all the interfaces with the following filters: s1ap or lte_rrc or mac-lte or rlc-lte"
+  echo_error "                                          or pdcp-lte. Note the L2 pdus are transmitted to the local interface."
   echo_error "  -x, --xforms                            Run XFORMS scope windows."
   echo_error " "
   echo_error " A simple data traffic test example: ping -m 1 -I oip1 192.168.12.100"
@@ -168,6 +172,11 @@ function main()
         exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
         shift ;
         ;;
+      -W | ----wireshark-l2)
+        echo "setting l2 pcap dump output"
+        exe_arguments="$exe_arguments -P wireshark"
+        shift 2;
+        ;;
       *)   
         echo "Unknown option $1"
         help
-- 
GitLab