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
51f3308d
Commit
51f3308d
authored
Jan 14, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ULNASTransport
parent
e30ea609
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
55 additions
and
56 deletions
+55
-56
src/amf-app/amf_app.cpp
src/amf-app/amf_app.cpp
+2
-2
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+11
-10
src/nas/ies/PDU_Session_Identity_2.cpp
src/nas/ies/PDU_Session_Identity_2.cpp
+2
-2
src/nas/ies/PDU_Session_Identity_2.hpp
src/nas/ies/PDU_Session_Identity_2.hpp
+2
-2
src/nas/msgs/AuthenticationFailure.cpp
src/nas/msgs/AuthenticationFailure.cpp
+1
-1
src/nas/msgs/AuthenticationFailure.hpp
src/nas/msgs/AuthenticationFailure.hpp
+1
-1
src/nas/msgs/DLNASTransport.cpp
src/nas/msgs/DLNASTransport.cpp
+5
-5
src/nas/msgs/DLNASTransport.hpp
src/nas/msgs/DLNASTransport.hpp
+13
-15
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
+1
-1
src/nas/msgs/RegistrationRequest.hpp
src/nas/msgs/RegistrationRequest.hpp
+1
-1
src/nas/msgs/SecurityModeReject.cpp
src/nas/msgs/SecurityModeReject.cpp
+1
-1
src/nas/msgs/SecurityModeReject.hpp
src/nas/msgs/SecurityModeReject.hpp
+1
-1
src/nas/msgs/ULNASTransport.cpp
src/nas/msgs/ULNASTransport.cpp
+10
-10
src/nas/msgs/ULNASTransport.hpp
src/nas/msgs/ULNASTransport.hpp
+2
-2
No files found.
src/amf-app/amf_app.cpp
View file @
51f3308d
...
...
@@ -351,9 +351,9 @@ void amf_app::handle_itti_message(
auto
dl
=
std
::
make_unique
<
DLNASTransport
>
();
dl
->
SetHeader
(
PLAIN_5GS_MSG
);
dl
->
SetPayloadContainerType
(
N1_SM_INFORMATION
);
dl
->
SetPayload
_
Container
(
dl
->
SetPayloadContainer
(
(
uint8_t
*
)
bdata
(
bstrcpy
(
itti_msg
.
n1sm
)),
blength
(
itti_msg
.
n1sm
));
dl
->
setPDU
SessionId
(
itti_msg
.
pdu_session_id
);
dl
->
SetPdu
SessionId
(
itti_msg
.
pdu_session_id
);
uint8_t
nas
[
BUFFER_SIZE_1024
];
int
encoded_size
=
dl
->
Encode
(
nas
,
BUFFER_SIZE_1024
);
...
...
src/amf-app/amf_n1.cpp
View file @
51f3308d
...
...
@@ -1596,7 +1596,7 @@ void amf_n1::send_registration_reject_msg(
std
::
unique_ptr
<
RegistrationReject
>
registration_reject
=
std
::
make_unique
<
RegistrationReject
>
();
registration_reject
->
SetHeader
(
PLAIN_5GS_MSG
);
registration_reject
->
set_5GMM_
Cause
(
cause_value
);
registration_reject
->
Set5gmm
Cause
(
cause_value
);
uint8_t
buffer
[
BUFFER_SIZE_1024
]
=
{
0
};
int
encoded_size
=
registration_reject
->
Encode
(
buffer
,
BUFFER_SIZE_1024
);
comUt
::
print_buffer
(
...
...
@@ -3223,7 +3223,12 @@ void amf_n1::ul_nas_transport_handle(
ul_nas
->
Decode
(
NULL
,
(
uint8_t
*
)
bdata
(
nas
),
blength
(
nas
));
uint8_t
payload_type
=
ul_nas
->
GetPayloadContainerType
();
uint8_t
pdu_session_id
=
ul_nas
->
GetPduSessionId
();
uint8_t
request_type
=
ul_nas
->
GetRequestType
();
uint8_t
request_type
=
0
;
if
(
!
ul_nas
->
GetRequestType
(
request_type
))
{
Logger
::
amf_n1
().
debug
(
"Request Type is not available"
);
// TODO:
}
bstring
sm_msg
=
nullptr
;
...
...
@@ -3280,10 +3285,8 @@ void amf_n1::ul_nas_transport_handle(
switch
(
payload_type
)
{
case
N1_SM_INFORMATION
:
{
if
(
!
ul_nas
->
GetPayloadContainer
(
sm_msg
))
{
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
return
;
}
// Get payload container
ul_nas
->
GetPayloadContainer
(
sm_msg
);
std
::
shared_ptr
<
itti_nsmf_pdusession_create_sm_context
>
itti_msg
=
std
::
make_shared
<
itti_nsmf_pdusession_create_sm_context
>
(
...
...
@@ -3315,10 +3318,8 @@ void amf_n1::ul_nas_transport_handle(
}
else
{
switch
(
payload_type
)
{
case
N1_SM_INFORMATION
:
{
if
(
!
ul_nas
->
GetPayloadContainer
(
sm_msg
))
{
Logger
::
amf_n1
().
error
(
"Cannot decode Payload Container"
);
return
;
}
// Get payload container
ul_nas
->
GetPayloadContainer
(
sm_msg
);
std
::
shared_ptr
<
itti_nsmf_pdusession_update_sm_context
>
itti_msg
=
std
::
make_shared
<
itti_nsmf_pdusession_update_sm_context
>
(
...
...
src/nas/ies/PDU_Session_Identity_2.cpp
View file @
51f3308d
...
...
@@ -54,12 +54,12 @@ PDU_Session_Identity_2::PDU_Session_Identity_2() {
PDU_Session_Identity_2
::~
PDU_Session_Identity_2
()
{}
//------------------------------------------------------------------------------
void
PDU_Session_Identity_2
::
s
etValue
(
uint8_t
value
)
{
void
PDU_Session_Identity_2
::
S
etValue
(
uint8_t
value
)
{
_value
=
value
;
}
//------------------------------------------------------------------------------
uint8_t
PDU_Session_Identity_2
::
g
etValue
()
{
uint8_t
PDU_Session_Identity_2
::
G
etValue
()
{
return
_value
;
}
...
...
src/nas/ies/PDU_Session_Identity_2.hpp
View file @
51f3308d
...
...
@@ -41,8 +41,8 @@ class PDU_Session_Identity_2 {
~
PDU_Session_Identity_2
();
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
uint8_t
*
buf
,
int
len
,
bool
is_option
);
void
s
etValue
(
uint8_t
value
);
uint8_t
g
etValue
();
void
S
etValue
(
uint8_t
value
);
uint8_t
G
etValue
();
private:
uint8_t
_iei
;
...
...
src/nas/msgs/AuthenticationFailure.cpp
View file @
51f3308d
...
...
@@ -51,7 +51,7 @@ void AuthenticationFailure::SetHeader(uint8_t security_header_type) {
}
//------------------------------------------------------------------------------
void
AuthenticationFailure
::
set_5GMM_
Cause
(
uint8_t
value
)
{
void
AuthenticationFailure
::
Set5gmm
Cause
(
uint8_t
value
)
{
ie_5gmm_cause
=
new
_5GMM_Cause
(
0x00
,
value
);
}
...
...
src/nas/msgs/AuthenticationFailure.hpp
View file @
51f3308d
...
...
@@ -40,7 +40,7 @@ class AuthenticationFailure {
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
set_5GMM_
Cause
(
uint8_t
value
);
void
Set5gmm
Cause
(
uint8_t
value
);
void
setAuthentication_Failure_Parameter
(
bstring
auts
);
uint8_t
get5GMmCause
();
...
...
src/nas/msgs/DLNASTransport.cpp
View file @
51f3308d
...
...
@@ -61,19 +61,19 @@ void DLNASTransport::SetPayloadContainerType(uint8_t value) {
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
SetPayload
_
Container
(
void
DLNASTransport
::
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
=
new
Payload_Container
(
content
);
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
SetPayload
_
Container
(
uint8_t
*
buf
,
int
len
)
{
void
DLNASTransport
::
SetPayloadContainer
(
uint8_t
*
buf
,
int
len
)
{
bstring
b
=
blk2bstr
(
buf
,
len
);
ie_payload_container
=
new
Payload_Container
(
b
);
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
setPDU
SessionId
(
uint8_t
value
)
{
void
DLNASTransport
::
SetPdu
SessionId
(
uint8_t
value
)
{
ie_pdu_session_identity_2
=
new
PDU_Session_Identity_2
(
0x12
,
value
);
}
...
...
@@ -83,12 +83,12 @@ void DLNASTransport::SetAdditionalInformation(uint8_t _length, uint8_t value) {
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
set_5GMM_
Cause
(
uint8_t
value
)
{
void
DLNASTransport
::
Set5gmm
Cause
(
uint8_t
value
)
{
ie_5gmm_cause
=
new
_5GMM_Cause
(
0x58
,
value
);
}
//------------------------------------------------------------------------------
void
DLNASTransport
::
setBack_off_timer_v
alue
(
uint8_t
unit
,
uint8_t
value
)
{
void
DLNASTransport
::
SetBackOffTimerV
alue
(
uint8_t
unit
,
uint8_t
value
)
{
ie_back_off_timer_value
=
new
GprsTimer3
(
0x37
,
unit
,
value
);
}
...
...
src/nas/msgs/DLNASTransport.hpp
View file @
51f3308d
...
...
@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
/*! \file
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#ifndef _DLNASTransport_H_
#define _DLNASTransport_H_
#ifndef _DL_NAS_TRANSPORT_H_
#define _DL_NAS_TRANSPORT_H_
#include "NasIeHeader.hpp"
...
...
@@ -37,16 +30,21 @@ class DLNASTransport {
public:
DLNASTransport
();
~
DLNASTransport
();
void
SetHeader
(
uint8_t
security_header_type
);
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
SetPayloadContainerType
(
uint8_t
value
);
void
SetPayload_Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
SetPayload_Container
(
uint8_t
*
buf
,
int
len
);
void
setPDUSessionId
(
uint8_t
value
);
void
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
SetPayloadContainer
(
uint8_t
*
buf
,
int
len
);
void
SetPduSessionId
(
uint8_t
value
);
void
SetAdditionalInformation
(
uint8_t
_length
,
uint8_t
value
);
void
set_5GMM_
Cause
(
uint8_t
value
);
void
setBack_off_timer_v
alue
(
uint8_t
unit
,
uint8_t
value
);
void
Set5gmm
Cause
(
uint8_t
value
);
void
SetBackOffTimerV
alue
(
uint8_t
unit
,
uint8_t
value
);
public:
NasMmPlainHeader
*
plain_header
;
...
...
src/nas/msgs/RegistrationReject.cpp
View file @
51f3308d
...
...
@@ -45,7 +45,7 @@ void RegistrationReject::SetHeader(uint8_t security_header_type) {
}
//------------------------------------------------------------------------------
void
RegistrationReject
::
set_5GMM_
Cause
(
uint8_t
value
)
{
void
RegistrationReject
::
Set5gmm
Cause
(
uint8_t
value
)
{
ie_5gmm_cause
.
setValue
(
value
);
}
...
...
src/nas/msgs/RegistrationReject.hpp
View file @
51f3308d
...
...
@@ -38,7 +38,7 @@ class RegistrationReject : public NasMmPlainHeader {
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
set_5GMM_
Cause
(
uint8_t
value
);
void
Set5gmm
Cause
(
uint8_t
value
);
// TODO: Get
void
setGPRS_Timer_2_3346
(
uint8_t
value
);
...
...
src/nas/msgs/RegistrationRequest.cpp
View file @
51f3308d
...
...
@@ -440,7 +440,7 @@ uint8_t RegistrationRequest::GetPayloadContainerType() {
}
//------------------------------------------------------------------------------
void
RegistrationRequest
::
SetPayload
_
Container
(
void
RegistrationRequest
::
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
=
std
::
make_optional
<
Payload_Container
>
(
kIeiPayloadContainer
,
content
);
...
...
src/nas/msgs/RegistrationRequest.hpp
View file @
51f3308d
...
...
@@ -124,7 +124,7 @@ class RegistrationRequest : public NasMmPlainHeader {
void
SetPayloadContainerType
(
uint8_t
value
);
uint8_t
GetPayloadContainerType
();
void
SetPayload
_
Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
);
bool
GetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
void
setNetwork_Slicing_Indication
(
bool
dcni
,
bool
nssci
);
...
...
src/nas/msgs/SecurityModeReject.cpp
View file @
51f3308d
...
...
@@ -51,7 +51,7 @@ void SecurityModeReject::SetHeader(uint8_t security_header_type) {
}
//------------------------------------------------------------------------------
void
SecurityModeReject
::
set_5GMM_
Cause
(
uint8_t
value
)
{
void
SecurityModeReject
::
Set5gmm
Cause
(
uint8_t
value
)
{
ie_5gmm_cause
=
new
_5GMM_Cause
(
0x00
,
value
);
}
...
...
src/nas/msgs/SecurityModeReject.hpp
View file @
51f3308d
...
...
@@ -40,7 +40,7 @@ class SecurityModeReject {
int
Encode
(
uint8_t
*
buf
,
int
len
);
int
Decode
(
NasMmPlainHeader
*
header
,
uint8_t
*
buf
,
int
len
);
void
SetHeader
(
uint8_t
security_header_type
);
void
set_5GMM_
Cause
(
uint8_t
value
);
void
Set5gmm
Cause
(
uint8_t
value
);
public:
NasMmPlainHeader
*
plain_header
;
...
...
src/nas/msgs/ULNASTransport.cpp
View file @
51f3308d
...
...
@@ -54,11 +54,11 @@ void ULNASTransport::SetPayloadContainerType(uint8_t value) {
//------------------------------------------------------------------------------
uint8_t
ULNASTransport
::
GetPayloadContainerType
()
{
return
ie_payload_container_type
->
GetValue
();
return
ie_payload_container_type
.
GetValue
();
}
//------------------------------------------------------------------------------
void
ULNASTransport
::
SetPayload
_
Container
(
void
ULNASTransport
::
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
)
{
ie_payload_container
.
SetValue
(
content
);
}
...
...
@@ -83,7 +83,7 @@ void ULNASTransport::SetPduSessionIdentity2(uint8_t value) {
//------------------------------------------------------------------------------
uint8_t
ULNASTransport
::
GetPduSessionId
()
{
if
(
ie_pdu_session_identity_2
.
has_value
())
{
return
ie_pdu_session_identity_2
.
value
().
g
etValue
();
return
ie_pdu_session_identity_2
.
value
().
G
etValue
();
}
else
{
return
-
1
;
}
...
...
@@ -96,9 +96,9 @@ void ULNASTransport::SetOldPduSessionIdentity2(uint8_t value) {
}
//------------------------------------------------------------------------------
bool
ULNASTransport
::
GetOldPduSessionId
(
uint8_t
&
value
)
const
{
bool
ULNASTransport
::
GetOldPduSessionId
(
uint8_t
&
value
)
{
if
(
ie_old_pdu_session_identity_2
.
has_value
())
{
value
=
ie_old_pdu_session_identity_2
.
value
().
g
etValue
();
value
=
ie_old_pdu_session_identity_2
.
value
().
G
etValue
();
return
true
;
}
else
{
return
false
;
...
...
@@ -332,16 +332,16 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
decoded_size
+=
decoded_result
;
// Payload Container Type
decoded_result
=
ie_payload_container_type
->
Decode
(
decoded_result
=
ie_payload_container_type
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
);
if
(
decoded_result
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
decoded_size
+=
decoded_result
;
decoded_size
++
;
// 1/2 octet for PayloadContainerType, 1/2 octet for spare
// Payload Container
decoded_result
+=
ie_payload_container
->
Decode
(
decoded_result
+=
ie_payload_container
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
false
,
ie_payload_container_type
->
GetValue
());
ie_payload_container_type
.
GetValue
());
if
(
decoded_result
==
KEncodeDecodeError
)
return
KEncodeDecodeError
;
decoded_size
+=
decoded_result
;
...
...
@@ -411,7 +411,7 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
}
break
;
case
0x59
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x59)"
);
PDU_Session_Identity_2
PDU_Session_Identity_2
=
{};
PDU_Session_Identity_2
ie_old_pdu_session_identity_2_tmp
=
{};
if
((
decoded_result
=
ie_old_pdu_session_identity_2_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
...
...
@@ -436,7 +436,7 @@ int ULNASTransport::Decode(NasMmPlainHeader* header, uint8_t* buf, int len) {
}
break
;
case
0x25
:
{
Logger
::
nas_mm
().
debug
(
"Decoding IEI (0x25)"
);
DNN
ie_dnn
=
{};
DNN
ie_dnn
_tmp
=
{};
if
((
decoded_result
=
ie_dnn_tmp
.
Decode
(
buf
+
decoded_size
,
len
-
decoded_size
,
true
))
==
KEncodeDecodeError
)
...
...
src/nas/msgs/ULNASTransport.hpp
View file @
51f3308d
...
...
@@ -39,7 +39,7 @@ class ULNASTransport : public NasMmPlainHeader {
void
SetPayloadContainerType
(
uint8_t
value
);
uint8_t
GetPayloadContainerType
();
void
SetPayload
_
Container
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
SetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>
content
);
void
GetPayloadContainer
(
std
::
vector
<
PayloadContainerEntry
>&
content
);
void
GetPayloadContainer
(
bstring
&
content
);
...
...
@@ -47,7 +47,7 @@ class ULNASTransport : public NasMmPlainHeader {
uint8_t
GetPduSessionId
();
void
SetOldPduSessionIdentity2
(
uint8_t
value
);
bool
GetOldPduSessionId
(
uint8_t
&
value
)
const
;
bool
GetOldPduSessionId
(
uint8_t
&
value
);
void
SetRequestType
(
uint8_t
value
);
bool
GetRequestType
(
uint8_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