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
zzha zzha
OpenXG-RAN
Commits
4700dde2
Commit
4700dde2
authored
Mar 11, 2023
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger deregistration
parent
a0318fb4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
86 additions
and
0 deletions
+86
-0
executables/nr-uesoftmodem.c
executables/nr-uesoftmodem.c
+7
-0
openair2/COMMON/as_message.h
openair2/COMMON/as_message.h
+7
-0
openair2/COMMON/rrc_messages_def.h
openair2/COMMON/rrc_messages_def.h
+1
-0
openair2/COMMON/rrc_messages_types.h
openair2/COMMON/rrc_messages_types.h
+2
-0
openair3/NAS/COMMON/NR_NAS_defs.h
openair3/NAS/COMMON/NR_NAS_defs.h
+6
-0
openair3/NAS/NR_UE/nr_nas_msg_sim.c
openair3/NAS/NR_UE/nr_nas_msg_sim.c
+60
-0
openair3/NAS/NR_UE/nr_nas_msg_sim.h
openair3/NAS/NR_UE/nr_nas_msg_sim.h
+3
-0
No files found.
executables/nr-uesoftmodem.c
View file @
4700dde2
...
@@ -397,6 +397,12 @@ void *rrc_enb_process_msg(void *notUsed) {
...
@@ -397,6 +397,12 @@ void *rrc_enb_process_msg(void *notUsed) {
return
NULL
;
return
NULL
;
}
}
static
void
trigger_deregistration
(
int
signal
)
{
MessageDef
*
msg
=
itti_alloc_new_message
(
TASK_RRC_UE_SIM
,
0
,
NAS_DEREGISTRATION_REQ
);
itti_send_msg_to_task
(
TASK_NAS_NRUE
,
0
,
msg
);
}
static
void
get_channel_model_mode
()
{
static
void
get_channel_model_mode
()
{
paramdef_t
GNBParams
[]
=
GNBPARAMS_DESC
;
paramdef_t
GNBParams
[]
=
GNBPARAMS_DESC
;
config_get
(
GNBParams
,
sizeof
(
GNBParams
)
/
sizeof
(
paramdef_t
),
NULL
);
config_get
(
GNBParams
,
sizeof
(
GNBParams
)
/
sizeof
(
paramdef_t
),
NULL
);
...
@@ -553,6 +559,7 @@ int main( int argc, char **argv ) {
...
@@ -553,6 +559,7 @@ int main( int argc, char **argv ) {
sleep
(
2
);
sleep
(
2
);
config_check_unknown_cmdlineopt
(
CONFIG_CHECKALLSECTIONS
);
config_check_unknown_cmdlineopt
(
CONFIG_CHECKALLSECTIONS
);
signal
(
SIGUSR2
,
trigger_deregistration
);
// wait for end of program
// wait for end of program
printf
(
"Entering ITTI signals handler
\n
"
);
printf
(
"Entering ITTI signals handler
\n
"
);
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
printf
(
"TYPE <CTRL-C> TO TERMINATE
\n
"
);
...
...
openair2/COMMON/as_message.h
View file @
4700dde2
...
@@ -327,6 +327,13 @@ typedef struct nas_establish_req_s {
...
@@ -327,6 +327,13 @@ typedef struct nas_establish_req_s {
as_nas_info_t
initialNasMsg
;
/* Initial NAS message to transfer */
as_nas_info_t
initialNasMsg
;
/* Initial NAS message to transfer */
}
nas_establish_req_t
;
}
nas_establish_req_t
;
/*
* fill me
*/
typedef
struct
nas_deregistration_req_s
{
// fill me
}
nas_deregistration_req_t
;
/*
/*
* AS->NAS - NAS signalling connection establishment indication
* AS->NAS - NAS signalling connection establishment indication
* AS transfers the initial NAS message to the NAS.
* AS transfers the initial NAS message to the NAS.
...
...
openair2/COMMON/rrc_messages_def.h
View file @
4700dde2
...
@@ -62,6 +62,7 @@ MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, NasKenbRefre
...
@@ -62,6 +62,7 @@ MESSAGE_DEF(NAS_KENB_REFRESH_REQ, MESSAGE_PRIORITY_MED, NasKenbRefre
MESSAGE_DEF
(
NAS_CELL_SELECTION_REQ
,
MESSAGE_PRIORITY_MED
,
NasCellSelectionReq
,
nas_cell_selection_req
)
MESSAGE_DEF
(
NAS_CELL_SELECTION_REQ
,
MESSAGE_PRIORITY_MED
,
NasCellSelectionReq
,
nas_cell_selection_req
)
MESSAGE_DEF
(
NAS_CONN_ESTABLI_REQ
,
MESSAGE_PRIORITY_MED
,
NasConnEstabliReq
,
nas_conn_establi_req
)
MESSAGE_DEF
(
NAS_CONN_ESTABLI_REQ
,
MESSAGE_PRIORITY_MED
,
NasConnEstabliReq
,
nas_conn_establi_req
)
MESSAGE_DEF
(
NAS_UPLINK_DATA_REQ
,
MESSAGE_PRIORITY_MED
,
NasUlDataReq
,
nas_ul_data_req
)
MESSAGE_DEF
(
NAS_UPLINK_DATA_REQ
,
MESSAGE_PRIORITY_MED
,
NasUlDataReq
,
nas_ul_data_req
)
MESSAGE_DEF
(
NAS_DEREGISTRATION_REQ
,
MESSAGE_PRIORITY_MED
,
NasDeregistrationReq
,
nas_deregistration_req
)
MESSAGE_DEF
(
NAS_RAB_ESTABLI_RSP
,
MESSAGE_PRIORITY_MED
,
NasRabEstRsp
,
nas_rab_est_rsp
)
MESSAGE_DEF
(
NAS_RAB_ESTABLI_RSP
,
MESSAGE_PRIORITY_MED
,
NasRabEstRsp
,
nas_rab_est_rsp
)
...
...
openair2/COMMON/rrc_messages_types.h
View file @
4700dde2
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
#define NAS_CELL_SELECTION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_req
#define NAS_CELL_SELECTION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_cell_selection_req
#define NAS_CONN_ESTABLI_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_req
#define NAS_CONN_ESTABLI_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_conn_establi_req
#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_req
#define NAS_UPLINK_DATA_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_ul_data_req
#define NAS_DEREGISTRATION_REQ(mSGpTR) (mSGpTR)->ittiMsg.nas_deregistration_req
#define NAS_RAB_ESTABLI_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_rab_est_rsp
#define NAS_RAB_ESTABLI_RSP(mSGpTR) (mSGpTR)->ittiMsg.nas_rab_est_rsp
...
@@ -441,6 +442,7 @@ typedef kenb_refresh_req_t NasKenbRefreshReq;
...
@@ -441,6 +442,7 @@ typedef kenb_refresh_req_t NasKenbRefreshReq;
typedef
cell_info_req_t
NasCellSelectionReq
;
typedef
cell_info_req_t
NasCellSelectionReq
;
typedef
nas_establish_req_t
NasConnEstabliReq
;
typedef
nas_establish_req_t
NasConnEstabliReq
;
typedef
ul_info_transfer_req_t
NasUlDataReq
;
typedef
ul_info_transfer_req_t
NasUlDataReq
;
typedef
nas_deregistration_req_t
NasDeregistrationReq
;
typedef
rab_establish_rsp_t
NasRabEstRsp
;
typedef
rab_establish_rsp_t
NasRabEstRsp
;
...
...
openair3/NAS/COMMON/NR_NAS_defs.h
View file @
4700dde2
...
@@ -364,6 +364,12 @@ typedef struct __attribute__((packed)) {
...
@@ -364,6 +364,12 @@ typedef struct __attribute__((packed)) {
}
securityModeCommand_t
;
}
securityModeCommand_t
;
typedef
struct
__attribute__
((
packed
))
{
Extendedprotocoldiscriminator_t
epd
:
8
;
Security_header_t
sh
:
8
;
SGSmobilitymanagementmessages_t
mt
:
8
;
}
deregistrationRequestUEOriginating_t
;
typedef
struct
{
typedef
struct
{
uicc_t
*
uicc
;
uicc_t
*
uicc
;
}
nr_user_nas_t
;
}
nr_user_nas_t
;
...
...
openair3/NAS/NR_UE/nr_nas_msg_sim.c
View file @
4700dde2
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include "PduSessionEstablishRequest.h"
#include "PduSessionEstablishRequest.h"
#include "PduSessionEstablishmentAccept.h"
#include "PduSessionEstablishmentAccept.h"
#include "RegistrationAccept.h"
#include "RegistrationAccept.h"
#include "FGSDeregistrationRequestUEOriginating.h"
#include "intertask_interface.h"
#include "intertask_interface.h"
#include "openair2/RRC/NAS/nas_config.h"
#include "openair2/RRC/NAS/nas_config.h"
#include <openair3/NAS/COMMON/NR_NAS_defs.h>
#include <openair3/NAS/COMMON/NR_NAS_defs.h>
...
@@ -184,6 +185,9 @@ int mm_msg_encode(MM_msg *mm_msg, uint8_t *buffer, uint32_t len) {
...
@@ -184,6 +185,9 @@ int mm_msg_encode(MM_msg *mm_msg, uint8_t *buffer, uint32_t len) {
case
FGS_UPLINK_NAS_TRANSPORT
:
case
FGS_UPLINK_NAS_TRANSPORT
:
encode_result
=
encode_fgs_uplink_nas_transport
(
&
mm_msg
->
uplink_nas_transport
,
buffer
,
len
);
encode_result
=
encode_fgs_uplink_nas_transport
(
&
mm_msg
->
uplink_nas_transport
,
buffer
,
len
);
break
;
break
;
case
FGS_DEREGISTRATION_REQUEST_UE_ORIGINATING
:
encode_result
=
encode_fgs_deregistration_request_ue_originating
(
&
mm_msg
->
fgs_deregistration_request_ue_originating
,
buffer
,
len
);
break
;
default:
default:
LOG_TRACE
(
ERROR
,
"EMM-MSG - Unexpected message type: 0x%x"
,
LOG_TRACE
(
ERROR
,
"EMM-MSG - Unexpected message type: 0x%x"
,
mm_msg
->
header
.
message_type
);
mm_msg
->
header
.
message_type
);
...
@@ -721,6 +725,53 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff
...
@@ -721,6 +725,53 @@ void decodeDownlinkNASTransport(as_nas_info_t *initialNasMsg, uint8_t * pdu_buff
}
}
}
}
static
void
generateDeregistrationRequest
(
nr_ue_nas_t
*
nas
,
as_nas_info_t
*
initialNasMsg
,
const
nas_deregistration_req_t
*
req
)
{
fgs_nas_message_t
nas_msg
=
{
0
};
fgs_nas_message_security_protected_t
*
sp_msg
;
sp_msg
=
&
nas_msg
.
security_protected
;
sp_msg
->
header
.
protocol_discriminator
=
FGS_MOBILITY_MANAGEMENT_MESSAGE
;
sp_msg
->
header
.
security_header_type
=
INTEGRITY_PROTECTED_AND_CIPHERED
;
sp_msg
->
header
.
message_authentication_code
=
0
;
sp_msg
->
header
.
sequence_number
=
2
;
int
size
=
sizeof
(
fgs_nas_message_security_header_t
);
fgs_deregistration_request_ue_originating_msg
*
dereg_req
=
&
sp_msg
->
plain
.
mm_msg
.
fgs_deregistration_request_ue_originating
;
dereg_req
->
protocoldiscriminator
=
FGS_MOBILITY_MANAGEMENT_MESSAGE
;
size
+=
1
;
dereg_req
->
securityheadertype
=
INTEGRITY_PROTECTED_AND_CIPHERED_WITH_NEW_SECU_CTX
;
size
+=
1
;
dereg_req
->
messagetype
=
FGS_DEREGISTRATION_REQUEST_UE_ORIGINATING
;
size
+=
1
;
dereg_req
->
deregistrationtype
.
switchoff
=
NORMAL_DEREGISTRATION
;
dereg_req
->
deregistrationtype
.
reregistration_required
=
REREGISTRATION_NOT_REQUIRED
;
dereg_req
->
deregistrationtype
.
access_type
=
TGPP_ACCESS
;
dereg_req
->
naskeysetidentifier
.
naskeysetidentifier
=
1
;
size
+=
1
;
size
+=
fill_guti
(
&
dereg_req
->
fgsmobileidentity
,
nas
->
guti
);
// encode the message
initialNasMsg
->
data
=
calloc
(
size
,
sizeof
(
Byte_t
));
int
security_header_len
=
nas_protected_security_header_encode
((
char
*
)(
initialNasMsg
->
data
),
&
nas_msg
.
header
,
size
);
initialNasMsg
->
length
=
security_header_len
+
mm_msg_encode
(
&
sp_msg
->
plain
.
mm_msg
,
(
uint8_t
*
)(
initialNasMsg
->
data
+
security_header_len
),
size
-
security_header_len
);
nas_stream_cipher_t
stream_cipher
=
{
.
key
=
nas
->
security
.
knas_int
,
.
key_length
=
16
,
.
count
=
nas
->
security
.
mm_counter
++
,
.
bearer
=
1
,
.
direction
=
0
,
.
message
=
(
unsigned
char
*
)(
initialNasMsg
->
data
+
6
),
.
blength
=
(
initialNasMsg
->
length
-
6
)
<<
3
,
/* length in bits */
};
uint8_t
mac
[
4
];
nas_stream_encrypt_eia2
(
&
stream_cipher
,
mac
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
initialNasMsg
->
data
[
2
+
i
]
=
mac
[
i
];
}
static
void
generatePduSessionEstablishRequest
(
nr_ue_nas_t
*
nas
,
as_nas_info_t
*
initialNasMsg
)
static
void
generatePduSessionEstablishRequest
(
nr_ue_nas_t
*
nas
,
as_nas_info_t
*
initialNasMsg
)
{
{
//wait send RegistrationComplete
//wait send RegistrationComplete
...
@@ -959,6 +1010,15 @@ void *nas_nrue_task(void *args_p)
...
@@ -959,6 +1010,15 @@ void *nas_nrue_task(void *args_p)
break
;
break
;
case
NAS_DEREGISTRATION_REQ
:
{
LOG_I
(
NAS
,
"[UE %ld] Received %s
\n
"
,
instance
,
ITTI_MSG_NAME
(
msg_p
));
nas_deregistration_req_t
*
req
=
&
NAS_DEREGISTRATION_REQ
(
msg_p
);
as_nas_info_t
initialNasMsg
=
{
0
};
generateDeregistrationRequest
(
nas
,
&
initialNasMsg
,
req
);
send_nas_uplink_data_req
(
instance
,
&
initialNasMsg
);
}
break
;
case
NAS_DOWNLINK_DATA_IND
:
case
NAS_DOWNLINK_DATA_IND
:
{
{
LOG_I
(
NAS
,
LOG_I
(
NAS
,
...
...
openair3/NAS/NR_UE/nr_nas_msg_sim.h
View file @
4700dde2
...
@@ -36,6 +36,7 @@
...
@@ -36,6 +36,7 @@
#include "FGSIdentityResponse.h"
#include "FGSIdentityResponse.h"
#include "FGSAuthenticationResponse.h"
#include "FGSAuthenticationResponse.h"
#include "FGSNASSecurityModeComplete.h"
#include "FGSNASSecurityModeComplete.h"
#include "FGSDeregistrationRequestUEOriginating.h"
#include "RegistrationComplete.h"
#include "RegistrationComplete.h"
#include "as_message.h"
#include "as_message.h"
#include "FGSUplinkNasTransport.h"
#include "FGSUplinkNasTransport.h"
...
@@ -50,6 +51,7 @@
...
@@ -50,6 +51,7 @@
#define REGISTRATION_REQUEST 0b01000001
/* 65 = 0x41 */
#define REGISTRATION_REQUEST 0b01000001
/* 65 = 0x41 */
#define REGISTRATION_ACCEPT 0b01000010
/* 66 = 0x42 */
#define REGISTRATION_ACCEPT 0b01000010
/* 66 = 0x42 */
#define REGISTRATION_COMPLETE 0b01000011
/* 67 = 0x43 */
#define REGISTRATION_COMPLETE 0b01000011
/* 67 = 0x43 */
#define FGS_DEREGISTRATION_REQUEST_UE_ORIGINATING 0b01000101
#define FGS_AUTHENTICATION_REQUEST 0b01010110
/* 86 = 0x56 */
#define FGS_AUTHENTICATION_REQUEST 0b01010110
/* 86 = 0x56 */
#define FGS_AUTHENTICATION_RESPONSE 0b01010111
/* 87 = 0x57 */
#define FGS_AUTHENTICATION_RESPONSE 0b01010111
/* 87 = 0x57 */
#define FGS_IDENTITY_REQUEST 0b01011011
/* 91 = 0x5b */
#define FGS_IDENTITY_REQUEST 0b01011011
/* 91 = 0x5b */
...
@@ -117,6 +119,7 @@ typedef union {
...
@@ -117,6 +119,7 @@ typedef union {
registration_request_msg
registration_request
;
registration_request_msg
registration_request
;
fgs_identiy_response_msg
fgs_identity_response
;
fgs_identiy_response_msg
fgs_identity_response
;
fgs_authentication_response_msg
fgs_auth_response
;
fgs_authentication_response_msg
fgs_auth_response
;
fgs_deregistration_request_ue_originating_msg
fgs_deregistration_request_ue_originating
;
fgs_security_mode_complete_msg
fgs_security_mode_complete
;
fgs_security_mode_complete_msg
fgs_security_mode_complete
;
registration_complete_msg
registration_complete
;
registration_complete_msg
registration_complete
;
fgs_uplink_nas_transport_msg
uplink_nas_transport
;
fgs_uplink_nas_transport_msg
uplink_nas_transport
;
...
...
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