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
canghaiwuhen
OpenXG-RAN
Commits
461d022d
Commit
461d022d
authored
Nov 23, 2020
by
Chenyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encode Security mode complete AND Registration complete
parent
141b56ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
0 deletions
+90
-0
openair3/NAS/NR_UE/nas_nrue_task.c
openair3/NAS/NR_UE/nas_nrue_task.c
+55
-0
openair3/NAS/NR_UE/nas_nrue_task.h
openair3/NAS/NR_UE/nas_nrue_task.h
+35
-0
No files found.
openair3/NAS/NR_UE/nas_nrue_task.c
View file @
461d022d
...
@@ -180,6 +180,20 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
...
@@ -180,6 +180,20 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len) {
break
;
break
;
}
}
case
SECURITY_MODE_COMMAND
:
{
len1
+=
securityModeComplete5g
((
void
**
)
&
msg1
->
securitymode_complete
);
size
=
encodeNasMsg
(
msg1
,
buffer
,
len1
);
nas_itti_ul_data_req
(
0
,
buffer
,
size
,
0
);
break
;
}
case
REGISTRATION_ACCEPT
:
{
len1
+=
registrationComplete5g
((
void
**
)
&
msg1
->
registration_complete
);
size
=
encodeNasMsg
(
msg1
,
buffer
,
len1
);
nas_itti_ul_data_req
(
0
,
buffer
,
size
,
0
);
break
;
}
for
(
int
i
=
0
;
i
<
size
;
i
++
)
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
{
printf
(
"aaaaaaaaaaaaa%x"
,
*
(
buffer
+
i
));
printf
(
"aaaaaaaaaaaaa%x"
,
*
(
buffer
+
i
));
...
@@ -237,6 +251,16 @@ int encodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) { //QUES:UENAS_m
...
@@ -237,6 +251,16 @@ int encodeNasMsg(UENAS_msg *msg, uint8_t *buffer, uint32_t len) { //QUES:UENAS_m
encode_result
=
encode_authentication_response5g
(
&
msg
->
authentication_response
,
buffer
,
len
);
encode_result
=
encode_authentication_response5g
(
&
msg
->
authentication_response
,
buffer
,
len
);
break
;
break
;
}
}
case
SECURITY_MODE_COMPLETE
:
{
encode_result
=
encode_security_mode_complete5g
(
&
msg
->
securitymode_complete
,
buffer
,
len
);
//TODO:encode_security_mode_complete5g
break
;
}
case
REGISTRATION_COMPLETE
:
{
encode_result
=
encode_registration_complete5g
(
&
msg
->
registration_complete
,
buffer
,
len
);
//TODO:encode_security_mode_complete5g
break
;
}
}
}
LOG_FUNC_RETURN
(
header_result
+
encode_result
);
LOG_FUNC_RETURN
(
header_result
+
encode_result
);
}
}
...
@@ -303,5 +327,36 @@ int encode_authentication_response5g(authenticationresponse_t *authentication_re
...
@@ -303,5 +327,36 @@ int encode_authentication_response5g(authenticationresponse_t *authentication_re
}
}
return
encoded
;
return
encoded
;
}
int
encode_security_mode_complete5g
(
securityModeComplete_t
*
securitymodecomplete
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
return
encoded
;
}
int
encode_registration_complete5g
(
registrationcomplete_t
*
registrationcomplete
,
uint8_t
*
buffer
,
uint32_t
len
)
{
int
encoded
=
0
;
return
encoded
;
}
int
securityModeComplete5g
(
void
**
msg
)
{
myCalloc
(
resp
,
securityModeComplete_t
);
resp
->
epd
=
SGSmobilitymanagementmessages
;
resp
->
sh
=
0
;
resp
->
mt
=
Registrationcomplete
;
*
msg
=
resp
;
return
sizeof
(
securityModeComplete_t
);
}
int
registrationComplete5g
(
void
**
msg
)
{
myCalloc
(
resp
,
registrationcomplete_t
);
resp
->
epd
=
SGSmobilitymanagementmessages
;
resp
->
sh
=
0
;
resp
->
mt
=
Securitymodecomplete
;
*
msg
=
resp
;
return
sizeof
(
registrationcomplete_t
);
}
}
openair3/NAS/NR_UE/nas_nrue_task.h
View file @
461d022d
...
@@ -34,12 +34,43 @@
...
@@ -34,12 +34,43 @@
#include "NR_NAS_defs.h"
#include "NR_NAS_defs.h"
#include "nr_nas_msg_sim.h"
#include "nr_nas_msg_sim.h"
# define REGISTRATION_ACCEPT 0b01000010
# define REGISTRATION_COMPLETE 0b01000011
typedef
struct
__attribute__
((
packed
))
{
Extendedprotocoldiscriminator_t
epd
:
8
;
Security_header_t
sh
:
8
;
SGSmobilitymanagementmessages_t
mt
:
8
;
}
securityModeComplete_t
;
typedef
struct
__attribute__
((
packed
))
{
unsigned
int
len
:
8
;
unsigned
int
allowed
:
4
;
unsigned
int
value
:
4
;
}
SGSregistrationresult
;
typedef
struct
__attribute__
((
packed
))
{
Extendedprotocoldiscriminator_t
epd
:
8
;
Security_header_t
sh
:
8
;
SGSmobilitymanagementmessages_t
mt
:
8
;
SGSregistrationresult
rr
;
}
registrationaccept_t
;
typedef
struct
__attribute__
((
packed
))
{
Extendedprotocoldiscriminator_t
epd
:
8
;
Security_header_t
sh
:
8
;
SGSmobilitymanagementmessages_t
mt
:
8
;
}
registrationcomplete_t
;
typedef
union
{
typedef
union
{
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
;
IdentityresponseIMSI_t
identity_response
;
IdentityresponseIMSI_t
identity_response
;
securityModeCommand_t
securitymode_command
;
securityModeComplete_t
securitymode_complete
;
registrationaccept_t
registration_accept
;
registrationcomplete_t
registration_complete
;
}
UENAS_msg
;
}
UENAS_msg
;
void
*
nas_nrue_task
(
void
*
args_p
);
void
*
nas_nrue_task
(
void
*
args_p
);
...
@@ -47,5 +78,9 @@ void nr_nas_proc_dl_transfer_ind (UENAS_msg *msg, Byte_t *data, uint32_t len);
...
@@ -47,5 +78,9 @@ 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
);
int
encode_authentication_response5g
(
authenticationresponse_t
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_authentication_response5g
(
authenticationresponse_t
*
authentication_response
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_security_mode_complete5g
(
securityModeComplete_t
*
securitymodecomplete
,
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_complete5g
(
registrationcomplete_t
*
registrationcomplete
,
uint8_t
*
buffer
,
uint32_t
len
);
int
securityModeComplete5g
(
void
**
msg
);
int
registrationComplete5g
(
void
**
msg
);
#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