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
3156a9df
Commit
3156a9df
authored
Dec 21, 2023
by
francescomani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
function to handle NAS registraction accept
parent
b2c5f4bc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
39 deletions
+32
-39
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
+1
-1
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
+1
-1
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
+3
-3
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
+1
-1
openair3/NAS/NR_UE/nr_nas_msg_sim.c
openair3/NAS/NR_UE/nr_nas_msg_sim.c
+26
-33
No files found.
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.c
View file @
3156a9df
...
...
@@ -39,7 +39,7 @@
#include "RegistrationAccept.h"
#include "assertions.h"
int
decode_registration_accept
(
registration_accept_msg
*
registration_accept
,
uint8_t
*
buffer
,
uint32_t
len
)
int
decode_registration_accept
(
registration_accept_msg
*
registration_accept
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
uint32_t
decoded
=
0
;
int
decoded_result
=
0
;
...
...
openair3/NAS/COMMON/EMM/MSG/RegistrationAccept.h
View file @
3156a9df
...
...
@@ -62,7 +62,7 @@ typedef struct registration_accept_msg_tag {
FGSMobileIdentity
*
guti
;
}
registration_accept_msg
;
int
decode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
const
uint8_t
*
buffer
,
uint32_t
len
);
int
encode_registration_accept
(
registration_accept_msg
*
registrationaccept
,
uint8_t
*
buffer
,
uint32_t
len
);
...
...
openair3/NAS/COMMON/IES/FGSMobileIdentity.c
View file @
3156a9df
...
...
@@ -37,13 +37,13 @@
#include "TLVDecoder.h"
#include "FGSMobileIdentity.h"
static
int
decode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
);
static
int
decode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
const
uint8_t
*
buffer
);
static
int
encode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
);
static
int
encode_suci_5gs_mobile_identity
(
Suci5GSMobileIdentity_t
*
suci
,
uint8_t
*
buffer
);
static
int
encode_imeisv_5gs_mobile_identity
(
Imeisv5GSMobileIdentity_t
*
imeisv
,
uint8_t
*
buffer
);
int
decode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
)
int
decode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
const
uint8_t
*
buffer
,
uint32_t
len
)
{
int
decoded_rc
=
TLV_DECODE_VALUE_DOESNT_MATCH
;
int
decoded
=
0
;
...
...
@@ -117,7 +117,7 @@ int encode_5gs_mobile_identity(FGSMobileIdentity *fgsmobileidentity, uint8_t iei
return
(
encoded
+
encoded_rc
);
}
static
int
decode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
uint8_t
*
buffer
)
static
int
decode_guti_5gs_mobile_identity
(
Guti5GSMobileIdentity_t
*
guti
,
const
uint8_t
*
buffer
)
{
int
decoded
=
0
;
uint16_t
temp
;
...
...
openair3/NAS/COMMON/IES/FGSMobileIdentity.h
View file @
3156a9df
...
...
@@ -149,7 +149,7 @@ typedef union FGSMobileIdentity_tag {
int
encode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
uint8_t
*
buffer
,
uint32_t
len
);
int
decode_5gs_mobile_identity
(
FGSMobileIdentity
*
fgsmobileidentity
,
uint8_t
iei
,
const
uint8_t
*
buffer
,
uint32_t
len
);
#endif
/* FGS MOBILE IDENTITY_H_ */
openair3/NAS/NR_UE/nr_nas_msg_sim.c
View file @
3156a9df
...
...
@@ -617,7 +617,7 @@ static void generateSecurityModeComplete(nr_ue_nas_t *nas, as_nas_info_t *initia
}
}
static
void
decodeRegistrationAccept
(
uint8_t
*
buf
,
int
len
,
nr_ue_nas_t
*
nas
)
static
void
decodeRegistrationAccept
(
const
uint8_t
*
buf
,
int
len
,
nr_ue_nas_t
*
nas
)
{
registration_accept_msg
reg_acc
=
{
0
};
/* it seems there is no 5G corresponding emm_msg_decode() function, so here
...
...
@@ -1033,6 +1033,29 @@ void *nas_nrue_task(void *args_p)
}
}
static
void
handle_registration_accept
(
instance_t
instance
,
nr_ue_nas_t
*
nas
,
const
uint8_t
*
pdu_buffer
,
uint32_t
msg_length
)
{
LOG_I
(
NAS
,
"[UE] Received REGISTRATION ACCEPT message
\n
"
);
decodeRegistrationAccept
(
pdu_buffer
,
msg_length
,
nas
);
get_allowed_nssai
(
nas_allowed_nssai
,
pdu_buffer
,
msg_length
);
as_nas_info_t
initialNasMsg
=
{
0
};
generateRegistrationComplete
(
nas
,
&
initialNasMsg
,
NULL
);
if
(
initialNasMsg
.
length
>
0
)
{
send_nas_uplink_data_req
(
instance
,
&
initialNasMsg
);
LOG_I
(
NAS
,
"Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)
\n
"
);
}
const
int
nssai_idx
=
get_user_nssai_idx
(
nas_allowed_nssai
,
nas
);
if
(
nssai_idx
<
0
)
{
LOG_E
(
NAS
,
"NSSAI parameters not match with allowed NSSAI. Couldn't request PDU session.
\n
"
);
}
else
{
request_default_pdusession
(
instance
,
nssai_idx
);
}
}
void
*
nas_nrue
(
void
*
args_p
)
{
// Wait for a message or an event
...
...
@@ -1112,24 +1135,8 @@ void *nas_nrue(void *args_p)
int
msg_type
=
get_msg_type
(
pdu_buffer
,
NAS_CONN_ESTABLI_CNF
(
msg_p
).
nasMsg
.
length
);
if
(
msg_type
==
REGISTRATION_ACCEPT
)
{
LOG_I
(
NAS
,
"[UE] Received REGISTRATION ACCEPT message
\n
"
);
nr_ue_nas_t
*
nas
=
get_ue_nas_info
(
0
);
decodeRegistrationAccept
(
pdu_buffer
,
NAS_CONN_ESTABLI_CNF
(
msg_p
).
nasMsg
.
length
,
nas
);
get_allowed_nssai
(
nas_allowed_nssai
,
pdu_buffer
,
NAS_CONN_ESTABLI_CNF
(
msg_p
).
nasMsg
.
length
);
as_nas_info_t
initialNasMsg
=
{
0
};
generateRegistrationComplete
(
nas
,
&
initialNasMsg
,
NULL
);
if
(
initialNasMsg
.
length
>
0
)
{
send_nas_uplink_data_req
(
instance
,
&
initialNasMsg
);
LOG_I
(
NAS
,
"Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)
\n
"
);
}
const
int
nssai_idx
=
get_user_nssai_idx
(
nas_allowed_nssai
,
nas
);
if
(
nssai_idx
<
0
)
{
LOG_E
(
NAS
,
"NSSAI parameters not match with allowed NSSAI. Couldn't request PDU session.
\n
"
);
}
else
{
request_default_pdusession
(
instance
,
nssai_idx
);
}
handle_registration_accept
(
instance
,
nas
,
pdu_buffer
,
NAS_CONN_ESTABLI_CNF
(
msg_p
).
nasMsg
.
length
);
}
else
if
(
msg_type
==
FGS_PDU_SESSION_ESTABLISHMENT_ACC
)
{
capture_pdu_session_establishment_accept_msg
(
pdu_buffer
,
NAS_CONN_ESTABLI_CNF
(
msg_p
).
nasMsg
.
length
);
}
...
...
@@ -1198,21 +1205,7 @@ void *nas_nrue(void *args_p)
decodeDownlinkNASTransport
(
&
initialNasMsg
,
pdu_buffer
);
break
;
case
REGISTRATION_ACCEPT
:
LOG_I
(
NAS
,
"[UE] Received REGISTRATION ACCEPT message
\n
"
);
decodeRegistrationAccept
(
pdu_buffer
,
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
length
,
nas
);
as_nas_info_t
initialNasMsg
=
{
0
};
generateRegistrationComplete
(
nas
,
&
initialNasMsg
,
NULL
);
if
(
initialNasMsg
.
length
>
0
)
{
send_nas_uplink_data_req
(
instance
,
&
initialNasMsg
);
LOG_I
(
NAS
,
"Send NAS_UPLINK_DATA_REQ message(RegistrationComplete)
\n
"
);
}
const
int
nssai_idx
=
get_user_nssai_idx
(
nas_allowed_nssai
,
nas
);
if
(
nssai_idx
<
0
)
{
LOG_E
(
NAS
,
"NSSAI parameters not match with allowed NSSAI. Couldn't request PDU session.
\n
"
);
}
else
{
request_default_pdusession
(
instance
,
nssai_idx
);
}
handle_registration_accept
(
instance
,
nas
,
pdu_buffer
,
NAS_DOWNLINK_DATA_IND
(
msg_p
).
nasMsg
.
length
);
break
;
case
FGS_DEREGISTRATION_ACCEPT
:
LOG_I
(
NAS
,
"received deregistration accept
\n
"
);
...
...
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