Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG-RAN
Commits
b7857a50
Commit
b7857a50
authored
Aug 05, 2021
by
Laurent THOMAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to fix CUDA, and fix infinite loop in nr UE uplink data collect
parent
7e158447
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
71 additions
and
99 deletions
+71
-99
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+6
-5
openair1/PHY/types.h
openair1/PHY/types.h
+1
-1
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
+39
-66
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
+4
-2
openair2/NETWORK_DRIVER/MESH/local.h
openair2/NETWORK_DRIVER/MESH/local.h
+0
-4
openair2/NETWORK_DRIVER/UE_IP/local.h
openair2/NETWORK_DRIVER/UE_IP/local.h
+0
-4
openair3/NAS/NR_UE/nr_nas_msg_sim.c
openair3/NAS/NR_UE/nr_nas_msg_sim.c
+19
-12
openair3/NAS/NR_UE/nr_nas_msg_sim.h
openair3/NAS/NR_UE/nr_nas_msg_sim.h
+0
-3
openair3/UICC/usim_interface.c
openair3/UICC/usim_interface.c
+1
-1
openair3/UICC/usim_interface.h
openair3/UICC/usim_interface.h
+1
-1
No files found.
cmake_targets/CMakeLists.txt
View file @
b7857a50
...
@@ -255,6 +255,7 @@ macro(add_list_string_option name val helpstr)
...
@@ -255,6 +255,7 @@ macro(add_list_string_option name val helpstr)
endif
()
endif
()
endmacro
(
add_list_string_option
)
endmacro
(
add_list_string_option
)
# this function should produce the same value as the macro MAKE_VERSION defined in the C code (file types.h)
function
(
make_version VERSION_VALUE
)
function
(
make_version VERSION_VALUE
)
math
(
EXPR RESULT
"0"
)
math
(
EXPR RESULT
"0"
)
foreach
(
ARG
${
ARGN
}
)
foreach
(
ARG
${
ARGN
}
)
...
@@ -311,13 +312,13 @@ endif()
...
@@ -311,13 +312,13 @@ endif()
add_definitions
(
"-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
)
add_definitions
(
"-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP"
)
set
(
commonOpts
"-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic"
)
set
(
commonOpts
"-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic"
)
set
(
MKVER
"'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
)
set
(
CMAKE_C_FLAGS
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=gnu99 -funroll-loops
-D
${
MKVER
}
"
)
"
${
CMAKE_C_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=gnu99 -funroll-loops"
)
set
(
CMAKE_CXX_FLAGS
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=c++11
-D
${
MKVER
}
"
)
"
${
CMAKE_CXX_FLAGS
}
${
C_FLAGS_PROCESSOR
}
${
commonOpts
}
-std=c++11"
)
# cuda compiler bug (limitation) on complex macro definition
if
(
CUDA_FOUND
)
if
(
CUDA_FOUND
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DCUDA_FLAG"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-DCUDA_FLAG"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCUDA_FLAG"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-DCUDA_FLAG"
)
...
@@ -336,7 +337,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb3 -Wl,-rpath -Wl,${C
...
@@ -336,7 +337,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ggdb3 -Wl,-rpath -Wl,${C
# set a flag for changes in the source code
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
# these changes are related to hardcoded path to include .h files
set
(
debugOpt
"-ggdb3 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks"
)
set
(
debugOpt
"-ggdb3 -DMALLOC_CHECK_=3 -fno-delete-null-pointer-checks"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
debugOpt
}
-O
g
"
)
set
(
CMAKE_C_FLAGS_DEBUG
"
${
debugOpt
}
-O
0
"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
debugOpt
}
-O2"
)
set
(
CMAKE_C_FLAGS_RELWITHDEBINFO
"
${
debugOpt
}
-O2"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3"
)
set
(
CMAKE_C_FLAGS_RELEASE
"-O3"
)
...
@@ -3491,7 +3492,7 @@ endfunction(make_driver name dir src)
...
@@ -3491,7 +3492,7 @@ endfunction(make_driver name dir src)
# nashmesh module
# nashmesh module
################
################
list
(
APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c
)
list
(
APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c
)
set
(
module_cc_opt
"
${
module_cc_opt
}
-DNAS_NETLINK -DPDCP_USE_NETLINK
-D
${
MKVER
}
"
)
set
(
module_cc_opt
"
${
module_cc_opt
}
-DNAS_NETLINK -DPDCP_USE_NETLINK"
)
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if
(
OAI_NW_DRIVER_USE_NETLINK
)
if
(
OAI_NW_DRIVER_USE_NETLINK
)
...
...
openair1/PHY/types.h
View file @
b7857a50
...
@@ -23,6 +23,6 @@
...
@@ -23,6 +23,6 @@
#define __openair_TYPES_H__
#define __openair_TYPES_H__
#include <stdint.h>
#include <stdint.h>
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+c)
#endif
/*__openair_TYPES_H__ */
#endif
/*__openair_TYPES_H__ */
openair2/LAYER2/NR_MAC_UE/nr_ue_scheduler.c
View file @
b7857a50
...
@@ -1970,93 +1970,66 @@ uint8_t
...
@@ -1970,93 +1970,66 @@ uint8_t
nr_ue_get_sdu
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
nr_ue_get_sdu
(
module_id_t
module_idP
,
int
CC_id
,
frame_t
frameP
,
sub_frame_t
subframe
,
uint8_t
eNB_index
,
sub_frame_t
subframe
,
uint8_t
eNB_index
,
uint8_t
*
ulsch_buffer
,
uint16_t
buflen
,
uint8_t
*
access_mode
)
{
uint8_t
*
ulsch_buffer
,
uint16_t
buflen
,
uint8_t
*
access_mode
)
{
uint8_t
total_rlc_pdu_header_len
=
0
;
int16_t
buflen_remain
=
0
;
uint8_t
lcid
=
0
;
uint8_t
lcid
=
0
;
uint16_t
sdu_lengths
[
MAX_LCID
]
=
{
0
};
uint16_t
sdu_lengths
[
MAX_LCID
]
=
{
0
};
uint8_t
sdu_lcids
[
MAX_LCID
]
=
{
0
};
uint8_t
sdu_lcids
[
MAX_LCID
]
=
{
0
};
uint16_t
payload_offset
=
0
,
num_sdus
=
0
;
uint16_t
payload_offset
=
0
,
num_sdus
=
0
;
uint8_t
ulsch_sdus
[
MAX_ULSCH_PAYLOAD_BYTES
];
uint8_t
ulsch_sdus
[
MAX_ULSCH_PAYLOAD_BYTES
];
uint16_t
sdu_length_total
=
0
;
//unsigned short post_padding = 0;
//unsigned short post_padding = 0;
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_idP
);
NR_UE_MAC_INST_t
*
mac
=
get_mac_inst
(
module_idP
);
rlc_buffer_occupancy_t
lcid_buffer_occupancy_new
=
0
;
LOG_D
(
NR_MAC
,
LOG_D
(
NR_MAC
,
"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d
\n
"
,
"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d
\n
"
,
module_idP
,
frameP
,
subframe
,
buflen
);
module_idP
,
frameP
,
subframe
,
buflen
);
AssertFatal
(
CC_id
==
0
,
AssertFatal
(
CC_id
==
0
,
"Transmission on secondary CCs is not supported yet
\n
"
);
"Transmission on secondary CCs is not supported yet
\n
"
);
// Check for DCCH first
// Check for DCCH first
// TO DO: Multiplex in the order defined by the logical channel prioritization
// TO DO: Multiplex in the order defined by the logical channel prioritization
int
buflen_remain
=
buflen
;
char
*
current_ulsch_ptr
=
(
char
*
)
ulsch_sdus
;
for
(
lcid
=
UL_SCH_LCID_SRB1
;
for
(
lcid
=
UL_SCH_LCID_SRB1
;
lcid
<
MAX_LCID
;
lcid
++
)
{
lcid
<
MAX_LCID
;
lcid
++
)
{
lcid_buffer_occupancy_new
=
mac_rlc_get_buffer_occupancy_ind
(
module_idP
,
mac
->
crnti
,
eNB_index
,
frameP
,
subframe
,
ENB_FLAG_NO
,
lcid
);
while
(
(
sdu_lengths
[
num_sdus
]
=
mac_rlc_data_req
(
module_idP
,
mac
->
crnti
,
if
(
lcid_buffer_occupancy_new
)
{
eNB_index
,
buflen_remain
=
frameP
,
buflen
-
(
total_rlc_pdu_header_len
+
sdu_length_total
+
MAX_RLC_SDU_SUBHEADER_SIZE
);
ENB_FLAG_NO
,
LOG_D
(
NR_MAC
,
MBMS_FLAG_NO
,
"[UE %d] Frame %d : UL-DXCH -> ULSCH, RLC %d has %d bytes to "
lcid
,
"send (Transport Block size %d SDU Length Total %d , mac header len %d, buflen_remain %d )
\n
"
,
//BSR byte before Tx=%d
buflen_remain
-
MAX_RLC_SDU_SUBHEADER_SIZE
*
2
,
module_idP
,
frameP
,
lcid
,
lcid_buffer_occupancy_new
,
//Fixme: Laurent I removed MAX_RLC_SDU_SUBHEADER_SIZE*2 because else we get out the buffer silently
buflen
,
sdu_length_total
,
// the interface with nr_generate_ulsch_pdu() looks over complex and not CPU optimized
total_rlc_pdu_header_len
,
buflen_remain
);
// ,nr_ue_mac_inst->scheduling_info.BSR_bytes[nr_ue_mac_inst->scheduling_info.LCGID[lcid]]
current_ulsch_ptr
,
0
,
0
))
>
0
)
{
while
(
buflen_remain
>
MAX_RLC_SDU_SUBHEADER_SIZE
&&
lcid_buffer_occupancy_new
){
AssertFatal
(
buflen_remain
>=
sdu_lengths
[
num_sdus
],
sdu_lengths
[
num_sdus
]
=
mac_rlc_data_req
(
module_idP
,
"LCID=%d RLC has segmented %d bytes but MAC has max=%d
\n
"
,
mac
->
crnti
,
lcid
,
sdu_lengths
[
num_sdus
],
buflen_remain
);
eNB_index
,
AssertFatal
(
current_ulsch_ptr
<
(
char
*
)
ulsch_sdus
+
MAX_ULSCH_PAYLOAD_BYTES
,
""
);
frameP
,
ENB_FLAG_NO
,
current_ulsch_ptr
+=
sdu_lengths
[
num_sdus
];
MBMS_FLAG_NO
,
buflen_remain
-=
sdu_lengths
[
num_sdus
];
lcid
,
buflen_remain
-=
MAX_RLC_SDU_SUBHEADER_SIZE
;
buflen_remain
-
MAX_RLC_SDU_SUBHEADER_SIZE
,
sdu_lcids
[
num_sdus
]
=
lcid
;
//Fixme: Laurent I removed MAX_RLC_SDU_SUBHEADER_SIZE because else we get out the buffer silently
num_sdus
++
;
// the interface with nr_generate_ulsch_pdu() looks over complex and not CPU optimized
(
char
*
)
&
ulsch_sdus
[
sdu_length_total
],
0
,
0
);
AssertFatal
(
buflen_remain
>=
sdu_lengths
[
num_sdus
],
"LCID=%d RLC has segmented %d bytes but MAC has max=%d
\n
"
,
lcid
,
sdu_lengths
[
num_sdus
],
buflen_remain
);
if
(
sdu_lengths
[
num_sdus
])
{
sdu_length_total
+=
sdu_lengths
[
num_sdus
];
sdu_lcids
[
num_sdus
]
=
lcid
;
total_rlc_pdu_header_len
+=
MAX_RLC_SDU_SUBHEADER_SIZE
;
//rlc_pdu_header_len_last;
//Update number of SDU
num_sdus
++
;
}
/* Get updated BO after multiplexing this PDU */
// we don't recompute it if the waiting queue is much larger than our buffer
// because mac_rlc_get_buffer_occupancy_ind() cpu cost is high when waiting queu is large
if
(
lcid_buffer_occupancy_new
<
buflen_remain
+
1000
)
lcid_buffer_occupancy_new
=
mac_rlc_get_buffer_occupancy_ind
(
module_idP
,
mac
->
crnti
,
eNB_index
,
frameP
,
subframe
,
ENB_FLAG_NO
,
lcid
);
buflen_remain
=
buflen
-
(
total_rlc_pdu_header_len
+
sdu_length_total
+
MAX_RLC_SDU_SUBHEADER_SIZE
);
}
}
}
}
}
// Generate ULSCH PDU
// Generate ULSCH PDU
if
(
num_sdus
>
0
)
{
if
(
num_sdus
>
0
)
{
payload_offset
=
nr_generate_ulsch_pdu
(
ulsch_sdus
,
payload_offset
=
nr_generate_ulsch_pdu
(
ulsch_sdus
,
ulsch_buffer
,
// mac header
ulsch_buffer
,
// mac header
num_sdus
,
// num sdus
num_sdus
,
// num sdus
sdu_lengths
,
// sdu length
sdu_lengths
,
// sdu length
sdu_lcids
,
// sdu lcid
sdu_lcids
,
// sdu lcid
0
,
// power_headroom
0
,
// power_headroom
mac
->
crnti
,
// crnti
mac
->
crnti
,
// crnti
0
,
// truncated_bsr
0
,
// truncated_bsr
0
,
// short_bsr
0
,
// short_bsr
0
,
// long_bsr
0
,
// long_bsr
0
,
// post_padding
0
,
// post_padding
buflen
);
// TBS in bytes
buflen
);
// TBS in bytes
}
else
{
}
else
{
return
0
;
return
0
;
}
}
...
...
openair2/LAYER2/nr_rlc/nr_rlc_oai_api.c
View file @
b7857a50
...
@@ -216,8 +216,10 @@ tbs_size_t mac_rlc_data_req(
...
@@ -216,8 +216,10 @@ tbs_size_t mac_rlc_data_req(
maxsize
=
tb_sizeP
;
maxsize
=
tb_sizeP
;
ret
=
rb
->
generate_pdu
(
rb
,
buffer_pP
,
maxsize
);
ret
=
rb
->
generate_pdu
(
rb
,
buffer_pP
,
maxsize
);
}
else
{
}
else
{
LOG_E
(
RLC
,
"%s:%d:%s: fatal: data req for unknown RB, channel_idP: %d
\n
"
,
__FILE__
,
__LINE__
,
__FUNCTION__
,
channel_idP
);
// Laurent: the query loop was checking all possible RB, but by mac_rlc_get_buffer_occupancy_ind
exit
(
1
);
// so it is more straitforward to try to get data
//LOG_E(RLC, "%s:%d:%s: fatal: data req for unknown RB, channel_idP: %d\n", __FILE__, __LINE__, __FUNCTION__, channel_idP);
//exit(1);
ret
=
0
;
ret
=
0
;
}
}
...
...
openair2/NETWORK_DRIVER/MESH/local.h
View file @
b7857a50
...
@@ -64,10 +64,6 @@
...
@@ -64,10 +64,6 @@
#include "rrc_nas_primitives.h"
#include "rrc_nas_primitives.h"
#include "COMMON/platform_types.h"
#include "COMMON/platform_types.h"
#ifndef MAKE_VERSION
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+(c))
#endif
struct
rb_entity
{
struct
rb_entity
{
nasRadioBearerId_t
rab_id
;
nasRadioBearerId_t
rab_id
;
nasSapId_t
sapi
;
nasSapId_t
sapi
;
...
...
openair2/NETWORK_DRIVER/UE_IP/local.h
View file @
b7857a50
...
@@ -55,10 +55,6 @@
...
@@ -55,10 +55,6 @@
#include "platform_types.h"
#include "platform_types.h"
#include "sap.h"
#include "sap.h"
#ifndef MAKE_VERSION
#define MAKE_VERSION(a,b,c) ((a)*256+(b)*16+(c))
#endif
typedef
struct
ue_ip_priv_s
{
typedef
struct
ue_ip_priv_s
{
int
irq
;
int
irq
;
int
rx_flags
;
int
rx_flags
;
...
...
openair3/NAS/NR_UE/nr_nas_msg_sim.c
View file @
b7857a50
...
@@ -465,7 +465,7 @@ static void generateAuthenticationResp(as_nas_info_t *initialNasMsg, uint8_t *bu
...
@@ -465,7 +465,7 @@ static void generateAuthenticationResp(as_nas_info_t *initialNasMsg, uint8_t *bu
initialNasMsg
->
length
=
mm_msg_encode
(
mm_msg
,
(
uint8_t
*
)(
initialNasMsg
->
data
),
size
);
initialNasMsg
->
length
=
mm_msg_encode
(
mm_msg
,
(
uint8_t
*
)(
initialNasMsg
->
data
),
size
);
}
}
void
generateSecurityModeComplete
(
as_nas_info_t
*
initialNasMsg
)
static
void
generateSecurityModeComplete
(
as_nas_info_t
*
initialNasMsg
)
{
{
int
size
=
sizeof
(
mm_msg_header_t
);
int
size
=
sizeof
(
mm_msg_header_t
);
fgs_nas_message_t
nas_msg
;
fgs_nas_message_t
nas_msg
;
...
@@ -532,7 +532,7 @@ void generateSecurityModeComplete(as_nas_info_t *initialNasMsg)
...
@@ -532,7 +532,7 @@ void generateSecurityModeComplete(as_nas_info_t *initialNasMsg)
}
}
}
}
void
generateRegistrationComplete
(
as_nas_info_t
*
initialNasMsg
,
SORTransparentContainer
*
sortransparentcontainer
)
{
static
void
generateRegistrationComplete
(
as_nas_info_t
*
initialNasMsg
,
SORTransparentContainer
*
sortransparentcontainer
)
{
//wait send RRCReconfigurationComplete and InitialContextSetupResponse
//wait send RRCReconfigurationComplete and InitialContextSetupResponse
sleep
(
1
);
sleep
(
1
);
int
length
=
0
;
int
length
=
0
;
...
@@ -625,12 +625,11 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff
...
@@ -625,12 +625,11 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff
}
}
}
}
void
generatePduSessionEstablishRequest
(
as_nas_info_t
*
initialNasMsg
){
static
void
generatePduSessionEstablishRequest
(
uicc_t
*
uicc
,
as_nas_info_t
*
initialNasMsg
){
//wait send RegistrationComplete
//wait send RegistrationComplete
usleep
(
100
*
150
);
usleep
(
100
*
150
);
int
size
=
0
;
int
size
=
0
;
fgs_nas_message_t
nas_msg
;
fgs_nas_message_t
nas_msg
=
{
0
};
memset
(
&
nas_msg
,
0
,
sizeof
(
fgs_nas_message_t
));
// setup pdu session establishment request
// setup pdu session establishment request
uint16_t
req_length
=
7
;
uint16_t
req_length
=
7
;
...
@@ -649,8 +648,6 @@ void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
...
@@ -649,8 +648,6 @@ void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
MM_msg
*
mm_msg
;
MM_msg
*
mm_msg
;
nas_stream_cipher_t
stream_cipher
;
nas_stream_cipher_t
stream_cipher
;
uint8_t
mac
[
4
];
uint8_t
mac
[
4
];
uint8_t
nssai
[]
=
{
1
,
0
,
0
,
1
};
//Corresponding to SST:1, SD:1
uint8_t
dnn
[
4
]
=
{
0x4
,
0x6f
,
0x61
,
0x69
};
//Corresponding to dnn:"oai"
nas_msg
.
header
.
protocol_discriminator
=
FGS_MOBILITY_MANAGEMENT_MESSAGE
;
nas_msg
.
header
.
protocol_discriminator
=
FGS_MOBILITY_MANAGEMENT_MESSAGE
;
nas_msg
.
header
.
security_header_type
=
INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX
;
nas_msg
.
header
.
security_header_type
=
INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX
;
size
+=
7
;
size
+=
7
;
...
@@ -680,11 +677,21 @@ void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
...
@@ -680,11 +677,21 @@ void generatePduSessionEstablishRequest(as_nas_info_t *initialNasMsg){
mm_msg
->
uplink_nas_transport
.
requesttype
=
1
;
mm_msg
->
uplink_nas_transport
.
requesttype
=
1
;
size
+=
3
;
size
+=
3
;
mm_msg
->
uplink_nas_transport
.
snssai
.
length
=
4
;
mm_msg
->
uplink_nas_transport
.
snssai
.
length
=
4
;
mm_msg
->
uplink_nas_transport
.
snssai
.
value
=
nssai
;
//Fixme: it seems there are a lot of memory errors in this: this value was on the stack,
size
+=
(
1
+
1
+
4
);
// but pushed in a itti message to another thread
mm_msg
->
uplink_nas_transport
.
dnn
.
length
=
4
;
// this kind of error seems in many places in 5G NAS
mm_msg
->
uplink_nas_transport
.
dnn
.
value
=
dnn
;
mm_msg
->
uplink_nas_transport
.
snssai
.
value
=
calloc
(
1
,
4
);
mm_msg
->
uplink_nas_transport
.
snssai
.
value
[
0
]
=
uicc
->
nssai_sst
;
mm_msg
->
uplink_nas_transport
.
snssai
.
value
[
1
]
=
(
uicc
->
nssai_sd
>>
16
)
&
0xFF
;
mm_msg
->
uplink_nas_transport
.
snssai
.
value
[
2
]
=
(
uicc
->
nssai_sd
>>
8
)
&
0xFF
;
mm_msg
->
uplink_nas_transport
.
snssai
.
value
[
3
]
=
(
uicc
->
nssai_sd
)
&
0xFF
;
size
+=
(
1
+
1
+
4
);
size
+=
(
1
+
1
+
4
);
int
dnnSize
=
strlen
(
uicc
->
dnnStr
);
mm_msg
->
uplink_nas_transport
.
dnn
.
value
=
calloc
(
1
,
dnnSize
+
1
);
mm_msg
->
uplink_nas_transport
.
dnn
.
length
=
dnnSize
+
1
;
mm_msg
->
uplink_nas_transport
.
dnn
.
value
[
0
]
=
dnnSize
+
1
;
memcpy
(
mm_msg
->
uplink_nas_transport
.
dnn
.
value
+
1
,
uicc
->
dnnStr
,
dnnSize
);
size
+=
(
1
+
1
+
dnnSize
+
1
);
// encode the message
// encode the message
initialNasMsg
->
data
=
(
Byte_t
*
)
malloc
(
size
*
sizeof
(
Byte_t
));
initialNasMsg
->
data
=
(
Byte_t
*
)
malloc
(
size
*
sizeof
(
Byte_t
));
...
@@ -819,7 +826,7 @@ void *nas_nrue_task(void *args_p)
...
@@ -819,7 +826,7 @@ void *nas_nrue_task(void *args_p)
as_nas_info_t
pduEstablishMsg
;
as_nas_info_t
pduEstablishMsg
;
memset
(
&
pduEstablishMsg
,
0
,
sizeof
(
as_nas_info_t
));
memset
(
&
pduEstablishMsg
,
0
,
sizeof
(
as_nas_info_t
));
generatePduSessionEstablishRequest
(
&
pduEstablishMsg
);
generatePduSessionEstablishRequest
(
uicc
,
&
pduEstablishMsg
);
if
(
pduEstablishMsg
.
length
>
0
){
if
(
pduEstablishMsg
.
length
>
0
){
MessageDef
*
message_p
;
MessageDef
*
message_p
;
message_p
=
itti_alloc_new_message
(
TASK_NAS_NRUE
,
0
,
NAS_UPLINK_DATA_REQ
);
message_p
=
itti_alloc_new_message
(
TASK_NAS_NRUE
,
0
,
NAS_UPLINK_DATA_REQ
);
...
...
openair3/NAS/NR_UE/nr_nas_msg_sim.h
View file @
b7857a50
...
@@ -117,9 +117,6 @@ typedef union {
...
@@ -117,9 +117,6 @@ typedef union {
}
fgs_nas_message_t
;
}
fgs_nas_message_t
;
void
generateRegistrationRequest
(
as_nas_info_t
*
initialNasMsg
,
int
Mod_id
);
void
generateRegistrationRequest
(
as_nas_info_t
*
initialNasMsg
,
int
Mod_id
);
void
generateSecurityModeComplete
(
as_nas_info_t
*
initialNasMsg
);
void
generateRegistrationComplete
(
as_nas_info_t
*
initialNasMsg
,
SORTransparentContainer
*
sortransparentcontainer
);
void
generatePduSessionEstablishRequest
(
as_nas_info_t
*
initialNasMsg
);
void
*
nas_nrue_task
(
void
*
args_p
);
void
*
nas_nrue_task
(
void
*
args_p
);
#endif
/* __NR_NAS_MSG_SIM_H__*/
#endif
/* __NR_NAS_MSG_SIM_H__*/
...
...
openair3/UICC/usim_interface.c
View file @
b7857a50
...
@@ -43,7 +43,7 @@ extern uint16_t NB_UE_INST;
...
@@ -43,7 +43,7 @@ extern uint16_t NB_UE_INST;
{"amf", "USIM amf\n", 0, strptr:&(uicc->amfStr), defstrval:"8000", TYPE_STRING, 0 },\
{"amf", "USIM amf\n", 0, strptr:&(uicc->amfStr), defstrval:"8000", TYPE_STRING, 0 },\
{"sqn", "USIM sqn\n", 0, strptr:&(uicc->sqnStr), defstrval:"000000", TYPE_STRING, 0 },\
{"sqn", "USIM sqn\n", 0, strptr:&(uicc->sqnStr), defstrval:"000000", TYPE_STRING, 0 },\
{"dnn", "UE dnn (apn)\n", 0, strptr:&(uicc->dnnStr), defstrval:"oai", TYPE_STRING, 0 },\
{"dnn", "UE dnn (apn)\n", 0, strptr:&(uicc->dnnStr), defstrval:"oai", TYPE_STRING, 0 },\
{"nssai_s
t", "UE nssai\n", 0, iptr:&(uicc->nssai_
st), defintval:1, TYPE_INT, 0 }, \
{"nssai_s
st", "UE nssai\n", 0, iptr:&(uicc->nssai_s
st), defintval:1, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&(uicc->nssai_sd), defintval:1, TYPE_INT, 0 }, \
{"nssai_sd", "UE nssai\n", 0, iptr:&(uicc->nssai_sd), defintval:1, TYPE_INT, 0 }, \
};
};
...
...
openair3/UICC/usim_interface.h
View file @
b7857a50
...
@@ -50,7 +50,7 @@ typedef struct {
...
@@ -50,7 +50,7 @@ typedef struct {
char
*
amfStr
;
char
*
amfStr
;
char
*
sqnStr
;
char
*
sqnStr
;
char
*
dnnStr
;
char
*
dnnStr
;
int
nssai_st
;
int
nssai_s
s
t
;
int
nssai_sd
;
int
nssai_sd
;
uint8_t
key
[
16
];
uint8_t
key
[
16
];
uint8_t
opc
[
16
];
uint8_t
opc
[
16
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment