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
promise
OpenXG-RAN
Commits
4cb7ee39
Commit
4cb7ee39
authored
Nov 22, 2020
by
Chenyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decode ok
parent
2c071253
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
openair3/NAS/NR_UE/nas_nrue_task.c
openair3/NAS/NR_UE/nas_nrue_task.c
+13
-9
openair3/NAS/NR_UE/nas_nrue_task.h
openair3/NAS/NR_UE/nas_nrue_task.h
+3
-3
No files found.
openair3/NAS/NR_UE/nas_nrue_task.c
View file @
4cb7ee39
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
*/
*/
#define NAS_BUILT_IN_UE 1 //QUES: #undef
#define NAS_BUILT_IN_UE 1 //QUES: #undef
#define __LITTLE_ENDIAN_BITFIELD 1
//
#define __LITTLE_ENDIAN_BITFIELD 1
#include "utils.h"
#include "utils.h"
# include "assertions.h"
# include "assertions.h"
...
@@ -158,7 +158,7 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
...
@@ -158,7 +158,7 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
decodeNasMsg
(
msg
,
data
,
len
);
decodeNasMsg
(
msg
,
data
,
len
);
switch
(
msg
->
header
.
message_type
)
{
switch
(
msg
->
header
.
message_type
)
{
case
IDENTITY_REQUEST
:
{
//send identityResponse in NAS_UPLINK_DATA_REQ
case
IDENTITY_REQUEST
:
{
//send identityResponse in NAS_UPLINK_DATA_REQ
msg1
->
header
.
protocol_discriminator
=
0
;
msg1
->
header
.
ex_
protocol_discriminator
=
0
;
msg1
->
header
.
security_header_type
=
0
;
msg1
->
header
.
security_header_type
=
0
;
len1
+=
sizeof
(
uint8_t
);
len1
+=
sizeof
(
uint8_t
);
msg1
->
header
.
message_type
=
IDENTITY_RESPONSE
;
msg1
->
header
.
message_type
=
IDENTITY_RESPONSE
;
...
@@ -170,7 +170,7 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
...
@@ -170,7 +170,7 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
}
}
case
AUTHENTICATION_REQUEST
:
{
//send authenticationResponse
case
AUTHENTICATION_REQUEST
:
{
//send authenticationResponse
msg1
->
header
.
protocol_discriminator
=
0
;
msg1
->
header
.
ex_
protocol_discriminator
=
0
;
msg1
->
header
.
security_header_type
=
0
;
msg1
->
header
.
security_header_type
=
0
;
len1
+=
sizeof
(
uint8_t
);
len1
+=
sizeof
(
uint8_t
);
msg1
->
header
.
message_type
=
AUTHENTICATION_RESPONSE
;
msg1
->
header
.
message_type
=
AUTHENTICATION_RESPONSE
;
...
@@ -189,7 +189,7 @@ int decodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) {
...
@@ -189,7 +189,7 @@ int decodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) {
int
decode_result
=
0
;
int
decode_result
=
0
;
/* First decode the EMM message header */
/* First decode the EMM message header */
header_result
=
_
e
mm_msg_decode_header
(
&
msg
->
header
,
buffer
,
len
);
header_result
=
_
nas_
mm_msg_decode_header
(
&
msg
->
header
,
buffer
,
len
);
if
(
header_result
<
0
)
{
if
(
header_result
<
0
)
{
LOG_TRACE
(
ERROR
,
"NR_UE - Failed to decode EMM message header "
LOG_TRACE
(
ERROR
,
"NR_UE - Failed to decode EMM message header "
...
@@ -237,19 +237,23 @@ int encodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) { //QUES:UENAS_m
...
@@ -237,19 +237,23 @@ int encodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) { //QUES:UENAS_m
LOG_FUNC_RETURN
(
header_result
+
encode_result
);
LOG_FUNC_RETURN
(
header_result
+
encode_result
);
}
}
static
int
_
emm_msg_decode_header
(
e
mm_msg_header_t
*
header
,
static
int
_
nas_mm_msg_decode_header
(
mm_msg_header_t
*
header
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
const
uint8_t
*
buffer
,
uint32_t
len
)
{
int
size
=
0
;
int
size
=
0
;
/* Check the buffer length */
/* Check the buffer length */
/* Decode the security header type and the protocol discriminator */
DECODE_U8
(
buffer
+
size
,
*
(
uint8_t
*
)(
header
),
size
);
/* Encode the extendedprotocol discriminator */
/* Decode the message type */
DECODE_U8
(
buffer
+
size
,
header
->
ex_protocol_discriminator
,
size
);
/* Encode the security header type */
DECODE_U8
(
buffer
+
size
,
header
->
security_header_type
,
size
);
/* Encode the message type */
DECODE_U8
(
buffer
+
size
,
header
->
message_type
,
size
);
DECODE_U8
(
buffer
+
size
,
header
->
message_type
,
size
);
/* Check the protocol discriminator */
/* Check the protocol discriminator */
return
(
size
);
return
(
size
);
}
}
...
@@ -265,6 +269,6 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
...
@@ -265,6 +269,6 @@ static int _emm_msg_encode_header(const emm_msg_header_t *header,
ENCODE_U8
(
buffer
+
size
,
*
(
uint8_t
*
)(
header
),
size
);
ENCODE_U8
(
buffer
+
size
,
*
(
uint8_t
*
)(
header
),
size
);
/* Encode the message type */
/* Encode the message type */
ENCODE_U8
(
buffer
+
size
,
header
->
message_type
,
size
);
ENCODE_U8
(
buffer
+
size
,
header
->
message_type
,
size
);
return
(
size
);
return
(
size
);
}
}
openair3/NAS/NR_UE/nas_nrue_task.h
View file @
4cb7ee39
...
@@ -32,10 +32,10 @@
...
@@ -32,10 +32,10 @@
#include "TLVDecoder.h"
#include "TLVDecoder.h"
#include "TLVEncoder.h"
#include "TLVEncoder.h"
#include "NR_NAS_defs.h"
#include "NR_NAS_defs.h"
#include "n
as_itti_messaging
.h"
#include "n
r_nas_msg_sim
.h"
typedef
union
{
typedef
union
{
e
mm_msg_header_t
header
;
mm_msg_header_t
header
;
authenticationrequestHeader_t
authentication_request
;
authenticationrequestHeader_t
authentication_request
;
authenticationresponse_t
authentication_response
;
authenticationresponse_t
authentication_response
;
Identityrequest_t
identity_request
;
Identityrequest_t
identity_request
;
...
@@ -46,7 +46,7 @@ void *nas_nrue_task(void *args_p);
...
@@ -46,7 +46,7 @@ void *nas_nrue_task(void *args_p);
void
nr_nas_proc_dl_transfer_ind
(
UENAS_msg
*
msg
,
Byte_t
*
data
,
uint32_t
len
);
void
nr_nas_proc_dl_transfer_ind
(
UENAS_msg
*
msg
,
Byte_t
*
data
,
uint32_t
len
);
int
decodeNasMsg
(
UENAS_msg
*
msg
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decodeNasMsg
(
UENAS_msg
*
msg
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encodeNasMsg
(
UENAS_msg
*
msg
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encodeNasMsg
(
UENAS_msg
*
msg
,
uint8_t
*
buffer
,
uint32_t
len
);
static
int
_
emm_msg_decode_header
(
e
mm_msg_header_t
*
header
,
const
uint8_t
*
buffer
,
uint32_t
len
);
//QUES: defined in emm_msg.c and no check
static
int
_
nas_mm_msg_decode_header
(
mm_msg_header_t
*
header
,
const
uint8_t
*
buffer
,
uint32_t
len
);
//QUES: defined in emm_msg.c and no check
static
int
_emm_msg_encode_header
(
const
emm_msg_header_t
*
header
,
uint8_t
*
buffer
,
uint32_t
len
);
static
int
_emm_msg_encode_header
(
const
emm_msg_header_t
*
header
,
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* NAS_TASK_H_ */
#endif
/* NAS_TASK_H_ */
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