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
e324c6f5
Commit
e324c6f5
authored
Jul 05, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue for nullptr for HO
parent
d524d28d
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
36 deletions
+67
-36
src/ngap/ngapMsgs/DownLinkNasTransport.cpp
src/ngap/ngapMsgs/DownLinkNasTransport.cpp
+14
-14
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
+10
-2
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
+2
-2
src/ngap/ngapMsgs/HandoverRequestAck.cpp
src/ngap/ngapMsgs/HandoverRequestAck.cpp
+11
-3
src/ngap/ngapMsgs/HandoverRequestAck.hpp
src/ngap/ngapMsgs/HandoverRequestAck.hpp
+0
-1
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
+28
-10
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
+2
-4
No files found.
src/ngap/ngapMsgs/DownLinkNasTransport.cpp
View file @
e324c6f5
...
...
@@ -27,6 +27,7 @@
*/
#include "DownLinkNasTransport.hpp"
#include "logger.hpp"
extern
"C"
{
#include "asn_codecs.h"
...
...
@@ -83,9 +84,8 @@ void DownLinkNasTransportMsg::setMessageType() {
&
(
downLinkNasTransportPdu
->
choice
.
initiatingMessage
->
value
.
choice
.
DownlinkNASTransport
);
}
else
{
cout
<<
"[warning] This information doesn't refer to DownlinkNASTransport "
"Message!!!"
<<
endl
;
Logger
::
ngap
().
warn
(
"This information doesn't refer to DownlinkNASTransport Message"
);
}
}
...
...
@@ -103,13 +103,13 @@ void DownLinkNasTransportMsg::setAmfUeNgapId(unsigned long id) {
int
ret
=
amfUeNgapId
->
encode2AMF_UE_NGAP_ID
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
);
if
(
!
ret
)
{
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode AMF_UE_NGAP_ID IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode AMF_UE_NGAP_ID IE error"
)
;
// free_wrapper((void**) &ie);
}
...
...
@@ -127,13 +127,13 @@ void DownLinkNasTransportMsg::setRanUeNgapId(uint32_t ran_ue_ngap_id) {
int
ret
=
ranUeNgapId
->
encode2RAN_UE_NGAP_ID
(
ie
->
value
.
choice
.
RAN_UE_NGAP_ID
);
if
(
!
ret
)
{
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode RAN_UE_NGAP_ID IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode RAN_UE_NGAP_ID IE error"
)
;
// free_wrapper((void**) &ie);
}
...
...
@@ -151,13 +151,13 @@ void DownLinkNasTransportMsg::setOldAmfName(const std::string name) {
int
ret
=
oldAmfName
->
encode2AmfName
(
&
ie
->
value
.
choice
.
AMFName
);
if
(
!
ret
)
{
cout
<<
"encode oldAmfName IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode oldAmfName IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode oldAmfName IE error"
<<
endl
;
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode oldAmfName IE error"
)
;
// free_wrapper((void**) &ie);
}
...
...
@@ -176,7 +176,7 @@ void DownLinkNasTransportMsg::setRanPagingPriority(uint8_t pagingPriority) {
int
ret
=
ranPagingPriority
->
encode2RANPagingPriority
(
ie
->
value
.
choice
.
RANPagingPriority
);
if
(
!
ret
)
{
cout
<<
"encode RANPagingPriority IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode RANPagingPriority IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
...
...
@@ -201,13 +201,13 @@ void DownLinkNasTransportMsg::setNasPdu(uint8_t* nas, size_t sizeofnas) {
int
ret
=
nasPdu
->
encode2octetstring
(
ie
->
value
.
choice
.
NAS_PDU
);
if
(
!
ret
)
{
cout
<<
"encode NAS_PDU IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode NAS_PDU IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode NAS_PDU IE error"
<<
endl
;
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode NAS_PDU IE error"
)
;
// free_wrapper((void**) &ie);
}
...
...
@@ -226,13 +226,13 @@ void DownLinkNasTransportMsg::setIndex2Rat_Frequency_SelectionPriority(
int
ret
=
indexToRFSP
->
encode2IndexToRFSP
(
ie
->
value
.
choice
.
IndexToRFSP
);
if
(
!
ret
)
{
cout
<<
"encode IndexToRFSP IE error"
<<
endl
;
Logger
::
ngap
().
error
(
"Encode IndexToRFSP IE error"
)
;
free_wrapper
((
void
**
)
&
ie
);
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
downLinkNasTransportIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode IndexToRFSP IE error"
<<
endl
;
if
(
ret
!=
0
)
Logger
::
ngap
().
error
(
"Encode IndexToRFSP IE error"
)
;
// free_wrapper((void**) &ie);
}
...
...
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
View file @
e324c6f5
...
...
@@ -51,7 +51,10 @@ HandoverNotifyMsg::HandoverNotifyMsg() {
HandoverNotifyMsg
::~
HandoverNotifyMsg
(){};
unsigned
long
HandoverNotifyMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
if
(
amfUeNgapId
)
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
else
return
0
;
}
int
HandoverNotifyMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverNotifyPdu
);
...
...
@@ -185,10 +188,15 @@ void HandoverNotifyMsg::setUserLocationInfoNR(
// free_wrapper((void**) &ie);
}
uint32_t
HandoverNotifyMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
if
(
ranUeNgapId
)
return
ranUeNgapId
->
getRanUeNgapId
();
else
return
0
;
}
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
)
{
if
(
!
userLocationInformation
)
return
false
;
UserLocationInformationNR
*
informationNR
;
userLocationInformation
->
getInformation
(
informationNR
);
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
!=
...
...
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
View file @
e324c6f5
...
...
@@ -48,8 +48,8 @@ class HandoverNotifyMsg {
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
void
setUserLocationInfoNR
(
struct
NrCgi_s
cig
,
struct
Tai_s
tai
);
unsigned
long
getAmfUeNgapId
();
// return -1;
uint32_t
getRanUeNgapId
();
// return -1;
unsigned
long
getAmfUeNgapId
();
uint32_t
getRanUeNgapId
();
bool
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
);
private:
...
...
src/ngap/ngapMsgs/HandoverRequestAck.cpp
View file @
e324c6f5
...
...
@@ -55,7 +55,10 @@ HandoverRequestAck::HandoverRequestAck() {
HandoverRequestAck
::~
HandoverRequestAck
()
{}
unsigned
long
HandoverRequestAck
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
if
(
amfUeNgapId
)
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
else
return
0
;
}
void
HandoverRequestAck
::
setMessageType
()
{
if
(
!
handoverRequestAckPdu
)
...
...
@@ -85,10 +88,15 @@ void HandoverRequestAck::setMessageType() {
}
}
uint32_t
HandoverRequestAck
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
if
(
ranUeNgapId
)
return
ranUeNgapId
->
getRanUeNgapId
();
else
return
0
;
}
OCTET_STRING_t
HandoverRequestAck
::
getTargetToSource_TransparentContainer
()
{
return
*
TargetToSource_TransparentContainer
;
if
(
TargetToSource_TransparentContainer
)
return
*
TargetToSource_TransparentContainer
;
return
OCTET_STRING_t
();
}
bool
HandoverRequestAck
::
getPDUSessionResourceAdmittedList
(
...
...
src/ngap/ngapMsgs/HandoverRequestAck.hpp
View file @
e324c6f5
...
...
@@ -65,7 +65,6 @@ class HandoverRequestAck {
private:
Ngap_NGAP_PDU_t
*
handoverRequestAckPdu
;
Ngap_HandoverRequestAcknowledge_t
*
handoverRequestAckIEs
;
/***************** for decoding ****************/
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
Ngap_HandoverType_t
*
handovertype
;
...
...
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
View file @
e324c6f5
...
...
@@ -52,31 +52,48 @@ HandoverRequiredMsg::HandoverRequiredMsg() {
HandoverRequiredMsg
::~
HandoverRequiredMsg
()
{}
unsigned
long
HandoverRequiredMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
if
(
amfUeNgapId
)
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
else
return
0
;
}
uint32_t
HandoverRequiredMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
if
(
ranUeNgapId
)
return
ranUeNgapId
->
getRanUeNgapId
();
else
return
0
;
}
Ngap_HandoverType_t
HandoverRequiredMsg
::
getHandoverType
()
{
return
*
handovertype
;
if
(
handovertype
)
return
*
handovertype
;
else
Ngap_HandoverType_t
();
}
Ngap_Cause_PR
HandoverRequiredMsg
::
getChoiceOfCause
()
{
return
cause
->
getChoiceOfCause
();
if
(
cause
)
return
cause
->
getChoiceOfCause
();
else
return
Ngap_Cause_PR
();
}
long
HandoverRequiredMsg
::
getCauseValue
()
{
return
cause
->
getValue
();
if
(
cause
)
return
cause
->
getValue
();
else
return
0
;
}
void
HandoverRequiredMsg
::
getGlobalRanNodeId
(
GlobalgNBId
*&
ptr
)
{
ptr
->
decodefromGlobalgNBId
(
targetid
->
choice
.
targetRANNodeID
->
globalRANNodeID
.
choice
.
globalGNB_ID
);
if
(
ptr
)
ptr
->
decodefromGlobalgNBId
(
targetid
->
choice
.
targetRANNodeID
->
globalRANNodeID
.
choice
.
globalGNB_ID
);
}
void
HandoverRequiredMsg
::
getTAI
(
TAI
*&
ptr
)
{
ptr
->
decodefromTAI
(
&
(
targetid
->
choice
.
targetRANNodeID
->
selectedTAI
));
if
(
ptr
)
ptr
->
decodefromTAI
(
&
(
targetid
->
choice
.
targetRANNodeID
->
selectedTAI
));
}
OCTET_STRING_t
HandoverRequiredMsg
::
getSourceToTarget_TransparentContainer
()
{
return
*
SourceToTarget_TransparentContainer
;
if
(
SourceToTarget_TransparentContainer
)
return
*
SourceToTarget_TransparentContainer
;
}
bool
HandoverRequiredMsg
::
getPDUSessionResourceList
(
...
...
@@ -103,7 +120,8 @@ bool HandoverRequiredMsg::getPDUSessionResourceList(
}
long
HandoverRequiredMsg
::
getDirectForwardingPathAvailability
()
{
return
*
directforwardingPathAvailability
;
if
(
directforwardingPathAvailability
)
return
*
directforwardingPathAvailability
;
}
bool
HandoverRequiredMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
...
...
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
View file @
e324c6f5
...
...
@@ -48,9 +48,8 @@ class HandoverRequiredMsg {
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
unsigned
long
getAmfUeNgapId
();
// return -1;(不存在)
uint32_t
getRanUeNgapId
();
// return -1;(不存在)
unsigned
long
getAmfUeNgapId
();
uint32_t
getRanUeNgapId
();
Ngap_HandoverType_t
getHandoverType
();
Ngap_Cause_PR
getChoiceOfCause
();
long
getCauseValue
();
...
...
@@ -63,7 +62,6 @@ class HandoverRequiredMsg {
private:
Ngap_NGAP_PDU_t
*
handoverRequiredPdu
;
Ngap_HandoverRequired_t
*
handoverRequiredIEs
;
/***************** for decoding ****************/
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
Ngap_HandoverType_t
*
handovertype
;
...
...
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