Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
oai
openairinterface5G
Commits
cf1db866
Commit
cf1db866
authored
Nov 02, 2018
by
Cédric Roux
Browse files
Merge remote-tracking branch 'origin/develop_integration_2018_w44' into develop
parents
3fa0f5a9
9b8e4e4c
Changes
114
Hide whitespace changes
Inline
Side-by-side
cmake_targets/CMakeLists.txt
View file @
cf1db866
...
...
@@ -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"
)
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
)
elseif
(
${
RRC_ASN1_VERSION
}
STREQUAL
"CBA"
)
make_version
(
RRC_VERSION 10 2 0
)
make_version
(
LTE_
RRC_VERSION 10 2 0
)
add_definitions
(
-DCBA
)
set
(
RRC_GRAMMAR
${
OPENAIR2_DIR
}
/RRC/LTE/MESSAGES/asn1c/ASN1_files/EUTRA-RRC-Definitions-a20-lola.asn
)
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
)
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
)
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
)
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
)
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
)
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
)
endif
(
${
RRC_ASN1_VERSION
}
STREQUAL
"Rel8"
)
add_definitions
(
-DRRC_VERSION=
${
RRC_VERSION
}
)
add_definitions
(
-D
LTE_
RRC_VERSION=
${
LTE_
RRC_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
}
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
)
if
(
NOT
${
ret
}
STREQUAL 0
)
message
(
FATAL_ERROR
"
${
ret
}
: error"
)
...
...
@@ -339,7 +339,7 @@ include_directories ("${RRC_FULL_DIR}")
add_custom_command
(
OUTPUT
${
RRC_FULL_DIR
}
/asn_constant.h
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
}
)
...
...
cmake_targets/autotests/test_case_list.xml
View file @
cf1db866
...
...
@@ -956,20 +956,20 @@
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args>
<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
-m4 -gF -s0 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O60
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
-m15 -gF -s6.7 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O60
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O25
-m15 -gG -s1.4 -w1.0 -f.2 -n500 -B25 -c2 -z2 -O25
-m25 -gF -s17.4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O60
-m25 -gF -s17.5 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O60
-m26 -gF -s17.7 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O60
-m26 -gF -s17.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -O60
-m26 -gF -s17.3 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1600 -O60
-m26 -gF -s16.6 -w1.0 -f.2 -n500 -B100 -c2 -z2 -r1899 -O60
-m14 -gF -s6.8 -w1.0 -f.2 -n500 -B50 -c2 -x2 -y2 -z2 -O60
-m13 -gF -s5.9 -w1.0 -f.2 -n500 -B25 -c3 -x2 -y2 -z2 -O60</main_exec_args>
<main_exec_args> -m
=
5 -g
=
F -s
=
-1
=
-w
=
1.0 -f
=
.2 -n
=
500 -B
=
50 -c
=
2 -z
=
2 -O
=
60
-m
=
4 -g
=
F -s
=
0 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
6 -c
=
4 -z
=
2 -O
=
60
-m
=
15 -g
=
F -s
=
6.7 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
50 -c
=
2 -z
=
2 -O
=
60
-m
=
15 -g
=
F -s
=
6.7 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
25 -c
=
2 -z
=
2 -O
=
60
-m
=
15 -g
=
G -s
=
1.4 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
50 -c
=
2 -z
=
2 -O
=
25
-m
=
15 -g
=
G -s
=
1.4 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
25 -c
=
2 -z
=
2 -O
=
25
-m
=
25 -g
=
F -s
=
17.4 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
25 -c
=
3 -z
=
2 -O
=
60
-m
=
25 -g
=
F -s
=
17.5 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
25 -c
=
3 -z
=
2 -r
=
1022 -O
=
60
-m
=
26 -g
=
F -s
=
17.7 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
50 -c
=
2 -z
=
2 -O
=
60
-m
=
26 -g
=
F -s
=
17.6 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
100 -c
=
2 -z
=
2 -O
=
60
-m
=
26 -g
=
F -s
=
17.3 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
100 -c
=
2 -z
=
2 -r
=
1600 -O
=
60
-m
=
26 -g
=
F -s
=
16.6 -w
=
1.0 -f
=
.2 -n
=
500 -B
=
100 -c
=
2 -z
=
2 -r
=
1899 -O
=
60
-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
-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>
<search_expr_true>"passed"</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
...
...
cmake_targets/lte-simulators/CMakeLists.txt
View file @
cf1db866
...
...
@@ -9,4 +9,5 @@ set(MU_RECIEVER False)
set
(
NAS_UE False
)
set
(
MESSAGE_CHART_GENERATOR False
)
set
(
RRC_ASN1_VERSION
"Rel14"
)
set
(
UE_TIMING_TRACE True
)
include
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/../CMakeLists.txt
)
cmake_targets/tools/build_helper
View file @
cf1db866
...
...
@@ -252,7 +252,7 @@ install_usrp_uhd_driver_from_source(){
rm -rf /tmp/uhd
git clone https://github.com/EttusResearch/uhd.git
cd uhd
git checkout tags/
release_003_010_001_001
git checkout tags/
v3.13.0.2
mkdir -p host/build
cd host/build
$CMAKE ../
...
...
@@ -683,7 +683,7 @@ install_asn1c_from_source(){
# better to use a given commit than a branch in case the branch
# is updated and requires modifications in the source of OAI
#git checkout velichkov_s1ap_plus_option_group
git checkout
d3aed06bb2bec7df1b5c6d0333f8c7dfc599337
2
git checkout
0a7524184f16e7093990a31d8d4db487a16e578
2
autoreconf -iv
./configure
make -j`nproc`
...
...
common/utils/T/T_messages.txt
View file @
cf1db866
...
...
@@ -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
ID = ENB_PHY_INITIATE_RA_PROCEDURE
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
ID = ENB_PHY_MIB
DESC = MIB data
GROUP = ALL:PHY:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,frame : int,subframe : buffer,data
#MAC logs
ID = ENB_MAC_UE_DL_SDU
...
...
@@ -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
ID = ENB_MAC_UE_UL_PDU_WITH_DATA
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
ID = ENB_MAC_UE_UL_SDU
DESC = MAC uplink UE received SDU
...
...
@@ -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
ID = ENB_MAC_UE_DL_PDU_WITH_DATA
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
ID = ENB_MAC_SCHEDULING_REQUEST
DESC = MAC scheduling request detected for an UE
GROUP = ALL:MAC:ENB
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
ID = ENB_RLC_DL
...
...
common/utils/T/tracer/Makefile
View file @
cf1db866
...
...
@@ -60,6 +60,11 @@ macpdu2wireshark: macpdu2wireshark.o database.o utils.o handler.o event.o \
multi
:
multi.o utils.o database.o config.o
$(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
gui/gui.a
:
...
...
common/utils/T/tracer/extract.c
View file @
cf1db866
...
...
@@ -16,6 +16,8 @@ void usage(void)
" -f <name> <value> field 'name' of 'event' has to match 'value'
\n
"
" type of 'name' must be int
\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
);
}
...
...
@@ -51,6 +53,10 @@ int main(int n, char **v)
int
filter_count
=
0
;
int
buffer_arg
;
int
found
;
int
count
=
1
;
int
check_time
=
0
;
time_t
sec
;
long
nsec
;
for
(
i
=
1
;
i
<
n
;
i
++
)
{
if
(
!
strcmp
(
v
[
i
],
"-h"
)
||
!
strcmp
(
v
[
i
],
"--help"
))
usage
();
...
...
@@ -63,6 +69,14 @@ int main(int n, char **v)
filter_value
[
filter_count
++
]
=
atoi
(
v
[
++
i
]);
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
(
event_name
==
NULL
)
{
event_name
=
v
[
i
];
continue
;
}
if
(
buffer_name
==
NULL
)
{
buffer_name
=
v
[
i
];
continue
;
}
...
...
@@ -111,13 +125,20 @@ int main(int n, char **v)
break
;
if
(
i
!=
filter_count
)
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
)
{
perror
(
output_file
);
exit
(
1
);
}
found
=
1
;
break
;
found
++
;
if
(
found
==
count
)
break
;
}
if
(
found
==
0
)
printf
(
"ERROR: event not found
\n
"
);
if
(
found
!=
count
)
printf
(
"WARNING: dumped %d events (wanted %d)
\n
"
,
found
,
count
);
fclose
(
out
);
...
...
common/utils/T/tracer/logger/logger.h
View file @
cf1db866
...
...
@@ -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
textlog_dump_buffer
(
logger
*
_this
,
int
dump_buffer
);
void
textlog_raw_time
(
logger
*
_this
,
int
raw_time
);
#include
"view/view.h"
...
...
common/utils/T/tracer/logger/textlog.c
View file @
cf1db866
...
...
@@ -33,6 +33,7 @@ struct textlog {
/* local output buffer */
OBUF
o
;
int
dump_buffer
;
int
raw_time
;
};
static
void
_event
(
void
*
p
,
event
e
)
...
...
@@ -51,9 +52,13 @@ static void _event(void *p, event e)
#ifdef T_SEND_TIME
t
=
localtime
(
&
e
.
sending_time
.
tv_sec
);
/* round tv_nsec to nearest millisecond */
sprintf
(
tt
,
"%2.2d:%2.2d:%2.2d.%9.9ld: "
,
t
->
tm_hour
,
t
->
tm_min
,
t
->
tm_sec
,
e
.
sending_time
.
tv_nsec
);
if
(
l
->
raw_time
)
sprintf
(
tt
,
"%2.2d:%2.2d:%2.2d.%9.9ld [%ld]: "
,
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
);
#endif
...
...
@@ -215,3 +220,9 @@ void textlog_dump_buffer(logger *_this, int dump_buffer)
struct
textlog
*
l
=
_this
;
l
->
dump_buffer
=
dump_buffer
;
}
void
textlog_raw_time
(
logger
*
_this
,
int
raw_time
)
{
struct
textlog
*
l
=
_this
;
l
->
raw_time
=
raw_time
;
}
common/utils/T/tracer/macpdu2wireshark.c
View file @
cf1db866
...
...
@@ -14,6 +14,11 @@
#define DEFAULT_IP "127.0.0.1"
#define DEFAULT_PORT 9999
#define NO_PREAMBLE -1
int
no_sib
=
0
;
int
no_mib
=
0
;
typedef
struct
{
int
socket
;
struct
sockaddr_in
to
;
...
...
@@ -28,11 +33,24 @@ typedef struct {
int
dl_frame
;
int
dl_subframe
;
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
;
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
;
int
fsf
;
int
i
;
...
...
@@ -41,79 +59,118 @@ void ul(void *_d, event e)
PUTS
(
&
d
->
buf
,
MAC_LTE_START_STRING
);
PUTC
(
&
d
->
buf
,
FDD_RADIO
);
PUTC
(
&
d
->
buf
,
DIRECTION_UPLINK
);
PUTC
(
&
d
->
buf
,
C_RNTI
);
PUTC
(
&
d
->
buf
,
direction
);
PUTC
(
&
d
->
buf
,
rnti_type
);
PUTC
(
&
d
->
buf
,
MAC_LTE_RNTI_TAG
);
PUTC
(
&
d
->
buf
,
(
e
.
e
[
d
->
ul_rnti
].
i
>>
8
)
&
255
);
PUTC
(
&
d
->
buf
,
e
.
e
[
d
->
ul_rnti
].
i
&
255
);
if
(
rnti_type
==
C_RNTI
||
rnti_type
==
RA_RNTI
)
{
PUTC
(
&
d
->
buf
,
MAC_LTE_RNTI_TAG
);
PUTC
(
&
d
->
buf
,
(
rnti
>>
8
)
&
255
);
PUTC
(
&
d
->
buf
,
rnti
&
255
);
}
/* 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? */
fsf
=
e
.
e
[
d
->
ul_
subframe
].
i
;
//
fsf = subframe;
PUTC
(
&
d
->
buf
,
MAC_LTE_FRAME_SUBFRAME_TAG
);
PUTC
(
&
d
->
buf
,
(
fsf
>>
8
)
&
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
);
for
(
i
=
0
;
i
<
e
.
e
[
d
->
ul_data
].
b
size
;
i
++
)
PUTC
(
&
d
->
buf
,
((
char
*
)
e
.
e
[
d
->
ul_data
].
b
)[
i
]);
for
(
i
=
0
;
i
<
buf
size
;
i
++
)
PUTC
(
&
d
->
buf
,
((
char
*
)
buf
)[
i
]);
ret
=
sendto
(
d
->
socket
,
d
->
buf
.
obuf
,
d
->
buf
.
osize
,
0
,
(
struct
sockaddr
*
)
&
d
->
to
,
sizeof
(
struct
sockaddr_in
));
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
)
{
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
);
PUTC
(
&
d
->
buf
,
FDD_RADIO
);
PUTC
(
&
d
->
buf
,
DIRECTION_DOWNLINK
);
PUTC
(
&
d
->
buf
,
C_RNTI
);
trace
(
d
,
DIRECTION_DOWNLINK
,
e
.
e
[
d
->
dl_rnti
].
i
!=
0xffff
?
C_RNTI
:
SI_RNTI
,
e
.
e
[
d
->
dl_rnti
].
i
,
e
.
e
[
d
->
dl_frame
].
i
,
e
.
e
[
d
->
dl_subframe
].
i
,
e
.
e
[
d
->
dl_data
].
b
,
e
.
e
[
d
->
dl_data
].
bsize
,
NO_PREAMBLE
);
}
PUTC
(
&
d
->
buf
,
MAC_LTE_RNTI_TAG
);
PUTC
(
&
d
->
buf
,
(
e
.
e
[
d
->
dl_rnti
].
i
>>
8
)
&
255
);
PUTC
(
&
d
->
buf
,
e
.
e
[
d
->
dl_rnti
].
i
&
255
)
;
void
mib
(
void
*
_d
,
event
e
)
{
ev_data
*
d
=
_d
;
/* for newer version of wireshark? */
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
);
if
(
no_mib
)
return
;
PUTC
(
&
d
->
buf
,
MAC_LTE_PAYLOAD_TAG
);
for
(
i
=
0
;
i
<
e
.
e
[
d
->
dl_data
].
bsize
;
i
++
)
PUTC
(
&
d
->
buf
,
((
char
*
)
e
.
e
[
d
->
dl_data
].
b
)[
i
]);
trace
(
d
,
DIRECTION_DOWNLINK
,
NO_RNTI
,
0
,
e
.
e
[
d
->
mib_frame
].
i
,
e
.
e
[
d
->
mib_subframe
].
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
,
(
struct
sockaddr
*
)
&
d
->
to
,
sizeof
(
struct
sockaddr_in
));
if
(
ret
!=
d
->
buf
.
osize
)
abort
();
void
preamble
(
void
*
_d
,
event
e
)
{
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
;
int
i
;
d
->
ul_rnti
=
-
1
;
d
->
ul_frame
=
-
1
;
d
->
ul_subframe
=
-
1
;
d
->
ul_data
=
-
1
;
d
->
ul_rnti
=
-
1
;
d
->
ul_frame
=
-
1
;
d
->
ul_subframe
=
-
1
;
d
->
ul_data
=
-
1
;
d
->
dl_rnti
=
-
1
;
d
->
dl_frame
=
-
1
;
d
->
dl_subframe
=
-
1
;
d
->
dl_data
=
-
1
;
d
->
dl_rnti
=
-
1
;
d
->
dl_frame
=
-
1
;
d
->
dl_subframe
=
-
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) \
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)
if
(
d
->
dl_rnti
==
-
1
||
d
->
dl_frame
==
-
1
||
d
->
dl_subframe
==
-
1
||
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
return
;
...
...
@@ -179,7 +267,9 @@ void usage(void)
" -d <database file> this option is mandatory
\n
"
" -i <dump file> read events from this dump file
\n
"
" -ip <IP address> send packets to this IP address (default %s)
\n
"
" -p <port> send packets to this port (default %d)
\n
"
,
" -p <port> send packets to this port (default %d)
\n
"
" -no-mib do not report MIB
\n
"
" -no-sib do not report SIBs
\n
"
,
DEFAULT_IP
,
DEFAULT_PORT
);
...
...
@@ -194,7 +284,7 @@ int main(int n, char **v)
event_handler
*
h
;
int
in
;
int
i
;
int
ul_id
,
dl_id
;
int
ul_id
,
dl_id
,
mib_id
=
-
1
,
preamble_id
,
rar_id
;
ev_data
d
;
char
*
ip
=
DEFAULT_IP
;
int
port
=
DEFAULT_PORT
;
...
...
@@ -209,6 +299,8 @@ int main(int n, char **v)
{
if
(
i
>
n
-
2
)
usage
();
input_filename
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-ip"
))
{
if
(
i
>
n
-
2
)
usage
();
ip
=
v
[
++
i
];
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-p"
))
{
if
(
i
>
n
-
2
)
usage
();
port
=
atoi
(
v
[
++
i
]);
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-no-mib"
))
{
no_mib
=
1
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-no-sib"
))
{
no_sib
=
1
;
continue
;
}
usage
();
}
...
...
@@ -232,10 +324,16 @@ int main(int n, char **v)
ul_id
=
event_id_from_name
(
database
,
"ENB_MAC_UE_UL_PDU_WITH_DATA"
);
dl_id
=
event_id_from_name
(
database
,
"ENB_MAC_UE_DL_PDU_WITH_DATA"
);
setup_data
(
&
d
,
database
,
ul_id
,
dl_id
);
mib_id
=
event_id_from_name
(
database
,
"ENB_PHY_MIB"
);
preamble_id
=
event_id_from_name
(
database
,
"ENB_PHY_INITIATE_RA_PROCEDURE"
);
rar_id
=
event_id_from_name
(
database
,
"ENB_MAC_UE_DL_RAR_PDU_WITH_DATA"
);
setup_data
(
&
d
,
database
,
ul_id
,
dl_id
,
mib_id
,
preamble_id
,
rar_id
);
register_handler_function
(
h
,
ul_id
,
ul
,
&
d
);
register_handler_function
(
h
,
dl_id
,
dl
,
&
d
);
register_handler_function
(
h
,
mib_id
,
mib
,
&
d
);
register_handler_function
(
h
,
preamble_id
,
preamble
,
&
d
);
register_handler_function
(
h
,
rar_id
,
rar
,
&
d
);
d
.
socket
=
socket
(
AF_INET
,
SOCK_DGRAM
,
0
);
if
(
d
.
socket
==
-
1
)
{
perror
(
"socket"
);
exit
(
1
);
}
...
...
@@ -253,7 +351,8 @@ int main(int n, char **v)
event
e
;
e
=
get_event
(
in
,
&
ebuf
,
database
);
if
(
e
.
type
==
-
1
)
break
;
if
(
!
(
e
.
type
==
ul_id
||
e
.
type
==
dl_id
))
continue
;
if
(
!
(
e
.
type
==
ul_id
||
e
.
type
==
dl_id
||
e
.
type
==
mib_id
||
e
.
type
==
preamble_id
||
e
.
type
==
rar_id
))
continue
;
handle_event
(
h
,
e
);
}
...
...
common/utils/T/tracer/textlog.c
View file @
cf1db866
...
...
@@ -52,6 +52,7 @@ void usage(void)
" they will be processed in order
\n
"
" by default, all is off
\n
"
" -full also dump buffers' content
\n
"
" -raw-time also prints 'raw time'
\n
"
" -ip <host> connect to given IP address (default %s)
\n
"
" -p <port> connect to given port (default %d)
\n
"
" -x GUI output
\n
"
...
...
@@ -91,6 +92,7 @@ int main(int n, char **v)
int
gui_active
=
1
;
textlog_data
textlog_data
;
int
full
=
0
;
int
raw_time
=
0
;
/* write on a socket fails if the other end is closed and we get SIGPIPE */
if
(
signal
(
SIGPIPE
,
SIG_IGN
)
==
SIG_ERR
)
abort
();
...
...
@@ -117,6 +119,7 @@ int main(int n, char **v)
if
(
!
strcmp
(
v
[
i
],
"-debug-gui"
))
{
gui_logd
=
1
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-no-gui"
))
{
gui_active
=
0
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-full"
))
{
full
=
1
;
continue
;
}
if
(
!
strcmp
(
v
[
i
],
"-raw-time"
))
{
raw_time
=
1
;
continue
;
}
usage
();
}
...
...
@@ -162,6 +165,7 @@ int main(int n, char **v)
// "ev: {} eNB_id [eNB_ID] frame [frame] subframe [subframe]");
logger_add_view
(
textlog
,
out
);