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
0344ddc8
Commit
0344ddc8
authored
Aug 26, 2022
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code refactoring for NAS PDU
parent
49a301cf
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
38 additions
and
46 deletions
+38
-46
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+0
-1
src/ngap/ngapIEs/NAS-PDU.cpp
src/ngap/ngapIEs/NAS-PDU.cpp
+13
-13
src/ngap/ngapIEs/NAS-PDU.hpp
src/ngap/ngapIEs/NAS-PDU.hpp
+4
-4
src/ngap/ngapIEs/PDUSessionResourceModifyItemModReq.cpp
src/ngap/ngapIEs/PDUSessionResourceModifyItemModReq.cpp
+2
-4
src/ngap/ngapIEs/PDUSessionResourceSetupItemCxtReq.cpp
src/ngap/ngapIEs/PDUSessionResourceSetupItemCxtReq.cpp
+2
-3
src/ngap/ngapIEs/PDUSessionResourceSetupItemSUReq.cpp
src/ngap/ngapIEs/PDUSessionResourceSetupItemSUReq.cpp
+2
-3
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
+3
-4
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
+2
-2
src/ngap/ngapMsgs/InitialUEMessage.cpp
src/ngap/ngapMsgs/InitialUEMessage.cpp
+3
-4
src/ngap/ngapMsgs/PduSessionResourceReleaseCommand.cpp
src/ngap/ngapMsgs/PduSessionResourceReleaseCommand.cpp
+2
-2
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
+2
-2
src/ngap/ngapMsgs/UplinkNASTransport.cpp
src/ngap/ngapMsgs/UplinkNASTransport.cpp
+3
-4
No files found.
src/amf-app/amf_n2.cpp
View file @
0344ddc8
...
@@ -664,7 +664,6 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
...
@@ -664,7 +664,6 @@ void amf_n2::handle_itti_message(itti_initial_ue_message& init_ue_msg) {
uint8_t
*
nas_buf
=
nullptr
;
uint8_t
*
nas_buf
=
nullptr
;
size_t
nas_len
=
0
;
size_t
nas_len
=
0
;
if
(
init_ue_msg
.
initUeMsg
->
getNasPdu
(
nas_buf
,
nas_len
))
{
if
(
init_ue_msg
.
initUeMsg
->
getNasPdu
(
nas_buf
,
nas_len
))
{
// bstring nas = blk2bstr(nas_buf, nas_len);
itti_msg
->
nas_buf
=
blk2bstr
(
nas_buf
,
nas_len
);
itti_msg
->
nas_buf
=
blk2bstr
(
nas_buf
,
nas_len
);
}
else
{
}
else
{
Logger
::
amf_n2
().
error
(
"Missing IE NAS-PDU"
);
Logger
::
amf_n2
().
error
(
"Missing IE NAS-PDU"
);
...
...
src/ngap/ngapIEs/NAS-PDU.cpp
View file @
0344ddc8
...
@@ -25,41 +25,41 @@ namespace ngap {
...
@@ -25,41 +25,41 @@ namespace ngap {
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
NAS_PDU
::
NAS_PDU
()
{
NAS_PDU
::
NAS_PDU
()
{
naspdubuffer
=
NULL
;
buffer_
=
nullptr
;
buffersize
=
-
1
;
size_
=
-
1
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
NAS_PDU
::~
NAS_PDU
()
{}
NAS_PDU
::~
NAS_PDU
()
{}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
NAS_PDU
::
encode
2octetstring
(
Ngap_NAS_PDU_t
&
m_nas
pdu
)
{
bool
NAS_PDU
::
encode
(
Ngap_NAS_PDU_t
&
nas_
pdu
)
{
int
ret
;
int
ret
;
ret
=
OCTET_STRING_fromBuf
(
&
m_naspdu
,
naspdubuffer
,
buffersize
);
ret
=
OCTET_STRING_fromBuf
(
&
nas_pdu
,
buffer_
,
size_
);
if
(
ret
!=
0
)
return
false
;
if
(
ret
!=
0
)
return
false
;
return
true
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
NAS_PDU
::
decode
fromoctetstring
(
Ngap_NAS_PDU_t
&
m_nas
pdu
)
{
bool
NAS_PDU
::
decode
(
Ngap_NAS_PDU_t
&
nas_
pdu
)
{
naspdubuffer
=
(
char
*
)
m_nas
pdu
.
buf
;
buffer_
=
(
char
*
)
nas_
pdu
.
buf
;
buffersize
=
m_nas
pdu
.
size
;
size_
=
nas_
pdu
.
size
;
return
true
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
bool
NAS_PDU
::
getNasPdu
(
uint8_t
*&
buffer
,
size_t
&
size
)
const
{
bool
NAS_PDU
::
getNasPdu
(
uint8_t
*&
buffer
,
size_t
&
size
)
const
{
buffer
=
(
uint8_t
*
)
naspdubuffer
;
buffer
=
(
uint8_t
*
)
buffer_
;
size
=
buffersize
;
size
=
size_
;
if
(
!
naspdubuffer
)
return
false
;
if
(
!
buffer_
)
return
false
;
if
(
buffersize
<
0
)
return
false
;
if
(
size_
<
0
)
return
false
;
return
true
;
return
true
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
NAS_PDU
::
setNasPdu
(
uint8_t
*
buffer
,
size_t
size
)
{
void
NAS_PDU
::
setNasPdu
(
uint8_t
*
buffer
,
size_t
size
)
{
naspdubuffer
=
(
char
*
)
buffer
;
buffer_
=
(
char
*
)
buffer
;
buffersize
=
size
;
size_
=
size
;
}
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapIEs/NAS-PDU.hpp
View file @
0344ddc8
...
@@ -33,14 +33,14 @@ class NAS_PDU {
...
@@ -33,14 +33,14 @@ class NAS_PDU {
NAS_PDU
();
NAS_PDU
();
virtual
~
NAS_PDU
();
virtual
~
NAS_PDU
();
bool
encode
2octetstring
(
Ngap_NAS_PDU_t
&
);
bool
encode
(
Ngap_NAS_PDU_t
&
);
bool
decode
fromoctetstring
(
Ngap_NAS_PDU_t
&
);
bool
decode
(
Ngap_NAS_PDU_t
&
);
bool
getNasPdu
(
uint8_t
*&
buffer
,
size_t
&
size
)
const
;
bool
getNasPdu
(
uint8_t
*&
buffer
,
size_t
&
size
)
const
;
void
setNasPdu
(
uint8_t
*
buffer
,
size_t
size
);
void
setNasPdu
(
uint8_t
*
buffer
,
size_t
size
);
private:
private:
char
*
naspdubuffer
;
char
*
buffer_
;
size_t
buffersize
;
size_t
size_
;
};
};
}
// namespace ngap
}
// namespace ngap
...
...
src/ngap/ngapIEs/PDUSessionResourceModifyItemModReq.cpp
View file @
0344ddc8
...
@@ -61,8 +61,7 @@ bool PDUSessionResourceModifyItemModReq::
...
@@ -61,8 +61,7 @@ bool PDUSessionResourceModifyItemModReq::
pduSessionResourceModifyItemModReq
.
nAS_PDU
=
pduSessionResourceModifyItemModReq
.
nAS_PDU
=
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
if
(
!
pduSessionResourceModifyItemModReq
.
nAS_PDU
)
return
false
;
if
(
!
pduSessionResourceModifyItemModReq
.
nAS_PDU
)
return
false
;
if
(
!
nAS_PDU
->
encode2octetstring
(
if
(
!
nAS_PDU
->
encode
(
*
pduSessionResourceModifyItemModReq
.
nAS_PDU
))
{
*
pduSessionResourceModifyItemModReq
.
nAS_PDU
))
{
if
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
!=
nullptr
)
if
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
!=
nullptr
)
free
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
);
free
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
);
return
false
;
return
false
;
...
@@ -86,8 +85,7 @@ bool PDUSessionResourceModifyItemModReq::
...
@@ -86,8 +85,7 @@ bool PDUSessionResourceModifyItemModReq::
if
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
)
{
if
(
pduSessionResourceModifyItemModReq
.
nAS_PDU
)
{
nAS_PDU
=
new
NAS_PDU
();
nAS_PDU
=
new
NAS_PDU
();
if
(
!
nAS_PDU
->
decodefromoctetstring
(
if
(
!
nAS_PDU
->
decode
(
*
pduSessionResourceModifyItemModReq
.
nAS_PDU
))
*
pduSessionResourceModifyItemModReq
.
nAS_PDU
))
return
false
;
return
false
;
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceSetupItemCxtReq.cpp
View file @
0344ddc8
...
@@ -72,7 +72,7 @@ bool PDUSessionResourceSetupItemCxtReq::
...
@@ -72,7 +72,7 @@ bool PDUSessionResourceSetupItemCxtReq::
Ngap_NAS_PDU_t
*
naspdu
=
Ngap_NAS_PDU_t
*
naspdu
=
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
if
(
!
naspdu
)
return
false
;
if
(
!
naspdu
)
return
false
;
if
(
!
nAS_PDU
->
encode
2octetstring
(
*
naspdu
))
{
if
(
!
nAS_PDU
->
encode
(
*
naspdu
))
{
free_wrapper
((
void
**
)
&
naspdu
);
free_wrapper
((
void
**
)
&
naspdu
);
return
false
;
return
false
;
}
}
...
@@ -100,8 +100,7 @@ bool PDUSessionResourceSetupItemCxtReq::
...
@@ -100,8 +100,7 @@ bool PDUSessionResourceSetupItemCxtReq::
if
(
pduSessionResourceSetupItemCxtReq
->
nAS_PDU
)
{
if
(
pduSessionResourceSetupItemCxtReq
->
nAS_PDU
)
{
if
(
nAS_PDU
==
nullptr
)
nAS_PDU
=
new
NAS_PDU
();
if
(
nAS_PDU
==
nullptr
)
nAS_PDU
=
new
NAS_PDU
();
if
(
!
nAS_PDU
->
decodefromoctetstring
(
if
(
!
nAS_PDU
->
decode
(
*
pduSessionResourceSetupItemCxtReq
->
nAS_PDU
))
*
pduSessionResourceSetupItemCxtReq
->
nAS_PDU
))
return
false
;
return
false
;
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceSetupItemSUReq.cpp
View file @
0344ddc8
...
@@ -68,7 +68,7 @@ bool PDUSessionResourceSetupItemSUReq::encode2PDUSessionResourceSetupItemSUReq(
...
@@ -68,7 +68,7 @@ bool PDUSessionResourceSetupItemSUReq::encode2PDUSessionResourceSetupItemSUReq(
Ngap_NAS_PDU_t
*
naspdu
=
Ngap_NAS_PDU_t
*
naspdu
=
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
(
Ngap_NAS_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NAS_PDU_t
));
if
(
!
naspdu
)
return
false
;
if
(
!
naspdu
)
return
false
;
if
(
!
nAS_PDU
->
encode
2octetstring
(
*
naspdu
))
{
if
(
!
nAS_PDU
->
encode
(
*
naspdu
))
{
free_wrapper
((
void
**
)
&
naspdu
);
free_wrapper
((
void
**
)
&
naspdu
);
return
false
;
return
false
;
}
}
...
@@ -93,8 +93,7 @@ bool PDUSessionResourceSetupItemSUReq::
...
@@ -93,8 +93,7 @@ bool PDUSessionResourceSetupItemSUReq::
if
(
pduSessionResourceSetupItemSUReq
->
pDUSessionNAS_PDU
)
{
if
(
pduSessionResourceSetupItemSUReq
->
pDUSessionNAS_PDU
)
{
nAS_PDU
=
new
NAS_PDU
();
nAS_PDU
=
new
NAS_PDU
();
if
(
!
nAS_PDU
->
decodefromoctetstring
(
if
(
!
nAS_PDU
->
decode
(
*
pduSessionResourceSetupItemSUReq
->
pDUSessionNAS_PDU
))
*
pduSessionResourceSetupItemSUReq
->
pDUSessionNAS_PDU
))
return
false
;
return
false
;
}
}
...
...
src/ngap/ngapMsgs/DownlinkNasTransport.cpp
View file @
0344ddc8
...
@@ -154,7 +154,7 @@ void DownLinkNasTransportMsg::setNasPdu(uint8_t* nas, size_t sizeofnas) {
...
@@ -154,7 +154,7 @@ void DownLinkNasTransportMsg::setNasPdu(uint8_t* nas, size_t sizeofnas) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_DownlinkNASTransport_IEs__value_PR_NAS_PDU
;
ie
->
value
.
present
=
Ngap_DownlinkNASTransport_IEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
.
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
.
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Encode NAS_PDU IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -284,9 +284,8 @@ bool DownLinkNasTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -284,9 +284,8 @@ bool DownLinkNasTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
Ngap_Criticality_reject
&&
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_DownlinkNASTransport_IEs__value_PR_NAS_PDU
)
{
Ngap_DownlinkNASTransport_IEs__value_PR_NAS_PDU
)
{
if
(
!
nasPdu
.
decodefromoctetstring
(
if
(
!
nasPdu
.
decode
(
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
downLinkNasTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
Logger
::
ngap
().
error
(
"Decode NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Decode NGAP NAS_PDU IE error"
);
return
false
;
return
false
;
}
}
...
...
src/ngap/ngapMsgs/InitialContextSetupRequest.cpp
View file @
0344ddc8
...
@@ -383,7 +383,7 @@ void InitialContextSetupRequestMsg::setNasPdu(uint8_t* nas, size_t size) {
...
@@ -383,7 +383,7 @@ void InitialContextSetupRequestMsg::setNasPdu(uint8_t* nas, size_t size) {
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_InitialContextSetupRequestIEs__value_PR_NAS_PDU
;
ie
->
value
.
present
=
Ngap_InitialContextSetupRequestIEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
->
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
->
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NAS PDU error!"
);
Logger
::
ngap
().
error
(
"Encode NAS PDU error!"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -638,7 +638,7 @@ bool InitialContextSetupRequestMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -638,7 +638,7 @@ bool InitialContextSetupRequestMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
->
value
.
present
==
->
value
.
present
==
Ngap_InitialContextSetupRequestIEs__value_PR_NAS_PDU
)
{
Ngap_InitialContextSetupRequestIEs__value_PR_NAS_PDU
)
{
nasPdu
=
new
NAS_PDU
();
nasPdu
=
new
NAS_PDU
();
if
(
!
nasPdu
->
decode
fromoctetstring
(
if
(
!
nasPdu
->
decode
(
initialContextSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
initialContextSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
...
...
src/ngap/ngapMsgs/InitialUEMessage.cpp
View file @
0344ddc8
...
@@ -81,7 +81,7 @@ void InitialUEMessageMsg::setNasPdu(uint8_t* nas, size_t size) {
...
@@ -81,7 +81,7 @@ void InitialUEMessageMsg::setNasPdu(uint8_t* nas, size_t size) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_InitialUEMessage_IEs__value_PR_NAS_PDU
;
ie
->
value
.
present
=
Ngap_InitialUEMessage_IEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
.
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
.
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NAS PDU IE error"
);
Logger
::
ngap
().
error
(
"Encode NAS PDU IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -218,9 +218,8 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -218,9 +218,8 @@ bool InitialUEMessageMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
Ngap_Criticality_reject
&&
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_InitialUEMessage_IEs__value_PR_NAS_PDU
)
{
Ngap_InitialUEMessage_IEs__value_PR_NAS_PDU
)
{
if
(
!
nasPdu
.
decodefromoctetstring
(
if
(
!
nasPdu
.
decode
(
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
initialUEMessageIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
return
false
;
return
false
;
}
}
...
...
src/ngap/ngapMsgs/PduSessionResourceReleaseCommand.cpp
View file @
0344ddc8
...
@@ -149,7 +149,7 @@ void PduSessionResourceReleaseCommandMsg::setNasPdu(uint8_t* nas, size_t size) {
...
@@ -149,7 +149,7 @@ void PduSessionResourceReleaseCommandMsg::setNasPdu(uint8_t* nas, size_t size) {
ie
->
value
.
present
=
ie
->
value
.
present
=
Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_NAS_PDU
;
Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
->
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
->
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
nas_mm
().
warn
(
"encode NAS_PDU IE error"
);
Logger
::
nas_mm
().
warn
(
"encode NAS_PDU IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -328,7 +328,7 @@ bool PduSessionResourceReleaseCommandMsg::decodeFromPdu(
...
@@ -328,7 +328,7 @@ bool PduSessionResourceReleaseCommandMsg::decodeFromPdu(
->
value
.
present
==
->
value
.
present
==
Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_NAS_PDU
)
{
Ngap_PDUSessionResourceReleaseCommandIEs__value_PR_NAS_PDU
)
{
nasPdu
=
new
NAS_PDU
();
nasPdu
=
new
NAS_PDU
();
if
(
!
nasPdu
->
decode
fromoctetstring
(
if
(
!
nasPdu
->
decode
(
pduSessionResourceReleaseCommandIEs
->
protocolIEs
.
list
pduSessionResourceReleaseCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
...
...
src/ngap/ngapMsgs/PduSessionResourceSetupRequest.cpp
View file @
0344ddc8
...
@@ -178,7 +178,7 @@ void PduSessionResourceSetupRequestMsg::setNasPdu(uint8_t* nas, size_t size) {
...
@@ -178,7 +178,7 @@ void PduSessionResourceSetupRequestMsg::setNasPdu(uint8_t* nas, size_t size) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU
;
ie
->
value
.
present
=
Ngap_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
->
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
->
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Encode NGAP NAS_PDU IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -372,7 +372,7 @@ bool PduSessionResourceSetupRequestMsg::decodeFromPdu(
...
@@ -372,7 +372,7 @@ bool PduSessionResourceSetupRequestMsg::decodeFromPdu(
->
value
.
present
==
->
value
.
present
==
Ngap_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU
)
{
Ngap_PDUSessionResourceSetupRequestIEs__value_PR_NAS_PDU
)
{
nasPdu
=
new
NAS_PDU
();
nasPdu
=
new
NAS_PDU
();
if
(
!
nasPdu
->
decode
fromoctetstring
(
if
(
!
nasPdu
->
decode
(
pduSessionResourceSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
pduSessionResourceSetupRequestIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
...
...
src/ngap/ngapMsgs/UplinkNASTransport.cpp
View file @
0344ddc8
...
@@ -97,7 +97,7 @@ void UplinkNASTransportMsg::setNasPdu(uint8_t* nas, size_t sizeofnas) {
...
@@ -97,7 +97,7 @@ void UplinkNASTransportMsg::setNasPdu(uint8_t* nas, size_t sizeofnas) {
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_UplinkNASTransport_IEs__value_PR_NAS_PDU
;
ie
->
value
.
present
=
Ngap_UplinkNASTransport_IEs__value_PR_NAS_PDU
;
int
ret
=
nasPdu
.
encode
2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
int
ret
=
nasPdu
.
encode
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
if
(
!
ret
)
{
Logger
::
ngap
().
error
(
"Encode NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Encode NGAP NAS_PDU IE error"
);
free_wrapper
((
void
**
)
&
ie
);
free_wrapper
((
void
**
)
&
ie
);
...
@@ -224,9 +224,8 @@ bool UplinkNASTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
...
@@ -224,9 +224,8 @@ bool UplinkNASTransportMsg::decodeFromPdu(Ngap_NGAP_PDU_t* ngapMsgPdu) {
Ngap_Criticality_reject
&&
Ngap_Criticality_reject
&&
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkNASTransport_IEs__value_PR_NAS_PDU
)
{
Ngap_UplinkNASTransport_IEs__value_PR_NAS_PDU
)
{
if
(
!
nasPdu
.
decodefromoctetstring
(
if
(
!
nasPdu
.
decode
(
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
uplinkNASTransportIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
NAS_PDU
))
{
->
value
.
choice
.
NAS_PDU
))
{
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
Logger
::
ngap
().
error
(
"Decoded NGAP NAS_PDU IE error"
);
return
false
;
return
false
;
}
}
...
...
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