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
e30ea609
Commit
e30ea609
authored
2 years ago
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update UL NAS Transport
parent
489e0fa6
Changes
50
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
423 additions
and
329 deletions
+423
-329
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+3
-3
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+18
-18
src/nas/common/Ie_Const.hpp
src/nas/common/Ie_Const.hpp
+2
-2
src/nas/ies/Payload_Container.cpp
src/nas/ies/Payload_Container.cpp
+13
-0
src/nas/ies/Payload_Container.hpp
src/nas/ies/Payload_Container.hpp
+1
-0
src/nas/ies/S_NSSAI.hpp
src/nas/ies/S_NSSAI.hpp
+1
-1
src/nas/msgs/AuthenticationFailure.cpp
src/nas/msgs/AuthenticationFailure.cpp
+2
-2
src/nas/msgs/AuthenticationFailure.hpp
src/nas/msgs/AuthenticationFailure.hpp
+1
-1
src/nas/msgs/AuthenticationReject.cpp
src/nas/msgs/AuthenticationReject.cpp
+1
-1
src/nas/msgs/AuthenticationReject.hpp
src/nas/msgs/AuthenticationReject.hpp
+1
-1
src/nas/msgs/AuthenticationRequest.cpp
src/nas/msgs/AuthenticationRequest.cpp
+1
-1
src/nas/msgs/AuthenticationRequest.hpp
src/nas/msgs/AuthenticationRequest.hpp
+1
-1
src/nas/msgs/AuthenticationResponse.cpp
src/nas/msgs/AuthenticationResponse.cpp
+1
-1
src/nas/msgs/AuthenticationResponse.hpp
src/nas/msgs/AuthenticationResponse.hpp
+1
-1
src/nas/msgs/AuthenticationResult.cpp
src/nas/msgs/AuthenticationResult.cpp
+2
-2
src/nas/msgs/AuthenticationResult.hpp
src/nas/msgs/AuthenticationResult.hpp
+1
-1
src/nas/msgs/ConfigurationUpdateCommand.cpp
src/nas/msgs/ConfigurationUpdateCommand.cpp
+2
-2
src/nas/msgs/ConfigurationUpdateCommand.hpp
src/nas/msgs/ConfigurationUpdateCommand.hpp
+1
-1
src/nas/msgs/DLNASTransport.cpp
src/nas/msgs/DLNASTransport.cpp
+6
-6
src/nas/msgs/DLNASTransport.hpp
src/nas/msgs/DLNASTransport.hpp
+5
-5
src/nas/msgs/DeregistrationAccept.cpp
src/nas/msgs/DeregistrationAccept.cpp
+2
-2
src/nas/msgs/DeregistrationAccept.hpp
src/nas/msgs/DeregistrationAccept.hpp
+1
-1
src/nas/msgs/DeregistrationRequest.cpp
src/nas/msgs/DeregistrationRequest.cpp
+2
-2
src/nas/msgs/DeregistrationRequest.hpp
src/nas/msgs/DeregistrationRequest.hpp
+1
-1
src/nas/msgs/IdentityRequest.cpp
src/nas/msgs/IdentityRequest.cpp
+2
-2
src/nas/msgs/IdentityRequest.hpp
src/nas/msgs/IdentityRequest.hpp
+1
-1
src/nas/msgs/IdentityResponse.cpp
src/nas/msgs/IdentityResponse.cpp
+2
-2
src/nas/msgs/IdentityResponse.hpp
src/nas/msgs/IdentityResponse.hpp
+1
-1
src/nas/msgs/NasMmPlainHeader.cpp
src/nas/msgs/NasMmPlainHeader.cpp
+1
-1
src/nas/msgs/NasMmPlainHeader.hpp
src/nas/msgs/NasMmPlainHeader.hpp
+1
-1
src/nas/msgs/RegistrationAccept.cpp
src/nas/msgs/RegistrationAccept.cpp
+1
-1
src/nas/msgs/RegistrationAccept.hpp
src/nas/msgs/RegistrationAccept.hpp
+1
-1
src/nas/msgs/RegistrationComplete.cpp
src/nas/msgs/RegistrationComplete.cpp
+2
-2
src/nas/msgs/RegistrationComplete.hpp
src/nas/msgs/RegistrationComplete.hpp
+1
-1
src/nas/msgs/RegistrationReject.cpp
src/nas/msgs/RegistrationReject.cpp
+1
-1
src/nas/msgs/RegistrationReject.hpp
src/nas/msgs/RegistrationReject.hpp
+1
-1
src/nas/msgs/RegistrationRequest.cpp
src/nas/msgs/RegistrationRequest.cpp
+7
-7
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+7
-7
src/nas/msgs/SecurityModeCommand.cpp
src/nas/msgs/SecurityModeCommand.cpp
+1
-1
src/nas/msgs/SecurityModeCommand.hpp
src/nas/msgs/SecurityModeCommand.hpp
+1
-1
src/nas/msgs/SecurityModeComplete.cpp
src/nas/msgs/SecurityModeComplete.cpp
+14
-12
src/nas/msgs/SecurityModeComplete.hpp
src/nas/msgs/SecurityModeComplete.hpp
+5
-5
src/nas/msgs/SecurityModeReject.cpp
src/nas/msgs/SecurityModeReject.cpp
+2
-2
src/nas/msgs/SecurityModeReject.hpp
src/nas/msgs/SecurityModeReject.hpp
+1
-1
src/nas/msgs/ServiceAccept.cpp
src/nas/msgs/ServiceAccept.cpp
+2
-2
src/nas/msgs/ServiceAccept.hpp
src/nas/msgs/ServiceAccept.hpp
+1
-1
src/nas/msgs/ServiceRequest.cpp
src/nas/msgs/ServiceRequest.cpp
+4
-4
src/nas/msgs/ServiceRequest.hpp
src/nas/msgs/ServiceRequest.hpp
+3
-3
src/nas/msgs/ULNASTransport.cpp
src/nas/msgs/ULNASTransport.cpp
+244
-173
src/nas/msgs/ULNASTransport.hpp
src/nas/msgs/ULNASTransport.hpp
+46
-39
No files found.
src/amf-app/amf_app.cpp
View file @
e30ea609
...
@@ -349,9 +349,9 @@ void amf_app::handle_itti_message(
...
@@ -349,9 +349,9 @@ void amf_app::handle_itti_message(
Logger
::
amf_app
().
info
(
"Handle ITTI N1N2 Message Transfer Request"
);
Logger
::
amf_app
().
info
(
"Handle ITTI N1N2 Message Transfer Request"
);
// Encode DL NAS TRANSPORT message(NAS message)
// Encode DL NAS TRANSPORT message(NAS message)
auto
dl
=
std
::
make_unique
<
DLNASTransport
>
();
auto
dl
=
std
::
make_unique
<
DLNASTransport
>
();
dl
->
s
etHeader
(
PLAIN_5GS_MSG
);
dl
->
S
etHeader
(
PLAIN_5GS_MSG
);
dl
->
setPayload_Container_
Type
(
N1_SM_INFORMATION
);
dl
->
SetPayloadContainer
Type
(
N1_SM_INFORMATION
);
dl
->
s
etPayload_Container
(
dl
->
S
etPayload_Container
(
(
uint8_t
*
)
bdata
(
bstrcpy
(
itti_msg
.
n1sm
)),
blength
(
itti_msg
.
n1sm
));
(
uint8_t
*
)
bdata
(
bstrcpy
(
itti_msg
.
n1sm
)),
blength
(
itti_msg
.
n1sm
));
dl
->
setPDUSessionId
(
itti_msg
.
pdu_session_id
);
dl
->
setPDUSessionId
(
itti_msg
.
pdu_session_id
);
...
...
This diff is collapsed.
Click to expand it.
src/amf-app/amf_n1.cpp
View file @
e30ea609
...
@@ -846,7 +846,7 @@ void amf_n1::service_request_handle(
...
@@ -846,7 +846,7 @@ void amf_n1::service_request_handle(
// bdestroy_wrapper(&nas);
// bdestroy_wrapper(&nas);
std
::
unique_ptr
<
ServiceAccept
>
service_accept
=
std
::
unique_ptr
<
ServiceAccept
>
service_accept
=
std
::
make_unique
<
ServiceAccept
>
();
std
::
make_unique
<
ServiceAccept
>
();
service_accept
->
s
etHeader
(
PLAIN_5GS_MSG
);
service_accept
->
S
etHeader
(
PLAIN_5GS_MSG
);
string
supi
=
"imsi-"
+
nc
->
imsi
;
string
supi
=
"imsi-"
+
nc
->
imsi
;
uc
->
supi
=
supi
;
uc
->
supi
=
supi
;
set_supi_2_amf_id
(
supi
,
amf_ue_ngap_id
);
set_supi_2_amf_id
(
supi
,
amf_ue_ngap_id
);
...
@@ -885,7 +885,7 @@ void amf_n1::service_request_handle(
...
@@ -885,7 +885,7 @@ void amf_n1::service_request_handle(
if
(
pdu_session_status
==
0
)
{
if
(
pdu_session_status
==
0
)
{
// Get PDU Session Status from NAS Message Container if available
// Get PDU Session Status from NAS Message Container if available
bstring
plain_msg
=
nullptr
;
bstring
plain_msg
=
nullptr
;
if
(
service_request
->
g
etNasMessageContainer
(
plain_msg
))
{
if
(
service_request
->
G
etNasMessageContainer
(
plain_msg
))
{
if
(
blength
(
plain_msg
)
<
NAS_MESSAGE_MIN_LENGTH
)
{
if
(
blength
(
plain_msg
)
<
NAS_MESSAGE_MIN_LENGTH
)
{
Logger
::
amf_n1
().
debug
(
"NAS message is too short!"
);
Logger
::
amf_n1
().
debug
(
"NAS message is too short!"
);
bdestroy_wrapper
(
&
plain_msg
);
bdestroy_wrapper
(
&
plain_msg
);
...
@@ -1335,7 +1335,7 @@ void amf_n1::registration_request_handle(
...
@@ -1335,7 +1335,7 @@ void amf_n1::registration_request_handle(
bstring
nas_msg
=
nullptr
;
bstring
nas_msg
=
nullptr
;
bool
is_messagecontainer
=
bool
is_messagecontainer
=
registration_request
->
g
etNasMessageContainer
(
nas_msg
);
registration_request
->
G
etNasMessageContainer
(
nas_msg
);
if
(
is_messagecontainer
)
{
if
(
is_messagecontainer
)
{
std
::
unique_ptr
<
RegistrationRequest
>
registration_request_msg_container
=
std
::
unique_ptr
<
RegistrationRequest
>
registration_request_msg_container
=
...
@@ -1595,7 +1595,7 @@ void amf_n1::send_registration_reject_msg(
...
@@ -1595,7 +1595,7 @@ void amf_n1::send_registration_reject_msg(
Logger
::
amf_n1
().
debug
(
"Create Registration Reject and send to UE"
);
Logger
::
amf_n1
().
debug
(
"Create Registration Reject and send to UE"
);
std
::
unique_ptr
<
RegistrationReject
>
registration_reject
=
std
::
unique_ptr
<
RegistrationReject
>
registration_reject
=
std
::
make_unique
<
RegistrationReject
>
();
std
::
make_unique
<
RegistrationReject
>
();
registration_reject
->
s
etHeader
(
PLAIN_5GS_MSG
);
registration_reject
->
S
etHeader
(
PLAIN_5GS_MSG
);
registration_reject
->
set_5GMM_Cause
(
cause_value
);
registration_reject
->
set_5GMM_Cause
(
cause_value
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
registration_reject
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
int
encoded_size
=
registration_reject
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
...
@@ -1677,7 +1677,7 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
...
@@ -1677,7 +1677,7 @@ void amf_n1::run_registration_procedure(std::shared_ptr<nas_context>& nc) {
nc
->
is_auth_vectors_present
=
false
;
nc
->
is_auth_vectors_present
=
false
;
std
::
unique_ptr
<
IdentityRequest
>
identity_request
=
std
::
unique_ptr
<
IdentityRequest
>
identity_request
=
std
::
make_unique
<
IdentityRequest
>
();
std
::
make_unique
<
IdentityRequest
>
();
identity_request
->
s
etHeader
(
PLAIN_5GS_MSG
);
identity_request
->
S
etHeader
(
PLAIN_5GS_MSG
);
identity_request
->
set_5GS_Identity_Type
(
SUCI
);
identity_request
->
set_5GS_Identity_Type
(
SUCI
);
uint8_t
buffer
[
BUFFER_SIZE_256
];
uint8_t
buffer
[
BUFFER_SIZE_256
];
int
encoded_size
=
identity_request
->
Encode
(
buffer
,
BUFFER_SIZE_256
);
int
encoded_size
=
identity_request
->
Encode
(
buffer
,
BUFFER_SIZE_256
);
...
@@ -2110,7 +2110,7 @@ bool amf_n1::start_authentication_procedure(
...
@@ -2110,7 +2110,7 @@ bool amf_n1::start_authentication_procedure(
nc
->
is_common_procedure_for_authentication_running
=
true
;
nc
->
is_common_procedure_for_authentication_running
=
true
;
std
::
unique_ptr
<
AuthenticationRequest
>
auth_request
=
std
::
unique_ptr
<
AuthenticationRequest
>
auth_request
=
std
::
make_unique
<
AuthenticationRequest
>
();
std
::
make_unique
<
AuthenticationRequest
>
();
auth_request
->
s
etHeader
(
PLAIN_5GS_MSG
);
auth_request
->
S
etHeader
(
PLAIN_5GS_MSG
);
auth_request
->
SetNgKsi
(
NAS_KEY_SET_IDENTIFIER_NATIVE
,
ngksi
);
auth_request
->
SetNgKsi
(
NAS_KEY_SET_IDENTIFIER_NATIVE
,
ngksi
);
uint8_t
abba
[
2
];
uint8_t
abba
[
2
];
abba
[
0
]
=
0x00
;
abba
[
0
]
=
0x00
;
...
@@ -2393,7 +2393,7 @@ bool amf_n1::start_security_mode_control_procedure(
...
@@ -2393,7 +2393,7 @@ bool amf_n1::start_security_mode_control_procedure(
std
::
unique_ptr
<
SecurityModeCommand
>
smc
=
std
::
unique_ptr
<
SecurityModeCommand
>
smc
=
std
::
make_unique
<
SecurityModeCommand
>
();
std
::
make_unique
<
SecurityModeCommand
>
();
smc
->
s
etHeader
(
PLAIN_5GS_MSG
);
smc
->
S
etHeader
(
PLAIN_5GS_MSG
);
smc
->
SetNasSecurityAlgorithms
(
amf_nea
,
amf_nia
);
smc
->
SetNasSecurityAlgorithms
(
amf_nea
,
amf_nia
);
Logger
::
amf_n1
().
debug
(
"Encoded ngKSI 0x%x"
,
nc
->
ngKsi
);
Logger
::
amf_n1
().
debug
(
"Encoded ngKSI 0x%x"
,
nc
->
ngKsi
);
smc
->
SetNgKsi
(
NAS_KEY_SET_IDENTIFIER_NATIVE
,
nc
->
ngKsi
&
0x07
);
smc
->
SetNgKsi
(
NAS_KEY_SET_IDENTIFIER_NATIVE
,
nc
->
ngKsi
&
0x07
);
...
@@ -2483,7 +2483,7 @@ void amf_n1::security_mode_complete_handle(
...
@@ -2483,7 +2483,7 @@ void amf_n1::security_mode_complete_handle(
(
uint8_t
*
)
bdata
(
nas_msg
),
blength
(
nas_msg
));
(
uint8_t
*
)
bdata
(
nas_msg
),
blength
(
nas_msg
));
bstring
nas_msg_container
=
nullptr
;
bstring
nas_msg_container
=
nullptr
;
if
(
security_mode_complete
->
g
etNasMessageContainer
(
nas_msg_container
))
{
if
(
security_mode_complete
->
G
etNasMessageContainer
(
nas_msg_container
))
{
comUt
::
print_buffer
(
comUt
::
print_buffer
(
"amf_n1"
,
"NAS Message Container"
,
(
uint8_t
*
)
bdata
(
nas_msg_container
),
"amf_n1"
,
"NAS Message Container"
,
(
uint8_t
*
)
bdata
(
nas_msg_container
),
blength
(
nas_msg_container
));
blength
(
nas_msg_container
));
...
@@ -2764,7 +2764,7 @@ void amf_n1::registration_complete_handle(
...
@@ -2764,7 +2764,7 @@ void amf_n1::registration_complete_handle(
auto configuration_update_command =
auto configuration_update_command =
std::make_unique<ConfigurationUpdateCommand>();
std::make_unique<ConfigurationUpdateCommand>();
configuration_update_command->
s
etHeader(PLAIN_5GS_MSG);
configuration_update_command->
S
etHeader(PLAIN_5GS_MSG);
configuration_update_command->setFullNameForNetwork("Testing"); // TODO:
configuration_update_command->setFullNameForNetwork("Testing"); // TODO:
configuration_update_command->setShortNameForNetwork("Testing"); // TODO:
configuration_update_command->setShortNameForNetwork("Testing"); // TODO:
...
@@ -3103,7 +3103,7 @@ void amf_n1::ue_initiate_de_registration_handle(
...
@@ -3103,7 +3103,7 @@ void amf_n1::ue_initiate_de_registration_handle(
if
((
deregType
&
DEREGISTRATION_TYPE_MASK
)
==
0
)
{
if
((
deregType
&
DEREGISTRATION_TYPE_MASK
)
==
0
)
{
// Prepare DeregistrationAccept
// Prepare DeregistrationAccept
auto
dereg_accept
=
std
::
make_unique
<
DeregistrationAccept
>
();
auto
dereg_accept
=
std
::
make_unique
<
DeregistrationAccept
>
();
dereg_accept
->
s
etHeader
(
PLAIN_5GS_MSG
);
dereg_accept
->
S
etHeader
(
PLAIN_5GS_MSG
);
uint8_t
buffer
[
BUFFER_SIZE_512
]
=
{
0
};
uint8_t
buffer
[
BUFFER_SIZE_512
]
=
{
0
};
int
encoded_size
=
dereg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_512
);
int
encoded_size
=
dereg_accept
->
Encode
(
buffer
,
BUFFER_SIZE_512
);
...
@@ -3221,9 +3221,9 @@ void amf_n1::ul_nas_transport_handle(
...
@@ -3221,9 +3221,9 @@ void amf_n1::ul_nas_transport_handle(
Logger
::
amf_n1
().
debug
(
"Handling UL NAS Transport"
);
Logger
::
amf_n1
().
debug
(
"Handling UL NAS Transport"
);
auto
ul_nas
=
std
::
make_unique
<
ULNASTransport
>
();
auto
ul_nas
=
std
::
make_unique
<
ULNASTransport
>
();
ul_nas
->
Decode
(
NULL
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
ul_nas
->
Decode
(
NULL
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
uint8_t
payload_type
=
ul_nas
->
g
etPayloadContainerType
();
uint8_t
payload_type
=
ul_nas
->
G
etPayloadContainerType
();
uint8_t
pdu_session_id
=
ul_nas
->
g
etPduSessionId
();
uint8_t
pdu_session_id
=
ul_nas
->
G
etPduSessionId
();
uint8_t
request_type
=
ul_nas
->
g
etRequestType
();
uint8_t
request_type
=
ul_nas
->
G
etRequestType
();
bstring
sm_msg
=
nullptr
;
bstring
sm_msg
=
nullptr
;
...
@@ -3231,7 +3231,7 @@ void amf_n1::ul_nas_transport_handle(
...
@@ -3231,7 +3231,7 @@ void amf_n1::ul_nas_transport_handle(
((
request_type
&
0x07
)
==
EXISTING_PDU_SESSION
))
{
((
request_type
&
0x07
)
==
EXISTING_PDU_SESSION
))
{
// SNSSAI
// SNSSAI
SNSSAI_t
snssai
=
{};
SNSSAI_t
snssai
=
{};
if
(
!
ul_nas
->
getSn
ssai
(
snssai
))
{
// If no SNSSAI in this message, use the
if
(
!
ul_nas
->
GetSN
ssai
(
snssai
))
{
// If no SNSSAI in this message, use the
// one in Registration Request
// one in Registration Request
Logger
::
amf_n1
().
debug
(
Logger
::
amf_n1
().
debug
(
"No Requested NSSAI available in ULNASTransport, use NSSAI from "
"No Requested NSSAI available in ULNASTransport, use NSSAI from "
...
@@ -3280,7 +3280,7 @@ void amf_n1::ul_nas_transport_handle(
...
@@ -3280,7 +3280,7 @@ void amf_n1::ul_nas_transport_handle(
switch
(
payload_type
)
{
switch
(
payload_type
)
{
case
N1_SM_INFORMATION
:
{
case
N1_SM_INFORMATION
:
{
if
(
!
ul_nas
->
g
etPayloadContainer
(
sm_msg
))
{
if
(
!
ul_nas
->
G
etPayloadContainer
(
sm_msg
))
{
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
return
;
return
;
}
}
...
@@ -3315,7 +3315,7 @@ void amf_n1::ul_nas_transport_handle(
...
@@ -3315,7 +3315,7 @@ void amf_n1::ul_nas_transport_handle(
}
else
{
}
else
{
switch
(
payload_type
)
{
switch
(
payload_type
)
{
case
N1_SM_INFORMATION
:
{
case
N1_SM_INFORMATION
:
{
if
(
!
ul_nas
->
g
etPayloadContainer
(
sm_msg
))
{
if
(
!
ul_nas
->
G
etPayloadContainer
(
sm_msg
))
{
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
return
;
return
;
}
}
...
@@ -4034,7 +4034,7 @@ void amf_n1::get_pdu_session_to_be_activated(
...
@@ -4034,7 +4034,7 @@ void amf_n1::get_pdu_session_to_be_activated(
void
amf_n1
::
initialize_registration_accept
(
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
->
s
etHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
S
etHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
set5GSRegistrationResult
(
registration_accept
->
set5GSRegistrationResult
(
false
,
false
,
false
,
false
,
false
,
false
,
0x01
);
// 3GPP Access
0x01
);
// 3GPP Access
...
@@ -4076,7 +4076,7 @@ void amf_n1::initialize_registration_accept(
...
@@ -4076,7 +4076,7 @@ void amf_n1::initialize_registration_accept(
void
amf_n1
::
initialize_registration_accept
(
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
->
s
etHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
S
etHeader
(
PLAIN_5GS_MSG
);
registration_accept
->
set5GSRegistrationResult
(
registration_accept
->
set5GSRegistrationResult
(
false
,
false
,
false
,
false
,
false
,
false
,
0x01
);
// 3GPP Access
0x01
);
// 3GPP Access
...
...
This diff is collapsed.
Click to expand it.
src/nas/common/Ie_Const.hpp
View file @
e30ea609
...
@@ -143,8 +143,8 @@ constexpr uint8_t kIeiSorTransparentContainer = 0x73;
...
@@ -143,8 +143,8 @@ constexpr uint8_t kIeiSorTransparentContainer = 0x73;
constexpr
uint8_t
kIeiLadnIndication
=
0x74
;
constexpr
uint8_t
kIeiLadnIndication
=
0x74
;
constexpr
uint8_t
kIeiLadnInformation
=
0x79
;
constexpr
uint8_t
kIeiLadnInformation
=
0x79
;
constexpr
uint8_t
kIei5gGuti
=
0x77
;
constexpr
uint8_t
kIei5gGuti
=
0x77
;
constexpr
uint8_t
kIeiImeisv
=
0x77
;
//
constexpr uint8_t kIeiImeisv = 0x77;
constexpr
uint8_t
kIeiNonImeisvPei
=
0x78
;
//
constexpr uint8_t kIeiNonImeisvPei = 0x78;
constexpr
uint8_t
kIeiEapMessage
=
0x78
;
constexpr
uint8_t
kIeiEapMessage
=
0x78
;
constexpr
uint8_t
kIeiPayloadContainer
=
0x7b
;
constexpr
uint8_t
kIeiPayloadContainer
=
0x7b
;
This diff is collapsed.
Click to expand it.
src/nas/ies/Payload_Container.cpp
View file @
e30ea609
...
@@ -103,6 +103,19 @@ void Payload_Container::setValue(uint8_t iei, uint8_t value) {
...
@@ -103,6 +103,19 @@ void Payload_Container::setValue(uint8_t iei, uint8_t value) {
}
}
*/
*/
//------------------------------------------------------------------------------
void
Payload_Container
::
SetValue
(
const
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
int
length
=
1
;
// for number of entries
// CONTENT.assign(content.begin(), content.end());
CONTENT
=
std
::
optional
<
std
::
vector
<
PayloadContainerEntry
>>
(
content
);
for
(
int
i
=
0
;
i
<
content
.
size
();
i
++
)
{
length
=
length
+
2
+
content
.
at
(
i
).
length
;
// 2 for Length of Payload container entry
}
SetLengthIndicator
(
length
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
Payload_Container
::
GetValue
(
bool
Payload_Container
::
GetValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
const
{
std
::
vector
<
PayloadContainerEntry
>&
content
)
const
{
...
...
This diff is collapsed.
Click to expand it.
src/nas/ies/Payload_Container.hpp
View file @
e30ea609
...
@@ -55,6 +55,7 @@ class Payload_Container : Type6NasIe {
...
@@ -55,6 +55,7 @@ class Payload_Container : Type6NasIe {
int
Encode
(
uint8_t
*
buf
,
int
len
,
uint8_t
type
);
int
Encode
(
uint8_t
*
buf
,
int
len
,
uint8_t
type
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
,
uint8_t
type
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_iei
,
uint8_t
type
);
void
SetValue
(
const
std
::
vector
<
PayloadContainerEntry
>&
content
);
bool
GetValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
const
;
bool
GetValue
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
const
;
bool
GetValue
(
bstring
&
cnt
)
const
;
bool
GetValue
(
bstring
&
cnt
)
const
;
...
...
This diff is collapsed.
Click to expand it.
src/nas/ies/S_NSSAI.hpp
View file @
e30ea609
...
@@ -41,7 +41,7 @@ class S_NSSAI {
...
@@ -41,7 +41,7 @@ class S_NSSAI {
S_NSSAI
();
S_NSSAI
();
S_NSSAI
(
std
::
optional
<
uint8_t
>
iei
,
SNSSAI_s
snssai
);
S_NSSAI
(
std
::
optional
<
uint8_t
>
iei
,
SNSSAI_s
snssai
);
~
S_NSSAI
();
~
S_NSSAI
();
// void
setS_NSSAI
(SNSSAI_s snssai);
// void
SetSNssai
(SNSSAI_s snssai);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
const
bool
is_option
=
true
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
const
bool
is_option
=
true
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationFailure.cpp
View file @
e30ea609
...
@@ -44,9 +44,9 @@ AuthenticationFailure::AuthenticationFailure() {
...
@@ -44,9 +44,9 @@ AuthenticationFailure::AuthenticationFailure() {
AuthenticationFailure
::~
AuthenticationFailure
()
{}
AuthenticationFailure
::~
AuthenticationFailure
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
AuthenticationFailure
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
AuthenticationFailure
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
AUTHENTICATION_FAILURE
);
EPD_5GS_MM_MSG
,
security_header_type
,
AUTHENTICATION_FAILURE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationFailure.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class AuthenticationFailure {
...
@@ -39,7 +39,7 @@ class AuthenticationFailure {
~
AuthenticationFailure
();
~
AuthenticationFailure
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
set_5GMM_Cause
(
uint8_t
value
);
void
set_5GMM_Cause
(
uint8_t
value
);
void
setAuthentication_Failure_Parameter
(
bstring
auts
);
void
setAuthentication_Failure_Parameter
(
bstring
auts
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationReject.cpp
View file @
e30ea609
...
@@ -36,7 +36,7 @@ AuthenticationReject::AuthenticationReject()
...
@@ -36,7 +36,7 @@ AuthenticationReject::AuthenticationReject()
AuthenticationReject
::~
AuthenticationReject
()
{}
AuthenticationReject
::~
AuthenticationReject
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
AuthenticationReject
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
AuthenticationReject
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationReject.hpp
View file @
e30ea609
...
@@ -31,7 +31,7 @@ class AuthenticationReject : public NasMmPlainHeader {
...
@@ -31,7 +31,7 @@ class AuthenticationReject : public NasMmPlainHeader {
AuthenticationReject
();
AuthenticationReject
();
~
AuthenticationReject
();
~
AuthenticationReject
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
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
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationRequest.cpp
View file @
e30ea609
...
@@ -38,7 +38,7 @@ AuthenticationRequest::AuthenticationRequest()
...
@@ -38,7 +38,7 @@ AuthenticationRequest::AuthenticationRequest()
AuthenticationRequest
::~
AuthenticationRequest
()
{}
AuthenticationRequest
::~
AuthenticationRequest
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
AuthenticationRequest
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
AuthenticationRequest
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationRequest.hpp
View file @
e30ea609
...
@@ -34,7 +34,7 @@ class AuthenticationRequest : public NasMmPlainHeader {
...
@@ -34,7 +34,7 @@ class AuthenticationRequest : 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
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetEapMessage
(
bstring
eap
);
void
SetEapMessage
(
bstring
eap
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationResponse.cpp
View file @
e30ea609
...
@@ -37,7 +37,7 @@ AuthenticationResponse::AuthenticationResponse()
...
@@ -37,7 +37,7 @@ AuthenticationResponse::AuthenticationResponse()
AuthenticationResponse
::~
AuthenticationResponse
()
{}
AuthenticationResponse
::~
AuthenticationResponse
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
AuthenticationResponse
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
AuthenticationResponse
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationResponse.hpp
View file @
e30ea609
...
@@ -34,7 +34,7 @@ class AuthenticationResponse : public NasMmPlainHeader {
...
@@ -34,7 +34,7 @@ class AuthenticationResponse : 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
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
SetAuthenticationResponseParameter
(
const
bstring
&
para
);
void
SetAuthenticationResponseParameter
(
const
bstring
&
para
);
bool
GetAuthenticationResponseParameter
(
bstring
&
para
);
bool
GetAuthenticationResponseParameter
(
bstring
&
para
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationResult.cpp
View file @
e30ea609
...
@@ -45,9 +45,9 @@ AuthenticationResult::AuthenticationResult() {
...
@@ -45,9 +45,9 @@ AuthenticationResult::AuthenticationResult() {
AuthenticationResult
::~
AuthenticationResult
()
{}
AuthenticationResult
::~
AuthenticationResult
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
AuthenticationResult
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
AuthenticationResult
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
AUTHENTICATION_RESULT
);
EPD_5GS_MM_MSG
,
security_header_type
,
AUTHENTICATION_RESULT
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/AuthenticationResult.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class AuthenticationResult {
...
@@ -39,7 +39,7 @@ class AuthenticationResult {
~
AuthenticationResult
();
~
AuthenticationResult
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetEapMessage
(
bstring
eap
);
void
SetEapMessage
(
bstring
eap
);
void
SetAbba
(
uint8_t
length
,
uint8_t
*
value
);
void
SetAbba
(
uint8_t
length
,
uint8_t
*
value
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ConfigurationUpdateCommand.cpp
View file @
e30ea609
...
@@ -38,9 +38,9 @@ ConfigurationUpdateCommand::ConfigurationUpdateCommand() {
...
@@ -38,9 +38,9 @@ ConfigurationUpdateCommand::ConfigurationUpdateCommand() {
ConfigurationUpdateCommand
::~
ConfigurationUpdateCommand
()
{}
ConfigurationUpdateCommand
::~
ConfigurationUpdateCommand
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ConfigurationUpdateCommand
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
ConfigurationUpdateCommand
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
CONFIGURATION_UPDATE_COMMAND
);
EPD_5GS_MM_MSG
,
security_header_type
,
CONFIGURATION_UPDATE_COMMAND
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ConfigurationUpdateCommand.hpp
View file @
e30ea609
...
@@ -34,7 +34,7 @@ class ConfigurationUpdateCommand {
...
@@ -34,7 +34,7 @@ class ConfigurationUpdateCommand {
ConfigurationUpdateCommand
();
ConfigurationUpdateCommand
();
~
ConfigurationUpdateCommand
();
~
ConfigurationUpdateCommand
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
bool
verifyHeader
();
bool
verifyHeader
();
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DLNASTransport.cpp
View file @
e30ea609
...
@@ -49,25 +49,25 @@ DLNASTransport::DLNASTransport() {
...
@@ -49,25 +49,25 @@ DLNASTransport::DLNASTransport() {
DLNASTransport
::~
DLNASTransport
()
{}
DLNASTransport
::~
DLNASTransport
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
DLNASTransport
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
DL_NAS_TRANSPORT
);
EPD_5GS_MM_MSG
,
security_header_type
,
DL_NAS_TRANSPORT
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
setPayload_Container_
Type
(
uint8_t
value
)
{
void
DLNASTransport
::
SetPayloadContainer
Type
(
uint8_t
value
)
{
ie_payload_container_type
=
new
PayloadContainerType
(
value
);
ie_payload_container_type
=
new
PayloadContainerType
(
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
s
etPayload_Container
(
void
DLNASTransport
::
S
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
=
new
Payload_Container
(
content
);
ie_payload_container
=
new
Payload_Container
(
content
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
s
etPayload_Container
(
uint8_t
*
buf
,
int
len
)
{
void
DLNASTransport
::
S
etPayload_Container
(
uint8_t
*
buf
,
int
len
)
{
bstring
b
=
blk2bstr
(
buf
,
len
);
bstring
b
=
blk2bstr
(
buf
,
len
);
ie_payload_container
=
new
Payload_Container
(
b
);
ie_payload_container
=
new
Payload_Container
(
b
);
}
}
...
@@ -78,7 +78,7 @@ void DLNASTransport::setPDUSessionId(uint8_t value) {
...
@@ -78,7 +78,7 @@ void DLNASTransport::setPDUSessionId(uint8_t value) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DLNASTransport
::
setAdditional_
Information
(
uint8_t
_length
,
uint8_t
value
)
{
void
DLNASTransport
::
SetAdditional
Information
(
uint8_t
_length
,
uint8_t
value
)
{
ie_additional_information
=
new
Additional_Information
(
0x24
,
_length
,
value
);
ie_additional_information
=
new
Additional_Information
(
0x24
,
_length
,
value
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DLNASTransport.hpp
View file @
e30ea609
...
@@ -39,12 +39,12 @@ class DLNASTransport {
...
@@ -39,12 +39,12 @@ class DLNASTransport {
~
DLNASTransport
();
~
DLNASTransport
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
setPayload_Container_
Type
(
uint8_t
value
);
void
SetPayloadContainer
Type
(
uint8_t
value
);
void
s
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
S
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
s
etPayload_Container
(
uint8_t
*
buf
,
int
len
);
void
S
etPayload_Container
(
uint8_t
*
buf
,
int
len
);
void
setPDUSessionId
(
uint8_t
value
);
void
setPDUSessionId
(
uint8_t
value
);
void
setAdditional_
Information
(
uint8_t
_length
,
uint8_t
value
);
void
SetAdditional
Information
(
uint8_t
_length
,
uint8_t
value
);
void
set_5GMM_Cause
(
uint8_t
value
);
void
set_5GMM_Cause
(
uint8_t
value
);
void
setBack_off_timer_value
(
uint8_t
unit
,
uint8_t
value
);
void
setBack_off_timer_value
(
uint8_t
unit
,
uint8_t
value
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DeregistrationAccept.cpp
View file @
e30ea609
...
@@ -43,9 +43,9 @@ DeregistrationAccept::DeregistrationAccept() {
...
@@ -43,9 +43,9 @@ DeregistrationAccept::DeregistrationAccept() {
DeregistrationAccept
::~
DeregistrationAccept
()
{}
DeregistrationAccept
::~
DeregistrationAccept
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DeregistrationAccept
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
DeregistrationAccept
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
EPD_5GS_MM_MSG
,
security_header_type
,
DEREGISTRATION_ACCEPT_UE_ORIGINATING
);
DEREGISTRATION_ACCEPT_UE_ORIGINATING
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DeregistrationAccept.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class DeregistrationAccept {
...
@@ -39,7 +39,7 @@ class DeregistrationAccept {
~
DeregistrationAccept
();
~
DeregistrationAccept
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
public:
public:
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DeregistrationRequest.cpp
View file @
e30ea609
...
@@ -49,9 +49,9 @@ DeregistrationRequest::DeregistrationRequest() {
...
@@ -49,9 +49,9 @@ DeregistrationRequest::DeregistrationRequest() {
DeregistrationRequest
::~
DeregistrationRequest
()
{}
DeregistrationRequest
::~
DeregistrationRequest
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
DeregistrationRequest
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
DeregistrationRequest
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
EPD_5GS_MM_MSG
,
security_header_type
,
DEREGISTRATION_REQUEST_UE_ORIGINATING
);
DEREGISTRATION_REQUEST_UE_ORIGINATING
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/DeregistrationRequest.hpp
View file @
e30ea609
...
@@ -40,7 +40,7 @@ class DeregistrationRequest {
...
@@ -40,7 +40,7 @@ class DeregistrationRequest {
~
DeregistrationRequest
();
~
DeregistrationRequest
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
setDeregistrationType
(
uint8_t
dereg_type
);
void
setDeregistrationType
(
uint8_t
dereg_type
);
void
setDeregistrationType
(
_5gs_deregistration_type_t
type
);
void
setDeregistrationType
(
_5gs_deregistration_type_t
type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/IdentityRequest.cpp
View file @
e30ea609
...
@@ -44,9 +44,9 @@ IdentityRequest::IdentityRequest() {
...
@@ -44,9 +44,9 @@ IdentityRequest::IdentityRequest() {
IdentityRequest
::~
IdentityRequest
()
{}
IdentityRequest
::~
IdentityRequest
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
IdentityRequest
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
IdentityRequest
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
IDENTITY_REQUEST
);
EPD_5GS_MM_MSG
,
security_header_type
,
IDENTITY_REQUEST
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/IdentityRequest.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class IdentityRequest {
...
@@ -39,7 +39,7 @@ class IdentityRequest {
~
IdentityRequest
();
~
IdentityRequest
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
set_5GS_Identity_Type
(
uint8_t
value
);
void
set_5GS_Identity_Type
(
uint8_t
value
);
public:
public:
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/IdentityResponse.cpp
View file @
e30ea609
...
@@ -44,9 +44,9 @@ IdentityResponse::IdentityResponse() {
...
@@ -44,9 +44,9 @@ IdentityResponse::IdentityResponse() {
IdentityResponse
::~
IdentityResponse
()
{}
IdentityResponse
::~
IdentityResponse
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
IdentityResponse
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
IdentityResponse
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
IDENTITY_RESPONSE
);
EPD_5GS_MM_MSG
,
security_header_type
,
IDENTITY_RESPONSE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/IdentityResponse.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class IdentityResponse {
...
@@ -39,7 +39,7 @@ class IdentityResponse {
~
IdentityResponse
();
~
IdentityResponse
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
setSUCI_SUPI_format_IMSI
(
void
setSUCI_SUPI_format_IMSI
(
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
const
string
mcc
,
const
string
mnc
,
const
string
routingInd
,
uint8_t
protection_sch_id
,
const
string
msin
);
uint8_t
protection_sch_id
,
const
string
msin
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/NasMmPlainHeader.cpp
View file @
e30ea609
...
@@ -64,7 +64,7 @@ uint8_t NasMmPlainHeader::GetMessageType() {
...
@@ -64,7 +64,7 @@ uint8_t NasMmPlainHeader::GetMessageType() {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NasMmPlainHeader
::
s
etHeader
(
void
NasMmPlainHeader
::
S
etHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
msg_type
)
{
const
uint8_t
&
msg_type
)
{
epd_
.
Set
(
epd
);
epd_
.
Set
(
epd
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/NasMmPlainHeader.hpp
View file @
e30ea609
...
@@ -36,7 +36,7 @@ class NasMmPlainHeader {
...
@@ -36,7 +36,7 @@ class NasMmPlainHeader {
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
);
NasMmPlainHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
msg_type
);
virtual
~
NasMmPlainHeader
();
virtual
~
NasMmPlainHeader
();
void
s
etHeader
(
void
S
etHeader
(
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
epd
,
const
uint8_t
&
security_header_type
,
const
uint8_t
&
msg_type
);
const
uint8_t
&
msg_type
);
void
SetMessageName
(
const
std
::
string
&
name
);
void
SetMessageName
(
const
std
::
string
&
name
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationAccept.cpp
View file @
e30ea609
...
@@ -71,7 +71,7 @@ RegistrationAccept::RegistrationAccept()
...
@@ -71,7 +71,7 @@ RegistrationAccept::RegistrationAccept()
RegistrationAccept
::~
RegistrationAccept
()
{}
RegistrationAccept
::~
RegistrationAccept
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationAccept
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
RegistrationAccept
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationAccept.hpp
View file @
e30ea609
...
@@ -31,7 +31,7 @@ class RegistrationAccept : public NasMmPlainHeader {
...
@@ -31,7 +31,7 @@ class RegistrationAccept : public NasMmPlainHeader {
RegistrationAccept
();
RegistrationAccept
();
~
RegistrationAccept
();
~
RegistrationAccept
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
// TODO
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
// TODO
bool
verifyHeader
();
// TODO
bool
verifyHeader
();
// TODO
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationComplete.cpp
View file @
e30ea609
...
@@ -44,9 +44,9 @@ RegistrationComplete::RegistrationComplete() {
...
@@ -44,9 +44,9 @@ RegistrationComplete::RegistrationComplete() {
RegistrationComplete
::~
RegistrationComplete
()
{}
RegistrationComplete
::~
RegistrationComplete
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationComplete
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
RegistrationComplete
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
REGISTRATION_COMPLETE
);
EPD_5GS_MM_MSG
,
security_header_type
,
REGISTRATION_COMPLETE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationComplete.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class RegistrationComplete {
...
@@ -39,7 +39,7 @@ class RegistrationComplete {
~
RegistrationComplete
();
~
RegistrationComplete
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
setSOR_Transparent_Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
void
setSOR_Transparent_Container
(
uint8_t
header
,
const
uint8_t
(
&
value
)[
16
]);
public:
public:
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationReject.cpp
View file @
e30ea609
...
@@ -40,7 +40,7 @@ RegistrationReject::RegistrationReject()
...
@@ -40,7 +40,7 @@ RegistrationReject::RegistrationReject()
RegistrationReject
::~
RegistrationReject
()
{}
RegistrationReject
::~
RegistrationReject
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationReject
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
RegistrationReject
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationReject.hpp
View file @
e30ea609
...
@@ -31,7 +31,7 @@ class RegistrationReject : public NasMmPlainHeader {
...
@@ -31,7 +31,7 @@ class RegistrationReject : public NasMmPlainHeader {
RegistrationReject
();
RegistrationReject
();
~
RegistrationReject
();
~
RegistrationReject
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
bool
verifyHeader
();
bool
verifyHeader
();
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationRequest.cpp
View file @
e30ea609
...
@@ -58,7 +58,7 @@ RegistrationRequest::RegistrationRequest()
...
@@ -58,7 +58,7 @@ RegistrationRequest::RegistrationRequest()
RegistrationRequest
::~
RegistrationRequest
()
{}
RegistrationRequest
::~
RegistrationRequest
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationRequest
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
RegistrationRequest
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
@@ -425,13 +425,13 @@ bool RegistrationRequest::getLadnIndication(std::vector<bstring>& ladnValue) {
...
@@ -425,13 +425,13 @@ bool RegistrationRequest::getLadnIndication(std::vector<bstring>& ladnValue) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setPayload_Container_
Type
(
uint8_t
value
)
{
void
RegistrationRequest
::
SetPayloadContainer
Type
(
uint8_t
value
)
{
ie_payload_container_type
=
ie_payload_container_type
=
std
::
make_optional
<
PayloadContainerType
>
(
kIeiPayloadContainerType
,
value
);
std
::
make_optional
<
PayloadContainerType
>
(
kIeiPayloadContainerType
,
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
uint8_t
RegistrationRequest
::
g
etPayloadContainerType
()
{
uint8_t
RegistrationRequest
::
G
etPayloadContainerType
()
{
if
(
ie_payload_container_type
.
has_value
())
{
if
(
ie_payload_container_type
.
has_value
())
{
return
ie_payload_container_type
.
value
().
GetValue
();
return
ie_payload_container_type
.
value
().
GetValue
();
}
else
{
}
else
{
...
@@ -440,14 +440,14 @@ uint8_t RegistrationRequest::getPayloadContainerType() {
...
@@ -440,14 +440,14 @@ uint8_t RegistrationRequest::getPayloadContainerType() {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationRequest
::
s
etPayload_Container
(
void
RegistrationRequest
::
S
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
=
ie_payload_container
=
std
::
make_optional
<
Payload_Container
>
(
kIeiPayloadContainer
,
content
);
std
::
make_optional
<
Payload_Container
>
(
kIeiPayloadContainer
,
content
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
g
etPayloadContainer
(
bool
RegistrationRequest
::
G
etPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
std
::
vector
<
PayloadContainerEntry
>&
content
)
{
if
(
ie_payload_container
.
has_value
())
{
if
(
ie_payload_container
.
has_value
())
{
return
ie_payload_container
.
value
().
GetValue
(
content
);
return
ie_payload_container
.
value
().
GetValue
(
content
);
...
@@ -497,12 +497,12 @@ bool RegistrationRequest::get5GSUpdateType(
...
@@ -497,12 +497,12 @@ bool RegistrationRequest::get5GSUpdateType(
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
RegistrationRequest
::
setNAS_Message_
Container
(
bstring
value
)
{
void
RegistrationRequest
::
SetNasMessage
Container
(
bstring
value
)
{
ie_nas_message_container
=
std
::
make_optional
<
NasMessageContainer
>
(
value
);
ie_nas_message_container
=
std
::
make_optional
<
NasMessageContainer
>
(
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
RegistrationRequest
::
g
etNasMessageContainer
(
bstring
&
nas
)
{
bool
RegistrationRequest
::
G
etNasMessageContainer
(
bstring
&
nas
)
{
if
(
ie_nas_message_container
.
has_value
())
{
if
(
ie_nas_message_container
.
has_value
())
{
ie_nas_message_container
.
value
().
GetValue
(
nas
);
ie_nas_message_container
.
value
().
GetValue
(
nas
);
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/RegistrationRequest.hpp
View file @
e30ea609
...
@@ -40,7 +40,7 @@ class RegistrationRequest : public NasMmPlainHeader {
...
@@ -40,7 +40,7 @@ class RegistrationRequest : 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
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
void
getSecurityHeaderType
(
uint8_t
security_header_type
);
bool
verifyHeader
();
bool
verifyHeader
();
...
@@ -121,11 +121,11 @@ class RegistrationRequest : public NasMmPlainHeader {
...
@@ -121,11 +121,11 @@ class RegistrationRequest : public NasMmPlainHeader {
void
setLADN_Indication
(
std
::
vector
<
bstring
>
ladnValue
);
void
setLADN_Indication
(
std
::
vector
<
bstring
>
ladnValue
);
bool
getLadnIndication
(
std
::
vector
<
bstring
>&
ladnValue
);
bool
getLadnIndication
(
std
::
vector
<
bstring
>&
ladnValue
);
void
setPayload_Container_
Type
(
uint8_t
value
);
void
SetPayloadContainer
Type
(
uint8_t
value
);
uint8_t
g
etPayloadContainerType
();
uint8_t
G
etPayloadContainerType
();
void
s
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
S
etPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
bool
g
etPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
bool
G
etPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
void
setNetwork_Slicing_Indication
(
bool
dcni
,
bool
nssci
);
void
setNetwork_Slicing_Indication
(
bool
dcni
,
bool
nssci
);
bool
getNetworkSlicingIndication
(
uint8_t
&
dcni
,
uint8_t
&
nssci
);
bool
getNetworkSlicingIndication
(
uint8_t
&
dcni
,
uint8_t
&
nssci
);
...
@@ -136,8 +136,8 @@ class RegistrationRequest : public NasMmPlainHeader {
...
@@ -136,8 +136,8 @@ class RegistrationRequest : public NasMmPlainHeader {
uint8_t
&
eps_pnb_ciot
,
uint8_t
&
_5gs_pnb_ciot
,
bool
&
ng_ran_rcu
,
uint8_t
&
eps_pnb_ciot
,
uint8_t
&
_5gs_pnb_ciot
,
bool
&
ng_ran_rcu
,
bool
&
sms_requested
);
bool
&
sms_requested
);
void
setNAS_Message_
Container
(
bstring
value
);
void
SetNasMessage
Container
(
bstring
value
);
bool
g
etNasMessageContainer
(
bstring
&
nas
);
bool
G
etNasMessageContainer
(
bstring
&
nas
);
bool
getEpsNasMessageContainer
(
bstring
&
epsNas
);
bool
getEpsNasMessageContainer
(
bstring
&
epsNas
);
// bool getEpsNasMessageContainer(bstring& epsNas);
// bool getEpsNasMessageContainer(bstring& epsNas);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeCommand.cpp
View file @
e30ea609
...
@@ -41,7 +41,7 @@ SecurityModeCommand::SecurityModeCommand()
...
@@ -41,7 +41,7 @@ SecurityModeCommand::SecurityModeCommand()
SecurityModeCommand
::~
SecurityModeCommand
()
{}
SecurityModeCommand
::~
SecurityModeCommand
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeCommand
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
SecurityModeCommand
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeCommand.hpp
View file @
e30ea609
...
@@ -31,7 +31,7 @@ class SecurityModeCommand : public NasMmPlainHeader {
...
@@ -31,7 +31,7 @@ class SecurityModeCommand : public NasMmPlainHeader {
SecurityModeCommand
();
SecurityModeCommand
();
~
SecurityModeCommand
();
~
SecurityModeCommand
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
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
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeComplete.cpp
View file @
e30ea609
...
@@ -39,26 +39,28 @@ SecurityModeComplete::SecurityModeComplete()
...
@@ -39,26 +39,28 @@ SecurityModeComplete::SecurityModeComplete()
SecurityModeComplete
::~
SecurityModeComplete
()
{}
SecurityModeComplete
::~
SecurityModeComplete
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
SecurityModeComplete
::
S
etHeader
(
uint8_t
security_header_type
)
{
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
NasMmPlainHeader
::
SetSecurityHeaderType
(
security_header_type
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
SetImeisv
(
IMEISV_t
imeisv
)
{
void
SecurityModeComplete
::
SetImeisv
(
IMEISV_t
imeisv
)
{
ie_imeisv
=
std
::
make_optional
<
_5GSMobileIdentity
>
(
kIeiImeisv
);
ie_imeisv
=
// ie_imeisv->SetIei(kIeiImeisv);
std
::
make_optional
<
_5GSMobileIdentity
>
(
kIei5gsMobileIdentityImeiSv
);
// ie_imeisv->SetIei(kIei5gsMobileIdentityImeiSv);
ie_imeisv
.
value
().
SetImeisv
(
imeisv
);
ie_imeisv
.
value
().
SetImeisv
(
imeisv
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
setNAS_Message_
Container
(
bstring
value
)
{
void
SecurityModeComplete
::
SetNasMessage
Container
(
bstring
value
)
{
ie_nas_message_container
=
std
::
make_optional
<
NasMessageContainer
>
(
value
);
ie_nas_message_container
=
std
::
make_optional
<
NasMessageContainer
>
(
value
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeComplete
::
setNON_IMEISV
(
IMEISV_t
imeisv
)
{
void
SecurityModeComplete
::
SetNonImeisv
(
IMEISV_t
imeisv
)
{
ie_non_imeisvpei
=
std
::
make_optional
<
_5GSMobileIdentity
>
(
kIeiNonImeisvPei
);
ie_non_imeisvpei
=
// ie_non_imeisvpei->SetIei(kIeiNonImeisvPei);
std
::
make_optional
<
_5GSMobileIdentity
>
(
kIei5gsMobileIdentityNonImeiSvPei
);
// ie_non_imeisvpei->SetIei(kIei5gsMobileIdentityNonImeiSvPei);
ie_non_imeisvpei
.
value
().
SetImeisv
(
imeisv
);
ie_non_imeisvpei
.
value
().
SetImeisv
(
imeisv
);
}
}
...
@@ -73,7 +75,7 @@ bool SecurityModeComplete::GetImeisv(IMEISV_t& imeisv) const {
...
@@ -73,7 +75,7 @@ bool SecurityModeComplete::GetImeisv(IMEISV_t& imeisv) const {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
SecurityModeComplete
::
g
etNasMessageContainer
(
bstring
&
nas
)
const
{
bool
SecurityModeComplete
::
G
etNasMessageContainer
(
bstring
&
nas
)
const
{
if
(
ie_nas_message_container
.
has_value
())
{
if
(
ie_nas_message_container
.
has_value
())
{
ie_nas_message_container
.
value
().
GetValue
(
nas
);
ie_nas_message_container
.
value
().
GetValue
(
nas
);
return
true
;
return
true
;
...
@@ -83,7 +85,7 @@ bool SecurityModeComplete::getNasMessageContainer(bstring& nas) const {
...
@@ -83,7 +85,7 @@ bool SecurityModeComplete::getNasMessageContainer(bstring& nas) const {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
SecurityModeComplete
::
getNON_IMEISV
(
IMEISV_t
&
imeisv
)
const
{
bool
SecurityModeComplete
::
GetNonImeisv
(
IMEISV_t
&
imeisv
)
const
{
if
(
ie_non_imeisvpei
.
has_value
())
{
if
(
ie_non_imeisvpei
.
has_value
())
{
ie_non_imeisvpei
.
value
().
GetImeisv
(
imeisv
);
ie_non_imeisvpei
.
value
().
GetImeisv
(
imeisv
);
return
true
;
return
true
;
...
@@ -170,7 +172,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
...
@@ -170,7 +172,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
uint8_t
octet
=
*
(
buf
+
decoded_size
);
uint8_t
octet
=
*
(
buf
+
decoded_size
);
Logger
::
nas_mm
().
debug
(
"Optional IEI (0x%x)"
,
octet
);
Logger
::
nas_mm
().
debug
(
"Optional IEI (0x%x)"
,
octet
);
switch
(
octet
)
{
switch
(
octet
)
{
case
0x77
:
{
case
kIei5gsMobileIdentityImeiSv
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x77)"
);
_5GSMobileIdentity
ie_imeisv_tmp
=
{};
_5GSMobileIdentity
ie_imeisv_tmp
=
{};
if
((
decoded_result
=
ie_imeisv_tmp
.
Decode
(
if
((
decoded_result
=
ie_imeisv_tmp
.
Decode
(
...
@@ -180,7 +182,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
...
@@ -180,7 +182,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
decoded_size
+=
decoded_result
;
decoded_size
+=
decoded_result
;
ie_imeisv
=
std
::
optional
<
_5GSMobileIdentity
>
(
ie_imeisv_tmp
);
ie_imeisv
=
std
::
optional
<
_5GSMobileIdentity
>
(
ie_imeisv_tmp
);
}
break
;
}
break
;
case
0x71
:
{
case
kIeiNasMessageContainer
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x71)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x71)"
);
NasMessageContainer
ie_nas_message_container_tmp
=
{};
NasMessageContainer
ie_nas_message_container_tmp
=
{};
if
((
decoded_result
=
ie_nas_message_container_tmp
.
Decode
(
if
((
decoded_result
=
ie_nas_message_container_tmp
.
Decode
(
...
@@ -191,7 +193,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
...
@@ -191,7 +193,7 @@ int SecurityModeComplete::Decode(uint8_t* buf, int len) {
ie_nas_message_container
=
ie_nas_message_container
=
std
::
optional
<
NasMessageContainer
>
(
ie_nas_message_container_tmp
);
std
::
optional
<
NasMessageContainer
>
(
ie_nas_message_container_tmp
);
}
break
;
}
break
;
case
0x78
:
{
case
kIei5gsMobileIdentityNonImeiSvPei
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x78)"
);
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x78)"
);
_5GSMobileIdentity
ie_non_imeisvpei_tmp
=
{};
_5GSMobileIdentity
ie_non_imeisvpei_tmp
=
{};
if
((
decoded_result
=
ie_non_imeisvpei_tmp
.
Decode
(
if
((
decoded_result
=
ie_non_imeisvpei_tmp
.
Decode
(
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeComplete.hpp
View file @
e30ea609
...
@@ -31,7 +31,7 @@ class SecurityModeComplete : public NasMmPlainHeader {
...
@@ -31,7 +31,7 @@ class SecurityModeComplete : public NasMmPlainHeader {
SecurityModeComplete
();
SecurityModeComplete
();
~
SecurityModeComplete
();
~
SecurityModeComplete
();
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
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
);
...
@@ -39,11 +39,11 @@ class SecurityModeComplete : public NasMmPlainHeader {
...
@@ -39,11 +39,11 @@ class SecurityModeComplete : public NasMmPlainHeader {
void
SetImeisv
(
IMEISV_t
imeisv
);
void
SetImeisv
(
IMEISV_t
imeisv
);
bool
GetImeisv
(
IMEISV_t
&
imeisv
)
const
;
bool
GetImeisv
(
IMEISV_t
&
imeisv
)
const
;
void
setNAS_Message_
Container
(
bstring
value
);
void
SetNasMessage
Container
(
bstring
value
);
bool
g
etNasMessageContainer
(
bstring
&
nas
)
const
;
bool
G
etNasMessageContainer
(
bstring
&
nas
)
const
;
void
setNON_IMEISV
(
IMEISV_t
imeisv
);
void
SetNonImeisv
(
IMEISV_t
imeisv
);
bool
getNON_IMEISV
(
IMEISV_t
&
imeisv
)
const
;
bool
GetNonImeisv
(
IMEISV_t
&
imeisv
)
const
;
public:
public:
std
::
optional
<
_5GSMobileIdentity
>
ie_imeisv
;
// Optional
std
::
optional
<
_5GSMobileIdentity
>
ie_imeisv
;
// Optional
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeReject.cpp
View file @
e30ea609
...
@@ -44,9 +44,9 @@ SecurityModeReject::SecurityModeReject() {
...
@@ -44,9 +44,9 @@ SecurityModeReject::SecurityModeReject() {
SecurityModeReject
::~
SecurityModeReject
()
{}
SecurityModeReject
::~
SecurityModeReject
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
SecurityModeReject
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
SecurityModeReject
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
SECURITY_MODE_REJECT
);
EPD_5GS_MM_MSG
,
security_header_type
,
SECURITY_MODE_REJECT
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/SecurityModeReject.hpp
View file @
e30ea609
...
@@ -39,7 +39,7 @@ class SecurityModeReject {
...
@@ -39,7 +39,7 @@ class SecurityModeReject {
~
SecurityModeReject
();
~
SecurityModeReject
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
set_5GMM_Cause
(
uint8_t
value
);
void
set_5GMM_Cause
(
uint8_t
value
);
public:
public:
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ServiceAccept.cpp
View file @
e30ea609
...
@@ -45,9 +45,9 @@ ServiceAccept::~ServiceAccept() {
...
@@ -45,9 +45,9 @@ ServiceAccept::~ServiceAccept() {
if
(
ie_session_reactivation_result
)
delete
ie_session_reactivation_result
;
if
(
ie_session_reactivation_result
)
delete
ie_session_reactivation_result
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceAccept
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
ServiceAccept
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
SERVICE_ACCEPT
);
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
SERVICE_ACCEPT
);
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ServiceAccept.hpp
View file @
e30ea609
...
@@ -43,7 +43,7 @@ class ServiceAccept {
...
@@ -43,7 +43,7 @@ class ServiceAccept {
~
ServiceAccept
();
~
ServiceAccept
();
public:
public:
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
setPDU_session_status
(
uint16_t
value
);
void
setPDU_session_status
(
uint16_t
value
);
void
setPDU_session_reactivation_result
(
uint16_t
);
void
setPDU_session_reactivation_result
(
uint16_t
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ServiceRequest.cpp
View file @
e30ea609
...
@@ -49,9 +49,9 @@ ServiceRequest::ServiceRequest() {
...
@@ -49,9 +49,9 @@ ServiceRequest::ServiceRequest() {
ServiceRequest
::~
ServiceRequest
()
{}
ServiceRequest
::~
ServiceRequest
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceRequest
::
s
etHeader
(
uint8_t
security_header_type
)
{
void
ServiceRequest
::
S
etHeader
(
uint8_t
security_header_type
)
{
plain_header
=
new
NasMmPlainHeader
();
plain_header
=
new
NasMmPlainHeader
();
plain_header
->
s
etHeader
(
plain_header
->
S
etHeader
(
EPD_5GS_MM_MSG
,
security_header_type
,
SERVICE_REQUEST
);
EPD_5GS_MM_MSG
,
security_header_type
,
SERVICE_REQUEST
);
}
}
...
@@ -88,7 +88,7 @@ void ServiceRequest::setAllowed_PDU_Session_Status(uint16_t value) {
...
@@ -88,7 +88,7 @@ void ServiceRequest::setAllowed_PDU_Session_Status(uint16_t value) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
ServiceRequest
::
setNAS_Message_
Container
(
bstring
value
)
{
void
ServiceRequest
::
SetNasMessage
Container
(
bstring
value
)
{
ie_nas_message_container
=
new
NasMessageContainer
(
value
);
ie_nas_message_container
=
new
NasMessageContainer
(
value
);
}
}
...
@@ -285,7 +285,7 @@ uint16_t ServiceRequest::getAllowedPduSessionStatus() {
...
@@ -285,7 +285,7 @@ uint16_t ServiceRequest::getAllowedPduSessionStatus() {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
ServiceRequest
::
g
etNasMessageContainer
(
bstring
&
nas
)
{
bool
ServiceRequest
::
G
etNasMessageContainer
(
bstring
&
nas
)
{
if
(
ie_nas_message_container
)
{
if
(
ie_nas_message_container
)
{
ie_nas_message_container
->
GetValue
(
nas
);
ie_nas_message_container
->
GetValue
(
nas
);
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ServiceRequest.hpp
View file @
e30ea609
...
@@ -44,14 +44,14 @@ class ServiceRequest {
...
@@ -44,14 +44,14 @@ class ServiceRequest {
~
ServiceRequest
();
~
ServiceRequest
();
public:
public:
void
s
etHeader
(
uint8_t
security_header_type
);
void
S
etHeader
(
uint8_t
security_header_type
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
SetNgKsi
(
uint8_t
tsc
,
uint8_t
key_set_id
);
void
setServiceType
(
uint8_t
stp
);
void
setServiceType
(
uint8_t
stp
);
void
Set5gSTmsi
(
uint16_t
amfSetId
,
uint8_t
amfPointer
,
string
tmsi
);
void
Set5gSTmsi
(
uint16_t
amfSetId
,
uint8_t
amfPointer
,
string
tmsi
);
void
setUplink_data_status
(
uint16_t
value
);
void
setUplink_data_status
(
uint16_t
value
);
void
setPDU_session_status
(
uint16_t
value
);
void
setPDU_session_status
(
uint16_t
value
);
void
setAllowed_PDU_Session_Status
(
uint16_t
value
);
void
setAllowed_PDU_Session_Status
(
uint16_t
value
);
void
setNAS_Message_
Container
(
bstring
value
);
void
SetNasMessage
Container
(
bstring
value
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
public:
public:
...
@@ -62,7 +62,7 @@ class ServiceRequest {
...
@@ -62,7 +62,7 @@ class ServiceRequest {
uint16_t
getUplinkDataStatus
();
uint16_t
getUplinkDataStatus
();
uint16_t
getPduSessionStatus
();
uint16_t
getPduSessionStatus
();
uint16_t
getAllowedPduSessionStatus
();
uint16_t
getAllowedPduSessionStatus
();
bool
g
etNasMessageContainer
(
bstring
&
nas
);
bool
G
etNasMessageContainer
(
bstring
&
nas
);
private:
private:
NasMmPlainHeader
*
plain_header
;
NasMmPlainHeader
*
plain_header
;
...
...
This diff is collapsed.
Click to expand it.
src/nas/msgs/ULNASTransport.cpp
View file @
e30ea609
This diff is collapsed.
Click to expand it.
src/nas/msgs/ULNASTransport.hpp
View file @
e30ea609
...
@@ -19,59 +19,66 @@
...
@@ -19,59 +19,66 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
#ifndef _UL_NAS_TRANSPORT_H_
\brief
#define _UL_NAS_TRANSPORT_H_
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _ULNASTransport_H_
#define _ULNASTransport_H_
#include "NasIeHeader.hpp"
#include "NasIeHeader.hpp"
namespace
nas
{
namespace
nas
{
class
ULNASTransport
{
class
ULNASTransport
:
public
NasMmPlainHeader
{
public:
public:
ULNASTransport
();
ULNASTransport
();
~
ULNASTransport
();
~
ULNASTransport
();
void
SetHeader
(
uint8_t
security_header_type
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
setHeader
(
uint8_t
security_header_type
);
void
setPayload_Container_Type
(
uint8_t
value
);
void
SetPayloadContainerType
(
uint8_t
value
);
void
setPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
uint8_t
GetPayloadContainerType
();
void
setPDU_Session_Identity_2
(
uint8_t
value
);
void
setOLD_PDU_Session_Identity_2
(
uint8_t
value
);
void
SetPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
setRequest_Type
(
uint8_t
value
);
void
GetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
void
setS_NSSAI
(
SNSSAI_s
snssai
);
void
GetPayloadContainer
(
bstring
&
content
);
void
SetPduSessionIdentity2
(
uint8_t
value
);
uint8_t
GetPduSessionId
();
void
SetOldPduSessionIdentity2
(
uint8_t
value
);
bool
GetOldPduSessionId
(
uint8_t
&
value
)
const
;
void
SetRequestType
(
uint8_t
value
);
bool
GetRequestType
(
uint8_t
&
value
);
void
SetSNssai
(
SNSSAI_s
snssai
);
bool
GetSNssai
(
SNSSAI_s
&
snssai
);
void
setDNN
(
bstring
dnn
);
void
setDNN
(
bstring
dnn
);
void
setAdditional_Information
(
uint8_t
_length
,
uint8_t
value
);
void
setMA_PDU_Session_Information
(
uint8_t
value
);
void
setRelease_Assistance_Indication
(
uint8_t
value
);
uint8_t
getPayloadContainerType
();
bool
getPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
bool
getPayloadContainer
(
bstring
&
content
);
uint8_t
getPduSessionId
();
uint8_t
getOldPduSessionId
();
uint8_t
getRequestType
();
bool
getSnssai
(
SNSSAI_s
&
snssai
);
bool
getDnn
(
bstring
&
dnn
);
bool
getDnn
(
bstring
&
dnn
);
void
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
);
void
SetMaPduSessionInformation
(
uint8_t
value
);
void
SetReleaseAssistanceIndication
(
uint8_t
value
);
public:
public:
NasMmPlainHeader
*
plain_header
;
PayloadContainerType
ie_payload_container_type
;
// Mandatory
PayloadContainerType
*
ie_payload_container_type
;
Payload_Container
ie_payload_container
;
// Mandatory
Payload_Container
*
ie_payload_container
;
PDU_Session_Identity_2
*
ie_pdu_session_identity_2
;
std
::
optional
<
PDU_Session_Identity_2
>
ie_pdu_session_identity_2
;
// Optional
PDU_Session_Identity_2
*
ie_old_pdu_session_identity_2
;
std
::
optional
<
PDU_Session_Identity_2
>
Request_Type
*
ie_request_type
;
ie_old_pdu_session_identity_2
;
// Optional
S_NSSAI
*
ie_s_nssai
;
std
::
optional
<
Request_Type
>
ie_request_type
;
// Optional
DNN
*
ie_dnn
;
std
::
optional
<
S_NSSAI
>
ie_s_nssai
;
// Optional
Additional_Information
*
ie_additional_information
;
std
::
optional
<
DNN
>
ie_dnn
;
// Optional
MA_PDU_Session_Information
*
ie_ma_pdu_session_information
;
std
::
optional
<
Additional_Information
>
ie_additional_information
;
// Optional
Release_Assistance_Indication
*
ie_release_assistance_indication
;
std
::
optional
<
MA_PDU_Session_Information
>
ie_ma_pdu_session_information
;
// Optional
std
::
optional
<
Release_Assistance_Indication
>
ie_release_assistance_indication
;
// Optional
};
};
}
// namespace nas
}
// namespace nas
...
...
This diff is collapsed.
Click to expand it.
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