Commit cf1db866 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/develop_integration_2018_w44' into develop

parents 3fa0f5a9 9b8e4e4c
...@@ -290,36 +290,36 @@ set(protobuf_generated_dir ${OPENAIR_BIN_DIR}) ...@@ -290,36 +290,36 @@ set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
add_list2_option(RRC_ASN1_VERSION "Rel14" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA") add_list2_option(RRC_ASN1_VERSION "Rel14" "ASN.1 version of RRC interface" "Rel8" "Rel10" "Rel14" "CBA")
if (${RRC_ASN1_VERSION} STREQUAL "Rel8") if (${RRC_ASN1_VERSION} STREQUAL "Rel8")
make_version(RRC_VERSION 8 6 0) make_version(LTE_RRC_VERSION 8 6 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-86.asn)
elseif (${RRC_ASN1_VERSION} STREQUAL "CBA") elseif (${RRC_ASN1_VERSION} STREQUAL "CBA")
make_version(RRC_VERSION 10 2 0) make_version(LTE_RRC_VERSION 10 2 0)
add_definitions(-DCBA) add_definitions(-DCBA)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel10") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel10")
make_version(RRC_VERSION 10 2 0) make_version(LTE_RRC_VERSION 10 2 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20.asn)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel11") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel11")
make_version(RRC_VERSION 11 18 0) make_version(LTE_RRC_VERSION 11 18 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-11.18.0.asn1) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-11.18.0.asn1)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel12") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel12")
make_version(RRC_VERSION 12 16 0) make_version(LTE_RRC_VERSION 12 16 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-12.16.0.asn1) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-12.16.0.asn1)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel13") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel13")
make_version(RRC_VERSION 13 9 1) make_version(LTE_RRC_VERSION 13 9 1)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-13.9.1.asn1) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-13.9.1.asn1)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel14") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel14")
make_version(RRC_VERSION 14 7 0) make_version(LTE_RRC_VERSION 14 7 0)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1)
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15") elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15")
make_version(RRC_VERSION 15 2 2) make_version(LTE_RRC_VERSION 15 2 2)
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.2.2.asn1) set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.2.2.asn1)
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8") endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
add_definitions(-DRRC_VERSION=${RRC_VERSION}) add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION})
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION}) set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
message("calling asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}") message("calling ASN1C_PREFIX=LTE_ asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}")
execute_process(COMMAND mkdir -p ${RRC_FULL_DIR} execute_process(COMMAND mkdir -p ${RRC_FULL_DIR}
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR} COMMAND env "ASN1C_PREFIX=LTE_" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
...@@ -339,7 +339,7 @@ include_directories ("${RRC_FULL_DIR}") ...@@ -339,7 +339,7 @@ include_directories ("${RRC_FULL_DIR}")
add_custom_command ( add_custom_command (
OUTPUT ${RRC_FULL_DIR}/asn_constant.h OUTPUT ${RRC_FULL_DIR}/asn_constant.h
COMMAND mkdir -p ${RRC_FULL_DIR} COMMAND mkdir -p ${RRC_FULL_DIR}
COMMAND env asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR} COMMAND env "ASN1C_PREFIX=LTE_" asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example -D ${RRC_FULL_DIR} ${RRC_GRAMMAR}
DEPENDS ${RRC_GRAMMAR} DEPENDS ${RRC_GRAMMAR}
) )
......
...@@ -956,20 +956,20 @@ ...@@ -956,20 +956,20 @@
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args> <pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/dlsim.Rel14</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/dlsim.Rel14</main_exec>
<main_exec_args> -m5 -gF -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60 <main_exec_args> -m=5 -g=F -s=-1= -w=1.0 -f=.2 -n=500 -B=50 -c=2 -z=2 -O=60
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O60 -m=4 -g=F -s=0 -w=1.0 -f=.2 -n=500 -B=6 -c=4 -z=2 -O=60
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60 -m=15 -g=F -s=6.7 -w=1.0 -f=.2 -n=500 -B=50 -c=2 -z=2 -O=60
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O60 -m=15 -g=F -s=6.7 -w=1.0 -f=.2 -n=500 -B=25 -c=2 -z=2 -O=60
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O25 -m=15 -g=G -s=1.4 -w=1.0 -f=.2 -n=500 -B=50 -c=2 -z=2 -O=25
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O25 -m=15 -g=G -s=1.4 -w=1.0 -f=.2 -n=500 -B=25 -c=2 -z=2 -O=25
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O60 -m=25 -g=F -s=17.4 -w=1.0 -f=.2 -n=500 -B=25 -c=3 -z=2 -O=60
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O60 -m=25 -g=F -s=17.5 -w=1.0 -f=.2 -n=500 -B=25 -c=3 -z=2 -r=1022 -O=60
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60 -m=26 -g=F -s=17.7 -w=1.0 -f=.2 -n=500 -B=50 -c=2 -z=2 -O=60
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O60 -m=26 -g=F -s=17.6 -w=1.0 -f=.2 -n=500 -B=100 -c=2 -z=2 -O=60
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O60 -m=26 -g=F -s=17.3 -w=1.0 -f=.2 -n=500 -B=100 -c=2 -z=2 -r=1600 -O=60
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O60 -m=26 -g=F -s=16.6 -w=1.0 -f=.2 -n=500 -B=100 -c=2 -z=2 -r=1899 -O=60
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O60 -m=14 -g=F -s=6.8 -w=1.0 -f=.2 -n=500 -B=50 -c=2 -x=2 -y=2 -z=2 -O=60
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O60</main_exec_args> -m=13 -g=F -s=5.9 -w=1.0 -f=.2 -n=500 -B=25 -c=3 -x=2 -y=2 -z=2 -O=60</main_exec_args>
<tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags> <tags>dlsim.test1 dlsim.test5 dlsim.test6 dlsim.test6b dlsim.test7 dlsim.test7b dlsim.test10 dlsim.test10b dlsim.test11 dlsim.TM2_test1 dlsim.TM2_test1b</tags>
<search_expr_true>"passed"</search_expr_true> <search_expr_true>"passed"</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
......
...@@ -9,4 +9,5 @@ set(MU_RECIEVER False) ...@@ -9,4 +9,5 @@ set(MU_RECIEVER False)
set(NAS_UE False) set(NAS_UE False)
set(MESSAGE_CHART_GENERATOR False) set(MESSAGE_CHART_GENERATOR False)
set(RRC_ASN1_VERSION "Rel14") set(RRC_ASN1_VERSION "Rel14")
set (UE_TIMING_TRACE True)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt) include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
...@@ -252,7 +252,7 @@ install_usrp_uhd_driver_from_source(){ ...@@ -252,7 +252,7 @@ install_usrp_uhd_driver_from_source(){
rm -rf /tmp/uhd rm -rf /tmp/uhd
git clone https://github.com/EttusResearch/uhd.git git clone https://github.com/EttusResearch/uhd.git
cd uhd cd uhd
git checkout tags/release_003_010_001_001 git checkout tags/v3.13.0.2
mkdir -p host/build mkdir -p host/build
cd host/build cd host/build
$CMAKE ../ $CMAKE ../
...@@ -683,7 +683,7 @@ install_asn1c_from_source(){ ...@@ -683,7 +683,7 @@ install_asn1c_from_source(){
# better to use a given commit than a branch in case the branch # better to use a given commit than a branch in case the branch
# is updated and requires modifications in the source of OAI # is updated and requires modifications in the source of OAI
#git checkout velichkov_s1ap_plus_option_group #git checkout velichkov_s1ap_plus_option_group
git checkout d3aed06bb2bec7df1b5c6d0333f8c7dfc5993372 git checkout 0a7524184f16e7093990a31d8d4db487a16e5782
autoreconf -iv autoreconf -iv
./configure ./configure
make -j`nproc` make -j`nproc`
......
...@@ -75,8 +75,12 @@ ID = ENB_PHY_MSG3_ALLOCATION ...@@ -75,8 +75,12 @@ ID = ENB_PHY_MSG3_ALLOCATION
FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe FORMAT = int,eNB_ID : int,frame : int,subframe : int,rnti : int,first_transmission : int,Msg3_frame : int,Msg3_subframe
ID = ENB_PHY_INITIATE_RA_PROCEDURE ID = ENB_PHY_INITIATE_RA_PROCEDURE
DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles DESC = eNodeB initiates a random access procedure after detecting enough energy for one of the preambles
GROUP = ALL:PHY:ENB GROUP = ALL:PHY:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay FORMAT = int,eNB_ID : int,frame : int,subframe : int,preamble : int,energy : int,delay
ID = ENB_PHY_MIB
DESC = MIB data
GROUP = ALL:PHY:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,frame : int,subframe : buffer,data
#MAC logs #MAC logs
ID = ENB_MAC_UE_DL_SDU ID = ENB_MAC_UE_DL_SDU
...@@ -97,7 +101,7 @@ ID = ENB_MAC_UE_UL_PDU ...@@ -97,7 +101,7 @@ ID = ENB_MAC_UE_UL_PDU
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu
ID = ENB_MAC_UE_UL_PDU_WITH_DATA ID = ENB_MAC_UE_UL_PDU_WITH_DATA
DESC = MAC uplink UE received PDU DESC = MAC uplink UE received PDU
GROUP = ALL:MAC:ENB GROUP = ALL:MAC:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu : buffer,data FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : int,sdu_length : int,num_ce : int,num_sdu : buffer,data
ID = ENB_MAC_UE_UL_SDU ID = ENB_MAC_UE_UL_SDU
DESC = MAC uplink UE received SDU DESC = MAC uplink UE received SDU
...@@ -113,12 +117,16 @@ ID = ENB_MAC_UE_UL_CE ...@@ -113,12 +117,16 @@ ID = ENB_MAC_UE_UL_CE
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,ce FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,ce
ID = ENB_MAC_UE_DL_PDU_WITH_DATA ID = ENB_MAC_UE_DL_PDU_WITH_DATA
DESC = MAC downlink PDU for an UE DESC = MAC downlink PDU for an UE
GROUP = ALL:MAC:ENB GROUP = ALL:MAC:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
ID = ENB_MAC_SCHEDULING_REQUEST ID = ENB_MAC_SCHEDULING_REQUEST
DESC = MAC scheduling request detected for an UE DESC = MAC scheduling request detected for an UE
GROUP = ALL:MAC:ENB GROUP = ALL:MAC:ENB
FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,rnti FORMAT = int,eNB_ID : int,CC_id : int,frame : int,subframe : int,rnti
ID = ENB_MAC_UE_DL_RAR_PDU_WITH_DATA
DESC = MAC downlink PDU for an UE
GROUP = ALL:MAC:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
#RLC logs #RLC logs
ID = ENB_RLC_DL ID = ENB_RLC_DL
......
...@@ -60,6 +60,11 @@ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \ ...@@ -60,6 +60,11 @@ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
multi: multi.o utils.o database.o config.o multi: multi.o utils.o database.o config.o
$(CC) $(CFLAGS) -o multi $^ $(LIBS) $(CC) $(CFLAGS) -o multi $^ $(LIBS)
multi.o: ../T_IDs.h
../T_IDs.h:
cd .. && $(MAKE)
.PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a .PHONY: all gui/gui.a view/view.a logger/logger.a filter/filter.a
gui/gui.a: gui/gui.a:
......
...@@ -16,6 +16,8 @@ void usage(void) ...@@ -16,6 +16,8 @@ void usage(void)
" -f <name> <value> field 'name' of 'event' has to match 'value'\n" " -f <name> <value> field 'name' of 'event' has to match 'value'\n"
" type of 'name' must be int\n" " type of 'name' must be int\n"
" (you can use several -f options)\n" " (you can use several -f options)\n"
" -after <raw time> <nsec> 'event' time has to be greater than this\n"
" -count <n> dump 'n' matching events (less if EOF reached)\n"
); );
exit(1); exit(1);
} }
...@@ -51,6 +53,10 @@ int main(int n, char **v) ...@@ -51,6 +53,10 @@ int main(int n, char **v)
int filter_count = 0; int filter_count = 0;
int buffer_arg; int buffer_arg;
int found; int found;
int count = 1;
int check_time = 0;
time_t sec;
long nsec;
for (i = 1; i < n; i++) { for (i = 1; i < n; i++) {
if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage(); if (!strcmp(v[i], "-h") || !strcmp(v[i], "--help")) usage();
...@@ -63,6 +69,14 @@ int main(int n, char **v) ...@@ -63,6 +69,14 @@ int main(int n, char **v)
filter_value[filter_count++] = atoi(v[++i]); filter_value[filter_count++] = atoi(v[++i]);
continue; continue;
} }
if (!strcmp(v[i], "-after")) { if (i>n-3) usage();
check_time = 1;
sec = atoll(v[++i]);
nsec = atol(v[++i]);
continue;
}
if (!strcmp(v[i], "-count"))
{ if (i > n-2) usage(); count = atoi(v[++i]); continue; }
if (file == NULL) { file = v[i]; continue; } if (file == NULL) { file = v[i]; continue; }
if (event_name == NULL) { event_name = v[i]; continue; } if (event_name == NULL) { event_name = v[i]; continue; }
if (buffer_name == NULL) { buffer_name = v[i]; continue; } if (buffer_name == NULL) { buffer_name = v[i]; continue; }
...@@ -111,13 +125,20 @@ int main(int n, char **v) ...@@ -111,13 +125,20 @@ int main(int n, char **v)
break; break;
if (i != filter_count) if (i != filter_count)
continue; continue;
if (check_time &&
!(e.sending_time.tv_sec > sec ||
(e.sending_time.tv_sec == sec && e.sending_time.tv_nsec >= nsec)))
continue;
if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1) if (fwrite(e.e[buffer_arg].b, e.e[buffer_arg].bsize, 1, out) != 1)
{ perror(output_file); exit(1); } { perror(output_file); exit(1); }
found = 1; found++;
break; if (found == count)
break;
} }
if (found == 0) printf("ERROR: event not found\n"); if (found == 0) printf("ERROR: event not found\n");
if (found != count)
printf("WARNING: dumped %d events (wanted %d)\n", found, count);
fclose(out); fclose(out);
......
...@@ -30,6 +30,7 @@ void framelog_set_skip(logger *_this, int skip_delay); ...@@ -30,6 +30,7 @@ void framelog_set_skip(logger *_this, int skip_delay);
void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9); void framelog_set_update_only_at_sf9(logger *_this, int update_only_at_sf9);
void textlog_dump_buffer(logger *_this, int dump_buffer); void textlog_dump_buffer(logger *_this, int dump_buffer);
void textlog_raw_time(logger *_this, int raw_time);
#include "view/view.h" #include "view/view.h"
......
...@@ -33,6 +33,7 @@ struct textlog { ...@@ -33,6 +33,7 @@ struct textlog {
/* local output buffer */ /* local output buffer */
OBUF o; OBUF o;
int dump_buffer; int dump_buffer;
int raw_time;
}; };
static void _event(void *p, event e) static void _event(void *p, event e)
...@@ -51,9 +52,13 @@ static void _event(void *p, event e) ...@@ -51,9 +52,13 @@ static void _event(void *p, event e)
#ifdef T_SEND_TIME #ifdef T_SEND_TIME
t = localtime(&e.sending_time.tv_sec); t = localtime(&e.sending_time.tv_sec);
/* round tv_nsec to nearest millisecond */ if (l->raw_time)
sprintf(tt, "%2.2d:%2.2d:%2.2d.%9.9ld: ", t->tm_hour, t->tm_min, t->tm_sec, sprintf(tt, "%2.2d:%2.2d:%2.2d.%9.9ld [%ld]: ",
e.sending_time.tv_nsec); t->tm_hour, t->tm_min, t->tm_sec,
e.sending_time.tv_nsec, e.sending_time.tv_sec);
else
sprintf(tt, "%2.2d:%2.2d:%2.2d.%9.9ld: ", t->tm_hour, t->tm_min, t->tm_sec,
e.sending_time.tv_nsec);
PUTS(&l->o, tt); PUTS(&l->o, tt);
#endif #endif
...@@ -215,3 +220,9 @@ void textlog_dump_buffer(logger *_this, int dump_buffer) ...@@ -215,3 +220,9 @@ void textlog_dump_buffer(logger *_this, int dump_buffer)
struct textlog *l = _this; struct textlog *l = _this;
l->dump_buffer = dump_buffer; l->dump_buffer = dump_buffer;
} }
void textlog_raw_time(logger *_this, int raw_time)
{
struct textlog *l = _this;
l->raw_time = raw_time;
}
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
#define DEFAULT_IP "127.0.0.1" #define DEFAULT_IP "127.0.0.1"
#define DEFAULT_PORT 9999 #define DEFAULT_PORT 9999
#define NO_PREAMBLE -1
int no_sib = 0;
int no_mib = 0;
typedef struct { typedef struct {
int socket; int socket;
struct sockaddr_in to; struct sockaddr_in to;
...@@ -28,11 +33,24 @@ typedef struct { ...@@ -28,11 +33,24 @@ typedef struct {
int dl_frame; int dl_frame;
int dl_subframe; int dl_subframe;
int dl_data; int dl_data;
/* mib */
int mib_frame;
int mib_subframe;
int mib_data;
/* RA preamble */
int preamble_frame;
int preamble_subframe;
int preamble_preamble;
/* RAR */
int rar_rnti;
int rar_frame;
int rar_subframe;
int rar_data;
} ev_data; } ev_data;
void ul(void *_d, event e) void trace(ev_data *d, int direction, int rnti_type, int rnti,
int frame, int subframe, void *buf, int bufsize, int preamble)
{ {
ev_data *d = _d;
ssize_t ret; ssize_t ret;
int fsf; int fsf;
int i; int i;
...@@ -41,79 +59,118 @@ void ul(void *_d, event e) ...@@ -41,79 +59,118 @@ void ul(void *_d, event e)
PUTS(&d->buf, MAC_LTE_START_STRING); PUTS(&d->buf, MAC_LTE_START_STRING);
PUTC(&d->buf, FDD_RADIO); PUTC(&d->buf, FDD_RADIO);
PUTC(&d->buf, DIRECTION_UPLINK); PUTC(&d->buf, direction);
PUTC(&d->buf, C_RNTI); PUTC(&d->buf, rnti_type);
PUTC(&d->buf, MAC_LTE_RNTI_TAG); if (rnti_type == C_RNTI || rnti_type == RA_RNTI) {
PUTC(&d->buf, (e.e[d->ul_rnti].i>>8) & 255); PUTC(&d->buf, MAC_LTE_RNTI_TAG);
PUTC(&d->buf, e.e[d->ul_rnti].i & 255); PUTC(&d->buf, (rnti>>8) & 255);
PUTC(&d->buf, rnti & 255);
}
/* for newer version of wireshark? */ /* for newer version of wireshark? */
fsf = (e.e[d->ul_frame].i << 4) + e.e[d->ul_subframe].i; fsf = (frame << 4) + subframe;
/* for older version? */ /* for older version? */
fsf = e.e[d->ul_subframe].i; //fsf = subframe;
PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG); PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
PUTC(&d->buf, (fsf>>8) & 255); PUTC(&d->buf, (fsf>>8) & 255);
PUTC(&d->buf, fsf & 255); PUTC(&d->buf, fsf & 255);
if (preamble != NO_PREAMBLE) {
PUTC(&d->buf, MAC_LTE_SEND_PREAMBLE_TAG);
PUTC(&d->buf, preamble);
PUTC(&d->buf, 0); /* rach attempt - always 0 for us (not sure of this) */
}
PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG); PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG);
for (i = 0; i < e.e[d->ul_data].bsize; i++) for (i = 0; i < bufsize; i++)
PUTC(&d->buf, ((char*)e.e[d->ul_data].b)[i]); PUTC(&d->buf, ((char*)buf)[i]);
ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0, ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
(struct sockaddr *)&d->to, sizeof(struct sockaddr_in)); (struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
if (ret != d->buf.osize) abort(); if (ret != d->buf.osize) abort();
} }
void ul(void *_d, event e)
{
ev_data *d = _d;
trace(d, DIRECTION_UPLINK, C_RNTI, e.e[d->ul_rnti].i,
e.e[d->ul_frame].i, e.e[d->ul_subframe].i,
e.e[d->ul_data].b, e.e[d->ul_data].bsize,
NO_PREAMBLE);
}
void dl(void *_d, event e) void dl(void *_d, event e)
{ {
ev_data *d = _d; ev_data *d = _d;
ssize_t ret;
int fsf;
int i;
d->buf.osize = 0; if (e.e[d->dl_rnti].i == 0xffff && no_sib) return;
PUTS(&d->buf, MAC_LTE_START_STRING); trace(d, DIRECTION_DOWNLINK,
PUTC(&d->buf, FDD_RADIO); e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i,
PUTC(&d->buf, DIRECTION_DOWNLINK); e.e[d->dl_frame].i, e.e[d->dl_subframe].i,
PUTC(&d->buf, C_RNTI); e.e[d->dl_data].b, e.e[d->dl_data].bsize,
NO_PREAMBLE);
}
PUTC(&d->buf, MAC_LTE_RNTI_TAG); void mib(void *_d, event e)
PUTC(&d->buf, (e.e[d->dl_rnti].i>>8) & 255); {
PUTC(&d->buf, e.e[d->dl_rnti].i & 255); ev_data *d = _d;
/* for newer version of wireshark? */ if (no_mib) return;
fsf = (e.e[d->dl_frame].i << 4) + e.e[d->dl_subframe].i;
/* for older version? */
fsf = e.e[d->dl_subframe].i;
PUTC(&d->buf, MAC_LTE_FRAME_SUBFRAME_TAG);
PUTC(&d->buf, (fsf>>8) & 255);
PUTC(&d->buf, fsf & 255);
PUTC(&d->buf, MAC_LTE_PAYLOAD_TAG); trace(d, DIRECTION_DOWNLINK, NO_RNTI, 0,
for (i = 0; i < e.e[d->dl_data].bsize; i++) e.e[d->mib_frame].i, e.e[d->mib_subframe].i,
PUTC(&d->buf, ((char*)e.e[d->dl_data].b)[i]); e.e[d->mib_data].b, e.e[d->mib_data].bsize,
NO_PREAMBLE);
}
ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0, void preamble(void *_d, event e)
(struct sockaddr *)&d->to, sizeof(struct sockaddr_in)); {
if (ret != d->buf.osize) abort(); ev_data *d = _d;
trace(d, DIRECTION_UPLINK, NO_RNTI, 0,
e.e[d->preamble_frame].i, e.e[d->preamble_subframe].i,
NULL, 0,
e.e[d->preamble_preamble].i);
}
void rar(void *_d, event e)
{
ev_data *d = _d;
trace(d, DIRECTION_DOWNLINK, RA_RNTI, e.e[d->rar_rnti].i,
e.e[d->rar_frame].i, e.e[d->rar_subframe].i,
e.e[d->rar_data].b, e.e[d->rar_data].bsize,
NO_PREAMBLE);
} }
void setup_data(ev_data *d, void *database, int ul_id, int dl_id) void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
int preamble_id, int rar_id)
{ {
database_event_format f; database_event_format f;
int i; int i;
d->ul_rnti = -1; d->ul_rnti = -1;
d->ul_frame = -1; d->ul_frame = -1;
d->ul_subframe = -1; d->ul_subframe = -1;
d->ul_data = -1; d->ul_data = -1;
d->dl_rnti = -1; d->dl_rnti = -1;
d->dl_frame = -1; d->dl_frame = -1;
d->dl_subframe = -1; d->dl_subframe = -1;
d->dl_data = -1; d->dl_data = -1;
d->mib_frame = -1;
d->mib_subframe = -1;
d->mib_data = -1;
d->preamble_frame = -1;
d->preamble_subframe = -1;
d->preamble_preamble = -1;
d->rar_rnti = -1;
d->rar_frame = -1;
d->rar_subframe = -1;
d->rar_data = -1;
#define G(var_name, var_type, var) \ #define G(var_name, var_type, var) \
if (!strcmp(f.name[i], var_name)) { \ if (!strcmp(f.name[i], var_name)) { \
...@@ -144,6 +201,37 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id) ...@@ -144,6 +201,37 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id)
if (d->dl_rnti == -1 || d->dl_frame == -1 || d->dl_subframe == -1 || if (d->dl_rnti == -1 || d->dl_frame == -1 || d->dl_subframe == -1 ||
d->dl_data == -1) goto error; d->dl_data == -1) goto error;
/* MIB: frame, subframe, data */
f = get_format(database, mib_id);
for (i = 0; i < f.count; i++) {
G("frame", "int", d->mib_frame);
G("subframe", "int", d->mib_subframe);
G("data", "buffer", d->mib_data);
}
if (d->mib_frame == -1 || d->mib_subframe == -1 || d->mib_data == -1)
goto error;
/* preamble: frame, subframe, preamble */
f = get_format(database, preamble_id);
for (i = 0; i < f.count; i++) {
G("frame", "int", d->preamble_frame);
G("subframe", "int", d->preamble_subframe);
G("preamble", "int", d->preamble_preamble);
}
if (d->preamble_frame == -1 || d->preamble_subframe == -1 ||
d->preamble_preamble == -1) goto error;
/* rar: rnti, frame, subframe, data */
f = get_format(database, rar_id);
for (i = 0; i < f.count; i++) {
G("rnti", "int", d->rar_rnti);
G("frame", "int", d->rar_frame);
G("subframe", "int", d->rar_subframe);
G("data", "buffer", d->rar_data);
}
if (d->rar_rnti == -1 || d->rar_frame == -1 || d->rar_subframe == -1 ||
d->rar_data == -1) goto error;
#undef G #undef G
return; return;
...@@ -179,7 +267,9 @@ void usage(void) ...@@ -179,7 +267,9 @@ void usage(void)
" -d <database file> this option is mandatory\n"