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
d4e1f921
Commit
d4e1f921
authored
Jan 23, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for Service Request
parent
91b14a14
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
36 deletions
+37
-36
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+27
-26
src/nas/msgs/ServiceAccept.cpp
src/nas/msgs/ServiceAccept.cpp
+4
-4
src/nas/msgs/ServiceAccept.hpp
src/nas/msgs/ServiceAccept.hpp
+4
-4
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+1
-1
src/nas/msgs/ServiceRequest.hpp
src/nas/msgs/ServiceRequest.hpp
+1
-1
No files found.
src/amf-app/amf_n1.cpp
View file @
d4e1f921
...
@@ -592,11 +592,13 @@ void amf_n1::nas_signalling_establishment_request_handle(
...
@@ -592,11 +592,13 @@ void amf_n1::nas_signalling_establishment_request_handle(
Logger
::
amf_n1
().
error
(
"No NAS Context found"
);
Logger
::
amf_n1
().
error
(
"No NAS Context found"
);
return
;
return
;
}
}
if
(
!
nc
->
security_ctx
)
{
/* if (!nc->security_ctx) {
Logger
::
amf_n1
().
error
(
"No Security Context found"
);
Logger::amf_n1().error("No Security Context found");
return
;
return;
}
}
*/
if
(
nc
&&
nc
->
security_ctx
)
nc
->
security_ctx
->
ul_count
.
seq_num
=
ulCount
;
if
(
nc
&&
nc
->
security_ctx
)
nc
->
security_ctx
->
ul_count
.
seq_num
=
ulCount
;
service_request_handle
(
nc
,
ran_ue_ngap_id
,
amf_ue_ngap_id
,
plain_msg
);
service_request_handle
(
nc
,
ran_ue_ngap_id
,
amf_ue_ngap_id
,
plain_msg
);
}
break
;
}
break
;
...
@@ -809,7 +811,7 @@ void amf_n1::service_request_handle(
...
@@ -809,7 +811,7 @@ void amf_n1::service_request_handle(
return
;
return
;
}
}
if
(
!
nc
or
!
uc
)
{
if
(
!
nc
or
!
uc
or
!
nc
->
security_ctx
)
{
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"Cannot find NAS/UE context, send Service Reject to UE"
);
"Cannot find NAS/UE context, send Service Reject to UE"
);
// TODO: service reject
// TODO: service reject
...
@@ -938,7 +940,7 @@ void amf_n1::service_request_handle(
...
@@ -938,7 +940,7 @@ void amf_n1::service_request_handle(
// No PDU Sessions To Be Activated
// No PDU Sessions To Be Activated
if
(
pdu_session_to_be_activated
.
size
()
==
0
)
{
if
(
pdu_session_to_be_activated
.
size
()
==
0
)
{
Logger
::
amf_n1
().
debug
(
"There is no PDU session to be activated"
);
Logger
::
amf_n1
().
debug
(
"There is no PDU session to be activated"
);
service_accept
->
setPDU_session_s
tatus
(
0x0000
);
service_accept
->
SetPduSessionS
tatus
(
0x0000
);
uint8_t
buffer
[
BUFFER_SIZE_256
];
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
service_accept
->
Encode
(
buffer
,
BUFFER_SIZE_256
);
int
encoded_size
=
service_accept
->
Encode
(
buffer
,
BUFFER_SIZE_256
);
bstring
protected_nas
=
nullptr
;
bstring
protected_nas
=
nullptr
;
...
@@ -978,9 +980,8 @@ void amf_n1::service_request_handle(
...
@@ -978,9 +980,8 @@ void amf_n1::service_request_handle(
std
::
shared_ptr
<
pdu_session_context
>
psc
=
{};
std
::
shared_ptr
<
pdu_session_context
>
psc
=
{};
service_accept
->
setPDU_session_status
(
service_accept
->
SetPduSessionStatus
(
service_request
->
getPduSessionStatus
());
service_request
->
getPduSessionStatus
());
service_accept
->
SetPduSessionReactivationResult
(
0x0000
);
service_accept
->
setPDU_session_reactivation_result
(
0x0000
);
uint8_t
pdu_session_id
=
pdu_session_to_be_activated
.
at
(
0
);
uint8_t
pdu_session_id
=
pdu_session_to_be_activated
.
at
(
0
);
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
pdu_session_id
,
psc
))
{
if
(
!
amf_app_inst
->
find_pdu_session_context
(
supi
,
pdu_session_id
,
psc
))
{
...
@@ -2550,8 +2551,8 @@ void amf_n1::security_mode_complete_handle(
...
@@ -2550,8 +2551,8 @@ void amf_n1::security_mode_complete_handle(
Logger
::
amf_n1
().
debug
(
"Allocated GUTI %s"
,
guti
.
c_str
());
Logger
::
amf_n1
().
debug
(
"Allocated GUTI %s"
,
guti
.
c_str
());
// TODO: remove hardcoded values
// TODO: remove hardcoded values
registration_accept
->
set_5GS_Network_Feature_
Support
(
0x01
,
0x00
);
registration_accept
->
Set5gsNetworkFeature
Support
(
0x01
,
0x00
);
// registration_accept->
setT3512_
Value(0x5, T3512_TIMER_VALUE_MIN);
// registration_accept->
SetT3512
Value(0x5, T3512_TIMER_VALUE_MIN);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
registration_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
registration_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
comUt
::
print_buffer
(
...
@@ -3364,7 +3365,7 @@ void amf_n1::run_mobility_registration_update_procedure(
...
@@ -3364,7 +3365,7 @@ void amf_n1::run_mobility_registration_update_procedure(
// Encoding REGISTRATION ACCEPT
// Encoding REGISTRATION ACCEPT
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
auto
reg_accept
=
std
::
make_unique
<
RegistrationAccept
>
();
initialize_registration_accept
(
reg_accept
);
initialize_registration_accept
(
reg_accept
);
reg_accept
->
set_5GS_Network_Feature_
Support
(
reg_accept
->
Set5gsNetworkFeature
Support
(
0x00
,
0x00
);
// TODO: remove hardcoded values
0x00
,
0x00
);
// TODO: remove hardcoded values
std
::
shared_ptr
<
pdu_session_context
>
psc
=
{};
std
::
shared_ptr
<
pdu_session_context
>
psc
=
{};
...
@@ -3463,14 +3464,14 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3463,14 +3464,14 @@ void amf_n1::run_periodic_registration_update_procedure(
amf_cfg
.
guami
.
AmfSetID
,
amf_cfg
.
guami
.
AmfPointer
,
uc
->
tmsi
);
amf_cfg
.
guami
.
AmfSetID
,
amf_cfg
.
guami
.
AmfPointer
,
uc
->
tmsi
);
if
(
pdu_session_status
==
0x0000
)
{
if
(
pdu_session_status
==
0x0000
)
{
reg_accept
->
setPDU_session_s
tatus
(
0x0000
);
reg_accept
->
SetPduSessionS
tatus
(
0x0000
);
}
else
{
}
else
{
reg_accept
->
setPDU_session_s
tatus
(
pdu_session_status
);
reg_accept
->
SetPduSessionS
tatus
(
pdu_session_status
);
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
}
}
reg_accept
->
set_5GS_Network_Feature_
Support
(
0x01
,
0x00
);
reg_accept
->
Set5gsNetworkFeature
Support
(
0x01
,
0x00
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
comUt
::
print_buffer
(
...
@@ -3533,14 +3534,14 @@ void amf_n1::run_periodic_registration_update_procedure(
...
@@ -3533,14 +3534,14 @@ void amf_n1::run_periodic_registration_update_procedure(
uint16_t
pdu_session_status
=
0xffff
;
uint16_t
pdu_session_status
=
0xffff
;
pdu_session_status
=
registration_request
->
getPduSessionStatus
();
pdu_session_status
=
registration_request
->
getPduSessionStatus
();
if
(
pdu_session_status
==
0x0000
)
{
if
(
pdu_session_status
==
0x0000
)
{
reg_accept
->
setPDU_session_s
tatus
(
0x0000
);
reg_accept
->
SetPduSessionS
tatus
(
0x0000
);
}
else
{
}
else
{
reg_accept
->
setPDU_session_s
tatus
(
pdu_session_status
);
reg_accept
->
SetPduSessionS
tatus
(
pdu_session_status
);
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
"PDU Session Status 0x%02x"
,
htonl
(
pdu_session_status
));
}
}
reg_accept
->
set_5GS_Network_Feature_
Support
(
0x01
,
0x00
);
reg_accept
->
Set5gsNetworkFeature
Support
(
0x01
,
0x00
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
reg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
comUt
::
print_buffer
(
...
@@ -4037,10 +4038,10 @@ void amf_n1::initialize_registration_accept(
...
@@ -4037,10 +4038,10 @@ void amf_n1::initialize_registration_accept(
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
)
{
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
)
{
// TODO: to be updated with the function below
// TODO: to be updated with the function below
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
set5GS
RegistrationResult
(
registration_accept
->
Set5gs
RegistrationResult
(
false
,
false
,
false
,
false
,
false
,
false
,
0x01
);
// 3GPP Access
0x01
);
// 3GPP Access
registration_accept
->
setT3512_
Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
registration_accept
->
SetT3512
Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
std
::
vector
<
p_tai_t
>
tai_list
;
std
::
vector
<
p_tai_t
>
tai_list
;
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
for
(
auto
p
:
amf_cfg
.
plmn_list
)
{
...
@@ -4070,7 +4071,7 @@ void amf_n1::initialize_registration_accept(
...
@@ -4070,7 +4071,7 @@ void amf_n1::initialize_registration_accept(
nssai
.
push_back
(
snssai
);
nssai
.
push_back
(
snssai
);
}
}
}
}
registration_accept
->
setALLOWED_NSSAI
(
nssai
);
registration_accept
->
SetAllowedNssai
(
nssai
);
return
;
return
;
}
}
...
@@ -4079,10 +4080,10 @@ void amf_n1::initialize_registration_accept(
...
@@ -4079,10 +4080,10 @@ void amf_n1::initialize_registration_accept(
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
,
std
::
unique_ptr
<
nas
::
RegistrationAccept
>&
registration_accept
,
const
std
::
shared_ptr
<
nas_context
>&
nc
)
{
const
std
::
shared_ptr
<
nas_context
>&
nc
)
{
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
set5GS
RegistrationResult
(
registration_accept
->
Set5gs
RegistrationResult
(
false
,
false
,
false
,
false
,
false
,
false
,
0x01
);
// 3GPP Access
0x01
);
// 3GPP Access
registration_accept
->
setT3512_
Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
registration_accept
->
SetT3512
Value
(
0x5
,
T3512_TIMER_VALUE_MIN
);
// Find UE Context
// Find UE Context
std
::
shared_ptr
<
ue_context
>
uc
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
...
@@ -4163,9 +4164,9 @@ void amf_n1::initialize_registration_accept(
...
@@ -4163,9 +4164,9 @@ void amf_n1::initialize_registration_accept(
}
}
}
}
registration_accept
->
setALLOWED_NSSAI
(
allowed_nssais
);
registration_accept
->
SetAllowedNssai
(
allowed_nssais
);
registration_accept
->
setRejected_NSSAI
(
rejected_nssais
);
registration_accept
->
SetRejectedNssai
(
rejected_nssais
);
registration_accept
->
setCONFIGURED_NSSAI
(
allowed_nssais
);
// TODO
registration_accept
->
SetConfiguredNssai
(
allowed_nssais
);
// TODO
return
;
return
;
}
}
...
...
src/nas/msgs/ServiceAccept.cpp
View file @
d4e1f921
...
@@ -42,18 +42,18 @@ void ServiceAccept::SetHeader(uint8_t security_header_type) {
...
@@ -42,18 +42,18 @@ void ServiceAccept::SetHeader(uint8_t security_header_type) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceAccept
::
setPDU_session_s
tatus
(
uint16_t
value
)
{
void
ServiceAccept
::
SetPduSessionS
tatus
(
uint16_t
value
)
{
ie_PDU_session_status
=
std
::
make_optional
<
PDUSessionStatus
>
(
value
);
ie_PDU_session_status
=
std
::
make_optional
<
PDUSessionStatus
>
(
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceAccept
::
setPDU_session_reactivation_r
esult
(
uint16_t
value
)
{
void
ServiceAccept
::
SetPduSessionReactivationR
esult
(
uint16_t
value
)
{
ie_pdu_session_reactivation_result
=
ie_pdu_session_reactivation_result
=
std
::
make_optional
<
PDU_Session_Reactivation_Result
>
(
value
);
std
::
make_optional
<
PDU_Session_Reactivation_Result
>
(
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceAccept
::
setPDU_session_reactivation_result_error_c
ause
(
void
ServiceAccept
::
SetPduSessionReactivationResultErrorC
ause
(
uint8_t
session_id
,
uint8_t
value
)
{
uint8_t
session_id
,
uint8_t
value
)
{
ie_pdu_session_reactivation_result_error_cause
=
ie_pdu_session_reactivation_result_error_cause
=
std
::
make_optional
<
PDU_Session_Reactivation_Result_Error_Cause
>
(
std
::
make_optional
<
PDU_Session_Reactivation_Result_Error_Cause
>
(
...
@@ -66,7 +66,7 @@ void ServiceAccept::SetEapMessage(bstring eap) {
...
@@ -66,7 +66,7 @@ void ServiceAccept::SetEapMessage(bstring eap) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceAccept
::
setT3448_
Value
(
uint8_t
unit
,
uint8_t
value
)
{
void
ServiceAccept
::
SetT3448
Value
(
uint8_t
unit
,
uint8_t
value
)
{
ie_T3448_value
=
std
::
make_optional
<
GprsTimer3
>
(
0x6B
,
unit
,
value
);
ie_T3448_value
=
std
::
make_optional
<
GprsTimer3
>
(
0x6B
,
unit
,
value
);
}
}
...
...
src/nas/msgs/ServiceAccept.hpp
View file @
d4e1f921
...
@@ -40,20 +40,20 @@ class ServiceAccept : public NasMmPlainHeader {
...
@@ -40,20 +40,20 @@ class ServiceAccept : public NasMmPlainHeader {
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
);
void
setPDU_session_s
tatus
(
uint16_t
value
);
void
SetPduSessionS
tatus
(
uint16_t
value
);
// TODO: Get
// TODO: Get
void
setPDU_session_reactivation_r
esult
(
uint16_t
);
void
SetPduSessionReactivationR
esult
(
uint16_t
);
// TODO: Get
// TODO: Get
void
setPDU_session_reactivation_result_error_c
ause
(
void
SetPduSessionReactivationResultErrorC
ause
(
uint8_t
session_id
,
uint8_t
value
);
uint8_t
session_id
,
uint8_t
value
);
// TODO: Get
// TODO: Get
void
SetEapMessage
(
bstring
eap
);
void
SetEapMessage
(
bstring
eap
);
// TODO: Get
// TODO: Get
void
setT3448_
Value
(
uint8_t
unit
,
uint8_t
value
);
void
SetT3448
Value
(
uint8_t
unit
,
uint8_t
value
);
// TODO: Get
// TODO: Get
private:
private:
...
...
src/nas/msgs/ServiceRequest.cpp
View file @
d4e1f921
...
@@ -67,7 +67,7 @@ void ServiceRequest::setUplink_data_status(uint16_t value) {
...
@@ -67,7 +67,7 @@ void ServiceRequest::setUplink_data_status(uint16_t value) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceRequest
::
setPDU_session_s
tatus
(
uint16_t
value
)
{
void
ServiceRequest
::
SetPduSessionS
tatus
(
uint16_t
value
)
{
ie_PDU_session_status
=
std
::
make_optional
<
PDUSessionStatus
>
(
value
);
ie_PDU_session_status
=
std
::
make_optional
<
PDUSessionStatus
>
(
value
);
}
}
...
...
src/nas/msgs/ServiceRequest.hpp
View file @
d4e1f921
...
@@ -51,7 +51,7 @@ class ServiceRequest : public NasMmPlainHeader {
...
@@ -51,7 +51,7 @@ class ServiceRequest : public NasMmPlainHeader {
void
setUplink_data_status
(
uint16_t
value
);
void
setUplink_data_status
(
uint16_t
value
);
uint16_t
getUplinkDataStatus
();
uint16_t
getUplinkDataStatus
();
void
setPDU_session_s
tatus
(
uint16_t
value
);
void
SetPduSessionS
tatus
(
uint16_t
value
);
uint16_t
getPduSessionStatus
();
uint16_t
getPduSessionStatus
();
void
setAllowed_PDU_Session_Status
(
uint16_t
value
);
void
setAllowed_PDU_Session_Status
(
uint16_t
value
);
...
...
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