Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
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
OpenXG
OpenXG-AMF
Commits
e8c4f0ce
Commit
e8c4f0ce
authored
Jan 23, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send Service Reject when there's no appropriate NAS/NGAP context
parent
d4e1f921
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
14 deletions
+25
-14
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+18
-7
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+1
-1
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+3
-3
src/nas/msgs/ServiceAccept.cpp
src/nas/msgs/ServiceAccept.cpp
+3
-3
No files found.
src/amf-app/amf_n1.cpp
View file @
e8c4f0ce
...
...
@@ -48,6 +48,7 @@
#include "SecurityModeComplete.hpp"
#include "ServiceAccept.hpp"
#include "ServiceRequest.hpp"
#include "ServiceReject.hpp"
#include "String2Value.hpp"
#include "UEAuthenticationCtx.h"
#include "ULNASTransport.hpp"
...
...
@@ -811,19 +812,28 @@ void amf_n1::service_request_handle(
return
;
}
// If there's no appropriate context, send Service Reject
if
(
!
nc
or
!
uc
or
!
nc
->
security_ctx
)
{
Logger
::
amf_n1
().
debug
(
"Cannot find NAS/UE context, send Service Reject to UE"
);
// TODO: service reject
uint8_t
nas
[
4
];
nas
[
0
]
=
EPD_5GS_MM_MSG
;
nas
[
1
]
=
PLAIN_5GS_MSG
;
nas
[
2
]
=
SERVICE_REJECT
;
nas
[
3
]
=
_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED
;
std
::
unique_ptr
<
ServiceReject
>
service_reject
=
std
::
make_unique
<
ServiceReject
>
();
service_reject
->
SetHeader
(
PLAIN_5GS_MSG
);
service_reject
->
Set5gmmCause
(
_5GMM_CAUSE_UE_IDENTITY_CANNOT_BE_DERIVED
);
uint8_t
buffer
[
BUFFER_SIZE_512
]
=
{
0
};
int
encoded_size
=
service_reject
->
Encode
(
buffer
,
BUFFER_SIZE_512
);
comUt
::
print_buffer
(
"amf_n1"
,
"Service-Reject message buffer"
,
buffer
,
encoded_size
);
if
(
!
encoded_size
)
{
Logger
::
amf_n1
().
error
(
"Encode Service-Reject message error"
);
return
;
}
std
::
shared_ptr
<
itti_dl_nas_transport
>
dnt
=
std
::
make_shared
<
itti_dl_nas_transport
>
(
TASK_AMF_N1
,
TASK_AMF_N2
);
dnt
->
nas
=
blk2bstr
(
nas
,
4
);
dnt
->
nas
=
blk2bstr
(
buffer
,
encoded_size
);
dnt
->
amf_ue_ngap_id
=
amf_ue_ngap_id
;
dnt
->
ran_ue_ngap_id
=
ran_ue_ngap_id
;
...
...
@@ -836,6 +846,7 @@ void amf_n1::service_request_handle(
return
;
}
// Otherwise, continue to process Service Request message
set_amf_ue_ngap_id_2_nas_context
(
amf_ue_ngap_id
,
nc
);
nas_secu_ctx
*
secu
=
nc
->
security_ctx
;
// TODO: remove naked ptr
if
(
!
secu
)
{
...
...
src/nas/common/Ie_Const.hpp
View file @
e8c4f0ce
...
...
@@ -130,7 +130,7 @@ constexpr uint8_t kIeiEpsBearerContextStatus = 0x60;
constexpr
uint8_t
kIeiUeRadioCapabilityId
=
0x67
;
constexpr
uint8_t
kIeiRejectedNssaiRr
=
0x69
;
constexpr
uint8_t
kIeiGprsTimer3T3324
=
0x6A
;
constexpr
uint8_t
kIeiGprsTimer3T3
3
48
=
0x6B
;
constexpr
uint8_t
kIeiGprsTimer3T3
4
48
=
0x6B
;
constexpr
uint8_t
kIeiGprsTimer3T3447
=
0x6C
;
constexpr
uint8_t
kIeiGprsTimer3T3512
=
0x5E
;
constexpr
uint8_t
kIeiGprsTimer3BackOffTimer
=
0x37
;
...
...
src/nas/msgs/RegistrationAccept.cpp
View file @
e8c4f0ce
...
...
@@ -1155,9 +1155,9 @@ int RegistrationAccept::Decode(uint8_t* buf, int len) {
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
case
kIeiGprsTimer3T3
3
48
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI 0x%x"
,
kIeiGprsTimer3T3
3
48
);
GprsTimer3
ie_T3448_value_tmp
(
kIeiGprsTimer3T3
3
48
);
case
kIeiGprsTimer3T3
4
48
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI 0x%x"
,
kIeiGprsTimer3T3
4
48
);
GprsTimer3
ie_T3448_value_tmp
(
kIeiGprsTimer3T3
4
48
);
if
((
decoded_result
=
ie_T3448_value_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
{
...
...
src/nas/msgs/ServiceAccept.cpp
View file @
e8c4f0ce
...
...
@@ -242,9 +242,9 @@ int ServiceAccept::Decode(uint8_t* buf, int len) {
Logger
::
nas_mm
().
debug
(
"Next IEI (0x%x)"
,
octet
);
}
break
;
case
kIeiGprsTimer3T3
3
48
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI 0x%x"
,
kIeiGprsTimer3T3
3
48
);
GprsTimer3
ie_T3448_value_tmp
(
kIeiGprsTimer3T3
3
48
);
case
kIeiGprsTimer3T3
4
48
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI 0x%x"
,
kIeiGprsTimer3T3
4
48
);
GprsTimer3
ie_T3448_value_tmp
(
kIeiGprsTimer3T3
4
48
);
if
((
decoded_result
=
ie_T3448_value_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
...
...
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