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-Simple
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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
CommunityXG
OpenXG-AMF-Simple
Commits
c6dfe333
Commit
c6dfe333
authored
Jan 03, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply google style format for new code
parent
210cc695
Changes
65
Hide whitespace changes
Inline
Side-by-side
Showing
65 changed files
with
3618 additions
and
3497 deletions
+3618
-3497
src/itti/msgs/itti_msg_n2.hpp
src/itti/msgs/itti_msg_n2.hpp
+78
-39
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.cpp
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.cpp
+32
-35
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.hpp
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.hpp
+16
-19
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.cpp
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.cpp
+44
-39
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.hpp
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.hpp
+24
-22
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.cpp
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.cpp
+53
-47
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.hpp
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.hpp
+24
-18
src/ngap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.cpp
...gap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.cpp
+76
-74
src/ngap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.hpp
...gap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.hpp
+18
-19
src/ngap/ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.cpp
.../ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.cpp
+82
-82
src/ngap/ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.hpp
.../ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.hpp
+22
-24
src/ngap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.cpp
...ap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.cpp
+65
-61
src/ngap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.hpp
...ap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.hpp
+21
-21
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.cpp
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.cpp
+42
-38
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.hpp
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.hpp
+22
-21
src/ngap/ngapIEs/PDUSessionResourceListHORqd.cpp
src/ngap/ngapIEs/PDUSessionResourceListHORqd.cpp
+51
-47
src/ngap/ngapIEs/PDUSessionResourceListHORqd.hpp
src/ngap/ngapIEs/PDUSessionResourceListHORqd.hpp
+22
-18
src/ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.cpp
...ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.cpp
+142
-139
src/ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.hpp
...ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.hpp
+24
-26
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.cpp
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.cpp
+48
-39
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.hpp
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.hpp
+23
-21
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.cpp
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.cpp
+58
-49
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.hpp
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.hpp
+24
-18
src/ngap/ngapIEs/PDUSessionResourceReleasedItemRelRes.cpp
src/ngap/ngapIEs/PDUSessionResourceReleasedItemRelRes.cpp
+3
-2
src/ngap/ngapIEs/PDUSessionResourceReleasedListRelRes.cpp
src/ngap/ngapIEs/PDUSessionResourceReleasedListRelRes.cpp
+4
-7
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.cpp
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.cpp
+53
-44
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.hpp
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.hpp
+25
-23
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.cpp
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.cpp
+56
-47
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.hpp
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.hpp
+24
-18
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.cpp
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.cpp
+33
-35
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.hpp
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.hpp
+20
-21
src/ngap/ngapIEs/QosFlowListWithDataForwarding.cpp
src/ngap/ngapIEs/QosFlowListWithDataForwarding.cpp
+31
-26
src/ngap/ngapIEs/QosFlowListWithDataForwarding.hpp
src/ngap/ngapIEs/QosFlowListWithDataForwarding.hpp
+22
-20
src/ngap/ngapIEs/QosFlowToBeForwardedItem.cpp
src/ngap/ngapIEs/QosFlowToBeForwardedItem.cpp
+23
-25
src/ngap/ngapIEs/QosFlowToBeForwardedItem.hpp
src/ngap/ngapIEs/QosFlowToBeForwardedItem.hpp
+13
-15
src/ngap/ngapIEs/QosFlowToBeForwardedList.cpp
src/ngap/ngapIEs/QosFlowToBeForwardedList.cpp
+35
-35
src/ngap/ngapIEs/QosFlowToBeForwardedList.hpp
src/ngap/ngapIEs/QosFlowToBeForwardedList.hpp
+15
-16
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.cpp
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.cpp
+34
-35
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.hpp
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.hpp
+17
-18
src/ngap/ngapIEs/dRBStatusDL.cpp
src/ngap/ngapIEs/dRBStatusDL.cpp
+30
-37
src/ngap/ngapIEs/dRBStatusDL.hpp
src/ngap/ngapIEs/dRBStatusDL.hpp
+15
-18
src/ngap/ngapIEs/dRBStatusDL18.cpp
src/ngap/ngapIEs/dRBStatusDL18.cpp
+28
-35
src/ngap/ngapIEs/dRBStatusDL18.hpp
src/ngap/ngapIEs/dRBStatusDL18.hpp
+15
-18
src/ngap/ngapIEs/dRBStatusUL.cpp
src/ngap/ngapIEs/dRBStatusUL.cpp
+30
-37
src/ngap/ngapIEs/dRBStatusUL.hpp
src/ngap/ngapIEs/dRBStatusUL.hpp
+15
-18
src/ngap/ngapIEs/dRBStatusUL18.cpp
src/ngap/ngapIEs/dRBStatusUL18.cpp
+28
-35
src/ngap/ngapIEs/dRBStatusUL18.hpp
src/ngap/ngapIEs/dRBStatusUL18.hpp
+15
-18
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.cpp
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.cpp
+59
-64
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.hpp
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.hpp
+19
-19
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.cpp
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.cpp
+49
-52
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.hpp
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.hpp
+17
-18
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.cpp
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.cpp
+132
-119
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.hpp
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.hpp
+19
-20
src/ngap/ngapMsgs/HandoverCommandMsg.cpp
src/ngap/ngapMsgs/HandoverCommandMsg.cpp
+294
-287
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
+48
-52
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
+166
-160
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
+23
-23
src/ngap/ngapMsgs/HandoverRequest.cpp
src/ngap/ngapMsgs/HandoverRequest.cpp
+406
-374
src/ngap/ngapMsgs/HandoverRequest.hpp
src/ngap/ngapMsgs/HandoverRequest.hpp
+49
-51
src/ngap/ngapMsgs/HandoverRequestAck.cpp
src/ngap/ngapMsgs/HandoverRequestAck.cpp
+311
-305
src/ngap/ngapMsgs/HandoverRequestAck.hpp
src/ngap/ngapMsgs/HandoverRequestAck.hpp
+26
-25
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
+240
-246
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
+39
-41
src/ngap/ngapMsgs/UplinkRANStatusTransfer.cpp
src/ngap/ngapMsgs/UplinkRANStatusTransfer.cpp
+108
-103
src/ngap/ngapMsgs/UplinkRANStatusTransfer.hpp
src/ngap/ngapMsgs/UplinkRANStatusTransfer.hpp
+18
-19
No files found.
src/itti/msgs/itti_msg_n2.hpp
View file @
c6dfe333
...
@@ -98,11 +98,17 @@ class itti_dl_nas_transport : public itti_msg_n2 {
...
@@ -98,11 +98,17 @@ class itti_dl_nas_transport : public itti_msg_n2 {
bstring
nas
;
bstring
nas
;
};
};
class
itti_initial_context_setup_request
:
public
itti_msg_n2
class
itti_initial_context_setup_request
:
public
itti_msg_n2
{
{
public:
public:
itti_initial_context_setup_request
(
const
task_id_t
origin
,
itti_initial_context_setup_request
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
INITIAL_CONTEXT_SETUP_REQUEST
,
origin
,
destination
)
{}
const
task_id_t
destination
)
itti_initial_context_setup_request
(
const
itti_initial_context_setup_request
&
i
)
:
itti_msg_n2
(
i
)
{
:
itti_msg_n2
(
INITIAL_CONTEXT_SETUP_REQUEST
,
origin
,
destination
)
{
}
itti_initial_context_setup_request
(
const
itti_initial_context_setup_request
&
i
)
:
itti_msg_n2
(
i
)
{
is_pdu_exist
=
false
;
is_pdu_exist
=
false
;
isn2sm_avaliable
=
false
;
isn2sm_avaliable
=
false
;
...
@@ -114,7 +120,7 @@ public:
...
@@ -114,7 +120,7 @@ public:
bool
is_sr
;
bool
is_sr
;
bstring
n2sm
;
bstring
n2sm
;
uint8_t
pdu_session_id
;
uint8_t
pdu_session_id
;
bool
is_pdu_exist
;
//true is no pdu context
bool
is_pdu_exist
;
//true is no pdu context
bool
isn2sm_avaliable
;
bool
isn2sm_avaliable
;
};
};
...
@@ -140,7 +146,7 @@ class itti_pdu_session_resource_setup_request : public itti_msg_n2 {
...
@@ -140,7 +146,7 @@ class itti_pdu_session_resource_setup_request : public itti_msg_n2 {
class
itti_pdu_session_resource_release_command
:
public
itti_msg_n2
{
class
itti_pdu_session_resource_release_command
:
public
itti_msg_n2
{
public:
public:
itti_pdu_session_resource_release_command
(
const
task_id_t
origin
,
itti_pdu_session_resource_release_command
(
const
task_id_t
origin
,
const
task_id_t
destination
)
const
task_id_t
destination
)
:
:
itti_msg_n2
(
PDU_SESSION_RESOURCE_RELEASE_COMMAND
,
origin
,
destination
)
{
itti_msg_n2
(
PDU_SESSION_RESOURCE_RELEASE_COMMAND
,
origin
,
destination
)
{
}
}
...
@@ -156,7 +162,6 @@ class itti_pdu_session_resource_release_command : public itti_msg_n2 {
...
@@ -156,7 +162,6 @@ class itti_pdu_session_resource_release_command : public itti_msg_n2 {
uint8_t
pdu_session_id
;
uint8_t
pdu_session_id
;
};
};
class
itti_ue_context_release_request
:
public
itti_msg_n2
{
class
itti_ue_context_release_request
:
public
itti_msg_n2
{
public:
public:
itti_ue_context_release_request
(
const
task_id_t
origin
,
itti_ue_context_release_request
(
const
task_id_t
origin
,
...
@@ -171,55 +176,89 @@ class itti_ue_context_release_request : public itti_msg_n2 {
...
@@ -171,55 +176,89 @@ class itti_ue_context_release_request : public itti_msg_n2 {
UEContextReleaseRequestMsg
*
ueCtxRel
;
UEContextReleaseRequestMsg
*
ueCtxRel
;
};
};
class
itti_ue_context_release_command
:
public
itti_msg_n2
class
itti_ue_context_release_command
:
public
itti_msg_n2
{
{
public:
public:
itti_ue_context_release_command
(
const
task_id_t
origin
,
itti_ue_context_release_command
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
UE_CONTEXT_RELEASE_COMMAND
,
origin
,
destination
)
{}
const
task_id_t
destination
)
itti_ue_context_release_command
(
const
itti_dl_nas_transport
&
i
)
:
itti_msg_n2
(
i
)
{}
:
itti_msg_n2
(
UE_CONTEXT_RELEASE_COMMAND
,
origin
,
destination
)
{
}
itti_ue_context_release_command
(
const
itti_dl_nas_transport
&
i
)
:
itti_msg_n2
(
i
)
{
}
public:
public:
uint32_t
ran_ue_ngap_id
;
uint32_t
ran_ue_ngap_id
;
long
amf_ue_ngap_id
;
long
amf_ue_ngap_id
;
Cause
cause
;
Cause
cause
;
};
};
class
itti_ue_radio_capability_indication
:
public
itti_msg_n2
class
itti_ue_radio_capability_indication
:
public
itti_msg_n2
{
{
public:
public:
itti_ue_radio_capability_indication
(
const
task_id_t
origin
,
itti_ue_radio_capability_indication
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
UE_RADIO_CAP_IND
,
origin
,
destination
)
{}
const
task_id_t
destination
)
itti_ue_radio_capability_indication
(
const
itti_ue_radio_capability_indication
&
i
)
:
itti_msg_n2
(
i
)
{}
:
itti_msg_n2
(
UE_RADIO_CAP_IND
,
origin
,
destination
)
{
}
itti_ue_radio_capability_indication
(
const
itti_ue_radio_capability_indication
&
i
)
:
itti_msg_n2
(
i
)
{
}
UeRadioCapabilityInfoIndicationMsg
*
ueRadioCap
;
UeRadioCapabilityInfoIndicationMsg
*
ueRadioCap
;
};
};
class
itti_handover_required
:
public
itti_msg_n2
class
itti_handover_required
:
public
itti_msg_n2
{
{
public:
public:
itti_handover_required
(
const
task_id_t
origin
,
const
task_id_t
destination
)
itti_handover_required
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
HANDOVER_REQUIRED
,
origin
,
destination
)
{}
:
itti_handover_required
(
const
itti_handover_required
&
i
)
:
itti_msg_n2
(
i
)
{}
itti_msg_n2
(
HANDOVER_REQUIRED
,
origin
,
destination
)
{
}
itti_handover_required
(
const
itti_handover_required
&
i
)
:
itti_msg_n2
(
i
)
{
}
HandoverRequiredMsg
*
handvoerRequ
;
HandoverRequiredMsg
*
handvoerRequ
;
};
};
class
itti_handover_request_Ack
:
public
itti_msg_n2
class
itti_handover_request_Ack
:
public
itti_msg_n2
{
{
public:
public:
itti_handover_request_Ack
(
const
task_id_t
origin
,
const
task_id_t
destination
)
itti_handover_request_Ack
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
HANDOVER_REQUEST_ACK
,
origin
,
destination
)
{}
:
itti_handover_request_Ack
(
const
itti_handover_request_Ack
&
i
)
:
itti_msg_n2
(
i
)
{}
itti_msg_n2
(
HANDOVER_REQUEST_ACK
,
origin
,
destination
)
{
}
itti_handover_request_Ack
(
const
itti_handover_request_Ack
&
i
)
:
itti_msg_n2
(
i
)
{
}
HandoverRequestAck
*
handoverrequestAck
;
HandoverRequestAck
*
handoverrequestAck
;
};
};
class
itti_handover_notify
:
public
itti_msg_n2
class
itti_handover_notify
:
public
itti_msg_n2
{
{
public:
public:
itti_handover_notify
(
const
task_id_t
origin
,
const
task_id_t
destination
)
itti_handover_notify
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
HANDOVER_NOTIFY
,
origin
,
destination
)
{}
:
itti_handover_notify
(
const
itti_handover_notify
&
i
)
:
itti_msg_n2
(
i
)
{}
itti_msg_n2
(
HANDOVER_NOTIFY
,
origin
,
destination
)
{
}
itti_handover_notify
(
const
itti_handover_notify
&
i
)
:
itti_msg_n2
(
i
)
{
}
HandoverNotifyMsg
*
handovernotify
;
HandoverNotifyMsg
*
handovernotify
;
};
};
class
itti_uplinkranstatsutransfer
:
public
itti_msg_n2
class
itti_uplinkranstatsutransfer
:
public
itti_msg_n2
{
{
public:
public:
itti_uplinkranstatsutransfer
(
const
task_id_t
origin
,
itti_uplinkranstatsutransfer
(
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
UPLINKRANSTATUSTRANSFER
,
origin
,
destination
)
{}
const
task_id_t
destination
)
itti_uplinkranstatsutransfer
(
const
itti_uplinkranstatsutransfer
&
i
)
:
itti_msg_n2
(
i
)
{}
:
itti_msg_n2
(
UPLINKRANSTATUSTRANSFER
,
origin
,
destination
)
{
}
itti_uplinkranstatsutransfer
(
const
itti_uplinkranstatsutransfer
&
i
)
:
itti_msg_n2
(
i
)
{
}
UplinkRANStatusTransfer
*
uplinkrantransfer
;
UplinkRANStatusTransfer
*
uplinkrantransfer
;
};
};
...
...
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.cpp
View file @
c6dfe333
...
@@ -30,38 +30,35 @@
...
@@ -30,38 +30,35 @@
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
COUNTValueForPDCP_SN18
::
COUNTValueForPDCP_SN18
()
{
COUNTValueForPDCP_SN18
::
COUNTValueForPDCP_SN18
()
pdcp
=
0
;
{
hfn_pdcp
=
0
;
pdcp
=
0
;
}
hfn_pdcp
=
0
;
COUNTValueForPDCP_SN18
::~
COUNTValueForPDCP_SN18
()
{
}
}
COUNTValueForPDCP_SN18
::~
COUNTValueForPDCP_SN18
()
{}
void
COUNTValueForPDCP_SN18
::
setvalue
(
long
pDCP
,
long
hfn_PDCP
)
{
void
COUNTValueForPDCP_SN18
::
setvalue
(
long
pDCP
,
long
hfn_PDCP
)
pdcp
=
pDCP
;
{
hfn_pdcp
=
hfn_PDCP
;
pdcp
=
pDCP
;
}
hfn_pdcp
=
hfn_PDCP
;
void
COUNTValueForPDCP_SN18
::
getvalue
(
long
&
pDCP
,
long
&
hFN_PDCP
)
{
}
pDCP
=
pdcp
;
void
COUNTValueForPDCP_SN18
::
getvalue
(
long
&
pDCP
,
long
&
hFN_PDCP
)
hFN_PDCP
=
hfn_pdcp
;
{
}
pDCP
=
pdcp
;
bool
COUNTValueForPDCP_SN18
::
encodedCOUNTValueForPDCP_SN18
(
hFN_PDCP
=
hfn_pdcp
;
Ngap_COUNTValueForPDCP_SN18_t
&
countvalue
)
{
}
countvalue
.
pDCP_SN18
=
pdcp
;
bool
COUNTValueForPDCP_SN18
::
encodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countvalue
)
countvalue
.
hFN_PDCP_SN18
=
hfn_pdcp
;
{
cout
<<
"the encode pdcp_sn18 is"
<<
countvalue
.
pDCP_SN18
<<
endl
;
countvalue
.
pDCP_SN18
=
pdcp
;
cout
<<
"the encode hfn_pdcp_sn18 is"
<<
countvalue
.
hFN_PDCP_SN18
<<
endl
;
countvalue
.
hFN_PDCP_SN18
=
hfn_pdcp
;
return
true
;
cout
<<
"the encode pdcp_sn18 is"
<<
countvalue
.
pDCP_SN18
<<
endl
;
}
cout
<<
"the encode hfn_pdcp_sn18 is"
<<
countvalue
.
hFN_PDCP_SN18
<<
endl
;
bool
COUNTValueForPDCP_SN18
::
decodedCOUNTValueForPDCP_SN18
(
return
true
;
Ngap_COUNTValueForPDCP_SN18_t
&
countValue
)
{
}
pdcp
=
countValue
.
pDCP_SN18
;
bool
COUNTValueForPDCP_SN18
::
decodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countValue
)
hfn_pdcp
=
countValue
.
hFN_PDCP_SN18
;
{
cout
<<
"the decode pdcp_sn18 is"
<<
countValue
.
pDCP_SN18
<<
endl
;
pdcp
=
countValue
.
pDCP_SN18
;
cout
<<
"the decode hfn_pdcp_sn18 is"
<<
countValue
.
hFN_PDCP_SN18
<<
endl
;
hfn_pdcp
=
countValue
.
hFN_PDCP_SN18
;
return
true
;
cout
<<
"the decode pdcp_sn18 is"
<<
countValue
.
pDCP_SN18
<<
endl
;
}
cout
<<
"the decode hfn_pdcp_sn18 is"
<<
countValue
.
hFN_PDCP_SN18
<<
endl
;
}
// namespace ngap
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/COUNTValueForPDCP_SN18.hpp
View file @
c6dfe333
...
@@ -27,27 +27,24 @@
...
@@ -27,27 +27,24 @@
*/
*/
#ifndef _COUNTVALUEFORPDCP_SN18_H_
#ifndef _COUNTVALUEFORPDCP_SN18_H_
#define _COUNTVALUEFORPDCP_SN18_H_
#define _COUNTVALUEFORPDCP_SN18_H_
extern
"C"
extern
"C"
{
{
#include "Ngap_COUNTValueForPDCP-SN18.h"
#include "Ngap_COUNTValueForPDCP-SN18.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
COUNTValueForPDCP_SN18
{
class
COUNTValueForPDCP_SN18
private:
{
/* data */
private:
long
pdcp
;
/* data */
long
hfn_pdcp
;
long
pdcp
;
long
hfn_pdcp
;
public:
public:
COUNTValueForPDCP_SN18
(
/* args */
);
COUNTValueForPDCP_SN18
(
/* args */
);
virtual
~
COUNTValueForPDCP_SN18
();
virtual
~
COUNTValueForPDCP_SN18
();
void
getvalue
(
long
&
pDCP
,
long
&
hFN_PDCP
);
void
getvalue
(
long
&
pDCP
,
long
&
hFN_PDCP
);
void
setvalue
(
long
pDCP
,
long
hfn_PDCP
);
void
setvalue
(
long
pDCP
,
long
hfn_PDCP
);
bool
encodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countvalue
);
bool
encodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countvalue
);
bool
decodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countValue
);
bool
decodedCOUNTValueForPDCP_SN18
(
Ngap_COUNTValueForPDCP_SN18_t
&
countValue
);
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.cpp
View file @
c6dfe333
...
@@ -25,48 +25,53 @@
...
@@ -25,48 +25,53 @@
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "PDUSessionResourceAdmittedItem.hpp"
#include "PDUSessionResourceAdmittedItem.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
PDUSessionResourceAdmittedItem
::
PDUSessionResourceAdmittedItem
()
PDUSessionResourceAdmittedItem
::
PDUSessionResourceAdmittedItem
()
{
{
pDUSessionID
=
NULL
;
pDUSessionID
=
NULL
;
}
}
PDUSessionResourceAdmittedItem
::~
PDUSessionResourceAdmittedItem
()
{
PDUSessionResourceAdmittedItem
::~
PDUSessionResourceAdmittedItem
(){}
}
void
PDUSessionResourceAdmittedItem
::
setPDUSessionResourceAdmittedItem
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequestAcktransfer
)
void
PDUSessionResourceAdmittedItem
::
setPDUSessionResourceAdmittedItem
(
{
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequestAcktransfer
)
{
pDUSessionID
=
m_pDUSessionID
;
pDUSessionID
=
m_pDUSessionID
;
handoverrequestAcktransfer
=
m_handoverrequestAcktransfer
;
handoverrequestAcktransfer
=
m_handoverrequestAcktransfer
;
}
}
bool
PDUSessionResourceAdmittedItem
::
encode2PDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
)
bool
PDUSessionResourceAdmittedItem
::
encode2PDUSessionResourceAdmittedItem
(
{
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
)
{
if
(
!
pDUSessionID
)
return
false
;
if
(
!
pDUSessionID
)
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pdUSessionResourceAdmittedItem
->
pDUSessionID
))
return
false
;
return
false
;
pdUSessionResourceAdmittedItem
->
handoverRequestAcknowledgeTransfer
=
handoverrequestAcktransfer
;
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pdUSessionResourceAdmittedItem
->
pDUSessionID
))
return
true
;
return
false
;
}
pdUSessionResourceAdmittedItem
->
handoverRequestAcknowledgeTransfer
=
//......
handoverrequestAcktransfer
;
bool
PDUSessionResourceAdmittedItem
::
decodefromPDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
)
{
return
true
;
pDUSessionID
=
new
PDUSessionID
();
}
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
pdUSessionResourceAdmittedItem
->
pDUSessionID
))
return
false
;
//�����......
handoverrequestAcktransfer
=
pdUSessionResourceAdmittedItem
->
handoverRequestAcknowledgeTransfer
;
bool
PDUSessionResourceAdmittedItem
::
decodefromPDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
)
{
return
true
;
pDUSessionID
=
new
PDUSessionID
();
}
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
void
PDUSessionResourceAdmittedItem
::
getPDUSessionResourceAdmittedItem
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequestAcktransfer
)
pdUSessionResourceAdmittedItem
->
pDUSessionID
))
{
return
false
;
m_pDUSessionID
=
pDUSessionID
;
handoverrequestAcktransfer
=
pdUSessionResourceAdmittedItem
m_handoverrequestAcktransfer
=
handoverrequestAcktransfer
;
->
handoverRequestAcknowledgeTransfer
;
}
return
true
;
}
void
PDUSessionResourceAdmittedItem
::
getPDUSessionResourceAdmittedItem
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequestAcktransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_handoverrequestAcktransfer
=
handoverrequestAcktransfer
;
}
}
}
src/ngap/ngapIEs/PDUSessionResourceAdmittedItem.hpp
View file @
c6dfe333
...
@@ -30,32 +30,34 @@
...
@@ -30,32 +30,34 @@
#include "PDUSessionID.hpp"
#include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceAdmittedItem.h"
#include "Ngap_PDUSessionResourceAdmittedItem.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceAdmittedItem
{
class
PDUSessionResourceAdmittedItem
{
public:
public:
PDUSessionResourceAdmittedItem
();
PDUSessionResourceAdmittedItem
();
virtual
~
PDUSessionResourceAdmittedItem
();
virtual
~
PDUSessionResourceAdmittedItem
();
void
setPDUSessionResourceAdmittedItem
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequestAcktransfer
);
void
setPDUSessionResourceAdmittedItem
(
void
getPDUSessionResourceAdmittedItem
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequestAcktransfer
);
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequestAcktransfer
);
bool
encode2PDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
);
void
getPDUSessionResourceAdmittedItem
(
bool
decodefromPDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
);
PDUSessionID
*&
m_pDUSessionID
,
private:
OCTET_STRING_t
&
m_handoverrequestAcktransfer
);
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
handoverrequestAcktransfer
;
bool
encode2PDUSessionResourceAdmittedItem
(
};
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
);
bool
decodefromPDUSessionResourceAdmittedItem
(
Ngap_PDUSessionResourceAdmittedItem_t
*
pdUSessionResourceAdmittedItem
);
private:
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
handoverrequestAcktransfer
;
};
}
}
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.cpp
View file @
c6dfe333
#include "PDUSessionResourceAdmittedList.hpp"
#include "PDUSessionResourceAdmittedList.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceAdmittedList
::
PDUSessionResourceAdmittedList
()
{
pduSessionResourceAdmittedItem
=
NULL
;
numofSessionResourceAdmittedItem
=
0
;
}
PDUSessionResourceAdmittedList
::~
PDUSessionResourceAdmittedList
(){}
void
PDUSessionResourceAdmittedList
::
setPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
,
int
num
)
{
pduSessionResourceAdmittedItem
=
m_pduSessionResourceAdmittedItem
;
numofSessionResourceAdmittedItem
=
num
;
}
bool
PDUSessionResourceAdmittedList
::
encode2PDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
)
{
for
(
int
i
=
0
;
i
<
numofSessionResourceAdmittedItem
;
i
++
)
{
Ngap_PDUSessionResourceAdmittedItem_t
*
response
=
(
Ngap_PDUSessionResourceAdmittedItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceAdmittedItem_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceAdmittedItem
[
i
].
encode2PDUSessionResourceAdmittedItem
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceAdmittedList
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceAdmittedList
::
decodefromPDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
)
{
numofSessionResourceAdmittedItem
=
pduSessionResourceAdmittedList
->
list
.
count
;
pduSessionResourceAdmittedItem
=
new
PDUSessionResourceAdmittedItem
[
numofSessionResourceAdmittedItem
]();
for
(
int
i
=
0
;
i
<
numofSessionResourceAdmittedItem
;
i
++
)
{
if
(
!
pduSessionResourceAdmittedItem
[
i
].
decodefromPDUSessionResourceAdmittedItem
(
pduSessionResourceAdmittedList
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceAdmittedList
::
getPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*&
m_pduSessionResourceAdmittedItem
,
int
&
num
)
{
m_pduSessionResourceAdmittedItem
=
pduSessionResourceAdmittedItem
;
num
=
numofSessionResourceAdmittedItem
;
}
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceAdmittedList
::
PDUSessionResourceAdmittedList
()
{
pduSessionResourceAdmittedItem
=
NULL
;
numofSessionResourceAdmittedItem
=
0
;
}
PDUSessionResourceAdmittedList
::~
PDUSessionResourceAdmittedList
()
{
}
void
PDUSessionResourceAdmittedList
::
setPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
,
int
num
)
{
pduSessionResourceAdmittedItem
=
m_pduSessionResourceAdmittedItem
;
numofSessionResourceAdmittedItem
=
num
;
}
bool
PDUSessionResourceAdmittedList
::
encode2PDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
)
{
for
(
int
i
=
0
;
i
<
numofSessionResourceAdmittedItem
;
i
++
)
{
Ngap_PDUSessionResourceAdmittedItem_t
*
response
=
(
Ngap_PDUSessionResourceAdmittedItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceAdmittedItem_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceAdmittedItem
[
i
].
encode2PDUSessionResourceAdmittedItem
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceAdmittedList
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceAdmittedList
::
decodefromPDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
)
{
numofSessionResourceAdmittedItem
=
pduSessionResourceAdmittedList
->
list
.
count
;
pduSessionResourceAdmittedItem
=
new
PDUSessionResourceAdmittedItem
[
numofSessionResourceAdmittedItem
]();
for
(
int
i
=
0
;
i
<
numofSessionResourceAdmittedItem
;
i
++
)
{
if
(
!
pduSessionResourceAdmittedItem
[
i
]
.
decodefromPDUSessionResourceAdmittedItem
(
pduSessionResourceAdmittedList
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceAdmittedList
::
getPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*&
m_pduSessionResourceAdmittedItem
,
int
&
num
)
{
m_pduSessionResourceAdmittedItem
=
pduSessionResourceAdmittedItem
;
num
=
numofSessionResourceAdmittedItem
;
}
}
src/ngap/ngapIEs/PDUSessionResourceAdmittedList.hpp
View file @
c6dfe333
...
@@ -3,26 +3,32 @@
...
@@ -3,26 +3,32 @@
#include "PDUSessionResourceAdmittedItem.hpp"
#include "PDUSessionResourceAdmittedItem.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceAdmittedList.h"
#include "Ngap_PDUSessionResourceAdmittedList.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceAdmittedList
{
class
PDUSessionResourceAdmittedList
{
public:
public:
PDUSessionResourceAdmittedList
();
PDUSessionResourceAdmittedList
();
virtual
~
PDUSessionResourceAdmittedList
();
virtual
~
PDUSessionResourceAdmittedList
();
void
setPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
,
int
num
);
void
setPDUSessionResourceAdmittedList
(
void
getPDUSessionResourceAdmittedList
(
PDUSessionResourceAdmittedItem
*&
m_pduSessionResourceAdmittedItem
,
int
&
num
);
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
,
int
num
);
bool
encode2PDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
);
void
getPDUSessionResourceAdmittedList
(
bool
decodefromPDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
);
PDUSessionResourceAdmittedItem
*&
m_pduSessionResourceAdmittedItem
,
private:
int
&
num
);
PDUSessionResourceAdmittedItem
*
pduSessionResourceAdmittedItem
;
int
numofSessionResourceAdmittedItem
;
bool
encode2PDUSessionResourceAdmittedList
(
};
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
);
bool
decodefromPDUSessionResourceAdmittedList
(
Ngap_PDUSessionResourceAdmittedList_t
*
pduSessionResourceAdmittedList
);
private:
PDUSessionResourceAdmittedItem
*
pduSessionResourceAdmittedItem
;
int
numofSessionResourceAdmittedItem
;
};
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.cpp
View file @
c6dfe333
...
@@ -26,8 +26,7 @@
...
@@ -26,8 +26,7 @@
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "PDUSessionResourceHandoverCommandTransfer.hpp"
#include "PDUSessionResourceHandoverCommandTransfer.hpp"
extern
"C"
extern
"C"
{
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
...
@@ -36,78 +35,81 @@ extern "C"
...
@@ -36,78 +35,81 @@ extern "C"
}
}
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
PDUSessionResourceHandoverCommandTransfer
::
PDUSessionResourceHandoverCommandTransfer
()
{
PDUSessionResourceHandoverCommandTransfer
::
PDUSessionResourceHandoverCommandTransfer
()
handovercommandtransferIE
=
(
Ngap_HandoverCommandTransfer_t
*
)
calloc
(
{
1
,
sizeof
(
Ngap_HandoverCommandTransfer_t
));
handovercommandtransferIE
=
(
Ngap_HandoverCommandTransfer_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandTransfer_t
));
dLForwardingUP_TNLInformation
=
NULL
;
dLForwardingUP_TNLInformation
=
NULL
;
qosFlowToBeForwardedList
=
NULL
;
qosFlowToBeForwardedList
=
NULL
;
}
PDUSessionResourceHandoverCommandTransfer
::~
PDUSessionResourceHandoverCommandTransfer
()
{
}
void
PDUSessionResourceHandoverCommandTransfer
::
setQosFlowToBeForwardedList
(
std
::
vector
<
QosFlowToBeForwardedItem_t
>
list
)
{
if
(
!
qosFlowToBeForwardedList
)
qosFlowToBeForwardedList
=
new
QosFlowToBeForwardedList
();
QosFlowToBeForwardedItem
*
m_item
=
new
QosFlowToBeForwardedItem
[
list
.
size
()]();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
QosFlowIdentifier
*
m_qosFlowIdentifier
=
new
QosFlowIdentifier
();
m_qosFlowIdentifier
->
setQosFlowIdentifier
(
list
[
i
].
QFI
);
m_item
[
i
].
setQosFlowIdentifier
(
m_qosFlowIdentifier
);
}
qosFlowToBeForwardedList
->
setQosFlowToBeForwardedItem
(
m_item
,
list
.
size
());
int
ret
=
qosFlowToBeForwardedList
->
encodeQosFlowToBeForwardedList
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
);
cout
<<
"QFI in list "
<<
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
count
<<
endl
;
if
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
)
{
cout
<<
"array OK"
<<
endl
;
if
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
[
0
])
{
cout
<<
"QFI in list "
<<
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
[
0
]
->
qosFlowIdentifier
<<
endl
;
}
else
{
cout
<<
"error1"
<<
endl
;
}
}
PDUSessionResourceHandoverCommandTransfer
::~
PDUSessionResourceHandoverCommandTransfer
()
{}
}
else
{
void
PDUSessionResourceHandoverCommandTransfer
::
setQosFlowToBeForwardedList
(
std
::
vector
<
QosFlowToBeForwardedItem_t
>
list
)
cout
<<
"error2"
<<
endl
;
{
}
if
(
!
qosFlowToBeForwardedList
)
qosFlowToBeForwardedList
=
new
QosFlowToBeForwardedList
();
QosFlowToBeForwardedItem
*
m_item
=
new
QosFlowToBeForwardedItem
[
list
.
size
()]();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
QosFlowIdentifier
*
m_qosFlowIdentifier
=
new
QosFlowIdentifier
();
m_qosFlowIdentifier
->
setQosFlowIdentifier
(
list
[
i
].
QFI
);
m_item
[
i
].
setQosFlowIdentifier
(
m_qosFlowIdentifier
);
}
qosFlowToBeForwardedList
->
setQosFlowToBeForwardedItem
(
m_item
,
list
.
size
());
int
ret
=
qosFlowToBeForwardedList
->
encodeQosFlowToBeForwardedList
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
);
cout
<<
"QFI in list "
<<
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
count
<<
endl
;
if
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
)
{
cout
<<
"array OK"
<<
endl
;
if
(
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
[
0
])
{
cout
<<
"QFI in list "
<<
handovercommandtransferIE
->
qosFlowToBeForwardedList
->
list
.
array
[
0
]
->
qosFlowIdentifier
<<
endl
;
}
else
{
cout
<<
"error1"
<<
endl
;
}
}
else
{
cout
<<
"error2"
<<
endl
;
}
if
(
!
ret
)
if
(
!
ret
)
{
{
cout
<<
"encode QosFlowToBeForwardedList IE error"
<<
endl
;
cout
<<
"encode QosFlowToBeForwardedList IE error"
<<
endl
;
return
;
return
;
}
}
}
}
void
PDUSessionResourceHandoverCommandTransfer
::
setUPTransportLayerInformation
(
void
PDUSessionResourceHandoverCommandTransfer
::
setUPTransportLayerInformation
(
GtpTunnel_t
uptlinfo
)
GtpTunnel_t
uptlinfo
)
{
{
if
(
!
dLForwardingUP_TNLInformation
)
{
if
(
!
dLForwardingUP_TNLInformation
)
dLForwardingUP_TNLInformation
=
new
UpTransportLayerInformation
();
{
}
dLForwardingUP_TNLInformation
=
new
UpTransportLayerInformation
();
TransportLayerAddress
*
m_transportLayerAddress
=
new
TransportLayerAddress
();
}
GtpTeid
*
m_gtpTeid
=
new
GtpTeid
();
TransportLayerAddress
*
m_transportLayerAddress
=
new
TransportLayerAddress
();
m_transportLayerAddress
->
setTransportLayerAddress
(
uptlinfo
.
ip_address
);
GtpTeid
*
m_gtpTeid
=
new
GtpTeid
();
m_gtpTeid
->
setGtpTeid
(
uptlinfo
.
gtp_teid
);
m_transportLayerAddress
->
setTransportLayerAddress
(
uptlinfo
.
ip_address
);
dLForwardingUP_TNLInformation
->
setUpTransportLayerInformation
(
m_gtpTeid
->
setGtpTeid
(
uptlinfo
.
gtp_teid
);
m_transportLayerAddress
,
m_gtpTeid
);
dLForwardingUP_TNLInformation
->
setUpTransportLayerInformation
(
m_transportLayerAddress
,
m_gtpTeid
);
Ngap_UPTransportLayerInformation
*
test
=
Ngap_UPTransportLayerInformation
*
test
=
(
Ngap_UPTransportLayerInformation
*
)
calloc
(
1
,
sizeof
(
Ngap_UPTransportLayerInformation
));
(
Ngap_UPTransportLayerInformation
*
)
calloc
(
handovercommandtransferIE
->
dLForwardingUP_TNLInformation
=
test
;
1
,
sizeof
(
Ngap_UPTransportLayerInformation
));
int
ret
=
dLForwardingUP_TNLInformation
->
encode2UpTransportLayerInformation
(
*
test
);
handovercommandtransferIE
->
dLForwardingUP_TNLInformation
=
test
;
if
(
!
ret
)
int
ret
=
dLForwardingUP_TNLInformation
->
encode2UpTransportLayerInformation
(
{
*
test
);
cout
<<
"encode dLForwardingUP_TNLInformation IE error"
;
if
(
!
ret
)
{
return
;
cout
<<
"encode dLForwardingUP_TNLInformation IE error"
;
}
return
;
}
}
int
PDUSessionResourceHandoverCommandTransfer
::
encodePDUSessionResourceHandoverCommandTransfer
(
uint8_t
*
buf
,
int
buf_size
)
}
{
int
PDUSessionResourceHandoverCommandTransfer
::
encodePDUSessionResourceHandoverCommandTransfer
(
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_HandoverCommandTransfer
,
handovercommandtransferIE
);
uint8_t
*
buf
,
int
buf_size
)
{
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_HandoverCommandTransfer
,
NULL
,
handovercommandtransferIE
,
buf
,
buf_size
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_HandoverCommandTransfer
,
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
handovercommandtransferIE
);
return
er
.
encoded
;
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
}
&
asn_DEF_Ngap_HandoverCommandTransfer
,
NULL
,
handovercommandtransferIE
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapIEs/PDUSessionResourceHandoverCommandTransfer.hpp
View file @
c6dfe333
...
@@ -31,28 +31,27 @@
...
@@ -31,28 +31,27 @@
#include "UPTransportLayerInformation.hpp"
#include "UPTransportLayerInformation.hpp"
#include "QosFlowToBeForwardedList.hpp"
#include "QosFlowToBeForwardedList.hpp"
#include "NgapIEsStruct.hpp"
#include "NgapIEsStruct.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverCommandTransfer.h"
#include "Ngap_HandoverCommandTransfer.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
PDUSessionResourceHandoverCommandTransfer
{
class
PDUSessionResourceHandoverCommandTransfer
private:
{
/* data */
private:
Ngap_HandoverCommandTransfer_t
*
handovercommandtransferIE
;
/* data */
UpTransportLayerInformation
*
dLForwardingUP_TNLInformation
;
Ngap_HandoverCommandTransfer_t
*
handovercommandtransferIE
;
QosFlowToBeForwardedList
*
qosFlowToBeForwardedList
;
UpTransportLayerInformation
*
dLForwardingUP_TNLInformation
;
QosFlowToBeForwardedList
*
qosFlowToBeForwardedList
;
public:
public:
PDUSessionResourceHandoverCommandTransfer
(
/* args */
);
PDUSessionResourceHandoverCommandTransfer
(
/* args */
);
virtual
~
PDUSessionResourceHandoverCommandTransfer
();
virtual
~
PDUSessionResourceHandoverCommandTransfer
();
void
setUPTransportLayerInformation
(
GtpTunnel_t
uptlinfo
);
void
setUPTransportLayerInformation
(
GtpTunnel_t
uptlinfo
);
void
setQosFlowToBeForwardedList
(
std
::
vector
<
QosFlowToBeForwardedItem_t
>
list
);
void
setQosFlowToBeForwardedList
(
int
encodePDUSessionResourceHandoverCommandTransfer
(
uint8_t
*
buf
,
int
buf_size
);
std
::
vector
<
QosFlowToBeForwardedItem_t
>
list
);
};
int
encodePDUSessionResourceHandoverCommandTransfer
(
uint8_t
*
buf
,
int
buf_size
);
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.cpp
View file @
c6dfe333
...
@@ -20,15 +20,14 @@
...
@@ -20,15 +20,14 @@
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern
"C"
extern
"C"
{
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
...
@@ -39,78 +38,79 @@ extern "C"
...
@@ -39,78 +38,79 @@ extern "C"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
PDUSessionResourceHandoverRequestAckTransfer
::
PDUSessionResourceHandoverRequestAckTransfer
()
{
PDUSessionResourceHandoverRequestAckTransfer
::
PDUSessionResourceHandoverRequestAckTransfer
()
handoverRequestAcknowledegTransferIEs
=
{
(
Ngap_HandoverRequestAcknowledgeTransfer_t
*
)
calloc
(
handoverRequestAcknowledegTransferIEs
=
(
Ngap_HandoverRequestAcknowledgeTransfer_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestAcknowledgeTransfer_t
));
1
,
sizeof
(
Ngap_HandoverRequestAcknowledgeTransfer_t
));
dLForwardingUP_TNLInformation
=
NULL
;
dLForwardingUP_TNLInformation
=
NULL
;
QosFlowSetupResponseList
=
NULL
;
QosFlowSetupResponseList
=
NULL
;
}
}
PDUSessionResourceHandoverRequestAckTransfer
::~
PDUSessionResourceHandoverRequestAckTransfer
()
{}
PDUSessionResourceHandoverRequestAckTransfer
::~
PDUSessionResourceHandoverRequestAckTransfer
()
{
bool
PDUSessionResourceHandoverRequestAckTransfer
::
decodefromHandoverRequestAckTransfer
(
uint8_t
*
buf
,
int
buf_size
)
}
{
bool
PDUSessionResourceHandoverRequestAckTransfer
::
decodefromHandoverRequestAckTransfer
(
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_HandoverRequestAcknowledgeTransfer
,
(
void
**
)
&
handoverRequestAcknowledegTransferIEs
,
buf
,
buf_size
);
uint8_t
*
buf
,
int
buf_size
)
{
if
(
rc
.
code
==
RC_OK
)
asn_dec_rval_t
rc
=
asn_decode
(
{
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
cout
<<
"Decoded handoverRequestAcknowledegTransfer successfully"
<<
endl
;
&
asn_DEF_Ngap_HandoverRequestAcknowledgeTransfer
,
}
(
void
**
)
&
handoverRequestAcknowledegTransferIEs
,
buf
,
buf_size
);
else
if
(
rc
.
code
==
RC_WMORE
)
if
(
rc
.
code
==
RC_OK
)
{
{
cout
<<
"Decoded handoverRequestAcknowledegTransfer successfully"
<<
endl
;
cout
<<
"More data expected, call again"
<<
endl
;
}
else
if
(
rc
.
code
==
RC_WMORE
)
{
return
false
;
cout
<<
"More data expected, call again"
<<
endl
;
}
return
false
;
else
}
else
{
{
cout
<<
"Failure to decode handoverRequestAcknowledegTransfer data"
<<
endl
;
cout
<<
"Failure to decode handoverRequestAcknowledegTransfer data"
<<
endl
;
//return false;
//return false;
}
}
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
cout
<<
endl
;
cout
<<
endl
;
dLForwardingUP_TNLInformation
=
new
UpTransportLayerInformation
();
dLForwardingUP_TNLInformation
=
new
UpTransportLayerInformation
();
if
(
!
dLForwardingUP_TNLInformation
->
decodefromUpTransportLayerInformation
(
if
(
!
dLForwardingUP_TNLInformation
->
decodefromUpTransportLayerInformation
(
*
handoverRequestAcknowledegTransferIEs
->
dLForwardingUP_TNLInformation
))
*
handoverRequestAcknowledegTransferIEs
->
dLForwardingUP_TNLInformation
))
{
{
cout
<<
"decoded ngap DL_NGU_UP_TNLInformation IE error"
<<
endl
;
cout
<<
"decoded ngap DL_NGU_UP_TNLInformation IE error"
<<
endl
;
return
false
;
return
false
;
}
}
QosFlowSetupResponseList
=
new
QosFlowListWithDataForwarding
();
QosFlowSetupResponseList
=
new
QosFlowListWithDataForwarding
();
if
(
!
QosFlowSetupResponseList
->
decodeFormQosFlowListWithDataForwarding
(
if
(
!
QosFlowSetupResponseList
->
decodeFormQosFlowListWithDataForwarding
(
handoverRequestAcknowledegTransferIEs
->
qosFlowSetupResponseList
))
handoverRequestAcknowledegTransferIEs
->
qosFlowSetupResponseList
))
{
{
cout
<<
"decoded ngap QosFlowSetupResponseList IE error"
<<
endl
;
cout
<<
"decoded ngap QosFlowSetupResponseList IE error"
<<
endl
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
bool
PDUSessionResourceHandoverRequestAckTransfer
::
getUpTransportLayerInformation2
(
bool
PDUSessionResourceHandoverRequestAckTransfer
::
getUpTransportLayerInformation2
(
GtpTunnel_t
*&
upTnlInfo
)
GtpTunnel_t
*&
upTnlInfo
)
{
{
if
(
!
dLForwardingUP_TNLInformation
->
decodefromUpTransportLayerInformation
(
if
(
!
dLForwardingUP_TNLInformation
->
decodefromUpTransportLayerInformation
(
*
handoverRequestAcknowledegTransferIEs
->
dLForwardingUP_TNLInformation
))
*
handoverRequestAcknowledegTransferIEs
->
dLForwardingUP_TNLInformation
))
return
false
;
return
false
;
TransportLayerAddress
*
m_transportLayerAddress
;
TransportLayerAddress
*
m_transportLayerAddress
;
GtpTeid
*
m_gtpTeid
;
GtpTeid
*
m_gtpTeid
;
if
(
!
dLForwardingUP_TNLInformation
->
getUpTransportLayerInformation
(
m_transportLayerAddress
,
m_gtpTeid
))
if
(
!
dLForwardingUP_TNLInformation
->
getUpTransportLayerInformation
(
return
false
;
m_transportLayerAddress
,
m_gtpTeid
))
if
(
!
m_transportLayerAddress
->
getTransportLayerAddress
(
upTnlInfo
->
ip_address
))
return
false
;
return
false
;
if
(
!
m_transportLayerAddress
->
getTransportLayerAddress
(
upTnlInfo
->
ip_address
))
if
(
!
m_gtpTeid
->
getGtpTeid
(
upTnlInfo
->
gtp_teid
))
return
false
;
return
false
;
if
(
!
m_gtpTeid
->
getGtpTeid
(
upTnlInfo
->
gtp_teid
))
return
true
;
return
false
;
}
return
true
;
bool
PDUSessionResourceHandoverRequestAckTransfer
::
getqosFlowSetupResponseList
(
std
::
vector
<
QosFlowLItemWithDataForwarding_t
>
&
list
)
}
{
bool
PDUSessionResourceHandoverRequestAckTransfer
::
getqosFlowSetupResponseList
(
if
(
!
QosFlowSetupResponseList
)
std
::
vector
<
QosFlowLItemWithDataForwarding_t
>
&
list
)
{
return
false
;
if
(
!
QosFlowSetupResponseList
)
QosFlowItemWithDataForWarding
*
m_qosflowitemwithdataforwarding
;
return
false
;
int
num
=
0
;
QosFlowItemWithDataForWarding
*
m_qosflowitemwithdataforwarding
;
if
(
QosFlowSetupResponseList
->
getQosFlowListWithDataForwarding
(
m_qosflowitemwithdataforwarding
,
num
))
int
num
=
0
;
{
if
(
QosFlowSetupResponseList
->
getQosFlowListWithDataForwarding
(
cout
<<
"successful decode QosFlowList"
<<
endl
;
m_qosflowitemwithdataforwarding
,
num
))
{
}
cout
<<
"successful decode QosFlowList"
<<
endl
;
for
(
int
i
=
0
;
i
<
num
;
i
++
)
}
{
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
QosFlowLItemWithDataForwarding_t
response
;
QosFlowLItemWithDataForwarding_t
response
;
m_qosflowitemwithdataforwarding
[
i
].
getQosFlowItemWithDataForWarding
(
response
.
qosFlowIdentifier
);
m_qosflowitemwithdataforwarding
[
i
].
getQosFlowItemWithDataForWarding
(
list
.
push_back
(
response
);
response
.
qosFlowIdentifier
);
}
list
.
push_back
(
response
);
return
true
;
}
}
return
true
;
}
// namespace ngap
}
}
// namespace ngap
src/ngap/ngapIEs/PDUSessionResourceHandoverRequestAckTransfer.hpp
View file @
c6dfe333
...
@@ -20,11 +20,11 @@
...
@@ -20,11 +20,11 @@
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#ifndef _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
#ifndef _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
#define _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
#define _PDUSESSIONRESOURCEHANDOVERREQUESTACKTRANSFER_H_
...
@@ -33,27 +33,25 @@
...
@@ -33,27 +33,25 @@
#include "DLQoSFlowPerTNLInformation.hpp"
#include "DLQoSFlowPerTNLInformation.hpp"
#include "SecurityResult.hpp"
#include "SecurityResult.hpp"
#include "QosFlowListWithDataForwarding.hpp"
#include "QosFlowListWithDataForwarding.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverRequestAcknowledgeTransfer.h"
#include "Ngap_HandoverRequestAcknowledgeTransfer.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
PDUSessionResourceHandoverRequestAckTransfer
{
class
PDUSessionResourceHandoverRequestAckTransfer
public:
{
PDUSessionResourceHandoverRequestAckTransfer
();
public:
virtual
~
PDUSessionResourceHandoverRequestAckTransfer
();
PDUSessionResourceHandoverRequestAckTransfer
();
bool
decodefromHandoverRequestAckTransfer
(
uint8_t
*
buf
,
int
buf_size
);
virtual
~
PDUSessionResourceHandoverRequestAckTransfer
();
bool
getUpTransportLayerInformation2
(
GtpTunnel_t
*&
upTnlInfo
);
bool
decodefromHandoverRequestAckTransfer
(
uint8_t
*
buf
,
int
buf_size
);
bool
getqosFlowSetupResponseList
(
bool
getUpTransportLayerInformation2
(
GtpTunnel_t
*&
upTnlInfo
);
std
::
vector
<
QosFlowLItemWithDataForwarding_t
>
&
list
);
bool
getqosFlowSetupResponseList
(
std
::
vector
<
QosFlowLItemWithDataForwarding_t
>
&
list
);
private:
private:
Ngap_HandoverRequestAcknowledgeTransfer_t
*
handoverRequestAcknowledegTransferIEs
;
Ngap_HandoverRequestAcknowledgeTransfer_t
*
handoverRequestAcknowledegTransferIEs
;
UpTransportLayerInformation
*
dLForwardingUP_TNLInformation
;
UpTransportLayerInformation
*
dLForwardingUP_TNLInformation
;
QosFlowListWithDataForwarding
*
QosFlowSetupResponseList
;
QosFlowListWithDataForwarding
*
QosFlowSetupResponseList
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
\ No newline at end of file
src/ngap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.cpp
View file @
c6dfe333
#include "PDUSessionResourceHandoverRequiredTransfer.hpp"
#include "PDUSessionResourceHandoverRequiredTransfer.hpp"
extern
"C"
{
extern
"C"
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "constraints.h"
}
}
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
PDUSessionResourceHandoverRequiredTransfer
::
PDUSessionResourceHandoverRequiredTransfer
()
PDUSessionResourceHandoverRequiredTransfer
::
PDUSessionResourceHandoverRequiredTransfer
()
{
{
handoverrquiredTransferIEs
=
(
Ngap_HandoverRequiredTransfer_t
*
)
calloc
(
handoverrquiredTransferIEs
=
(
Ngap_HandoverRequiredTransfer_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequiredTransfer_t
));
1
,
sizeof
(
Ngap_HandoverRequiredTransfer_t
));
DirectForwardingPathAvailability
=
NULL
;
DirectForwardingPathAvailability
=
NULL
;
}
}
PDUSessionResourceHandoverRequiredTransfer
::~
PDUSessionResourceHandoverRequiredTransfer
(){}
PDUSessionResourceHandoverRequiredTransfer
::~
PDUSessionResourceHandoverRequiredTransfer
()
{
}
void
PDUSessionResourceHandoverRequiredTransfer
::
setDirectForwardingPathAvailability
(
Ngap_DirectForwardingPathAvailability_t
directForwardingPathAvailability
)
{
if
(
!
DirectForwardingPathAvailability
)
DirectForwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
();
*
DirectForwardingPathAvailability
=
directForwardingPathAvailability
;
}
void
PDUSessionResourceHandoverRequiredTransfer
::
setDirectForwardingPathAvailability
(
Ngap_DirectForwardingPathAvailability_t
directForwardingPathAvailability
)
int
PDUSessionResourceHandoverRequiredTransfer
::
encode2buffer
(
uint8_t
*
buf
,
{
int
buf_size
)
{
if
(
!
DirectForwardingPathAvailability
)
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_HandoverRequiredTransfer
,
DirectForwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
();
handoverrquiredTransferIEs
);
*
DirectForwardingPathAvailability
=
directForwardingPathAvailability
;
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
}
&
asn_DEF_Ngap_HandoverRequiredTransfer
,
NULL
,
handoverrquiredTransferIEs
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
//Decapsulation
bool
PDUSessionResourceHandoverRequiredTransfer
::
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_HandoverRequiredTransfer
,
(
void
**
)
&
handoverrquiredTransferIEs
,
buf
,
buf_size
);
if
(
rc
.
code
==
RC_OK
)
{
cout
<<
"Decoded successfully"
<<
endl
;
}
else
if
(
rc
.
code
==
RC_WMORE
)
{
cout
<<
"More data expected, call again"
<<
endl
;
return
false
;
}
else
{
cout
<<
"Failure to decode data"
<<
endl
;
return
false
;
}
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
cout
<<
endl
;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, pduSessionResourceSetupResponseTransferIEs);
if
(
handoverrquiredTransferIEs
->
directForwardingPathAvailability
)
{
Ngap_DirectForwardingPathAvailability_t
*
directForwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
;
directForwardingPathAvailability
=
handoverrquiredTransferIEs
->
directForwardingPathAvailability
;
}
return
true
;
}
int
PDUSessionResourceHandoverRequiredTransfer
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
bool
PDUSessionResourceHandoverRequiredTransfer
::
getDirectForwardingPathAvailability
(
{
long
*
directForwardingPathAvailability
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_HandoverRequiredTransfer
,
handoverrquiredTransferIEs
);
directForwardingPathAvailability
=
DirectForwardingPathAvailability
;
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_HandoverRequiredTransfer
,
NULL
,
handoverrquiredTransferIEs
,
buf
,
buf_size
);
return
true
;
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
}
return
er
.
encoded
;
}
//Decapsulation
bool
PDUSessionResourceHandoverRequiredTransfer
::
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_HandoverRequiredTransfer
,(
void
**
)
&
handoverrquiredTransferIEs
,
buf
,
buf_size
);
if
(
rc
.
code
==
RC_OK
)
{
cout
<<
"Decoded successfully"
<<
endl
;
}
else
if
(
rc
.
code
==
RC_WMORE
)
{
cout
<<
"More data expected, call again"
<<
endl
;
return
false
;
}
else
{
cout
<<
"Failure to decode data"
<<
endl
;
return
false
;
}
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
cout
<<
endl
;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupResponseTransfer, pduSessionResourceSetupResponseTransferIEs);
if
(
handoverrquiredTransferIEs
->
directForwardingPathAvailability
)
{
Ngap_DirectForwardingPathAvailability_t
*
directForwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
;
directForwardingPathAvailability
=
handoverrquiredTransferIEs
->
directForwardingPathAvailability
;
}
return
true
;
}
bool
PDUSessionResourceHandoverRequiredTransfer
::
getDirectForwardingPathAvailability
(
long
*
directForwardingPathAvailability
)
{
directForwardingPathAvailability
=
DirectForwardingPathAvailability
;
return
true
;
}
}
}
src/ngap/ngapIEs/PDUSessionResourceHandoverRequiredTransfer.hpp
View file @
c6dfe333
...
@@ -6,30 +6,30 @@
...
@@ -6,30 +6,30 @@
#include "DLQoSFlowPerTNLInformation.hpp"
#include "DLQoSFlowPerTNLInformation.hpp"
#include "SecurityResult.hpp"
#include "SecurityResult.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_HandoverRequiredTransfer.h"
#include "Ngap_HandoverRequiredTransfer.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceHandoverRequiredTransfer
{
class
PDUSessionResourceHandoverRequiredTransfer
{
public:
public:
PDUSessionResourceHandoverRequiredTransfer
();
PDUSessionResourceHandoverRequiredTransfer
();
virtual
~
PDUSessionResourceHandoverRequiredTransfer
();
virtual
~
PDUSessionResourceHandoverRequiredTransfer
();
void
setDirectForwardingPathAvailability
(
Ngap_DirectForwardingPathAvailability_t
directForwardingPathAvailability
);
void
setDirectForwardingPathAvailability
(
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
Ngap_DirectForwardingPathAvailability_t
directForwardingPathAvailability
);
//Decapsulation
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
);
//Decapsulation
bool
getDirectForwardingPathAvailability
(
long
*
directForwardingPathAvailability
);
bool
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
);
private:
bool
getDirectForwardingPathAvailability
(
Ngap_HandoverRequiredTransfer_t
*
handoverrquiredTransferIEs
;
long
*
directForwardingPathAvailability
);
Ngap_DirectForwardingPathAvailability_t
*
DirectForwardingPathAvailability
;
private:
};
Ngap_HandoverRequiredTransfer_t
*
handoverrquiredTransferIEs
;
Ngap_DirectForwardingPathAvailability_t
*
DirectForwardingPathAvailability
;
};
}
}
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.cpp
View file @
c6dfe333
...
@@ -25,47 +25,51 @@
...
@@ -25,47 +25,51 @@
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "PDUSessionResourceItemHORqd.hpp"
#include "PDUSessionResourceItemHORqd.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
PDUSessionResourceItemHORqd
::
PDUSessionResourceItemHORqd
()
PDUSessionResourceItemHORqd
::
PDUSessionResourceItemHORqd
()
{
{
pDUSessionID
=
NULL
;
pDUSessionID
=
NULL
;
}
}
PDUSessionResourceItemHORqd
::~
PDUSessionResourceItemHORqd
()
{
PDUSessionResourceItemHORqd
::~
PDUSessionResourceItemHORqd
(){}
}
void
PDUSessionResourceItemHORqd
::
setPDUSessionResourceItemHORqd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequiredtransfer
)
void
PDUSessionResourceItemHORqd
::
setPDUSessionResourceItemHORqd
(
{
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequiredtransfer
)
{
pDUSessionID
=
m_pDUSessionID
;
pDUSessionID
=
m_pDUSessionID
;
handoverrequiredtransfer
=
m_handoverrequiredtransfer
;
handoverrequiredtransfer
=
m_handoverrequiredtransfer
;
}
}
bool
PDUSessionResourceItemHORqd
::
encode2PDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
)
bool
PDUSessionResourceItemHORqd
::
encode2PDUSessionResourceItemHORqd
(
{
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
)
{
if
(
!
pDUSessionID
)
return
false
;
if
(
!
pDUSessionID
)
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pdUSessionResourceItemHORqd
->
pDUSessionID
))
return
false
;
return
false
;
pdUSessionResourceItemHORqd
->
handoverRequiredTransfer
=
handoverrequiredtransfer
;
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pdUSessionResourceItemHORqd
->
pDUSessionID
))
return
true
;
return
false
;
}
pdUSessionResourceItemHORqd
->
handoverRequiredTransfer
=
bool
PDUSessionResourceItemHORqd
::
decodefromPDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
)
handoverrequiredtransfer
;
{
pDUSessionID
=
new
PDUSessionID
();
return
true
;
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
pdUSessionResourceItemHORqd
->
pDUSessionID
))
return
false
;
}
handoverrequiredtransfer
=
pdUSessionResourceItemHORqd
->
handoverRequiredTransfer
;
bool
PDUSessionResourceItemHORqd
::
decodefromPDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
)
{
return
true
;
pDUSessionID
=
new
PDUSessionID
();
}
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
void
PDUSessionResourceItemHORqd
::
getPDUSessionResourceItemHORqd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequiredtransfer
)
pdUSessionResourceItemHORqd
->
pDUSessionID
))
{
return
false
;
m_pDUSessionID
=
pDUSessionID
;
handoverrequiredtransfer
=
pdUSessionResourceItemHORqd
m_handoverrequiredtransfer
=
handoverrequiredtransfer
;
->
handoverRequiredTransfer
;
}
return
true
;
}
void
PDUSessionResourceItemHORqd
::
getPDUSessionResourceItemHORqd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequiredtransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_handoverrequiredtransfer
=
handoverrequiredtransfer
;
}
}
}
src/ngap/ngapIEs/PDUSessionResourceItemHORqd.hpp
View file @
c6dfe333
...
@@ -30,32 +30,33 @@
...
@@ -30,32 +30,33 @@
#include "PDUSessionID.hpp"
#include "PDUSessionID.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
#include "PDUSessionResourceHandoverRequestAckTransfer.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceItemHORqd.h"
#include "Ngap_PDUSessionResourceItemHORqd.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceItemHORqd
{
public:
PDUSessionResourceItemHORqd
();
virtual
~
PDUSessionResourceItemHORqd
();
void
setPDUSessionResourceItemHORqd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequiredtransfer
);
void
getPDUSessionResourceItemHORqd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequiredtransfer
);
bool
encode2PDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
);
bool
decodefromPDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
);
private:
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
handoverrequiredtransfer
;
};
}
class
PDUSessionResourceItemHORqd
{
public:
#endif
PDUSessionResourceItemHORqd
();
virtual
~
PDUSessionResourceItemHORqd
();
void
setPDUSessionResourceItemHORqd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_handoverrequiredtransfer
);
void
getPDUSessionResourceItemHORqd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_handoverrequiredtransfer
);
bool
encode2PDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
);
bool
decodefromPDUSessionResourceItemHORqd
(
Ngap_PDUSessionResourceItemHORqd_t
*
pdUSessionResourceItemHORqd
);
private:
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
handoverrequiredtransfer
;
};
}
#endif
src/ngap/ngapIEs/PDUSessionResourceListHORqd.cpp
View file @
c6dfe333
#include "PDUSessionResourceListHORqd.hpp"
#include "PDUSessionResourceListHORqd.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceListHORqd
::
PDUSessionResourceListHORqd
()
{
pduSessionResourceItemHORqd
=
NULL
;
numofpduSessionResourceItemHORqd
=
0
;
}
PDUSessionResourceListHORqd
::~
PDUSessionResourceListHORqd
(){}
void
PDUSessionResourceListHORqd
::
setPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
,
int
num
)
{
pduSessionResourceItemHORqd
=
m_pduSessionResourceItemHORqd
;
numofpduSessionResourceItemHORqd
=
num
;
}
bool
PDUSessionResourceListHORqd
::
encode2PDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceItemHORqd
;
i
++
)
{
Ngap_PDUSessionResourceItemHORqd_t
*
response
=
(
Ngap_PDUSessionResourceItemHORqd_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceItemHORqd_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceItemHORqd
[
i
].
encode2PDUSessionResourceItemHORqd
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceListHORQqd
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceListHORqd
::
decodefromPDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
)
{
numofpduSessionResourceItemHORqd
=
pduSessionResourceListHORQqd
->
list
.
count
;
pduSessionResourceItemHORqd
=
new
PDUSessionResourceItemHORqd
[
numofpduSessionResourceItemHORqd
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceItemHORqd
;
i
++
)
{
if
(
!
pduSessionResourceItemHORqd
[
i
].
decodefromPDUSessionResourceItemHORqd
(
pduSessionResourceListHORQqd
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceListHORqd
::
getPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*&
m_pduSessionResourceItemHORqd
,
int
&
num
)
{
m_pduSessionResourceItemHORqd
=
pduSessionResourceItemHORqd
;
num
=
numofpduSessionResourceItemHORqd
;
}
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceListHORqd
::
PDUSessionResourceListHORqd
()
{
pduSessionResourceItemHORqd
=
NULL
;
numofpduSessionResourceItemHORqd
=
0
;
}
PDUSessionResourceListHORqd
::~
PDUSessionResourceListHORqd
()
{
}
void
PDUSessionResourceListHORqd
::
setPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
,
int
num
)
{
pduSessionResourceItemHORqd
=
m_pduSessionResourceItemHORqd
;
numofpduSessionResourceItemHORqd
=
num
;
}
bool
PDUSessionResourceListHORqd
::
encode2PDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceItemHORqd
;
i
++
)
{
Ngap_PDUSessionResourceItemHORqd_t
*
response
=
(
Ngap_PDUSessionResourceItemHORqd_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceItemHORqd_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceItemHORqd
[
i
].
encode2PDUSessionResourceItemHORqd
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceListHORQqd
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceListHORqd
::
decodefromPDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
)
{
numofpduSessionResourceItemHORqd
=
pduSessionResourceListHORQqd
->
list
.
count
;
pduSessionResourceItemHORqd
=
new
PDUSessionResourceItemHORqd
[
numofpduSessionResourceItemHORqd
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceItemHORqd
;
i
++
)
{
if
(
!
pduSessionResourceItemHORqd
[
i
].
decodefromPDUSessionResourceItemHORqd
(
pduSessionResourceListHORQqd
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceListHORqd
::
getPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*&
m_pduSessionResourceItemHORqd
,
int
&
num
)
{
m_pduSessionResourceItemHORqd
=
pduSessionResourceItemHORqd
;
num
=
numofpduSessionResourceItemHORqd
;
}
}
src/ngap/ngapIEs/PDUSessionResourceListHORqd.hpp
View file @
c6dfe333
...
@@ -3,26 +3,30 @@
...
@@ -3,26 +3,30 @@
#include "PDUSessionResourceItemHORqd.hpp"
#include "PDUSessionResourceItemHORqd.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceListHORqd.h"
#include "Ngap_PDUSessionResourceListHORqd.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceListHORqd
{
class
PDUSessionResourceListHORqd
{
public:
public:
PDUSessionResourceListHORqd
();
PDUSessionResourceListHORqd
();
virtual
~
PDUSessionResourceListHORqd
();
virtual
~
PDUSessionResourceListHORqd
();
void
setPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
,
int
num
);
void
setPDUSessionResourceListHORqd
(
void
getPDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*&
m_pduSessionResourceItemHORqd
,
int
&
num
);
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
,
int
num
);
void
getPDUSessionResourceListHORqd
(
bool
encode2PDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
);
PDUSessionResourceItemHORqd
*&
m_pduSessionResourceItemHORqd
,
int
&
num
);
bool
decodefromPDUSessionResourceListHORqd
(
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
);
private:
bool
encode2PDUSessionResourceListHORqd
(
PDUSessionResourceItemHORqd
*
pduSessionResourceItemHORqd
;
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
);
int
numofpduSessionResourceItemHORqd
;
bool
decodefromPDUSessionResourceListHORqd
(
};
Ngap_PDUSessionResourceListHORqd_t
*
pduSessionResourceListHORQqd
);
private:
PDUSessionResourceItemHORqd
*
pduSessionResourceItemHORqd
;
int
numofpduSessionResourceItemHORqd
;
};
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.cpp
View file @
c6dfe333
...
@@ -39,143 +39,146 @@ extern "C" {
...
@@ -39,143 +39,146 @@ extern "C" {
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
PDUSessionResourceReleaseCommandTransfer
::
PDUSessionResourceReleaseCommandTransfer
()
PDUSessionResourceReleaseCommandTransfer
::
PDUSessionResourceReleaseCommandTransfer
()
{
{
pduSessionResourceReleaseCommandTransferIEs
=
pduSessionResourceReleaseCommandTransferIEs
=
(
Ngap_PDUSessionResourceReleaseCommandTransfer_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceReleaseCommandTransfer_t
));
(
Ngap_PDUSessionResourceReleaseCommandTransfer_t
*
)
calloc
(
causeValue
=
NULL
;
1
,
sizeof
(
Ngap_PDUSessionResourceReleaseCommandTransfer_t
));
}
causeValue
=
NULL
;
PDUSessionResourceReleaseCommandTransfer
::~
PDUSessionResourceReleaseCommandTransfer
()
{
}
//if(pduSessionResourceReleaseCommandTransferIEs) ASN_STRUCT_FREE(asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,pduSessionResourceReleaseCommandTransferIEs);
PDUSessionResourceReleaseCommandTransfer
::~
PDUSessionResourceReleaseCommandTransfer
()
{
if
(
causeValue
)
delete
causeValue
;
//if(pduSessionResourceReleaseCommandTransferIEs) ASN_STRUCT_FREE(asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer,pduSessionResourceReleaseCommandTransferIEs);
//if (pduSessionResourceReleaseCommandTransferIEs) free(pduSessionResourceReleaseCommandTransferIEs);
if
(
causeValue
)
}
delete
causeValue
;
//if (pduSessionResourceReleaseCommandTransferIEs) free(pduSessionResourceReleaseCommandTransferIEs);
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseRadioNetwork
(
e_Ngap_CauseRadioNetwork
cause_value
)
}
{
if
(
!
causeValue
)
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseRadioNetwork
(
causeValue
=
new
Cause
();
e_Ngap_CauseRadioNetwork
cause_value
)
{
if
(
!
causeValue
)
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_radioNetwork
);
causeValue
=
new
Cause
();
causeValue
->
setValue
(
cause_value
);
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_radioNetwork
);
int
ret
=
causeValue
->
encode2Cause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
causeValue
->
setValue
(
cause_value
);
if
(
!
ret
)
{
int
ret
=
causeValue
->
encode2Cause
(
cout
<<
"encode CauseRadioNetwork IE error"
<<
endl
;
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
return
;
if
(
!
ret
)
{
}
cout
<<
"encode CauseRadioNetwork IE error"
<<
endl
;
}
return
;
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseTransport
(
e_Ngap_CauseTransport
cause_value
)
}
{
}
if
(
!
causeValue
)
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseTransport
(
causeValue
=
new
Cause
();
e_Ngap_CauseTransport
cause_value
)
{
if
(
!
causeValue
)
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_transport
);
causeValue
=
new
Cause
();
causeValue
->
setValue
(
cause_value
);
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_transport
);
int
ret
=
causeValue
->
encode2Cause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
causeValue
->
setValue
(
cause_value
);
if
(
!
ret
)
{
int
ret
=
causeValue
->
encode2Cause
(
cout
<<
"encode CauseTransport IE error"
<<
endl
;
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
return
;
if
(
!
ret
)
{
}
cout
<<
"encode CauseTransport IE error"
<<
endl
;
}
return
;
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseNas
(
e_Ngap_CauseNas
cause_value
)
}
{
}
if
(
!
causeValue
)
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseNas
(
causeValue
=
new
Cause
();
e_Ngap_CauseNas
cause_value
)
{
if
(
!
causeValue
)
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_nas
);
causeValue
=
new
Cause
();
causeValue
->
setValue
(
cause_value
);
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_nas
);
int
ret
=
causeValue
->
encode2Cause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
causeValue
->
setValue
(
cause_value
);
if
(
!
ret
)
{
int
ret
=
causeValue
->
encode2Cause
(
cout
<<
"encode CauseNas IE error"
<<
endl
;
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
return
;
if
(
!
ret
)
{
}
cout
<<
"encode CauseNas IE error"
<<
endl
;
}
return
;
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseProtocol
(
e_Ngap_CauseProtocol
cause_value
)
}
{
}
if
(
!
causeValue
)
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseProtocol
(
causeValue
=
new
Cause
();
e_Ngap_CauseProtocol
cause_value
)
{
if
(
!
causeValue
)
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_protocol
);
causeValue
=
new
Cause
();
causeValue
->
setValue
(
cause_value
);
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_protocol
);
int
ret
=
causeValue
->
encode2Cause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
causeValue
->
setValue
(
cause_value
);
if
(
!
ret
)
{
int
ret
=
causeValue
->
encode2Cause
(
cout
<<
"encode CauseProtocol IE error"
<<
endl
;
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
return
;
if
(
!
ret
)
{
}
cout
<<
"encode CauseProtocol IE error"
<<
endl
;
}
return
;
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseMisc
(
e_Ngap_CauseMisc
cause_value
)
}
{
}
if
(
!
causeValue
)
void
PDUSessionResourceReleaseCommandTransfer
::
setCauseMisc
(
causeValue
=
new
Cause
();
e_Ngap_CauseMisc
cause_value
)
{
if
(
!
causeValue
)
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_misc
);
causeValue
=
new
Cause
();
causeValue
->
setValue
(
cause_value
);
causeValue
->
setChoiceOfCause
(
Ngap_Cause_PR_misc
);
int
ret
=
causeValue
->
encode2Cause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
causeValue
->
setValue
(
cause_value
);
if
(
!
ret
)
{
int
ret
=
causeValue
->
encode2Cause
(
cout
<<
"encode CauseMisc IE error"
<<
endl
;
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
);
return
;
if
(
!
ret
)
{
}
cout
<<
"encode CauseMisc IE error"
<<
endl
;
}
return
;
}
int
PDUSessionResourceReleaseCommandTransfer
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
}
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
pduSessionResourceReleaseCommandTransferIEs
);
int
PDUSessionResourceReleaseCommandTransfer
::
encode2buffer
(
uint8_t
*
buf
,
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
NULL
,
pduSessionResourceReleaseCommandTransferIEs
,
buf
,
buf_size
);
int
buf_size
)
{
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
return
er
.
encoded
;
pduSessionResourceReleaseCommandTransferIEs
);
}
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
//Decapsulation
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
NULL
,
bool
PDUSessionResourceReleaseCommandTransfer
::
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
)
pduSessionResourceReleaseCommandTransferIEs
,
buf
,
buf_size
);
{
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
asn_dec_rval_t
rc
=
asn_decode
(
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
(
void
**
)
&
pduSessionResourceReleaseCommandTransferIEs
,
buf
,
buf_size
);
return
er
.
encoded
;
}
if
(
rc
.
code
==
RC_OK
)
//Decapsulation
{
bool
PDUSessionResourceReleaseCommandTransfer
::
decodefromIE
(
uint8_t
*
buf
,
cout
<<
"Decoded successfully"
<<
endl
;
int
buf_size
)
{
}
asn_dec_rval_t
rc
=
asn_decode
(
else
if
(
rc
.
code
==
RC_WMORE
)
NULL
,
ATS_ALIGNED_CANONICAL_PER
,
{
&
asn_DEF_Ngap_PDUSessionResourceReleaseCommandTransfer
,
cout
<<
"More data expected, call again"
<<
endl
;
(
void
**
)
&
pduSessionResourceReleaseCommandTransferIEs
,
buf
,
buf_size
);
return
false
;
}
if
(
rc
.
code
==
RC_OK
)
{
else
cout
<<
"Decoded successfully"
<<
endl
;
{
}
else
if
(
rc
.
code
==
RC_WMORE
)
{
cout
<<
"Failure to decode data"
<<
endl
;
cout
<<
"More data expected, call again"
<<
endl
;
return
false
;
return
false
;
}
}
else
{
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
cout
<<
"Failure to decode data"
<<
endl
;
cout
<<
endl
;
return
false
;
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, pduSessionResourceSetupUnsuccessfulTransferIEs);
}
cout
<<
"rc.consumed to decode = "
<<
rc
.
consumed
<<
endl
;
causeValue
=
new
Cause
();
cout
<<
endl
;
if
(
!
causeValue
->
decodefromCause
(
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
))
//asn_fprint(stderr, &asn_DEF_Ngap_PDUSessionResourceSetupUnsuccessfulTransfer, pduSessionResourceSetupUnsuccessfulTransferIEs);
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
causeValue
=
new
Cause
();
return
false
;
if
(
!
causeValue
->
decodefromCause
(
}
&
pduSessionResourceReleaseCommandTransferIEs
->
cause
))
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
return
true
;
return
false
;
}
}
long
PDUSessionResourceReleaseCommandTransfer
::
getChoiceOfCause
()
return
true
;
{
}
if
(
!
causeValue
)
return
-
1
;
long
PDUSessionResourceReleaseCommandTransfer
::
getChoiceOfCause
()
{
return
causeValue
->
getChoiceOfCause
();
if
(
!
causeValue
)
}
return
-
1
;
long
PDUSessionResourceReleaseCommandTransfer
::
getCause
()
{
return
causeValue
->
getChoiceOfCause
();
if
(
!
causeValue
)
return
-
1
;
}
long
PDUSessionResourceReleaseCommandTransfer
::
getCause
()
{
return
causeValue
->
getValue
();
if
(
!
causeValue
)
}
return
-
1
;
return
causeValue
->
getValue
();
}
}
}
src/ngap/ngapIEs/PDUSessionResourceReleaseCommandTransfer.hpp
View file @
c6dfe333
...
@@ -5,39 +5,37 @@
...
@@ -5,39 +5,37 @@
#include "Cause.hpp"
#include "Cause.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_PDUSessionResourceReleaseCommandTransfer.h"
#include "Ngap_PDUSessionResourceReleaseCommandTransfer.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceReleaseCommandTransfer
{
class
PDUSessionResourceReleaseCommandTransfer
{
public:
PDUSessionResourceReleaseCommandTransfer
();
public:
virtual
~
PDUSessionResourceReleaseCommandTransfer
();
PDUSessionResourceReleaseCommandTransfer
();
virtual
~
PDUSessionResourceReleaseCommandTransfer
();
void
setCauseRadioNetwork
(
e_Ngap_CauseRadioNetwork
cause_value
);
void
setCauseTransport
(
e_Ngap_CauseTransport
cause_value
);
void
setCauseNas
(
e_Ngap_CauseNas
cause_value
);
void
setCauseProtocol
(
e_Ngap_CauseProtocol
cause_value
);
void
setCauseMisc
(
e_Ngap_CauseMisc
cause_value
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
//Decapsulation
bool
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
);
long
getChoiceOfCause
();
long
getCause
();
private:
void
setCauseRadioNetwork
(
e_Ngap_CauseRadioNetwork
cause_value
);
Ngap_PDUSessionResourceReleaseCommandTransfer_t
*
pduSessionResourceReleaseCommandTransferIEs
;
void
setCauseTransport
(
e_Ngap_CauseTransport
cause_value
);
void
setCauseNas
(
e_Ngap_CauseNas
cause_value
);
void
setCauseProtocol
(
e_Ngap_CauseProtocol
cause_value
);
void
setCauseMisc
(
e_Ngap_CauseMisc
cause_value
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
//Decapsulation
bool
decodefromIE
(
uint8_t
*
buf
,
int
buf_size
);
long
getChoiceOfCause
();
long
getCause
();
Cause
*
causeValue
;
private:
Ngap_PDUSessionResourceReleaseCommandTransfer_t
*
pduSessionResourceReleaseCommandTransferIEs
;
};
Cause
*
causeValue
;
};
}
}
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.cpp
View file @
c6dfe333
...
@@ -25,48 +25,57 @@
...
@@ -25,48 +25,57 @@
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "PDUSessionResourceReleaseItemCmd.hpp"
#include "PDUSessionResourceReleaseItemCmd.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
PDUSessionResourceReleaseItemCmd
::
PDUSessionResourceReleaseItemCmd
()
PDUSessionResourceReleaseItemCmd
::
PDUSessionResourceReleaseItemCmd
()
{
{
pDUSessionID
=
NULL
;
pDUSessionID
=
NULL
;
}
}
PDUSessionResourceReleaseItemCmd
::~
PDUSessionResourceReleaseItemCmd
()
{
PDUSessionResourceReleaseItemCmd
::~
PDUSessionResourceReleaseItemCmd
(){
if
(
pDUSessionID
)
if
(
pDUSessionID
)
delete
pDUSessionID
;
delete
pDUSessionID
;
}
}
void
PDUSessionResourceReleaseItemCmd
::
setPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_pDUSessionResourceReleaseCommandTransfer
)
void
PDUSessionResourceReleaseItemCmd
::
setPDUSessionResourceReleaseItemCmd
(
{
PDUSessionID
*
m_pDUSessionID
,
pDUSessionID
=
m_pDUSessionID
;
OCTET_STRING_t
m_pDUSessionResourceReleaseCommandTransfer
)
{
pDUSessionResourceReleaseCommandTransfer
=
m_pDUSessionResourceReleaseCommandTransfer
;
pDUSessionID
=
m_pDUSessionID
;
}
pDUSessionResourceReleaseCommandTransfer
=
bool
PDUSessionResourceReleaseItemCmd
::
encode2PDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
)
m_pDUSessionResourceReleaseCommandTransfer
;
{
}
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pduSessionResourceReleaseCommandTransfer
->
pDUSessionID
))
return
false
;
bool
PDUSessionResourceReleaseItemCmd
::
encode2PDUSessionResourceReleaseItemCmd
(
pduSessionResourceReleaseCommandTransfer
->
pDUSessionResourceReleaseCommandTransfer
=
pDUSessionResourceReleaseCommandTransfer
;
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
)
{
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
return
true
;
pduSessionResourceReleaseCommandTransfer
->
pDUSessionID
))
}
return
false
;
bool
PDUSessionResourceReleaseItemCmd
::
decodefromPDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
)
pduSessionResourceReleaseCommandTransfer
{
->
pDUSessionResourceReleaseCommandTransfer
=
pDUSessionID
=
new
PDUSessionID
();
pDUSessionResourceReleaseCommandTransfer
;
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
pduSessionResourceReleaseCommandTransfer
->
pDUSessionID
))
return
false
;
pDUSessionResourceReleaseCommandTransfer
=
pduSessionResourceReleaseCommandTransfer
->
pDUSessionResourceReleaseCommandTransfer
;
return
true
;
}
return
true
;
bool
PDUSessionResourceReleaseItemCmd
::
decodefromPDUSessionResourceReleaseItemCmd
(
}
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
)
{
void
PDUSessionResourceReleaseItemCmd
::
getPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_pDUSessionResourceReleaseCommandTransfer
)
pDUSessionID
=
new
PDUSessionID
();
{
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
m_pDUSessionID
=
pDUSessionID
;
pduSessionResourceReleaseCommandTransfer
->
pDUSessionID
))
m_pDUSessionResourceReleaseCommandTransfer
=
pDUSessionResourceReleaseCommandTransfer
;
return
false
;
}
pDUSessionResourceReleaseCommandTransfer
=
pduSessionResourceReleaseCommandTransfer
->
pDUSessionResourceReleaseCommandTransfer
;
return
true
;
}
void
PDUSessionResourceReleaseItemCmd
::
getPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_pDUSessionResourceReleaseCommandTransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_pDUSessionResourceReleaseCommandTransfer
=
pDUSessionResourceReleaseCommandTransfer
;
}
}
}
src/ngap/ngapIEs/PDUSessionResourceReleaseItemCmd.hpp
View file @
c6dfe333
...
@@ -33,32 +33,34 @@
...
@@ -33,32 +33,34 @@
#include "S-NSSAI.hpp"
#include "S-NSSAI.hpp"
#include "PDUSessionResourceReleaseCommandTransfer.hpp"
#include "PDUSessionResourceReleaseCommandTransfer.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceToReleaseItemRelCmd.h"
#include "Ngap_PDUSessionResourceToReleaseItemRelCmd.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceReleaseItemCmd
{
class
PDUSessionResourceReleaseItemCmd
{
public:
public:
PDUSessionResourceReleaseItemCmd
();
PDUSessionResourceReleaseItemCmd
();
virtual
~
PDUSessionResourceReleaseItemCmd
();
virtual
~
PDUSessionResourceReleaseItemCmd
();
void
setPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_pDUSessionResourceReleaseCommandTransfer
);
void
getPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_pDUSessionResourceReleaseCommandTransfer
);
bool
encode2PDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
);
bool
decodefromPDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
);
private:
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
pDUSessionResourceReleaseCommandTransfer
;
};
}
#endif
void
setPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*
m_pDUSessionID
,
OCTET_STRING_t
m_pDUSessionResourceReleaseCommandTransfer
);
void
getPDUSessionResourceReleaseItemCmd
(
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_pDUSessionResourceReleaseCommandTransfer
);
bool
encode2PDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
);
bool
decodefromPDUSessionResourceReleaseItemCmd
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
pduSessionResourceReleaseCommandTransfer
);
private:
PDUSessionID
*
pDUSessionID
;
OCTET_STRING_t
pDUSessionResourceReleaseCommandTransfer
;
};
}
#endif
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.cpp
View file @
c6dfe333
#include "PDUSessionResourceReleaseListCmd.hpp"
#include "PDUSessionResourceReleaseListCmd.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceReleaseListCmd
::
PDUSessionResourceReleaseListCmd
()
{
pduSessionResourceReleaseItemCmd
=
NULL
;
numofpduSessionResourceReleaseItemCmd
=
0
;
}
PDUSessionResourceReleaseListCmd
::~
PDUSessionResourceReleaseListCmd
(){
if
(
pduSessionResourceReleaseItemCmd
)
delete
[]
pduSessionResourceReleaseItemCmd
;
}
void
PDUSessionResourceReleaseListCmd
::
setPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*
m_pduSessionResourceReleaseItemCmd
,
int
num
)
{
pduSessionResourceReleaseItemCmd
=
m_pduSessionResourceReleaseItemCmd
;
numofpduSessionResourceReleaseItemCmd
=
num
;
}
bool
PDUSessionResourceReleaseListCmd
::
encode2PDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceReleaseItemCmd
;
i
++
)
{
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
response
=
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceReleaseItemCmd
[
i
].
encode2PDUSessionResourceReleaseItemCmd
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceReleaseListCmd
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceReleaseListCmd
::
decodefromPDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
)
{
numofpduSessionResourceReleaseItemCmd
=
pduSessionResourceReleaseListCmd
->
list
.
count
;
pduSessionResourceReleaseItemCmd
=
new
PDUSessionResourceReleaseItemCmd
[
numofpduSessionResourceReleaseItemCmd
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceReleaseItemCmd
;
i
++
)
{
if
(
!
pduSessionResourceReleaseItemCmd
[
i
].
decodefromPDUSessionResourceReleaseItemCmd
(
pduSessionResourceReleaseListCmd
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceReleaseListCmd
::
getPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*&
m_pduSessionResourceReleaseItemCmd
,
int
&
num
)
{
m_pduSessionResourceReleaseItemCmd
=
pduSessionResourceReleaseItemCmd
;
num
=
numofpduSessionResourceReleaseItemCmd
;
}
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceReleaseListCmd
::
PDUSessionResourceReleaseListCmd
()
{
pduSessionResourceReleaseItemCmd
=
NULL
;
numofpduSessionResourceReleaseItemCmd
=
0
;
}
PDUSessionResourceReleaseListCmd
::~
PDUSessionResourceReleaseListCmd
()
{
if
(
pduSessionResourceReleaseItemCmd
)
delete
[]
pduSessionResourceReleaseItemCmd
;
}
void
PDUSessionResourceReleaseListCmd
::
setPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*
m_pduSessionResourceReleaseItemCmd
,
int
num
)
{
pduSessionResourceReleaseItemCmd
=
m_pduSessionResourceReleaseItemCmd
;
numofpduSessionResourceReleaseItemCmd
=
num
;
}
bool
PDUSessionResourceReleaseListCmd
::
encode2PDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceReleaseItemCmd
;
i
++
)
{
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
response
=
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceToReleaseItemRelCmd_t
));
if
(
!
response
)
return
false
;
if
(
!
pduSessionResourceReleaseItemCmd
[
i
]
.
encode2PDUSessionResourceReleaseItemCmd
(
response
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceReleaseListCmd
->
list
,
response
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceReleaseListCmd
::
decodefromPDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
)
{
numofpduSessionResourceReleaseItemCmd
=
pduSessionResourceReleaseListCmd
->
list
.
count
;
pduSessionResourceReleaseItemCmd
=
new
PDUSessionResourceReleaseItemCmd
[
numofpduSessionResourceReleaseItemCmd
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceReleaseItemCmd
;
i
++
)
{
if
(
!
pduSessionResourceReleaseItemCmd
[
i
]
.
decodefromPDUSessionResourceReleaseItemCmd
(
pduSessionResourceReleaseListCmd
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceReleaseListCmd
::
getPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*&
m_pduSessionResourceReleaseItemCmd
,
int
&
num
)
{
m_pduSessionResourceReleaseItemCmd
=
pduSessionResourceReleaseItemCmd
;
num
=
numofpduSessionResourceReleaseItemCmd
;
}
}
src/ngap/ngapIEs/PDUSessionResourceReleaseListCmd.hpp
View file @
c6dfe333
...
@@ -3,26 +3,32 @@
...
@@ -3,26 +3,32 @@
#include "PDUSessionResourceReleaseItemCmd.hpp"
#include "PDUSessionResourceReleaseItemCmd.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceToReleaseListRelCmd.h"
#include "Ngap_PDUSessionResourceToReleaseListRelCmd.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceReleaseListCmd
{
class
PDUSessionResourceReleaseListCmd
{
public:
public:
PDUSessionResourceReleaseListCmd
();
PDUSessionResourceReleaseListCmd
();
virtual
~
PDUSessionResourceReleaseListCmd
();
virtual
~
PDUSessionResourceReleaseListCmd
();
void
setPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*
m_pduSessionResourceReleaseItemCmd
,
int
num
);
void
setPDUSessionResourceReleaseListCmd
(
void
getPDUSessionResourceReleaseListCmd
(
PDUSessionResourceReleaseItemCmd
*&
m_pduSessionResourceReleaseItemCmd
,
int
&
num
);
PDUSessionResourceReleaseItemCmd
*
m_pduSessionResourceReleaseItemCmd
,
int
num
);
bool
encode2PDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
);
void
getPDUSessionResourceReleaseListCmd
(
bool
decodefromPDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
);
PDUSessionResourceReleaseItemCmd
*&
m_pduSessionResourceReleaseItemCmd
,
private:
int
&
num
);
PDUSessionResourceReleaseItemCmd
*
pduSessionResourceReleaseItemCmd
;
int
numofpduSessionResourceReleaseItemCmd
;
bool
encode2PDUSessionResourceReleaseListCmd
(
};
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
);
bool
decodefromPDUSessionResourceReleaseListCmd
(
Ngap_PDUSessionResourceToReleaseListRelCmd_t
*
pduSessionResourceReleaseListCmd
);
private:
PDUSessionResourceReleaseItemCmd
*
pduSessionResourceReleaseItemCmd
;
int
numofpduSessionResourceReleaseItemCmd
;
};
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceReleasedItemRelRes.cpp
View file @
c6dfe333
...
@@ -53,7 +53,8 @@ void PDUSessionResourceReleasedItemRelRes::getPDUSessionResourceReleasedItemRelR
...
@@ -53,7 +53,8 @@ void PDUSessionResourceReleasedItemRelRes::getPDUSessionResourceReleasedItemRelR
PDUSessionID
*&
m_pDUSessionID
,
PDUSessionID
*&
m_pDUSessionID
,
OCTET_STRING_t
&
m_pDUSessionResourceReleaseResponseTransfer
)
{
OCTET_STRING_t
&
m_pDUSessionResourceReleaseResponseTransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_pDUSessionID
=
pDUSessionID
;
m_pDUSessionResourceReleaseResponseTransfer
=
pDUSessionResourceReleaseResponseTransfer
;
m_pDUSessionResourceReleaseResponseTransfer
=
pDUSessionResourceReleaseResponseTransfer
;
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
...
@@ -65,7 +66,7 @@ bool PDUSessionResourceReleasedItemRelRes::encode2PDUSessionResourceReleasedItem
...
@@ -65,7 +66,7 @@ bool PDUSessionResourceReleasedItemRelRes::encode2PDUSessionResourceReleasedItem
pduSessionResourceReleasedItemRelRes
pduSessionResourceReleasedItemRelRes
->
pDUSessionResourceReleaseResponseTransfer
=
->
pDUSessionResourceReleaseResponseTransfer
=
pDUSessionResourceReleaseResponseTransfer
;
pDUSessionResourceReleaseResponseTransfer
;
return
true
;
return
true
;
}
}
...
...
src/ngap/ngapIEs/PDUSessionResourceReleasedListRelRes.cpp
View file @
c6dfe333
...
@@ -44,8 +44,7 @@ PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() {
...
@@ -44,8 +44,7 @@ PDUSessionResourceReleasedListRelRes::~PDUSessionResourceReleasedListRelRes() {
void
PDUSessionResourceReleasedListRelRes
::
setPDUSessionResourceReleasedListRelRes
(
void
PDUSessionResourceReleasedListRelRes
::
setPDUSessionResourceReleasedListRelRes
(
PDUSessionResourceReleasedItemRelRes
*
m_pduSessionResourceReleasedItemRelRes
,
PDUSessionResourceReleasedItemRelRes
*
m_pduSessionResourceReleasedItemRelRes
,
int
num
)
{
int
num
)
{
pduSessionResourceReleasedItemRelRes
=
pduSessionResourceReleasedItemRelRes
=
m_pduSessionResourceReleasedItemRelRes
;
m_pduSessionResourceReleasedItemRelRes
;
maxnoofPDUSessions
=
num
;
maxnoofPDUSessions
=
num
;
}
}
...
@@ -53,8 +52,7 @@ void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelR
...
@@ -53,8 +52,7 @@ void PDUSessionResourceReleasedListRelRes::setPDUSessionResourceReleasedListRelR
void
PDUSessionResourceReleasedListRelRes
::
getPDUSessionResourceReleasedListRelRes
(
void
PDUSessionResourceReleasedListRelRes
::
getPDUSessionResourceReleasedListRelRes
(
PDUSessionResourceReleasedItemRelRes
*&
m_pduSessionResourceReleasedItemRelRes
,
PDUSessionResourceReleasedItemRelRes
*&
m_pduSessionResourceReleasedItemRelRes
,
int
&
num
)
{
int
&
num
)
{
m_pduSessionResourceReleasedItemRelRes
=
m_pduSessionResourceReleasedItemRelRes
=
pduSessionResourceReleasedItemRelRes
;
pduSessionResourceReleasedItemRelRes
;
num
=
maxnoofPDUSessions
;
num
=
maxnoofPDUSessions
;
}
}
...
@@ -70,8 +68,7 @@ bool PDUSessionResourceReleasedListRelRes::encode2PDUSessionResourceReleasedList
...
@@ -70,8 +68,7 @@ bool PDUSessionResourceReleasedListRelRes::encode2PDUSessionResourceReleasedList
if
(
!
pduSessionResourceReleasedItemRelRes
[
i
]
if
(
!
pduSessionResourceReleasedItemRelRes
[
i
]
.
encode2PDUSessionResourceReleasedItemRelRes
(
rel
))
.
encode2PDUSessionResourceReleasedItemRelRes
(
rel
))
return
false
;
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceReleasedListRelRes
->
list
,
rel
)
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceReleasedListRelRes
->
list
,
rel
)
!=
0
)
!=
0
)
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -86,7 +83,7 @@ bool PDUSessionResourceReleasedListRelRes::decodefromPDUSessionResourceReleasedL
...
@@ -86,7 +83,7 @@ bool PDUSessionResourceReleasedListRelRes::decodefromPDUSessionResourceReleasedL
for
(
int
i
=
0
;
i
<
maxnoofPDUSessions
;
i
++
)
{
for
(
int
i
=
0
;
i
<
maxnoofPDUSessions
;
i
++
)
{
if
(
!
pduSessionResourceReleasedItemRelRes
[
i
]
if
(
!
pduSessionResourceReleasedItemRelRes
[
i
]
.
decodefromPDUSessionResourceReleasedItemRelRes
(
.
decodefromPDUSessionResourceReleasedItemRelRes
(
pduSessionResourceReleasedListRelRes
->
list
.
array
[
i
]))
pduSessionResourceReleasedListRelRes
->
list
.
array
[
i
]))
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
...
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.cpp
View file @
c6dfe333
#include "PDUSessionResourceSetupItemHOReq.hpp"
#include "PDUSessionResourceSetupItemHOReq.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceSetupItemHOReq
::
PDUSessionResourceSetupItemHOReq
()
{
pDUSessionID
=
NULL
;
s_NSSAI
=
NULL
;
}
PDUSessionResourceSetupItemHOReq
::~
PDUSessionResourceSetupItemHOReq
(){}
void
PDUSessionResourceSetupItemHOReq
::
setPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*
m_pDUSessionID
,
S_NSSAI
*
m_s_NSSAI
,
OCTET_STRING_t
m_pDUSessionResourceSetupRequestTransfer
)
{
pDUSessionID
=
m_pDUSessionID
;
s_NSSAI
=
m_s_NSSAI
;
pDUSessionResourceSetupRequestTransfer
=
m_pDUSessionResourceSetupRequestTransfer
;
}
bool
PDUSessionResourceSetupItemHOReq
::
encode2PDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
)
{
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pduSessionResourceSetupItemHOReq
->
pDUSessionID
))
return
false
;
if
(
!
s_NSSAI
->
encode2S_NSSAI
(
&
pduSessionResourceSetupItemHOReq
->
s_NSSAI
))
return
false
;
pduSessionResourceSetupItemHOReq
->
handoverRequestTransfer
=
pDUSessionResourceSetupRequestTransfer
;
return
true
;
}
bool
PDUSessionResourceSetupItemHOReq
::
decodefromPDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
)
{
pDUSessionID
=
new
PDUSessionID
();
s_NSSAI
=
new
S_NSSAI
();
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
pduSessionResourceSetupItemHOReq
->
pDUSessionID
))
return
false
;
if
(
!
s_NSSAI
->
decodefromS_NSSAI
(
&
pduSessionResourceSetupItemHOReq
->
s_NSSAI
))
return
false
;
pDUSessionResourceSetupRequestTransfer
=
pduSessionResourceSetupItemHOReq
->
handoverRequestTransfer
;
return
true
;
}
void
PDUSessionResourceSetupItemHOReq
::
getPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*&
m_pDUSessionID
,
S_NSSAI
*&
m_s_NSSAI
,
OCTET_STRING_t
&
m_pDUSessionResourceSetupRequestTransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_s_NSSAI
=
s_NSSAI
;
m_pDUSessionResourceSetupRequestTransfer
=
pDUSessionResourceSetupRequestTransfer
;
}
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceSetupItemHOReq
::
PDUSessionResourceSetupItemHOReq
()
{
pDUSessionID
=
NULL
;
s_NSSAI
=
NULL
;
}
PDUSessionResourceSetupItemHOReq
::~
PDUSessionResourceSetupItemHOReq
()
{
}
void
PDUSessionResourceSetupItemHOReq
::
setPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*
m_pDUSessionID
,
S_NSSAI
*
m_s_NSSAI
,
OCTET_STRING_t
m_pDUSessionResourceSetupRequestTransfer
)
{
pDUSessionID
=
m_pDUSessionID
;
s_NSSAI
=
m_s_NSSAI
;
pDUSessionResourceSetupRequestTransfer
=
m_pDUSessionResourceSetupRequestTransfer
;
}
bool
PDUSessionResourceSetupItemHOReq
::
encode2PDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
)
{
if
(
!
pDUSessionID
->
encode2PDUSessionID
(
pduSessionResourceSetupItemHOReq
->
pDUSessionID
))
return
false
;
if
(
!
s_NSSAI
->
encode2S_NSSAI
(
&
pduSessionResourceSetupItemHOReq
->
s_NSSAI
))
return
false
;
pduSessionResourceSetupItemHOReq
->
handoverRequestTransfer
=
pDUSessionResourceSetupRequestTransfer
;
return
true
;
}
bool
PDUSessionResourceSetupItemHOReq
::
decodefromPDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
)
{
pDUSessionID
=
new
PDUSessionID
();
s_NSSAI
=
new
S_NSSAI
();
if
(
!
pDUSessionID
->
decodefromPDUSessionID
(
pduSessionResourceSetupItemHOReq
->
pDUSessionID
))
return
false
;
if
(
!
s_NSSAI
->
decodefromS_NSSAI
(
&
pduSessionResourceSetupItemHOReq
->
s_NSSAI
))
return
false
;
pDUSessionResourceSetupRequestTransfer
=
pduSessionResourceSetupItemHOReq
->
handoverRequestTransfer
;
return
true
;
}
void
PDUSessionResourceSetupItemHOReq
::
getPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*&
m_pDUSessionID
,
S_NSSAI
*&
m_s_NSSAI
,
OCTET_STRING_t
&
m_pDUSessionResourceSetupRequestTransfer
)
{
m_pDUSessionID
=
pDUSessionID
;
m_s_NSSAI
=
s_NSSAI
;
m_pDUSessionResourceSetupRequestTransfer
=
pDUSessionResourceSetupRequestTransfer
;
}
}
src/ngap/ngapIEs/PDUSessionResourceSetupItemHOReq.hpp
View file @
c6dfe333
...
@@ -6,33 +6,35 @@
...
@@ -6,33 +6,35 @@
#include "S-NSSAI.hpp"
#include "S-NSSAI.hpp"
#include "PDUSessionResourceSetupRequestTransfer.hpp"
#include "PDUSessionResourceSetupRequestTransfer.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceSetupItemHOReq.h"
#include "Ngap_PDUSessionResourceSetupItemHOReq.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceSetupItemHOReq
{
class
PDUSessionResourceSetupItemHOReq
{
public:
public:
PDUSessionResourceSetupItemHOReq
();
PDUSessionResourceSetupItemHOReq
();
virtual
~
PDUSessionResourceSetupItemHOReq
();
virtual
~
PDUSessionResourceSetupItemHOReq
();
void
setPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*
m_pDUSessionID
,
S_NSSAI
*
m_s_NSSAI
,
OCTET_STRING_t
m_pDUSessionResourceSetupRequestTransfer
);
void
setPDUSessionResourceSetupItemHOReq
(
void
getPDUSessionResourceSetupItemHOReq
(
PDUSessionID
*&
m_pDUSessionID
,
S_NSSAI
*&
m_s_NSSAI
,
OCTET_STRING_t
&
m_pDUSessionResourceSetupRequestTransfer
);
PDUSessionID
*
m_pDUSessionID
,
S_NSSAI
*
m_s_NSSAI
,
OCTET_STRING_t
m_pDUSessionResourceSetupRequestTransfer
);
bool
encode2PDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
);
void
getPDUSessionResourceSetupItemHOReq
(
bool
decodefromPDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
);
PDUSessionID
*&
m_pDUSessionID
,
S_NSSAI
*&
m_s_NSSAI
,
private:
OCTET_STRING_t
&
m_pDUSessionResourceSetupRequestTransfer
);
PDUSessionID
*
pDUSessionID
;
S_NSSAI
*
s_NSSAI
;
bool
encode2PDUSessionResourceSetupItemHOReq
(
OCTET_STRING_t
pDUSessionResourceSetupRequestTransfer
;
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
);
};
bool
decodefromPDUSessionResourceSetupItemHOReq
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
pduSessionResourceSetupItemHOReq
);
private:
PDUSessionID
*
pDUSessionID
;
S_NSSAI
*
s_NSSAI
;
OCTET_STRING_t
pDUSessionResourceSetupRequestTransfer
;
};
}
}
#endif
#endif
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.cpp
View file @
c6dfe333
#include "PDUSessionResourceSetupListHOReq.hpp"
#include "PDUSessionResourceSetupListHOReq.hpp"
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceSetupListHOReq
::
PDUSessionResourceSetupListHOReq
()
{
pduSessionResourceSetupItemHOReq
=
NULL
;
numofpduSessionResourceSetupItemHOReq
=
0
;
}
PDUSessionResourceSetupListHOReq
::~
PDUSessionResourceSetupListHOReq
(){}
void
PDUSessionResourceSetupListHOReq
::
setPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
,
int
num
)
{
pduSessionResourceSetupItemHOReq
=
m_pduSessionResourceSetupItemHOReq
;
numofpduSessionResourceSetupItemHOReq
=
num
;
}
bool
PDUSessionResourceSetupListHOReq
::
encode2PDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceSetupItemHOReq
;
i
++
)
{
Ngap_PDUSessionResourceSetupItemHOReq_t
*
request
=
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceSetupItemHOReq_t
));
if
(
!
request
)
return
false
;
if
(
!
pduSessionResourceSetupItemHOReq
[
i
].
encode2PDUSessionResourceSetupItemHOReq
(
request
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceSetupListHOReq
->
list
,
request
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceSetupListHOReq
::
decodefromPDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
)
{
numofpduSessionResourceSetupItemHOReq
=
pduSessionResourceSetupListHOReq
->
list
.
count
;
pduSessionResourceSetupItemHOReq
=
new
PDUSessionResourceSetupItemHOReq
[
numofpduSessionResourceSetupItemHOReq
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceSetupItemHOReq
;
i
++
)
{
if
(
!
pduSessionResourceSetupItemHOReq
[
i
].
decodefromPDUSessionResourceSetupItemHOReq
(
pduSessionResourceSetupListHOReq
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceSetupListHOReq
::
getPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*&
m_pduSessionResourceSetupItemHOReq
,
int
&
num
)
{
m_pduSessionResourceSetupItemHOReq
=
pduSessionResourceSetupItemHOReq
;
num
=
numofpduSessionResourceSetupItemHOReq
;
}
}
#include <iostream>
using
namespace
std
;
namespace
ngap
{
PDUSessionResourceSetupListHOReq
::
PDUSessionResourceSetupListHOReq
()
{
pduSessionResourceSetupItemHOReq
=
NULL
;
numofpduSessionResourceSetupItemHOReq
=
0
;
}
PDUSessionResourceSetupListHOReq
::~
PDUSessionResourceSetupListHOReq
()
{
}
void
PDUSessionResourceSetupListHOReq
::
setPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
,
int
num
)
{
pduSessionResourceSetupItemHOReq
=
m_pduSessionResourceSetupItemHOReq
;
numofpduSessionResourceSetupItemHOReq
=
num
;
}
bool
PDUSessionResourceSetupListHOReq
::
encode2PDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
)
{
for
(
int
i
=
0
;
i
<
numofpduSessionResourceSetupItemHOReq
;
i
++
)
{
Ngap_PDUSessionResourceSetupItemHOReq_t
*
request
=
(
Ngap_PDUSessionResourceSetupItemHOReq_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceSetupItemHOReq_t
));
if
(
!
request
)
return
false
;
if
(
!
pduSessionResourceSetupItemHOReq
[
i
]
.
encode2PDUSessionResourceSetupItemHOReq
(
request
))
return
false
;
if
(
ASN_SEQUENCE_ADD
(
&
pduSessionResourceSetupListHOReq
->
list
,
request
)
!=
0
)
return
false
;
}
return
true
;
}
bool
PDUSessionResourceSetupListHOReq
::
decodefromPDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
)
{
numofpduSessionResourceSetupItemHOReq
=
pduSessionResourceSetupListHOReq
->
list
.
count
;
pduSessionResourceSetupItemHOReq
=
new
PDUSessionResourceSetupItemHOReq
[
numofpduSessionResourceSetupItemHOReq
]();
for
(
int
i
=
0
;
i
<
numofpduSessionResourceSetupItemHOReq
;
i
++
)
{
if
(
!
pduSessionResourceSetupItemHOReq
[
i
]
.
decodefromPDUSessionResourceSetupItemHOReq
(
pduSessionResourceSetupListHOReq
->
list
.
array
[
i
]))
return
false
;
}
return
true
;
}
void
PDUSessionResourceSetupListHOReq
::
getPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*&
m_pduSessionResourceSetupItemHOReq
,
int
&
num
)
{
m_pduSessionResourceSetupItemHOReq
=
pduSessionResourceSetupItemHOReq
;
num
=
numofpduSessionResourceSetupItemHOReq
;
}
}
src/ngap/ngapIEs/PDUSessionResourceSetupListHOReq.hpp
View file @
c6dfe333
...
@@ -3,27 +3,33 @@
...
@@ -3,27 +3,33 @@
#include "PDUSessionResourceSetupItemHOReq.hpp"
#include "PDUSessionResourceSetupItemHOReq.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_PDUSessionResourceSetupListHOReq.h"
#include "Ngap_PDUSessionResourceSetupListHOReq.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
PDUSessionResourceSetupListHOReq
{
class
PDUSessionResourceSetupListHOReq
{
public:
public:
PDUSessionResourceSetupListHOReq
();
PDUSessionResourceSetupListHOReq
();
virtual
~
PDUSessionResourceSetupListHOReq
();
virtual
~
PDUSessionResourceSetupListHOReq
();
void
setPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
,
int
num
);
void
setPDUSessionResourceSetupListHOReq
(
void
getPDUSessionResourceSetupListHOReq
(
PDUSessionResourceSetupItemHOReq
*&
m_pduSessionResourceSetupItemHOReq
,
int
&
num
);
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
,
int
num
);
bool
encode2PDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
);
void
getPDUSessionResourceSetupListHOReq
(
bool
decodefromPDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
);
PDUSessionResourceSetupItemHOReq
*&
m_pduSessionResourceSetupItemHOReq
,
private:
int
&
num
);
PDUSessionResourceSetupItemHOReq
*
pduSessionResourceSetupItemHOReq
;
int
numofpduSessionResourceSetupItemHOReq
;
bool
encode2PDUSessionResourceSetupListHOReq
(
};
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
);
bool
decodefromPDUSessionResourceSetupListHOReq
(
Ngap_PDUSessionResourceSetupListHOReq_t
*
pduSessionResourceSetupListHOReq
);
private:
PDUSessionResourceSetupItemHOReq
*
pduSessionResourceSetupItemHOReq
;
int
numofpduSessionResourceSetupItemHOReq
;
};
}
}
...
...
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.cpp
View file @
c6dfe333
...
@@ -20,42 +20,40 @@
...
@@ -20,42 +20,40 @@
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "QosFlowItemWithDataForwarding.hpp"
#include "QosFlowItemWithDataForwarding.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
QosFlowItemWithDataForWarding
::
QosFlowItemWithDataForWarding
()
{
QosFlowItemWithDataForWarding
::
QosFlowItemWithDataForWarding
()
qosFlowIdentifier
=
NULL
;
{
}
qosFlowIdentifier
=
NULL
;
QosFlowItemWithDataForWarding
::~
QosFlowItemWithDataForWarding
()
{
}
}
QosFlowItemWithDataForWarding
::~
QosFlowItemWithDataForWarding
()
{}
void
QosFlowItemWithDataForWarding
::
getQosFlowItemWithDataForWarding
(
void
QosFlowItemWithDataForWarding
::
getQosFlowItemWithDataForWarding
(
Ngap_QosFlowIdentifier_t
&
m_QosFlowIdentifier
)
Ngap_QosFlowIdentifier_t
&
m_QosFlowIdentifier
)
{
{
if
(
!
qosFlowIdentifier
)
if
(
!
qosFlowIdentifier
)
printf
(
"qosFlowIdentifier null
\n
"
);
printf
(
"qosFlowIdentifier null
\n
"
);
else
else
printf
(
"qosFlowIdentifier
\n
"
);
printf
(
"qosFlowIdentifier
\n
"
);
if
(
qosFlowIdentifier
->
getQosFlowIdentifier
(
value
))
{
if
(
qosFlowIdentifier
->
getQosFlowIdentifier
(
value
))
m_QosFlowIdentifier
=
(
Ngap_QosFlowIdentifier_t
)
value
;
{
}
m_QosFlowIdentifier
=
(
Ngap_QosFlowIdentifier_t
)
value
;
}
}
bool
QosFlowItemWithDataForWarding
::
decodeformQosFlowItemWithDataForWarding
(
}
Ngap_QosFlowSetupResponseItemHOReqAck_t
*
qosFlowItemWithDataForWarding
)
{
bool
QosFlowItemWithDataForWarding
::
decodeformQosFlowItemWithDataForWarding
(
Ngap_QosFlowSetupResponseItemHOReqAck_t
*
qosFlowItemWithDataForWarding
)
qosFlowIdentifier
=
new
QosFlowIdentifier
();
{
if
(
!
qosFlowIdentifier
->
decodefromQosFlowIdentifier
(
qosFlowIdentifier
=
new
QosFlowIdentifier
();
&
(
qosFlowItemWithDataForWarding
->
qosFlowIdentifier
)))
{
if
(
!
qosFlowIdentifier
->
decodefromQosFlowIdentifier
(
&
(
qosFlowItemWithDataForWarding
->
qosFlowIdentifier
)))
printf
(
"false
\n
"
);
{
return
false
;
printf
(
"false
\n
"
);
}
return
false
;
printf
(
"true
\n
"
);
}
return
true
;
printf
(
"true
\n
"
);
}
return
true
;
}
// namespace ngap
}
}
// namespace ngap
src/ngap/ngapIEs/QosFlowItemWithDataForwarding.hpp
View file @
c6dfe333
...
@@ -20,35 +20,34 @@
...
@@ -20,35 +20,34 @@
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#ifndef _QOSFLOWITEMWITHDATAFORWARDING_H_
#ifndef _QOSFLOWITEMWITHDATAFORWARDING_H_
#define _QOSFLOWITEMWITHDATAFORWARDING_H_
#define _QOSFLOWITEMWITHDATAFORWARDING_H_
#include "QosFlowLevelQosParameters.hpp"
#include "QosFlowLevelQosParameters.hpp"
#include "QosFlowIdentifier.hpp"
#include "QosFlowIdentifier.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_QosFlowSetupResponseItemHOReqAck.h"
#include "Ngap_QosFlowSetupResponseItemHOReqAck.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
QosFlowItemWithDataForWarding
{
class
QosFlowItemWithDataForWarding
public:
{
QosFlowItemWithDataForWarding
();
public:
virtual
~
QosFlowItemWithDataForWarding
();
QosFlowItemWithDataForWarding
();
virtual
~
QosFlowItemWithDataForWarding
();
void
getQosFlowItemWithDataForWarding
(
Ngap_QosFlowIdentifier_t
&
m_QosFlowIdentifier
);
void
getQosFlowItemWithDataForWarding
(
bool
decodeformQosFlowItemWithDataForWarding
(
Ngap_QosFlowSetupResponseItemHOReqAck_t
*
qosFlowItemWithDataForWarding
);
Ngap_QosFlowIdentifier_t
&
m_QosFlowIdentifier
);
bool
decodeformQosFlowItemWithDataForWarding
(
Ngap_QosFlowSetupResponseItemHOReqAck_t
*
qosFlowItemWithDataForWarding
);
private:
private:
long
value
;
long
value
;
QosFlowIdentifier
*
qosFlowIdentifier
;
QosFlowIdentifier
*
qosFlowIdentifier
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif // !_QOSFLOWITEMWITHDATAFORWARDING_H_
#endif // !_QOSFLOWITEMWITHDATAFORWARDING_H_
src/ngap/ngapIEs/QosFlowListWithDataForwarding.cpp
View file @
c6dfe333
...
@@ -19,36 +19,41 @@
...
@@ -19,36 +19,41 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "QosFlowListWithDataForwarding.hpp"
#include "QosFlowListWithDataForwarding.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
QosFlowListWithDataForwarding
::
QosFlowListWithDataForwarding
()
QosFlowListWithDataForwarding
::
QosFlowListWithDataForwarding
()
{
{
qosFlowItemWithDataForwarding
=
NULL
;
qosFlowItemWithDataForwarding
=
NULL
;
numofQosFlowItemWithDataForwarding
=
0
;
numofQosFlowItemWithDataForwarding
=
0
;
}
}
QosFlowListWithDataForwarding
::~
QosFlowListWithDataForwarding
()
{
QosFlowListWithDataForwarding
::~
QosFlowListWithDataForwarding
(){
}
}
bool
QosFlowListWithDataForwarding
::
decodeFormQosFlowListWithDataForwarding
(
Ngap_QosFlowSetupResponseListHOReqAck_t
qosFlowSetupResponseList
)
{
bool
QosFlowListWithDataForwarding
::
decodeFormQosFlowListWithDataForwarding
(
numofQosFlowItemWithDataForwarding
=
qosFlowSetupResponseList
.
list
.
count
;
Ngap_QosFlowSetupResponseListHOReqAck_t
qosFlowSetupResponseList
)
{
qosFlowItemWithDataForwarding
=
new
QosFlowItemWithDataForWarding
[
numofQosFlowItemWithDataForwarding
]();
numofQosFlowItemWithDataForwarding
=
qosFlowSetupResponseList
.
list
.
count
;
for
(
int
i
=
0
;
i
<
numofQosFlowItemWithDataForwarding
;
i
++
)
{
qosFlowItemWithDataForwarding
=
if
(
!
qosFlowItemWithDataForwarding
[
i
].
decodeformQosFlowItemWithDataForWarding
(
qosFlowSetupResponseList
.
list
.
array
[
i
]))
new
QosFlowItemWithDataForWarding
[
numofQosFlowItemWithDataForwarding
]();
return
false
;
for
(
int
i
=
0
;
i
<
numofQosFlowItemWithDataForwarding
;
i
++
)
{
}
if
(
!
qosFlowItemWithDataForwarding
[
i
]
return
true
;
.
decodeformQosFlowItemWithDataForWarding
(
}
qosFlowSetupResponseList
.
list
.
array
[
i
]))
bool
QosFlowListWithDataForwarding
::
getQosFlowListWithDataForwarding
(
QosFlowItemWithDataForWarding
*&
m_QosFlowItemWithDataForwarding
,
int
&
num
){
return
false
;
m_QosFlowItemWithDataForwarding
=
qosFlowItemWithDataForwarding
;
}
num
=
numofQosFlowItemWithDataForwarding
;
return
true
;
return
true
;
}
}
bool
QosFlowListWithDataForwarding
::
getQosFlowListWithDataForwarding
(
QosFlowItemWithDataForWarding
*&
m_QosFlowItemWithDataForwarding
,
int
&
num
)
{
m_QosFlowItemWithDataForwarding
=
qosFlowItemWithDataForwarding
;
num
=
numofQosFlowItemWithDataForwarding
;
return
true
;
}
}
}
src/ngap/ngapIEs/QosFlowListWithDataForwarding.hpp
View file @
c6dfe333
...
@@ -19,33 +19,35 @@
...
@@ -19,33 +19,35 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file
/*! \file
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#ifndef _QOSFLOWLISTWITHDATAFORWRADING_H_
#ifndef _QOSFLOWLISTWITHDATAFORWRADING_H_
#define _QOSFLOWLISTWITHDATAFORWRADING_H_
#define _QOSFLOWLISTWITHDATAFORWRADING_H_
#include "QosFlowLevelQosParameters.hpp"
#include "QosFlowLevelQosParameters.hpp"
#include "QosFlowItemWithDataForwarding.hpp"
#include "QosFlowItemWithDataForwarding.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_QosFlowSetupResponseListHOReqAck.h"
#include "Ngap_QosFlowSetupResponseListHOReqAck.h"
}
}
namespace
ngap
{
namespace
ngap
{
class
QosFlowListWithDataForwarding
{
class
QosFlowListWithDataForwarding
{
public:
public:
QosFlowListWithDataForwarding
();
QosFlowListWithDataForwarding
();
virtual
~
QosFlowListWithDataForwarding
();
virtual
~
QosFlowListWithDataForwarding
();
bool
getQosFlowListWithDataForwarding
(
QosFlowItemWithDataForWarding
*&
m_QosFlowItemWithDataForwarding
,
int
&
num
);
bool
getQosFlowListWithDataForwarding
(
bool
decodeFormQosFlowListWithDataForwarding
(
Ngap_QosFlowSetupResponseListHOReqAck_t
qosFlowSetupResponseList
);
QosFlowItemWithDataForWarding
*&
m_QosFlowItemWithDataForwarding
,
private:
int
&
num
);
//QosFlowIdentifier *qosFlowIdentifier;
bool
decodeFormQosFlowListWithDataForwarding
(
QosFlowItemWithDataForWarding
*
qosFlowItemWithDataForwarding
;
Ngap_QosFlowSetupResponseListHOReqAck_t
qosFlowSetupResponseList
);
int
numofQosFlowItemWithDataForwarding
;
private:
};
//QosFlowIdentifier *qosFlowIdentifier;
QosFlowItemWithDataForWarding
*
qosFlowItemWithDataForwarding
;
int
numofQosFlowItemWithDataForwarding
;
};
}
}
#endif
#endif
src/ngap/ngapIEs/QosFlowToBeForwardedItem.cpp
View file @
c6dfe333
...
@@ -26,31 +26,29 @@
...
@@ -26,31 +26,29 @@
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "QosFlowToBeForwardedItem.hpp"
#include "QosFlowToBeForwardedItem.hpp"
extern
"C"
extern
"C"
{
{
}
}
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
QosFlowToBeForwardedItem
::
QosFlowToBeForwardedItem
()
{
QosFlowToBeForwardedItem
::
QosFlowToBeForwardedItem
()
qosflowidentifier
=
NULL
;
{
}
qosflowidentifier
=
NULL
;
QosFlowToBeForwardedItem
::~
QosFlowToBeForwardedItem
()
{
}
}
QosFlowToBeForwardedItem
::~
QosFlowToBeForwardedItem
()
{}
void
QosFlowToBeForwardedItem
::
setQosFlowIdentifier
(
void
QosFlowToBeForwardedItem
::
setQosFlowIdentifier
(
QosFlowIdentifier
*
m_qosflowidentifier
)
QosFlowIdentifier
*
m_qosflowidentifier
)
{
{
qosflowidentifier
=
m_qosflowidentifier
;
qosflowidentifier
=
m_qosflowidentifier
;
}
}
bool
QosFlowToBeForwardedItem
::
encodeQosFlowToBeForwardedItem
(
bool
QosFlowToBeForwardedItem
::
encodeQosFlowToBeForwardedItem
(
Ngap_QosFlowToBeForwardedItem_t
*
qosflowtobeforwardeditem
)
Ngap_QosFlowToBeForwardedItem_t
*
qosflowtobeforwardeditem
)
{
{
if
(
!
qosflowidentifier
)
if
(
!
qosflowidentifier
)
return
false
;
return
false
;
if
(
!
qosflowidentifier
->
encode2QosFlowIdentifier
(
if
(
!
qosflowidentifier
->
encode2QosFlowIdentifier
(
&
qosflowtobeforwardeditem
->
qosFlowIdentifier
))
&
qosflowtobeforwardeditem
->
qosFlowIdentifier
))
{
{
cout
<<
"encode QFI error"
<<
endl
;
cout
<<
"encode QFI error"
<<
endl
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapIEs/QosFlowToBeForwardedItem.hpp
View file @
c6dfe333
...
@@ -28,22 +28,20 @@
...
@@ -28,22 +28,20 @@
#ifndef _QOSFLOWTOBEFORWARDEDITEM_H_
#ifndef _QOSFLOWTOBEFORWARDEDITEM_H_
#define _QOSFLOWTOBEFORWARDEDITEM_H_
#define _QOSFLOWTOBEFORWARDEDITEM_H_
#include "QosFlowIdentifier.hpp"
#include "QosFlowIdentifier.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_QosFlowToBeForwardedItem.h"
#include "Ngap_QosFlowToBeForwardedItem.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
QosFlowToBeForwardedItem
{
class
QosFlowToBeForwardedItem
public:
{
QosFlowToBeForwardedItem
();
public:
virtual
~
QosFlowToBeForwardedItem
();
QosFlowToBeForwardedItem
();
void
setQosFlowIdentifier
(
QosFlowIdentifier
*
m_qosflowidentifier
);
virtual
~
QosFlowToBeForwardedItem
();
bool
encodeQosFlowToBeForwardedItem
(
void
setQosFlowIdentifier
(
QosFlowIdentifier
*
m_qosflowidentifier
);
Ngap_QosFlowToBeForwardedItem_t
*
qosflowtobeforwardeditem
);
bool
encodeQosFlowToBeForwardedItem
(
Ngap_QosFlowToBeForwardedItem_t
*
qosflowtobeforwardeditem
);
private:
private:
QosFlowIdentifier
*
qosflowidentifier
;
QosFlowIdentifier
*
qosflowidentifier
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/QosFlowToBeForwardedList.cpp
View file @
c6dfe333
...
@@ -28,40 +28,40 @@
...
@@ -28,40 +28,40 @@
#include "QosFlowToBeForwardedList.hpp"
#include "QosFlowToBeForwardedList.hpp"
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
QosFlowToBeForwardedList
::
QosFlowToBeForwardedList
()
{
QosFlowToBeForwardedList
::
QosFlowToBeForwardedList
()
Qosflowtobeforwardeditem
=
NULL
;
{
numofqosflowtobeforwardeditem
=
0
;
Qosflowtobeforwardeditem
=
NULL
;
}
numofqosflowtobeforwardeditem
=
0
;
QosFlowToBeForwardedList
::~
QosFlowToBeForwardedList
()
{
}
void
QosFlowToBeForwardedList
::
setQosFlowToBeForwardedItem
(
QosFlowToBeForwardedItem
*
m_qosflowtobeforwardeditem
,
int
num
)
{
Qosflowtobeforwardeditem
=
m_qosflowtobeforwardeditem
;
numofqosflowtobeforwardeditem
=
num
;
}
bool
QosFlowToBeForwardedList
::
encodeQosFlowToBeForwardedList
(
Ngap_QosFlowToBeForwardedList
*&
m_ngap_qosflowtobeforwardedlist
)
{
m_ngap_qosflowtobeforwardedlist
=
(
Ngap_QosFlowToBeForwardedList_t
*
)
calloc
(
1
,
sizeof
(
Ngap_QosFlowToBeForwardedList_t
));
for
(
int
i
=
0
;
i
<
numofqosflowtobeforwardeditem
;
i
++
)
{
cout
<<
"encoding list..."
<<
endl
;
Ngap_QosFlowToBeForwardedItem_t
*
response
=
(
Ngap_QosFlowToBeForwardedItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_QosFlowToBeForwardedItem_t
));
if
(
!
response
)
return
false
;
if
(
!
Qosflowtobeforwardeditem
[
i
].
encodeQosFlowToBeForwardedItem
(
response
))
{
cout
<<
"encode QosFlowTowardedItem error"
<<
endl
;
return
false
;
}
}
QosFlowToBeForwardedList
::~
QosFlowToBeForwardedList
()
{}
cout
<<
"QFI is "
<<
response
->
qosFlowIdentifier
<<
endl
;
void
QosFlowToBeForwardedList
::
setQosFlowToBeForwardedItem
(
QosFlowToBeForwardedItem
*
m_qosflowtobeforwardeditem
,
int
num
)
if
(
ASN_SEQUENCE_ADD
(
&
m_ngap_qosflowtobeforwardedlist
->
list
,
response
)
{
!=
0
)
{
Qosflowtobeforwardeditem
=
m_qosflowtobeforwardeditem
;
cout
<<
"encode QosFlowTowardedList error"
<<
endl
;
numofqosflowtobeforwardeditem
=
num
;
return
false
;
}
}
bool
QosFlowToBeForwardedList
::
encodeQosFlowToBeForwardedList
(
Ngap_QosFlowToBeForwardedList
*&
m_ngap_qosflowtobeforwardedlist
)
}
{
return
true
;
m_ngap_qosflowtobeforwardedlist
=
(
Ngap_QosFlowToBeForwardedList_t
*
)
calloc
(
1
,
sizeof
(
Ngap_QosFlowToBeForwardedList_t
));
}
for
(
int
i
=
0
;
i
<
numofqosflowtobeforwardeditem
;
i
++
)
}
// namespace ngap
{
cout
<<
"encoding list..."
<<
endl
;
Ngap_QosFlowToBeForwardedItem_t
*
response
=
(
Ngap_QosFlowToBeForwardedItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_QosFlowToBeForwardedItem_t
));
if
(
!
response
)
return
false
;
if
(
!
Qosflowtobeforwardeditem
[
i
].
encodeQosFlowToBeForwardedItem
(
response
))
{
cout
<<
"encode QosFlowTowardedItem error"
<<
endl
;
return
false
;
}
cout
<<
"QFI is "
<<
response
->
qosFlowIdentifier
<<
endl
;
if
(
ASN_SEQUENCE_ADD
(
&
m_ngap_qosflowtobeforwardedlist
->
list
,
response
)
!=
0
)
{
cout
<<
"encode QosFlowTowardedList error"
<<
endl
;
return
false
;
}
}
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/QosFlowToBeForwardedList.hpp
View file @
c6dfe333
...
@@ -29,23 +29,22 @@
...
@@ -29,23 +29,22 @@
#define _QOSFLOWTOBEFORWARDEDLIST_H_
#define _QOSFLOWTOBEFORWARDEDLIST_H_
#include "QosFlowToBeForwardedItem.hpp"
#include "QosFlowToBeForwardedItem.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_QosFlowToBeForwardedList.h"
#include "Ngap_QosFlowToBeForwardedList.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
QosFlowToBeForwardedList
{
class
QosFlowToBeForwardedList
public:
{
QosFlowToBeForwardedList
();
public:
virtual
~
QosFlowToBeForwardedList
();
QosFlowToBeForwardedList
();
void
setQosFlowToBeForwardedItem
(
virtual
~
QosFlowToBeForwardedList
(
);
QosFlowToBeForwardedItem
*
m_qosflowtobeforwardeditem
,
int
num
);
void
setQosFlowToBeForwardedItem
(
QosFlowToBeForwardedItem
*
m_qosflowtobeforwardeditem
,
int
num
);
bool
encodeQosFlowToBeForwardedList
(
bool
encodeQosFlowToBeForwardedList
(
Ngap_QosFlowToBeForwardedList
*&
m_ngap_qosflowtobeforwardedlist
);
Ngap_QosFlowToBeForwardedList
*&
m_ngap_qosflowtobeforwardedlist
);
private:
private:
QosFlowToBeForwardedItem
*
Qosflowtobeforwardeditem
;
QosFlowToBeForwardedItem
*
Qosflowtobeforwardeditem
;
int
numofqosflowtobeforwardeditem
;
int
numofqosflowtobeforwardeditem
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.cpp
View file @
c6dfe333
...
@@ -30,38 +30,37 @@
...
@@ -30,38 +30,37 @@
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
RANStatusTransferTransparentContainer
::
RANStatusTransferTransparentContainer
()
{
RANStatusTransferTransparentContainer
::
RANStatusTransferTransparentContainer
()
drb_sub_list
=
NULL
;
{
}
drb_sub_list
=
NULL
;
RANStatusTransferTransparentContainer
::~
RANStatusTransferTransparentContainer
()
{
}
}
RANStatusTransferTransparentContainer
::~
RANStatusTransferTransparentContainer
()
{}
void
RANStatusTransferTransparentContainer
::
getdRBSubject_list
(
void
RANStatusTransferTransparentContainer
::
getdRBSubject_list
(
dRBSubjectList
*&
drblist
)
dRBSubjectList
*&
drblist
)
{
{
drblist
=
drb_sub_list
;
drblist
=
drb_sub_list
;
}
}
void
RANStatusTransferTransparentContainer
::
setdRBSubject_list
(
void
RANStatusTransferTransparentContainer
::
setdRBSubject_list
(
dRBSubjectList
*
drblist
)
dRBSubjectList
*
drblist
)
{
{
drb_sub_list
=
drblist
;
drb_sub_list
=
drblist
;
}
}
bool
RANStatusTransferTransparentContainer
::
encoderanstatustransfer_transparentcontainer
(
bool
RANStatusTransferTransparentContainer
::
encoderanstatustransfer_transparentcontainer
(
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
)
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
)
{
{
if
(
!
drb_sub_list
->
encodefromdRBSubjectlist
(
if
(
!
drb_sub_list
->
encodefromdRBSubjectlist
(
ranstatustransfer_transparentcontainer
->
dRBsSubjectToStatusTransferList
))
ranstatustransfer_transparentcontainer
->
dRBsSubjectToStatusTransferList
))
{
{
cout
<<
"encoderanstatustransfer_transparentcontainer error"
<<
endl
;
cout
<<
"encoderanstatustransfer_transparentcontainer error"
<<
endl
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
bool
RANStatusTransferTransparentContainer
::
decoderanstatustransfer_transparentcontainer
(
bool
RANStatusTransferTransparentContainer
::
decoderanstatustransfer_transparentcontainer
(
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
)
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
)
{
{
drb_sub_list
=
new
dRBSubjectList
();
drb_sub_list
=
new
dRBSubjectList
();
if
(
!
drb_sub_list
->
decodefromdRBSubjectlist
(
if
(
!
drb_sub_list
->
decodefromdRBSubjectlist
(
ranstatustransfer_transparentcontainer
->
dRBsSubjectToStatusTransferList
))
ranstatustransfer_transparentcontainer
->
dRBsSubjectToStatusTransferList
))
{
{
cout
<<
"decoderanstatustransfer_transparentcontainer error"
<<
endl
;
cout
<<
"decoderanstatustransfer_transparentcontainer error"
<<
endl
;
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapIEs/RANStatusTransferTransparentContainer.hpp
View file @
c6dfe333
...
@@ -29,26 +29,25 @@
...
@@ -29,26 +29,25 @@
#define _RANSTATUSTRANSFERTRANSPATENTCONTAINER_H_
#define _RANSTATUSTRANSFERTRANSPATENTCONTAINER_H_
#include "dRBsSubjectToStatusTransferList.hpp"
#include "dRBsSubjectToStatusTransferList.hpp"
#include "dRBsSubjectToStatusTransferItem.hpp"
#include "dRBsSubjectToStatusTransferItem.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
RANStatusTransferTransparentContainer
{
class
RANStatusTransferTransparentContainer
private:
{
/* data */
private:
dRBSubjectList
*
drb_sub_list
;
/* data */
dRBSubjectList
*
drb_sub_list
;
public:
public:
RANStatusTransferTransparentContainer
(
/* args */
);
RANStatusTransferTransparentContainer
(
/* args */
);
virtual
~
RANStatusTransferTransparentContainer
();
virtual
~
RANStatusTransferTransparentContainer
();
void
getdRBSubject_list
(
dRBSubjectList
*&
drblist
);
void
getdRBSubject_list
(
dRBSubjectList
*&
drblist
);
void
setdRBSubject_list
(
dRBSubjectList
*
drblist
);
void
setdRBSubject_list
(
dRBSubjectList
*
drblist
);
bool
encoderanstatustransfer_transparentcontainer
(
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
);
bool
encoderanstatustransfer_transparentcontainer
(
bool
decoderanstatustransfer_transparentcontainer
(
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
);
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
);
};
bool
decoderanstatustransfer_transparentcontainer
(
Ngap_RANStatusTransfer_TransparentContainer_t
*
ranstatustransfer_transparentcontainer
);
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBStatusDL.cpp
View file @
c6dfe333
...
@@ -29,40 +29,33 @@
...
@@ -29,40 +29,33 @@
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
dRBStatusDL
::
dRBStatusDL
()
{
dRBStatusDL
::
dRBStatusDL
()
dl18
=
(
DRBStatusDL18
*
)
calloc
(
1
,
sizeof
(
DRBStatusDL18
));
{
}
dl18
=
(
DRBStatusDL18
*
)
calloc
(
1
,
sizeof
(
DRBStatusDL18
));
dRBStatusDL
::~
dRBStatusDL
()
{
}
}
dRBStatusDL
::~
dRBStatusDL
()
{}
void
dRBStatusDL
::
setDRBStatusDL18
(
DRBStatusDL18
*
dL18
)
{
void
dRBStatusDL
::
setDRBStatusDL18
(
DRBStatusDL18
*
dL18
)
dl18
=
dL18
;
{
}
dl18
=
dL18
;
void
dRBStatusDL
::
getDRBStatusDL18
(
DRBStatusDL18
*&
dL18
)
{
}
dL18
=
dl18
;
void
dRBStatusDL
::
getDRBStatusDL18
(
DRBStatusDL18
*&
dL18
)
}
{
bool
dRBStatusDL
::
encodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
)
{
dL18
=
dl18
;
if
(
!
dl18
->
encodeddRBStatusDL18
(
dL
->
choice
.
dRBStatusDL18
))
{
}
cout
<<
"encodedRBStatusDL error"
<<
endl
;
bool
dRBStatusDL
::
encodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
)
return
false
;
{
}
if
(
!
dl18
->
encodeddRBStatusDL18
(
dL
->
choice
.
dRBStatusDL18
))
cout
<<
"encodedRBStatusDL successfully"
<<
endl
;
{
return
true
;
cout
<<
"encodedRBStatusDL error"
<<
endl
;
}
return
false
;
bool
dRBStatusDL
::
decodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
)
{
}
dl18
=
new
DRBStatusDL18
();
cout
<<
"encodedRBStatusDL successfully"
<<
endl
;
if
(
!
dl18
->
decodeddRBStatusDL18
(
dL
->
choice
.
dRBStatusDL18
))
{
return
true
;
cout
<<
"decodedRBStatusDL error"
<<
endl
;
}
return
false
;
bool
dRBStatusDL
::
decodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
)
}
{
cout
<<
"decodedRBStatusDL successfully"
<<
endl
;
dl18
=
new
DRBStatusDL18
();
return
true
;
if
(
!
dl18
->
decodeddRBStatusDL18
(
dL
->
choice
.
dRBStatusDL18
))
}
{
}
// namespace ngap
cout
<<
"decodedRBStatusDL error"
<<
endl
;
return
false
;
}
cout
<<
"decodedRBStatusDL successfully"
<<
endl
;
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBStatusDL.hpp
View file @
c6dfe333
...
@@ -28,27 +28,24 @@
...
@@ -28,27 +28,24 @@
#ifndef _DRBSTATUSDL_H_
#ifndef _DRBSTATUSDL_H_
#define _DRBSTATUSDL_H_
#define _DRBSTATUSDL_H_
#include "dRBStatusDL18.hpp"
#include "dRBStatusDL18.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBStatusDL.h"
#include "Ngap_DRBStatusDL.h"
#include "Ngap_DRBStatusDL18.h"
#include "Ngap_DRBStatusDL18.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
dRBStatusDL
{
class
dRBStatusDL
private:
{
/* data */
private:
DRBStatusDL18
*
dl18
;
/* data */
DRBStatusDL18
*
dl18
;
public:
public:
dRBStatusDL
();
dRBStatusDL
();
virtual
~
dRBStatusDL
();
virtual
~
dRBStatusDL
();
void
getDRBStatusDL18
(
DRBStatusDL18
*&
dL18
);
void
getDRBStatusDL18
(
DRBStatusDL18
*&
dL18
);
void
setDRBStatusDL18
(
DRBStatusDL18
*
dL18
);
void
setDRBStatusDL18
(
DRBStatusDL18
*
dL18
);
bool
encodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
);
bool
encodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
);
bool
decodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
);
bool
decodedRBStatusDL
(
Ngap_DRBStatusDL_t
*
dL
);
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBStatusDL18.cpp
View file @
c6dfe333
...
@@ -29,38 +29,31 @@
...
@@ -29,38 +29,31 @@
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
DRBStatusDL18
::
DRBStatusDL18
()
{
DRBStatusDL18
::
DRBStatusDL18
()
pdcp_value
=
NULL
;
{
}
pdcp_value
=
NULL
;
DRBStatusDL18
::~
DRBStatusDL18
()
{
}
}
DRBStatusDL18
::~
DRBStatusDL18
()
{}
void
DRBStatusDL18
::
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
)
{
void
DRBStatusDL18
::
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
)
count_value
=
pdcp_value
;
{
}
count_value
=
pdcp_value
;
void
DRBStatusDL18
::
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
)
{
}
pdcp_value
=
count_value
;
void
DRBStatusDL18
::
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
)
}
{
bool
DRBStatusDL18
::
encodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
)
{
pdcp_value
=
count_value
;
if
(
!
pdcp_value
->
encodedCOUNTValueForPDCP_SN18
(
DL18
->
dL_COUNTValue
))
{
}
cout
<<
"encodeddRBStatusDL18 error"
<<
endl
;
bool
DRBStatusDL18
::
encodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
)
return
false
;
{
}
if
(
!
pdcp_value
->
encodedCOUNTValueForPDCP_SN18
(
DL18
->
dL_COUNTValue
))
return
true
;
{
}
cout
<<
"encodeddRBStatusDL18 error"
<<
endl
;
bool
DRBStatusDL18
::
decodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
)
{
return
false
;
pdcp_value
=
new
COUNTValueForPDCP_SN18
();
}
if
(
!
pdcp_value
->
decodedCOUNTValueForPDCP_SN18
(
DL18
->
dL_COUNTValue
))
{
return
true
;
cout
<<
"decodeddRBStatusDL18 error"
<<
endl
;
}
return
false
;
bool
DRBStatusDL18
::
decodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
)
}
{
return
true
;
pdcp_value
=
new
COUNTValueForPDCP_SN18
();
}
if
(
!
pdcp_value
->
decodedCOUNTValueForPDCP_SN18
(
DL18
->
dL_COUNTValue
))
}
// namespace ngap
{
cout
<<
"decodeddRBStatusDL18 error"
<<
endl
;
return
false
;
}
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBStatusDL18.hpp
View file @
c6dfe333
...
@@ -28,25 +28,22 @@
...
@@ -28,25 +28,22 @@
#ifndef _DRBSTATUSDL18_H_
#ifndef _DRBSTATUSDL18_H_
#define _DRBSTATUSDL18_H_
#define _DRBSTATUSDL18_H_
#include "COUNTValueForPDCP_SN18.hpp"
#include "COUNTValueForPDCP_SN18.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBStatusDL18.h"
#include "Ngap_DRBStatusDL18.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
DRBStatusDL18
{
class
DRBStatusDL18
private:
{
/* data */
private:
COUNTValueForPDCP_SN18
*
pdcp_value
;
/* data */
COUNTValueForPDCP_SN18
*
pdcp_value
;
public:
public:
DRBStatusDL18
(
/* args */
);
DRBStatusDL18
(
/* args */
);
virtual
~
DRBStatusDL18
();
virtual
~
DRBStatusDL18
();
void
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
);
void
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
);
void
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
);
void
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
);
bool
encodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
);
bool
encodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
);
bool
decodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
);
bool
decodeddRBStatusDL18
(
Ngap_DRBStatusDL18_t
*
DL18
);
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBStatusUL.cpp
View file @
c6dfe333
...
@@ -30,40 +30,33 @@
...
@@ -30,40 +30,33 @@
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
dRBStatusUL
::
dRBStatusUL
()
{
dRBStatusUL
::
dRBStatusUL
()
ul18
=
(
dRBStatusUL18
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL18
));
{
}
ul18
=
(
dRBStatusUL18
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL18
));
dRBStatusUL
::~
dRBStatusUL
()
{
}
}
dRBStatusUL
::~
dRBStatusUL
()
{}
void
dRBStatusUL
::
setdRBStatusUL
(
dRBStatusUL18
*
uL18
)
{
void
dRBStatusUL
::
setdRBStatusUL
(
dRBStatusUL18
*
uL18
)
ul18
=
uL18
;
{
}
ul18
=
uL18
;
void
dRBStatusUL
::
getdRBStatusUL
(
dRBStatusUL18
*&
uL18
)
{
}
uL18
=
ul18
;
void
dRBStatusUL
::
getdRBStatusUL
(
dRBStatusUL18
*&
uL18
)
}
{
bool
dRBStatusUL
::
encodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
)
{
uL18
=
ul18
;
if
(
ul18
->
encodeddRBStatusUL18
(
uL
->
choice
.
dRBStatusUL18
))
{
}
cout
<<
"encodeddRBStatusUL18 error"
<<
endl
;
bool
dRBStatusUL
::
encodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
)
return
false
;
{
}
if
(
ul18
->
encodeddRBStatusUL18
(
uL
->
choice
.
dRBStatusUL18
))
cout
<<
"encodedRBStatusUL successfully"
<<
endl
;
{
return
true
;
cout
<<
"encodeddRBStatusUL18 error"
<<
endl
;
}
return
false
;
bool
dRBStatusUL
::
decodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
)
{
}
ul18
=
new
dRBStatusUL18
();
cout
<<
"encodedRBStatusUL successfully"
<<
endl
;
if
(
!
ul18
->
decodeddRBStatusUL18
(
uL
->
choice
.
dRBStatusUL18
))
{
return
true
;
cout
<<
"decodeddRBStatusUL18 error"
<<
endl
;
}
return
false
;
bool
dRBStatusUL
::
decodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
)
}
{
cout
<<
"decodedRBStatusUL successfully"
<<
endl
;
ul18
=
new
dRBStatusUL18
();
return
true
;
if
(
!
ul18
->
decodeddRBStatusUL18
(
uL
->
choice
.
dRBStatusUL18
))
}
{
}
// namespace ngap
cout
<<
"decodeddRBStatusUL18 error"
<<
endl
;
return
false
;
}
cout
<<
"decodedRBStatusUL successfully"
<<
endl
;
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBStatusUL.hpp
View file @
c6dfe333
...
@@ -28,25 +28,22 @@
...
@@ -28,25 +28,22 @@
#ifndef _DRBSTATUSUL_H_
#ifndef _DRBSTATUSUL_H_
#define _DRBSTATUSUL_H_
#define _DRBSTATUSUL_H_
#include "dRBStatusUL18.hpp"
#include "dRBStatusUL18.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBStatusUL.h"
#include "Ngap_DRBStatusUL.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
dRBStatusUL
{
class
dRBStatusUL
private:
{
/* data */
private:
dRBStatusUL18
*
ul18
;
/* data */
dRBStatusUL18
*
ul18
;
public:
public:
dRBStatusUL
(
/* args */
);
dRBStatusUL
(
/* args */
);
virtual
~
dRBStatusUL
();
virtual
~
dRBStatusUL
();
void
setdRBStatusUL
(
dRBStatusUL18
*
uL18
);
void
setdRBStatusUL
(
dRBStatusUL18
*
uL18
);
void
getdRBStatusUL
(
dRBStatusUL18
*&
uL18
);
void
getdRBStatusUL
(
dRBStatusUL18
*&
uL18
);
bool
encodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
);
bool
encodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
);
bool
decodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
);
bool
decodedRBStatusUL
(
Ngap_DRBStatusUL_t
*
uL
);
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBStatusUL18.cpp
View file @
c6dfe333
...
@@ -29,38 +29,31 @@
...
@@ -29,38 +29,31 @@
#include <iostream>
#include <iostream>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
dRBStatusUL18
::
dRBStatusUL18
()
{
dRBStatusUL18
::
dRBStatusUL18
()
pdcp_value
=
NULL
;
{
}
pdcp_value
=
NULL
;
dRBStatusUL18
::~
dRBStatusUL18
()
{
}
}
dRBStatusUL18
::~
dRBStatusUL18
()
{}
void
dRBStatusUL18
::
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
)
{
void
dRBStatusUL18
::
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
)
count_value
=
pdcp_value
;
{
}
count_value
=
pdcp_value
;
void
dRBStatusUL18
::
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
)
{
}
pdcp_value
=
count_value
;
void
dRBStatusUL18
::
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
)
}
{
bool
dRBStatusUL18
::
encodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
)
{
pdcp_value
=
count_value
;
if
(
!
pdcp_value
->
encodedCOUNTValueForPDCP_SN18
(
UL18
->
uL_COUNTValue
))
{
}
cout
<<
"encodeddRBStatusUL18 error"
<<
endl
;
bool
dRBStatusUL18
::
encodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
)
return
false
;
{
}
if
(
!
pdcp_value
->
encodedCOUNTValueForPDCP_SN18
(
UL18
->
uL_COUNTValue
))
return
true
;
{
}
cout
<<
"encodeddRBStatusUL18 error"
<<
endl
;
bool
dRBStatusUL18
::
decodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
)
{
return
false
;
pdcp_value
=
new
COUNTValueForPDCP_SN18
();
}
if
(
!
pdcp_value
->
decodedCOUNTValueForPDCP_SN18
(
UL18
->
uL_COUNTValue
))
{
return
true
;
cout
<<
"decodeddRBStatusUL18 error"
<<
endl
;
}
return
false
;
bool
dRBStatusUL18
::
decodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
)
}
{
return
true
;
pdcp_value
=
new
COUNTValueForPDCP_SN18
();
}
if
(
!
pdcp_value
->
decodedCOUNTValueForPDCP_SN18
(
UL18
->
uL_COUNTValue
))
}
// namespace ngap
{
cout
<<
"decodeddRBStatusUL18 error"
<<
endl
;
return
false
;
}
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBStatusUL18.hpp
View file @
c6dfe333
...
@@ -28,26 +28,23 @@
...
@@ -28,26 +28,23 @@
#ifndef _DRBSTATUSUL18_H_
#ifndef _DRBSTATUSUL18_H_
#define _DRBSTATUSUL18_H_
#define _DRBSTATUSUL18_H_
#include "COUNTValueForPDCP_SN18.hpp"
#include "COUNTValueForPDCP_SN18.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBStatusUL18.h"
#include "Ngap_DRBStatusUL18.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
dRBStatusUL18
{
class
dRBStatusUL18
private:
{
/* data */
private:
COUNTValueForPDCP_SN18
*
pdcp_value
;
/* data */
COUNTValueForPDCP_SN18
*
pdcp_value
;
public:
public:
dRBStatusUL18
(
/* args */
);
dRBStatusUL18
(
/* args */
);
virtual
~
dRBStatusUL18
();
virtual
~
dRBStatusUL18
();
void
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
);
void
getcountvalue
(
COUNTValueForPDCP_SN18
*&
count_value
);
void
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
);
void
setcountvalue
(
COUNTValueForPDCP_SN18
*
count_value
);
bool
encodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
);
bool
encodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
);
bool
decodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
);
bool
decodeddRBStatusUL18
(
Ngap_DRBStatusUL18_t
*
UL18
);
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.cpp
View file @
c6dfe333
...
@@ -31,67 +31,62 @@
...
@@ -31,67 +31,62 @@
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
dRBSubjectItem
::
dRBSubjectItem
()
{
dRBSubjectItem
::
dRBSubjectItem
()
drb_id
=
NULL
;
{
drb_ul
=
NULL
;
drb_id
=
NULL
;
drb_dl
=
NULL
;
drb_ul
=
NULL
;
}
drb_dl
=
NULL
;
dRBSubjectItem
::~
dRBSubjectItem
()
{
}
}
dRBSubjectItem
::~
dRBSubjectItem
()
{}
void
dRBSubjectItem
::
setdRBSubjectItem
(
Ngap_DRB_ID_t
*
dRB_ID
,
void
dRBSubjectItem
::
setdRBSubjectItem
(
Ngap_DRB_ID_t
*
dRB_ID
,
dRBStatusUL
*
dRB_UL
,
dRBStatusDL
*
dRB_DL
)
dRBStatusUL
*
dRB_UL
,
{
dRBStatusDL
*
dRB_DL
)
{
drb_id
=
dRB_ID
;
drb_id
=
dRB_ID
;
drb_ul
=
dRB_UL
;
drb_ul
=
dRB_UL
;
drb_dl
=
dRB_DL
;
drb_dl
=
dRB_DL
;
}
}
void
dRBSubjectItem
::
getdRBSubjectItem
(
Ngap_DRB_ID_t
*&
dRB_ID
,
dRBStatusUL
*&
dRB_UL
,
dRBStatusDL
*&
dRB_DL
)
void
dRBSubjectItem
::
getdRBSubjectItem
(
Ngap_DRB_ID_t
*&
dRB_ID
,
{
dRBStatusUL
*&
dRB_UL
,
dRB_ID
=
drb_id
;
dRBStatusDL
*&
dRB_DL
)
{
dRB_UL
=
drb_ul
;
dRB_ID
=
drb_id
;
dRB_DL
=
drb_dl
;
dRB_UL
=
drb_ul
;
}
dRB_DL
=
drb_dl
;
bool
dRBSubjectItem
::
decodefromdRBSubjectItem
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
)
}
{
bool
dRBSubjectItem
::
decodefromdRBSubjectItem
(
if
(
dRB_item
->
dRB_ID
)
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
)
{
{
if
(
dRB_item
->
dRB_ID
)
{
drb_id
=
&
dRB_item
->
dRB_ID
;
drb_id
=
&
dRB_item
->
dRB_ID
;
cout
<<
"the decode drb_id is"
<<
*
drb_id
<<
endl
;
cout
<<
"the decode drb_id is"
<<
*
drb_id
<<
endl
;
}
}
drb_ul
=
new
dRBStatusUL
();
drb_ul
=
new
dRBStatusUL
();
if
(
!
drb_ul
->
decodedRBStatusUL
(
&
dRB_item
->
dRBStatusUL
))
if
(
!
drb_ul
->
decodedRBStatusUL
(
&
dRB_item
->
dRBStatusUL
))
{
{
cout
<<
"decode from dRBSubjectItem dRBStatusUL error"
<<
endl
;
cout
<<
"decode from dRBSubjectItem dRBStatusUL error"
<<
endl
;
return
false
;
return
false
;
}
}
drb_dl
=
new
dRBStatusDL
();
drb_dl
=
new
dRBStatusDL
();
if
(
!
drb_dl
->
decodedRBStatusDL
(
&
dRB_item
->
dRBStatusDL
))
{
if
(
!
drb_dl
->
decodedRBStatusDL
(
&
dRB_item
->
dRBStatusDL
))
cout
<<
"decode from dRBSubjectItem dRBStatusDL error"
<<
endl
;
{
return
false
;
cout
<<
"decode from dRBSubjectItem dRBStatusDL error"
<<
endl
;
}
return
false
;
cout
<<
"decode from dRBSubjectItem successfully"
<<
endl
;
}
return
true
;
cout
<<
"decode from dRBSubjectItem successfully"
<<
endl
;
}
return
true
;
bool
dRBSubjectItem
::
encodedRBSubjectItem
(
}
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
)
{
bool
dRBSubjectItem
::
encodedRBSubjectItem
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
)
if
(
drb_id
)
{
{
dRB_item
->
dRB_ID
=
*
drb_id
;
if
(
drb_id
)
cout
<<
"the encode drb_id is"
<<
*
drb_id
<<
endl
;
{
}
dRB_item
->
dRB_ID
=
*
drb_id
;
if
(
!
drb_ul
->
encodedRBStatusUL
(
&
dRB_item
->
dRBStatusUL
))
{
cout
<<
"the encode drb_id is"
<<
*
drb_id
<<
endl
;
cout
<<
"encode from dRBSubjectItem dRBStatusUL error"
<<
endl
;
}
return
false
;
if
(
!
drb_ul
->
encodedRBStatusUL
(
&
dRB_item
->
dRBStatusUL
))
}
{
if
(
!
drb_dl
->
encodedRBStatusDL
(
&
dRB_item
->
dRBStatusDL
))
{
cout
<<
"encode from dRBSubjectItem dRBStatusUL error"
<<
endl
;
cout
<<
"encode from dRBSubjectItem dRBStatusDL error"
<<
endl
;
return
false
;
return
false
;
}
}
if
(
!
drb_dl
->
encodedRBStatusDL
(
&
dRB_item
->
dRBStatusDL
))
cout
<<
"encode from dRBSubjectItem successfully"
<<
endl
;
{
return
true
;
cout
<<
"encode from dRBSubjectItem dRBStatusDL error"
<<
endl
;
}
return
false
;
}
// namespace ngap
}
cout
<<
"encode from dRBSubjectItem successfully"
<<
endl
;
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBsSubjectToStatusTransferItem.hpp
View file @
c6dfe333
...
@@ -29,26 +29,26 @@
...
@@ -29,26 +29,26 @@
#define _DRBSSUBJECTTOSTATUSTRANSFERITEM_H_
#define _DRBSSUBJECTTOSTATUSTRANSFERITEM_H_
#include "dRBStatusUL.hpp"
#include "dRBStatusUL.hpp"
#include "dRBStatusDL.hpp"
#include "dRBStatusDL.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBsSubjectToStatusTransferItem.h"
#include "Ngap_DRBsSubjectToStatusTransferItem.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
dRBSubjectItem
{
class
dRBSubjectItem
public:
{
dRBSubjectItem
();
public:
virtual
~
dRBSubjectItem
();
dRBSubjectItem
();
void
getdRBSubjectItem
(
Ngap_DRB_ID_t
*&
dRB_ID
,
dRBStatusUL
*&
dRB_UL
,
virtual
~
dRBSubjectItem
();
dRBStatusDL
*&
dRB_DL
);
void
getdRBSubjectItem
(
Ngap_DRB_ID_t
*&
dRB_ID
,
dRBStatusUL
*&
dRB_UL
,
dRBStatusDL
*&
dRB_DL
);
void
setdRBSubjectItem
(
Ngap_DRB_ID_t
*
dRB_ID
,
dRBStatusUL
*
dRB_UL
,
void
setdRBSubjectItem
(
Ngap_DRB_ID_t
*
dRB_ID
,
dRBStatusUL
*
dRB_UL
,
dRBStatusDL
*
dRB_DL
);
dRBStatusDL
*
dRB_DL
);
bool
decodefromdRBSubjectItem
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
);
bool
decodefromdRBSubjectItem
(
bool
encodedRBSubjectItem
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
);
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
);
bool
encodedRBSubjectItem
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
dRB_item
);
private:
private:
Ngap_DRB_ID_t
*
drb_id
;
Ngap_DRB_ID_t
*
drb_id
;
dRBStatusUL
*
drb_ul
;
dRBStatusUL
*
drb_ul
;
dRBStatusDL
*
drb_dl
;
dRBStatusDL
*
drb_dl
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.cpp
View file @
c6dfe333
...
@@ -29,58 +29,55 @@
...
@@ -29,58 +29,55 @@
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
dRBSubjectList
::
dRBSubjectList
()
{
dRBSubjectList
::
dRBSubjectList
()
drbsubjectitem
=
NULL
;
{
numofitem
=
0
;
drbsubjectitem
=
NULL
;
}
numofitem
=
0
;
dRBSubjectList
::~
dRBSubjectList
()
{
}
void
dRBSubjectList
::
setdRBSubjectItem
(
dRBSubjectItem
*
m_item
,
int
num
)
{
drbsubjectitem
=
m_item
;
numofitem
=
num
;
}
void
dRBSubjectList
::
getdRBSubjectItem
(
dRBSubjectItem
*&
m_item
,
int
&
num
)
{
m_item
=
drbsubjectitem
;
num
=
numofitem
;
}
bool
dRBSubjectList
::
encodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
)
{
for
(
int
i
=
0
;
i
<
numofitem
;
i
++
)
{
Ngap_DRBsSubjectToStatusTransferItem_t
*
ie
=
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DRBsSubjectToStatusTransferItem_t
));
if
(
!
ie
)
return
false
;
if
(
!
drbsubjectitem
[
i
].
encodedRBSubjectItem
(
ie
))
{
cout
<<
"encodefromdRBSubjectlist error"
<<
endl
;
return
false
;
}
}
dRBSubjectList
::~
dRBSubjectList
()
{}
if
(
ASN_SEQUENCE_ADD
(
&
DRBsSubjectToStatusTransferList
.
list
,
ie
)
!=
0
)
{
void
dRBSubjectList
::
setdRBSubjectItem
(
dRBSubjectItem
*
m_item
,
int
num
)
cout
{
<<
"ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) error"
drbsubjectitem
=
m_item
;
<<
endl
;
numofitem
=
num
;
return
false
;
}
}
void
dRBSubjectList
::
getdRBSubjectItem
(
dRBSubjectItem
*&
m_item
,
int
&
num
)
}
{
cout
<<
"encodefromdRBSubjectlist successfully"
<<
endl
;
m_item
=
drbsubjectitem
;
return
true
;
num
=
numofitem
;
}
bool
dRBSubjectList
::
decodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
)
{
numofitem
=
DRBsSubjectToStatusTransferList
.
list
.
count
;
drbsubjectitem
=
new
dRBSubjectItem
[
numofitem
]();
for
(
int
i
=
0
;
i
<
numofitem
;
i
++
)
{
if
(
!
drbsubjectitem
[
i
].
decodefromdRBSubjectItem
(
DRBsSubjectToStatusTransferList
.
list
.
array
[
i
]))
{
cout
<<
"decodefromdRBSubjectlist error"
<<
endl
;
return
false
;
}
}
bool
dRBSubjectList
::
encodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
)
}
{
cout
<<
"decodefromdRBSubjectlist successfully"
<<
endl
;
for
(
int
i
=
0
;
i
<
numofitem
;
i
++
)
return
true
;
{
}
Ngap_DRBsSubjectToStatusTransferItem_t
*
ie
=
(
Ngap_DRBsSubjectToStatusTransferItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DRBsSubjectToStatusTransferItem_t
));
}
// namespace ngap
if
(
!
ie
)
return
false
;
if
(
!
drbsubjectitem
[
i
].
encodedRBSubjectItem
(
ie
))
{
cout
<<
"encodefromdRBSubjectlist error"
<<
endl
;
return
false
;
}
if
(
ASN_SEQUENCE_ADD
(
&
DRBsSubjectToStatusTransferList
.
list
,
ie
)
!=
0
)
{
cout
<<
"ASN_SEQUENCE_ADD(&DRBsSubjectToStatusTransferList.list, ie) error"
<<
endl
;
return
false
;
}
}
cout
<<
"encodefromdRBSubjectlist successfully"
<<
endl
;
return
true
;
}
bool
dRBSubjectList
::
decodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
)
{
numofitem
=
DRBsSubjectToStatusTransferList
.
list
.
count
;
drbsubjectitem
=
new
dRBSubjectItem
[
numofitem
]();
for
(
int
i
=
0
;
i
<
numofitem
;
i
++
)
{
if
(
!
drbsubjectitem
[
i
].
decodefromdRBSubjectItem
(
DRBsSubjectToStatusTransferList
.
list
.
array
[
i
]))
{
cout
<<
"decodefromdRBSubjectlist error"
<<
endl
;
return
false
;
}
}
cout
<<
"decodefromdRBSubjectlist successfully"
<<
endl
;
return
true
;
}
}
// namespace ngap
src/ngap/ngapIEs/dRBsSubjectToStatusTransferList.hpp
View file @
c6dfe333
...
@@ -28,26 +28,25 @@
...
@@ -28,26 +28,25 @@
#ifndef _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#ifndef _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#define _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#define _DRBSSUBJECTTOSTATUSTRANSFERLIST_H_
#include "dRBsSubjectToStatusTransferItem.hpp"
#include "dRBsSubjectToStatusTransferItem.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_DRBsSubjectToStatusTransferList.h"
#include "Ngap_DRBsSubjectToStatusTransferList.h"
#include "asn_SEQUENCE_OF.h"
#include "asn_SEQUENCE_OF.h"
}
}
namespace
ngap
namespace
ngap
{
{
class
dRBSubjectList
{
class
dRBSubjectList
public:
{
dRBSubjectList
();
public:
virtual
~
dRBSubjectList
();
dRBSubjectList
(
);
void
setdRBSubjectItem
(
dRBSubjectItem
*
m_item
,
int
num
);
virtual
~
dRBSubjectList
(
);
void
getdRBSubjectItem
(
dRBSubjectItem
*&
m_item
,
int
&
num
);
void
setdRBSubjectItem
(
dRBSubjectItem
*
m_item
,
int
num
);
bool
decodefromdRBSubjectlist
(
void
getdRBSubjectItem
(
dRBSubjectItem
*&
m_item
,
int
&
num
);
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
);
bool
decodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
);
bool
encodefromdRBSubjectlist
(
bool
encodefromdRBSubjectlist
(
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
);
Ngap_DRBsSubjectToStatusTransferList_t
&
DRBsSubjectToStatusTransferList
);
private:
private:
dRBSubjectItem
*
drbsubjectitem
;
dRBSubjectItem
*
drbsubjectitem
;
int
numofitem
;
int
numofitem
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.cpp
View file @
c6dfe333
...
@@ -29,128 +29,141 @@
...
@@ -29,128 +29,141 @@
#include <iostream>
#include <iostream>
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
DownlinkRANStatusTransfer
::
DownlinkRANStatusTransfer
()
{
DownlinkRANStatusTransfer
::
DownlinkRANStatusTransfer
()
amfUeNgapId
=
NULL
;
{
ranUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
ranStatusTransfer_TransparentContainer
=
NULL
;
ranUeNgapId
=
NULL
;
DownlinkranstatustransferIEs
=
NULL
;
ranStatusTransfer_TransparentContainer
=
NULL
;
DownlinkranstatustransferPDU
=
NULL
;
DownlinkranstatustransferIEs
=
NULL
;
}
DownlinkranstatustransferPDU
=
NULL
;
DownlinkRANStatusTransfer
::~
DownlinkRANStatusTransfer
()
{
}
}
DownlinkRANStatusTransfer
::~
DownlinkRANStatusTransfer
()
void
DownlinkRANStatusTransfer
::
setAmfUeNgapId
(
unsigned
long
id
)
{
{
if
(
!
amfUeNgapId
)
}
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
void
DownlinkRANStatusTransfer
::
setAmfUeNgapId
(
unsigned
long
id
)
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
{
if
(
!
amfUeNgapId
)
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
ie
->
criticality
=
Ngap_Criticality_reject
;
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
ie
->
value
.
present
=
Ngap_DownlinkRANStatusTransferIEs__value_PR_AMF_UE_NGAP_ID
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_DownlinkRANStatusTransferIEs__value_PR_AMF_UE_NGAP_ID
;
int
ret
=
amfUeNgapId
->
encode2AMF_UE_NGAP_ID
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
);
int
ret
=
amfUeNgapId
->
encode2AMF_UE_NGAP_ID
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
);
if
(
!
ret
)
if
(
!
ret
)
{
{
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
return
;
return
;
}
}
ret
=
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
);
ret
=
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
}
}
void
DownlinkRANStatusTransfer
::
setRanUeNgapId
(
uint32_t
id
)
void
DownlinkRANStatusTransfer
::
setRanUeNgapId
(
uint32_t
id
)
{
{
if
(
!
ranUeNgapId
)
if
(
!
ranUeNgapId
)
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
ranUeNgapId
->
setRanUeNgapId
(
id
);
ranUeNgapId
->
setRanUeNgapId
(
id
);
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
ie
->
id
=
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
;
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
ie
->
criticality
=
Ngap_Criticality_reject
;
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
ie
->
value
.
present
=
Ngap_DownlinkRANStatusTransferIEs__value_PR_RAN_UE_NGAP_ID
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_DownlinkRANStatusTransferIEs__value_PR_RAN_UE_NGAP_ID
;
int
ret
=
ranUeNgapId
->
encode2RAN_UE_NGAP_ID
(
ie
->
value
.
choice
.
RAN_UE_NGAP_ID
);
int
ret
=
ranUeNgapId
->
encode2RAN_UE_NGAP_ID
(
ie
->
value
.
choice
.
RAN_UE_NGAP_ID
);
if
(
!
ret
)
if
(
!
ret
)
{
{
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
return
;
return
;
}
}
ret
=
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
);
ret
=
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
}
}
void
DownlinkRANStatusTransfer
::
setRANStatusTransfer_TransparentContainer
(
long
drb_id
,
long
ul_pcdp
,
long
ul_hfn_pdcp
,
long
dl_pcdp
,
long
dl_hfn_pdcp
)
void
DownlinkRANStatusTransfer
::
setRANStatusTransfer_TransparentContainer
(
{
long
drb_id
,
long
ul_pcdp
,
long
ul_hfn_pdcp
,
long
dl_pcdp
,
if
(
!
ranStatusTransfer_TransparentContainer
)
long
dl_hfn_pdcp
)
{
{
if
(
!
ranStatusTransfer_TransparentContainer
)
{
ranStatusTransfer_TransparentContainer
=
new
RANStatusTransferTransparentContainer
();
ranStatusTransfer_TransparentContainer
=
}
new
RANStatusTransferTransparentContainer
();
Ngap_DRB_ID_t
*
dRB_id
=
(
Ngap_DRB_ID_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DRB_ID_t
));
}
dRB_id
=
&
drb_id
;
Ngap_DRB_ID_t
*
dRB_id
=
(
Ngap_DRB_ID_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DRB_ID_t
));
COUNTValueForPDCP_SN18
*
UL_value
=
(
COUNTValueForPDCP_SN18
*
)
calloc
(
1
,
sizeof
(
COUNTValueForPDCP_SN18
));
dRB_id
=
&
drb_id
;
UL_value
->
setvalue
(
ul_pcdp
,
ul_hfn_pdcp
);
COUNTValueForPDCP_SN18
*
UL_value
=
(
COUNTValueForPDCP_SN18
*
)
calloc
(
COUNTValueForPDCP_SN18
*
DL_value
=
(
COUNTValueForPDCP_SN18
*
)
calloc
(
1
,
sizeof
(
COUNTValueForPDCP_SN18
));
1
,
sizeof
(
COUNTValueForPDCP_SN18
));
DL_value
->
setvalue
(
dl_pcdp
,
dl_hfn_pdcp
);
UL_value
->
setvalue
(
ul_pcdp
,
ul_hfn_pdcp
);
dRBStatusUL18
*
UL18
=
(
dRBStatusUL18
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL18
));
COUNTValueForPDCP_SN18
*
DL_value
=
(
COUNTValueForPDCP_SN18
*
)
calloc
(
UL18
->
setcountvalue
(
UL_value
);
1
,
sizeof
(
COUNTValueForPDCP_SN18
));
DRBStatusDL18
*
DL18
=
(
DRBStatusDL18
*
)
calloc
(
1
,
sizeof
(
DRBStatusDL18
));
DL_value
->
setvalue
(
dl_pcdp
,
dl_hfn_pdcp
);
DL18
->
setcountvalue
(
DL_value
);
dRBStatusUL18
*
UL18
=
(
dRBStatusUL18
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL18
));
dRBStatusDL
*
DL
=
(
dRBStatusDL
*
)
calloc
(
1
,
sizeof
(
dRBStatusDL
));
UL18
->
setcountvalue
(
UL_value
);
DL
->
setDRBStatusDL18
(
DL18
);
DRBStatusDL18
*
DL18
=
(
DRBStatusDL18
*
)
calloc
(
1
,
sizeof
(
DRBStatusDL18
));
dRBStatusUL
*
UL
=
(
dRBStatusUL
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL
));
DL18
->
setcountvalue
(
DL_value
);
UL
->
setdRBStatusUL
(
UL18
);
dRBStatusDL
*
DL
=
(
dRBStatusDL
*
)
calloc
(
1
,
sizeof
(
dRBStatusDL
));
dRBSubjectItem
*
m_item
=
(
dRBSubjectItem
*
)
calloc
(
1
,
sizeof
(
dRBSubjectItem
));
DL
->
setDRBStatusDL18
(
DL18
);
m_item
->
setdRBSubjectItem
(
dRB_id
,
UL
,
DL
);
dRBStatusUL
*
UL
=
(
dRBStatusUL
*
)
calloc
(
1
,
sizeof
(
dRBStatusUL
));
dRBSubjectList
*
m_list
=
(
dRBSubjectList
*
)
calloc
(
1
,
sizeof
(
dRBSubjectList
));
UL
->
setdRBStatusUL
(
UL18
);
m_list
->
setdRBSubjectItem
(
m_item
,
1
);
dRBSubjectItem
*
m_item
=
(
dRBSubjectItem
*
)
calloc
(
1
,
sizeof
(
dRBSubjectItem
));
ranStatusTransfer_TransparentContainer
->
setdRBSubject_list
(
m_list
);
m_item
->
setdRBSubjectItem
(
dRB_id
,
UL
,
DL
);
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
dRBSubjectList
*
m_list
=
(
dRBSubjectList
*
)
calloc
(
1
,
sizeof
(
dRBSubjectList
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_RANStatusTransfer_TransparentContainer
;
m_list
->
setdRBSubjectItem
(
m_item
,
1
);
ie
->
criticality
=
Ngap_Criticality_reject
;
ranStatusTransfer_TransparentContainer
->
setdRBSubject_list
(
m_list
);
ie
->
value
.
present
=
Ngap_DownlinkRANStatusTransferIEs__value_PR_RANStatusTransfer_TransparentContainer
;
Ngap_DownlinkRANStatusTransferIEs_t
*
ie
=
bool
ret
=
ranStatusTransfer_TransparentContainer
->
encoderanstatustransfer_transparentcontainer
(
&
ie
->
value
.
choice
.
RANStatusTransfer_TransparentContainer
);
(
Ngap_DownlinkRANStatusTransferIEs_t
*
)
calloc
(
if
(
!
ret
)
1
,
sizeof
(
Ngap_DownlinkRANStatusTransferIEs_t
));
{
ie
->
id
=
Ngap_ProtocolIE_ID_id_RANStatusTransfer_TransparentContainer
;
cout
<<
"encode ranstatustransfer_transparentcontainer error"
<<
endl
;
ie
->
criticality
=
Ngap_Criticality_reject
;
}
ie
->
value
.
present
=
if
(
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
)
!=
0
)
Ngap_DownlinkRANStatusTransferIEs__value_PR_RANStatusTransfer_TransparentContainer
;
{
bool
ret
=
ranStatusTransfer_TransparentContainer
cout
<<
"encode ranstatustransfer_transparentcontainer error 2"
<<
endl
;
->
encoderanstatustransfer_transparentcontainer
(
}
&
ie
->
value
.
choice
.
RANStatusTransfer_TransparentContainer
);
}
if
(
!
ret
)
{
void
DownlinkRANStatusTransfer
::
setmessagetype
()
cout
<<
"encode ranstatustransfer_transparentcontainer error"
<<
endl
;
{
}
if
(
!
DownlinkranstatustransferPDU
)
if
(
ASN_SEQUENCE_ADD
(
&
DownlinkranstatustransferIEs
->
protocolIEs
.
list
,
ie
)
{
!=
0
)
{
DownlinkranstatustransferPDU
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
cout
<<
"encode ranstatustransfer_transparentcontainer error 2"
<<
endl
;
}
}
MessageType
downlinkranstatustransfermessageIEs
;
}
downlinkranstatustransfermessageIEs
.
setProcedureCode
(
Ngap_ProcedureCode_id_DownlinkRANStatusTransfer
);
void
DownlinkRANStatusTransfer
::
setmessagetype
()
{
downlinkranstatustransfermessageIEs
.
setTypeOfMessage
(
Ngap_NGAP_PDU_PR_initiatingMessage
);
if
(
!
DownlinkranstatustransferPDU
)
{
downlinkranstatustransfermessageIEs
.
setCriticality
(
Ngap_Criticality_ignore
);
DownlinkranstatustransferPDU
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
downlinkranstatustransfermessageIEs
.
setValuePresent
(
Ngap_InitiatingMessage__value_PR_DownlinkRANStatusTransfer
);
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
if
(
downlinkranstatustransfermessageIEs
.
getProcedureCode
()
==
Ngap_ProcedureCode_id_DownlinkRANStatusTransfer
&&
downlinkranstatustransfermessageIEs
.
getTypeOfMessage
()
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
}
{
MessageType
downlinkranstatustransfermessageIEs
;
downlinkranstatustransfermessageIEs
.
encode2pdu
(
DownlinkranstatustransferPDU
);
downlinkranstatustransfermessageIEs
.
setProcedureCode
(
DownlinkranstatustransferIEs
=
&
(
DownlinkranstatustransferPDU
->
choice
.
initiatingMessage
->
value
.
choice
.
DownlinkRANStatusTransfer
);
Ngap_ProcedureCode_id_DownlinkRANStatusTransfer
);
}
downlinkranstatustransfermessageIEs
.
setTypeOfMessage
(
else
Ngap_NGAP_PDU_PR_initiatingMessage
);
{
downlinkranstatustransfermessageIEs
.
setCriticality
(
Ngap_Criticality_ignore
);
cout
<<
"[warning] This information doesn't refer to downlinkranstatustransfer Message!!!"
<<
endl
;
downlinkranstatustransfermessageIEs
.
setValuePresent
(
}
Ngap_InitiatingMessage__value_PR_DownlinkRANStatusTransfer
);
}
if
(
downlinkranstatustransfermessageIEs
.
getProcedureCode
()
int
DownlinkRANStatusTransfer
::
encodetobuffer
(
uint8_t
*
buf
,
int
buf_size
)
==
Ngap_ProcedureCode_id_DownlinkRANStatusTransfer
{
&&
downlinkranstatustransfermessageIEs
.
getTypeOfMessage
()
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
DownlinkranstatustransferPDU
);
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
DownlinkranstatustransferPDU
,
buf
,
buf_size
);
downlinkranstatustransfermessageIEs
.
encode2pdu
(
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
DownlinkranstatustransferPDU
);
return
er
.
encoded
;
DownlinkranstatustransferIEs
=
&
(
DownlinkranstatustransferPDU
->
choice
}
.
initiatingMessage
->
value
.
choice
.
DownlinkRANStatusTransfer
);
}
// namespace ngap
}
else
{
cout
<<
"[warning] This information doesn't refer to downlinkranstatustransfer Message!!!"
<<
endl
;
}
}
int
DownlinkRANStatusTransfer
::
encodetobuffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
DownlinkranstatustransferPDU
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
DownlinkranstatustransferPDU
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
}
// namespace ngap
src/ngap/ngapMsgs/DownlinkRANStatusTransfer.hpp
View file @
c6dfe333
...
@@ -32,8 +32,7 @@
...
@@ -32,8 +32,7 @@
#include "MessageType.hpp"
#include "MessageType.hpp"
#include "RANStatusTransferTransparentContainer.hpp"
#include "RANStatusTransferTransparentContainer.hpp"
#include "dRBStatusDL18.hpp"
#include "dRBStatusDL18.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
...
@@ -43,23 +42,23 @@ extern "C"
...
@@ -43,23 +42,23 @@ extern "C"
}
}
namespace
ngap
namespace
ngap
{
{
class
DownlinkRANStatusTransfer
class
DownlinkRANStatusTransfer
{
{
public:
public:
DownlinkRANStatusTransfer
();
DownlinkRANStatusTransfer
();
virtual
~
DownlinkRANStatusTransfer
();
virtual
~
DownlinkRANStatusTransfer
();
void
setmessagetype
();
void
setmessagetype
();
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setRanUeNgapId
(
uint32_t
id
);
// 32 bits
void
setRanUeNgapId
(
uint32_t
id
);
// 32 bits
void
setRANStatusTransfer_TransparentContainer
(
long
drb_id
,
long
ul_pcdp
,
long
ul_hfn_pdcp
,
long
dl_pcdp
,
long
dl_hfn_pdcp
);
void
setRANStatusTransfer_TransparentContainer
(
long
drb_id
,
long
ul_pcdp
,
long
ul_hfn_pdcp
,
long
dl_pcdp
,
long
dl_hfn_pdcp
);
int
encodetobuffer
(
uint8_t
*
buf
,
int
buf_size
);
int
encodetobuffer
(
uint8_t
*
buf
,
int
buf_size
);
private:
private:
Ngap_NGAP_PDU_t
*
DownlinkranstatustransferPDU
;
Ngap_NGAP_PDU_t
*
DownlinkranstatustransferPDU
;
Ngap_DownlinkRANStatusTransfer_t
*
DownlinkranstatustransferIEs
;
Ngap_DownlinkRANStatusTransfer_t
*
DownlinkranstatustransferIEs
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
RANStatusTransferTransparentContainer
*
ranStatusTransfer_TransparentContainer
;
RANStatusTransferTransparentContainer
*
ranStatusTransfer_TransparentContainer
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
src/ngap/ngapMsgs/HandoverCommandMsg.cpp
View file @
c6dfe333
#include "HandoverCommandMsg.hpp"
#include "HandoverCommandMsg.hpp"
extern
"C"
{
extern
"C"
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "constraints.h"
#include "Ngap_PDUSessionResourceHandoverItem.h"
#include "Ngap_PDUSessionResourceHandoverItem.h"
}
}
#include <iostream>
#include <iostream>
...
@@ -14,296 +14,303 @@ extern "C"{
...
@@ -14,296 +14,303 @@ extern "C"{
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
HandoverCommandMsg
::
HandoverCommandMsg
()
HandoverCommandMsg
::
HandoverCommandMsg
()
{
{
amfUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
ngap_handovertype
=
NULL
;
ngap_handovertype
=
NULL
;
NASSecurityParametersFromNGRAN
=
NULL
;
NASSecurityParametersFromNGRAN
=
NULL
;
PDUSessionResourceHandoverList
=
NULL
;
PDUSessionResourceHandoverList
=
NULL
;
PDUSessionResourceToReleaseListHOCmd
=
NULL
;
PDUSessionResourceToReleaseListHOCmd
=
NULL
;
TargetToSource_TransparentContainer
=
NULL
;
TargetToSource_TransparentContainer
=
NULL
;
CriticalityDiagnostics
=
NULL
;
CriticalityDiagnostics
=
NULL
;
handoverCommandPdu
=
NULL
;
handoverCommandPdu
=
NULL
;
handoverCommandIEs
=
NULL
;
handoverCommandIEs
=
NULL
;
}
}
HandoverCommandMsg
::~
HandoverCommandMsg
()
{
HandoverCommandMsg
::~
HandoverCommandMsg
()
{}
}
unsigned
long
HandoverCommandMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
uint32_t
HandoverCommandMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
}
bool
HandoverCommandMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
handoverCommandPdu
=
ngap_msg_pdu
;
if
(
handoverCommandPdu
->
present
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
{
if
(
handoverCommandPdu
->
choice
.
successfulOutcome
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
present
==
Ngap_SuccessfulOutcome__value_PR_HandoverCommand
)
{
handoverCommandIEs
=
&
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverCommand
;
}
else
{
cout
<<
"Check HandoverCommand message error!!!"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"HandoverRequired MessageType error!!!"
<<
endl
;
return
false
;
}
for
(
int
i
=
0
;
i
<
handoverCommandIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
switch
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_HandoverType
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_HandoverType
)
{
ngap_handovertype
=
new
Ngap_HandoverType_t
();
*
ngap_handovertype
=
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
HandoverType
;
}
else
{
cout
<<
"decoded ngap Handover Type IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList
)
{
}
else
{
cout
<<
"decoded ngap PDUSessionResourceHandoverList IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd
)
{
}
else
{
cout
<<
"decoded ngap PDUSessionResourceToReleaseListHOCmd IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer
)
{
}
else
{
cout
<<
"decoded ngap TargetToSource_TransparentContainer IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_CriticalityDiagnostics
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics
)
{
}
else
{
cout
<<
"decoded ngap CriticalityDiagnostics IE error"
<<
endl
;
return
false
;
}
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
return
true
;
}
int
HandoverCommandMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverCommandPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverCommandPdu
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
void
HandoverCommandMsg
::
setMessageType
()
{
if
(
!
handoverCommandPdu
)
handoverCommandPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
MessageType
HandoverCommandMessageTypeIE
;
HandoverCommandMessageTypeIE
.
setProcedureCode
(
Ngap_ProcedureCode_id_HandoverPreparation
);
HandoverCommandMessageTypeIE
.
setTypeOfMessage
(
Ngap_NGAP_PDU_PR_successfulOutcome
);
HandoverCommandMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
HandoverCommandMessageTypeIE
.
setValuePresent
(
Ngap_SuccessfulOutcome__value_PR_HandoverCommand
);
if
(
HandoverCommandMessageTypeIE
.
getProcedureCode
()
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
HandoverCommandMessageTypeIE
.
getTypeOfMessage
()
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
{
HandoverCommandMessageTypeIE
.
encode2pdu
(
handoverCommandPdu
);
handoverCommandIEs
=
&
(
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverCommand
);
}
else
{
cout
<<
"[warning] This information doesn't refer to HandoverCommand Message!!!"
<<
endl
;
}
}
void
HandoverCommandMsg
::
setAmfUeNgapId
(
unsigned
long
id
)
{
if
(
!
amfUeNgapId
)
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_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
;
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setRanUeNgapId
(
uint32_t
ran_ue_ngap_id
)
{
if
(
!
ranUeNgapId
)
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
ranUeNgapId
->
setRanUeNgapId
(
ran_ue_ngap_id
);
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_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
;
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setHandoverType
(
long
type
)
{
if
(
!
ngap_handovertype
)
ngap_handovertype
=
new
Ngap_HandoverType_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_HandoverType
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_HandoverType
;
ie
->
value
.
choice
.
HandoverType
=
type
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode HandoverType IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setPduSessionResourceHandoverList
(
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
list
)
{
if
(
!
PDUSessionResourceHandoverList
)
PDUSessionResourceHandoverList
=
new
Ngap_PDUSessionResourceHandoverList_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
Ngap_PDUSessionResourceHandoverItem_t
*
item
=
(
Ngap_PDUSessionResourceHandoverItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceHandoverItem_t
));
item
->
pDUSessionID
=
list
[
i
].
pduSessionId
;
item
->
handoverCommandTransfer
=
list
[
i
].
HandoverCommandTransfer
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
PDUSessionResourceHandoverList
->
list
,
item
);
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceHandoverListItem IE error"
<<
endl
;
}
ie
->
id
=
Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList
;
ie
->
value
.
choice
.
PDUSessionResourceHandoverList
=
*
PDUSessionResourceHandoverList
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceHandoverList IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setTargetToSource_TransparentContainer
(
OCTET_STRING_t
targetTosource
)
{
if
(
!
TargetToSource_TransparentContainer
)
TargetToSource_TransparentContainer
=
new
Ngap_TargetToSource_TransparentContainer_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer
;
ie
->
value
.
choice
.
TargetToSource_TransparentContainer
=
targetTosource
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode HandoverType IE error"
<<
endl
;
}
unsigned
long
HandoverCommandMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
uint32_t
HandoverCommandMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
}
bool
HandoverCommandMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
handoverCommandPdu
=
ngap_msg_pdu
;
if
(
handoverCommandPdu
->
present
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
{
if
(
handoverCommandPdu
->
choice
.
successfulOutcome
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
present
==
Ngap_SuccessfulOutcome__value_PR_HandoverCommand
)
{
handoverCommandIEs
=
&
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverCommand
;
}
else
{
cout
<<
"Check HandoverCommand message error!!!"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"HandoverRequired MessageType error!!!"
<<
endl
;
return
false
;
}
for
(
int
i
=
0
;
i
<
handoverCommandIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
switch
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_HandoverType
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_HandoverType
)
{
ngap_handovertype
=
new
Ngap_HandoverType_t
();
*
ngap_handovertype
=
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
HandoverType
;
}
else
{
cout
<<
"decoded ngap Handover Type IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList
)
{
}
else
{
cout
<<
"decoded ngap PDUSessionResourceHandoverList IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd
)
{
}
else
{
cout
<<
"decoded ngap PDUSessionResourceToReleaseListHOCmd IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer
)
{
}
else
{
cout
<<
"decoded ngap TargetToSource_TransparentContainer IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_CriticalityDiagnostics
:
{
if
(
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverCommandIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics
)
{
}
else
{
cout
<<
"decoded ngap CriticalityDiagnostics IE error"
<<
endl
;
return
false
;
}
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
return
true
;
}
int
HandoverCommandMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverCommandPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverCommandPdu
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
void
HandoverCommandMsg
::
setMessageType
()
{
if
(
!
handoverCommandPdu
)
handoverCommandPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
MessageType
HandoverCommandMessageTypeIE
;
HandoverCommandMessageTypeIE
.
setProcedureCode
(
Ngap_ProcedureCode_id_HandoverPreparation
);
HandoverCommandMessageTypeIE
.
setTypeOfMessage
(
Ngap_NGAP_PDU_PR_successfulOutcome
);
HandoverCommandMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
HandoverCommandMessageTypeIE
.
setValuePresent
(
Ngap_SuccessfulOutcome__value_PR_HandoverCommand
);
if
(
HandoverCommandMessageTypeIE
.
getProcedureCode
()
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
HandoverCommandMessageTypeIE
.
getTypeOfMessage
()
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
{
HandoverCommandMessageTypeIE
.
encode2pdu
(
handoverCommandPdu
);
handoverCommandIEs
=
&
(
handoverCommandPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverCommand
);
}
else
{
cout
<<
"[warning] This information doesn't refer to HandoverCommand Message!!!"
<<
endl
;
}
}
void
HandoverCommandMsg
::
setAmfUeNgapId
(
unsigned
long
id
)
{
if
(
!
amfUeNgapId
)
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_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
;
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setRanUeNgapId
(
uint32_t
ran_ue_ngap_id
)
{
if
(
!
ranUeNgapId
)
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
ranUeNgapId
->
setRanUeNgapId
(
ran_ue_ngap_id
);
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_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
;
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode RAN_UE_NGAP_ID IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setHandoverType
(
long
type
)
{
if
(
!
ngap_handovertype
)
ngap_handovertype
=
new
Ngap_HandoverType_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_HandoverType
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_HandoverType
;
ie
->
value
.
choice
.
HandoverType
=
type
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode HandoverType IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setPduSessionResourceHandoverList
(
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
list
)
{
if
(
!
PDUSessionResourceHandoverList
)
PDUSessionResourceHandoverList
=
new
Ngap_PDUSessionResourceHandoverList_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
Ngap_PDUSessionResourceHandoverItem_t
*
item
=
(
Ngap_PDUSessionResourceHandoverItem_t
*
)
calloc
(
1
,
sizeof
(
Ngap_PDUSessionResourceHandoverItem_t
));
item
->
pDUSessionID
=
list
[
i
].
pduSessionId
;
item
->
handoverCommandTransfer
=
list
[
i
].
HandoverCommandTransfer
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
PDUSessionResourceHandoverList
->
list
,
item
);
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceHandoverListItem IE error"
<<
endl
;
}
ie
->
id
=
Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList
;
ie
->
value
.
choice
.
PDUSessionResourceHandoverList
=
*
PDUSessionResourceHandoverList
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceHandoverList IE error"
<<
endl
;
}
void
HandoverCommandMsg
::
setTargetToSource_TransparentContainer
(
OCTET_STRING_t
targetTosource
)
{
if
(
!
TargetToSource_TransparentContainer
)
TargetToSource_TransparentContainer
=
new
Ngap_TargetToSource_TransparentContainer_t
();
Ngap_HandoverCommandIEs_t
*
ie
=
(
Ngap_HandoverCommandIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverCommandIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer
;
ie
->
value
.
choice
.
TargetToSource_TransparentContainer
=
targetTosource
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverCommandIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode HandoverType IE error"
<<
endl
;
}
}
}
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
View file @
c6dfe333
...
@@ -11,60 +11,56 @@
...
@@ -11,60 +11,56 @@
#include "AMF-UE-NGAP-ID.hpp"
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "Cause.hpp"
#include "Cause.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_NGSetupRequest.h"
#include "Ngap_NGSetupRequest.h"
}
}
namespace
ngap
{
namespace
ngap
{
typedef
struct
{
typedef
struct
{
uint8_t
pduSessionId
;
uint8_t
pduSessionId
;
OCTET_STRING_t
HandoverCommandTransfer
;
OCTET_STRING_t
HandoverCommandTransfer
;
}
PDUSessionResourceHandoverItem_t
;
}
PDUSessionResourceHandoverItem_t
;
class
HandoverCommandMsg
{
public:
class
HandoverCommandMsg
{
HandoverCommandMsg
();
public:
virtual
~
HandoverCommandMsg
();
HandoverCommandMsg
();
virtual
~
HandoverCommandMsg
();
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
void
setRanUeNgapId
(
uint32_t
id
);
// 32 bits
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setRanUeNgapId
(
uint32_t
id
);
// 32 bits
void
setHandoverType
(
long
type
);
void
setPduSessionResourceHandoverList
(
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
list
);
void
setTargetToSource_TransparentContainer
(
OCTET_STRING_t
targetTosource
);
void
setHandoverType
(
long
type
);
void
setPduSessionResourceHandoverList
(
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
list
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
void
setTargetToSource_TransparentContainer
(
OCTET_STRING_t
targetTosource
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
/*void getHandoverType(Ngap_HandoverType_t &handovertype);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
void getCause(Cause cause);
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
void getTargetID(Ngap_TargetID_t targetID);
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
void getDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directpathavailable);
/*void getHandoverType(Ngap_HandoverType_t &handovertype);
void getPDUSessionResourceList(Ngap_PDUSessionResourceHandoverList_t pdusessionresourcelist);
void getCause(Cause cause);
void getSourceToTargetTransparentContainer();*/
void getTargetID(Ngap_TargetID_t targetID);
private:
void getDirectForwardingPathAvailability(Ngap_DirectForwardingPathAvailability_t directpathavailable);
Ngap_NGAP_PDU_t
*
handoverCommandPdu
;
void getPDUSessionResourceList(Ngap_PDUSessionResourceHandoverList_t pdusessionresourcelist);
Ngap_HandoverCommand_t
*
handoverCommandIEs
;
void getSourceToTargetTransparentContainer();*/
/***************** for decoding ****************/
private:
AMF_UE_NGAP_ID
*
amfUeNgapId
;
Ngap_NGAP_PDU_t
*
handoverCommandPdu
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
Ngap_HandoverCommand_t
*
handoverCommandIEs
;
Ngap_HandoverType_t
*
ngap_handovertype
;
/***************** for decoding ****************/
Ngap_NASSecurityParametersFromNGRAN_t
*
NASSecurityParametersFromNGRAN
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
Ngap_PDUSessionResourceHandoverList_t
*
PDUSessionResourceHandoverList
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
Ngap_PDUSessionResourceToReleaseListHOCmd_t
*
PDUSessionResourceToReleaseListHOCmd
;
Ngap_HandoverType_t
*
ngap_handovertype
;
Ngap_TargetToSource_TransparentContainer_t
*
TargetToSource_TransparentContainer
;
Ngap_NASSecurityParametersFromNGRAN_t
*
NASSecurityParametersFromNGRAN
;
Ngap_CriticalityDiagnostics_t
*
CriticalityDiagnostics
;
Ngap_PDUSessionResourceHandoverList_t
*
PDUSessionResourceHandoverList
;
Ngap_PDUSessionResourceToReleaseListHOCmd_t
*
PDUSessionResourceToReleaseListHOCmd
;
};
Ngap_TargetToSource_TransparentContainer_t
*
TargetToSource_TransparentContainer
;
Ngap_CriticalityDiagnostics_t
*
CriticalityDiagnostics
;
};
}
}
...
...
src/ngap/ngapMsgs/HandoverNotifyMsg.cpp
View file @
c6dfe333
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file HandoverNotifyMsg.cpp
/*! \file HandoverNotifyMsg.cpp
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#include "HandoverNotifyMsg.hpp"
#include "HandoverNotifyMsg.hpp"
extern
"C"
{
extern
"C"
{
...
@@ -40,165 +40,171 @@ extern "C" {
...
@@ -40,165 +40,171 @@ extern "C" {
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
HandoverNotifyMsg
::
HandoverNotifyMsg
()
HandoverNotifyMsg
::
HandoverNotifyMsg
()
{
{
amfUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
userLocationInformation
=
NULL
;
userLocationInformation
=
NULL
;
}
}
HandoverNotifyMsg
::~
HandoverNotifyMsg
()
{
HandoverNotifyMsg
::~
HandoverNotifyMsg
()
{};
}
unsigned
long
HandoverNotifyMsg
::
getAmfUeNgapId
()
;
{
unsigned
long
HandoverNotifyMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
}
int
HandoverNotifyMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
int
HandoverNotifyMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverNotifyPdu
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverNotifyPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverNotifyPdu
,
buf
,
buf_size
);
handoverNotifyPdu
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
return
er
.
encoded
;
}
}
bool
HandoverNotifyMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
bool
HandoverNotifyMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
{
handoverNotifyPdu
=
ngap_msg_pdu
;
handoverNotifyPdu
=
ngap_msg_pdu
;
if
(
handoverNotifyPdu
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
if
(
handoverNotifyPdu
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
{
if
(
handoverNotifyPdu
->
choice
.
initiatingMessage
if
(
handoverNotifyPdu
->
choice
.
initiatingMessage
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
criticality
==
Ngap_Criticality_reject
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
value
.
present
==
Ngap_InitiatingMessage__value_PR_HandoverNotify
)
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
procedureCode
{
==
Ngap_ProcedureCode_id_HandoverPreparation
handoverNotifyIEs
=
&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
value
.
choice
.
HandoverNotify
;
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
criticality
}
==
Ngap_Criticality_reject
else
&&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
value
.
present
{
==
Ngap_InitiatingMessage__value_PR_HandoverNotify
)
{
cout
<<
"Check HandoverNotify message error!!!"
<<
endl
;
handoverNotifyIEs
=
&
handoverNotifyPdu
->
choice
.
initiatingMessage
->
value
return
false
;
.
choice
.
HandoverNotify
;
}
}
else
{
}
cout
<<
"Check HandoverNotify message error!!!"
<<
endl
;
else
return
false
;
{
}
cout
<<
"HandoverNotify MessageType error!!!"
<<
endl
;
}
else
{
return
false
;
cout
<<
"HandoverNotify MessageType error!!!"
<<
endl
;
}
return
false
;
for
(
int
i
=
0
;
i
<
handoverNotifyIEs
->
protocolIEs
.
list
.
count
;
i
++
)
}
{
for
(
int
i
=
0
;
i
<
handoverNotifyIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
switch
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
switch
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverNotifyIEs__value_PR_AMF_UE_NGAP_ID
)
==
Ngap_Criticality_reject
{
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
==
Ngap_HandoverNotifyIEs__value_PR_AMF_UE_NGAP_ID
)
{
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
{
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
return
false
;
.
AMF_UE_NGAP_ID
))
{
}
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
else
}
{
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
return
false
;
}
}
}
break
;
}
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:{
break
;
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverNotifyIEs__value_PR_RAN_UE_NGAP_ID
)
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
{
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
==
Ngap_Criticality_reject
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
{
==
Ngap_HandoverNotifyIEs__value_PR_RAN_UE_NGAP_ID
)
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
return
false
;
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
}
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
}
.
RAN_UE_NGAP_ID
))
{
else
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
{
return
false
;
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
}
else
{
}
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
case
Ngap_ProtocolIE_ID_id_UserLocationInformation
:
{
}
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
)
}
{
case
Ngap_ProtocolIE_ID_id_UserLocationInformation
:
{
userLocationInformation
=
new
UserLocationInformation
();
if
(
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
if
(
!
userLocationInformation
->
decodefromUserLocationInformation
(
&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
UserLocationInformation
))
==
Ngap_Criticality_ignore
{
&&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
cout
<<
"decoded ngap UserLocationInformation IE error"
<<
endl
;
==
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
)
{
return
false
;
userLocationInformation
=
new
UserLocationInformation
();
}
if
(
!
userLocationInformation
->
decodefromUserLocationInformation
(
}
&
handoverNotifyIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
else
.
UserLocationInformation
))
{
{
cout
<<
"decoded ngap UserLocationInformation IE error"
<<
endl
;
cout
<<
"decoded ngap UserLocationInformation IE error"
<<
endl
;
return
false
;
return
false
;
}
}
}
else
{
}
break
;
cout
<<
"decoded ngap UserLocationInformation IE error"
<<
endl
;
}
return
false
;
}
}
return
true
;
}
}
break
;
void
HandoverNotifyMsg
::
setUserLocationInfoNR
(
struct
NrCgi_s
cig
,
struct
Tai_s
tai
)
}
{
}
if
(
!
userLocationInformation
)
return
true
;
userLocationInformation
=
new
UserLocationInformation
();
}
void
HandoverNotifyMsg
::
setUserLocationInfoNR
(
struct
NrCgi_s
cig
,
struct
Tai_s
tai
)
{
if
(
!
userLocationInformation
)
userLocationInformation
=
new
UserLocationInformation
();
//userLocationInformation->setInformation(UserLocationInformationEUTRA * informationEUTRA);
//userLocationInformation->setInformation(UserLocationInformationEUTRA * informationEUTRA);
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
();
UserLocationInformationNR
*
informationNR
=
new
UserLocationInformationNR
();
NR_CGI
*
nR_CGI
=
new
NR_CGI
();
NR_CGI
*
nR_CGI
=
new
NR_CGI
();
PlmnId
*
plmnId_cgi
=
new
PlmnId
();
PlmnId
*
plmnId_cgi
=
new
PlmnId
();
NRCellIdentity
*
nRCellIdentity
=
new
NRCellIdentity
();
NRCellIdentity
*
nRCellIdentity
=
new
NRCellIdentity
();
plmnId_cgi
->
setMccMnc
(
cig
.
mcc
,
cig
.
mnc
);
plmnId_cgi
->
setMccMnc
(
cig
.
mcc
,
cig
.
mnc
);
nRCellIdentity
->
setNRCellIdentity
(
cig
.
nrCellID
);
nRCellIdentity
->
setNRCellIdentity
(
cig
.
nrCellID
);
nR_CGI
->
setNR_CGI
(
plmnId_cgi
,
nRCellIdentity
);
nR_CGI
->
setNR_CGI
(
plmnId_cgi
,
nRCellIdentity
);
TAI
*
tai_nr
=
new
TAI
();
TAI
*
tai_nr
=
new
TAI
();
PlmnId
*
plmnId_tai
=
new
PlmnId
();
PlmnId
*
plmnId_tai
=
new
PlmnId
();
plmnId_tai
->
setMccMnc
(
tai
.
mcc
,
tai
.
mnc
);
plmnId_tai
->
setMccMnc
(
tai
.
mcc
,
tai
.
mnc
);
TAC
*
tac
=
new
TAC
();
TAC
*
tac
=
new
TAC
();
tac
->
setTac
(
tai
.
tac
);
tac
->
setTac
(
tai
.
tac
);
tai_nr
->
setTAI
(
plmnId_tai
,
tac
);
tai_nr
->
setTAI
(
plmnId_tai
,
tac
);
informationNR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
informationNR
->
setInformationNR
(
nR_CGI
,
tai_nr
);
userLocationInformation
->
setInformation
(
informationNR
);
userLocationInformation
->
setInformation
(
informationNR
);
Ngap_HandoverNotifyIEs_t
*
ie
=
(
Ngap_HandoverNotifyIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverNotifyIEs_t
));
Ngap_HandoverNotifyIEs_t
*
ie
=
(
Ngap_HandoverNotifyIEs_t
*
)
calloc
(
ie
->
id
=
Ngap_ProtocolIE_ID_id_UserLocationInformation
;
1
,
sizeof
(
Ngap_HandoverNotifyIEs_t
));
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_UserLocationInformation
;
ie
->
value
.
present
=
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
ie
->
value
.
present
=
Ngap_HandoverNotifyIEs__value_PR_UserLocationInformation
;
int
ret
=
userLocationInformation
->
encodefromUserLocationInformation
(
&
ie
->
value
.
choice
.
UserLocationInformation
);
int
ret
=
userLocationInformation
->
encodefromUserLocationInformation
(
if
(
!
ret
)
&
ie
->
value
.
choice
.
UserLocationInformation
);
{
if
(
!
ret
)
{
cout
<<
"encode UserLocationInformation IE error"
<<
endl
;
cout
<<
"encode UserLocationInformation IE error"
<<
endl
;
return
;
return
;
}
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverNotifyIEs
->
protocolIEs
.
list
,
ie
);
ret
=
ASN_SEQUENCE_ADD
(
&
handoverNotifyIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode UserLocationInformation IE error"
<<
endl
;
if
(
ret
!=
0
)
}
cout
<<
"encode UserLocationInformation IE error"
<<
endl
;
uint32_t
HandoverNotifyMsg
::
getRanUeNgapId
()
}
{
uint32_t
HandoverNotifyMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
return
ranUeNgapId
->
getRanUeNgapId
();
}
}
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
)
bool
HandoverNotifyMsg
::
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
{
struct
Tai_s
&
tai
)
{
UserLocationInformationNR
*
informationNR
;
UserLocationInformationNR
*
informationNR
;
userLocationInformation
->
getInformation
(
informationNR
);
userLocationInformation
->
getInformation
(
informationNR
);
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
return
false
;
if
(
userLocationInformation
->
getChoiceOfUserLocationInformation
()
NR_CGI
*
nR_CGI
;
!=
Ngap_UserLocationInformation_PR_userLocationInformationNR
)
TAI
*
nR_TAI
;
return
false
;
informationNR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
NR_CGI
*
nR_CGI
;
PlmnId
*
cgi_plmnId
;
TAI
*
nR_TAI
;
NRCellIdentity
*
nRCellIdentity
;
informationNR
->
getInformationNR
(
nR_CGI
,
nR_TAI
);
nR_CGI
->
getNR_CGI
(
cgi_plmnId
,
nRCellIdentity
);
PlmnId
*
cgi_plmnId
;
cgi_plmnId
->
getMcc
(
cig
.
mcc
);
NRCellIdentity
*
nRCellIdentity
;
cgi_plmnId
->
getMnc
(
cig
.
mnc
);
nR_CGI
->
getNR_CGI
(
cgi_plmnId
,
nRCellIdentity
);
cig
.
nrCellID
=
nRCellIdentity
->
getNRCellIdentity
();
cgi_plmnId
->
getMcc
(
cig
.
mcc
);
cgi_plmnId
->
getMnc
(
cig
.
mnc
);
cig
.
nrCellID
=
nRCellIdentity
->
getNRCellIdentity
();
PlmnId
*
tai_plmnId
;
PlmnId
*
tai_plmnId
;
TAC
*
tac
;
TAC
*
tac
;
nR_TAI
->
getTAI
(
tai_plmnId
,
tac
);
nR_TAI
->
getTAI
(
tai_plmnId
,
tac
);
tai_plmnId
->
getMcc
(
tai
.
mcc
);
tai_plmnId
->
getMcc
(
tai
.
mcc
);
tai_plmnId
->
getMnc
(
tai
.
mnc
);
tai_plmnId
->
getMnc
(
tai
.
mnc
);
tai
.
tac
=
tac
->
getTac
();
tai
.
tac
=
tac
->
getTac
();
return
true
;
return
true
;
}
}
}
}
\ No newline at end of file
src/ngap/ngapMsgs/HandoverNotifyMsg.hpp
View file @
c6dfe333
...
@@ -19,12 +19,12 @@
...
@@ -19,12 +19,12 @@
* contact@openairinterface.org
* contact@openairinterface.org
*/
*/
/*! \file HandoverNotifyMsg.hpp
/*! \file HandoverNotifyMsg.hpp
\brief
\brief
\author niuxiansheng-niu, BUPT
\author niuxiansheng-niu, BUPT
\date 2020
\date 2020
\email: contact@openairinterface.org
\email: contact@openairinterface.org
*/
*/
#ifndef _HANDOVERNOTIFYMSG_H_
#ifndef _HANDOVERNOTIFYMSG_H_
#define _HANDOVERNOTIFYMSG_H_
#define _HANDOVERNOTIFYMSG_H_
...
@@ -42,24 +42,24 @@ extern "C" {
...
@@ -42,24 +42,24 @@ extern "C" {
}
}
namespace
ngap
{
namespace
ngap
{
class
HandoverNotifyMsg
{
class
HandoverNotifyMsg
{
public:
public:
HandoverNotifyMsg
();
HandoverNotifyMsg
();
virtual
~
HandoverNotifyMsg
();
virtual
~
HandoverNotifyMsg
();
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
void
setUserLocationInfoNR
(
struct
NrCgi_s
cig
,
struct
Tai_s
tai
);
void
setUserLocationInfoNR
(
struct
NrCgi_s
cig
,
struct
Tai_s
tai
);
unsigned
long
getAmfUeNgapId
();
//return -1;()
unsigned
long
getAmfUeNgapId
();
//return -1;(������)
uint32_t
getRanUeNgapId
();
//return -1;()
uint32_t
getRanUeNgapId
();
//return -1;(������)
bool
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
);
bool
getUserLocationInfoNR
(
struct
NrCgi_s
&
cig
,
struct
Tai_s
&
tai
);
private:
private:
Ngap_NGAP_PDU_t
*
handoverNotifyPdu
;
Ngap_NGAP_PDU_t
*
handoverNotifyPdu
;
Ngap_HandoverNotify_t
*
handoverNotifyIEs
;
Ngap_HandoverNotify_t
*
handoverNotifyIEs
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
UserLocationInformation
*
userLocationInformation
;
UserLocationInformation
*
userLocationInformation
;
};
};
}
}
#endif
#endif
src/ngap/ngapMsgs/HandoverRequest.cpp
View file @
c6dfe333
#include "HandoverRequest.hpp"
#include "HandoverRequest.hpp"
extern
"C"
{
extern
"C"
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "constraints.h"
}
}
#include <iostream>
#include <iostream>
...
@@ -14,373 +14,405 @@ extern "C"{
...
@@ -14,373 +14,405 @@ extern "C"{
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
HandoverRequest
::
HandoverRequest
()
HandoverRequest
::
HandoverRequest
()
{
{
amfUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
handovertype
=
NULL
;
handovertype
=
NULL
;
cause
=
NULL
;
cause
=
NULL
;
ueAggregateMaximumBitRate
=
NULL
;
ueAggregateMaximumBitRate
=
NULL
;
ueSecurityCapabilities
=
NULL
;
ueSecurityCapabilities
=
NULL
;
SecurityContext
=
NULL
;
SecurityContext
=
NULL
;
PDUSessionResourceSetupList
=
NULL
;
PDUSessionResourceSetupList
=
NULL
;
allowedNSSAI
=
NULL
;
allowedNSSAI
=
NULL
;
SourceToTarget_TransparentContainer
=
NULL
;
SourceToTarget_TransparentContainer
=
NULL
;
guami
=
NULL
;
guami
=
NULL
;
handoverRequestPdu
=
NULL
;
handoverRequestPdu
=
NULL
;
handoverRequestIEs
=
NULL
;
handoverRequestIEs
=
NULL
;
}
}
HandoverRequest
::~
HandoverRequest
()
{
HandoverRequest
::~
HandoverRequest
()
{}
}
unsigned
long
HandoverRequest
::
getAmfUeNgapId
()
unsigned
long
HandoverRequest
::
getAmfUeNgapId
()
{
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
}
/*bool HandoverRequest::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
{
/*bool HandoverRequest::decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu)
handoverCommandPdu = ngap_msg_pdu;
{
handoverCommandPdu = ngap_msg_pdu;
if (handoverCommandPdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
{
if (handoverCommandPdu->present == Ngap_NGAP_PDU_PR_successfulOutcome)
if (handoverCommandPdu->choice.successfulOutcome && handoverCommandPdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverCommandPdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && handoverRequiredPdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_HandoverCommand)
{
{
if (handoverCommandPdu->choice.successfulOutcome && handoverCommandPdu->choice.successfulOutcome->procedureCode == Ngap_ProcedureCode_id_HandoverPreparation && handoverCommandPdu->choice.successfulOutcome->criticality == Ngap_Criticality_reject && handoverRequiredPdu->choice.successfulOutcome->value.present == Ngap_SuccessfulOutcome__value_PR_HandoverCommand)
handoverCommandIEs = &handoverCommandIEs->choice.successfulOutcome->value.choice.HandoverCommand;
{
}
handoverCommandIEs = &handoverCommandIEs->choice.successfulOutcome->value.choice.HandoverCommand;
else
}
{
else
cout << "Check HandoverCommand message error!!!" << endl;
{
return false;
cout << "Check HandoverCommand message error!!!" << endl;
}
return false;
}
}
else
}
{
else
cout << "HandoverRequired MessageType error!!!" << endl;
{
return false;
cout << "HandoverRequired MessageType error!!!" << endl;
}
return false;
for (int i = 0; i < handoverCommandIEs->protocolIEs.list.count; i++)
}
{
for (int i = 0; i < handoverCommandIEs->protocolIEs.list.count; i++)
switch (handoverCommandIEs->protocolIEs.list.array[i]->id)
{
{
switch (handoverCommandIEs->protocolIEs.list.array[i]->id)
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID)
case Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_AMF_UE_NGAP_ID)
amfUeNgapId = new AMF_UE_NGAP_ID();
{
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
amfUeNgapId = new AMF_UE_NGAP_ID();
{
if (!amfUeNgapId->decodefromAMF_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.AMF_UE_NGAP_ID))
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
{
return false;
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
}
return false;
}
}
else
}
{
else
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
{
return false;
cout << "decoded ngap AMF_UE_NGAP_ID IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID)
case Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_RAN_UE_NGAP_ID)
ranUeNgapId = new RAN_UE_NGAP_ID();
{
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
ranUeNgapId = new RAN_UE_NGAP_ID();
{
if (!ranUeNgapId->decodefromRAN_UE_NGAP_ID(handoverCommandIEs->protocolIEs.list.array[i]->value.choice.RAN_UE_NGAP_ID))
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
{
return false;
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
}
return false;
}
}
else
}
{
else
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
{
return false;
cout << "decoded ngap RAN_UE_NGAP_ID IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_HandoverType: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_HandoverType)
case Ngap_ProtocolIE_ID_id_HandoverType: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_HandoverType)
ngap_handovertype = new Ngap_HandoverType_t();
{
ngap_handovertype = handoverCommandIEs->protocolIEs.list.array[i]->value.choice.HandoverType;
ngap_handovertype = new Ngap_HandoverType_t();
}
ngap_handovertype = handoverCommandIEs->protocolIEs.list.array[i]->value.choice.HandoverType;
else
}
{
else
cout << "decoded ngap Handover Type IE error" << endl;
{
return false;
cout << "decoded ngap Handover Type IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList)
case Ngap_ProtocolIE_ID_id_PDUSessionResourceHandoverList: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceHandoverList)
}
{
else
}
{
else
cout << "decoded ngap PDUSessionResourceHandoverList IE error" << endl;
{
return false;
cout << "decoded ngap PDUSessionResourceHandoverList IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd)
case Ngap_ProtocolIE_ID_id_PDUSessionResourceToReleaseListHOCmd: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_PDUSessionResourceToReleaseListHOCmd)
{
}
else
}
{
else
cout << "decoded ngap PDUSessionResourceToReleaseListHOCmd IE error" << endl;
{
return false;
cout << "decoded ngap PDUSessionResourceToReleaseListHOCmd IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer)
case Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_reject && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_TargetToSource_TransparentContainer)
}
{
else
}
{
else
cout << "decoded ngap TargetToSource_TransparentContainer IE error" << endl;
{
return false;
cout << "decoded ngap TargetToSource_TransparentContainer IE error" << endl;
}
return false;
}break;
}
case Ngap_ProtocolIE_ID_id_CriticalityDiagnostics: {
}break;
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics)
case Ngap_ProtocolIE_ID_id_CriticalityDiagnostics: {
{
if (handoverCommandIEs->protocolIEs.list.array[i]->criticality == Ngap_Criticality_ignore && handoverCommandIEs->protocolIEs.list.array[i]->value.present == Ngap_HandoverCommandIEs__value_PR_CriticalityDiagnostics)
}
{
else
}
{
else
cout << "decoded ngap CriticalityDiagnostics IE error" << endl;
{
return false;
cout << "decoded ngap CriticalityDiagnostics IE error" << endl;
}
return false;
}break;
}
default: {
}break;
cout << "decoded ngap message pdu error" << endl;
default: {
return false;
cout << "decoded ngap message pdu error" << endl;
}
return false;
}
}
}
}
}
return true;
}*/
return true;
}*/
int
HandoverRequest
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequestPdu
);
int
HandoverRequest
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
{
handoverRequestPdu
,
buf
,
buf_size
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequestPdu
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverRequestPdu
,
buf
,
buf_size
);
return
er
.
encoded
;
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
}
return
er
.
encoded
;
}
void
HandoverRequest
::
setMessageType
()
{
if
(
!
handoverRequestPdu
)
void
HandoverRequest
::
setMessageType
()
handoverRequestPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
{
if
(
!
handoverRequestPdu
)
handoverRequestPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
MessageType
handoverRequestMessageTypeIE
;
handoverRequestMessageTypeIE
.
setProcedureCode
(
MessageType
handoverRequestMessageTypeIE
;
Ngap_ProcedureCode_id_HandoverResourceAllocation
);
handoverRequestMessageTypeIE
.
setProcedureCode
(
Ngap_ProcedureCode_id_HandoverResourceAllocation
);
handoverRequestMessageTypeIE
.
setTypeOfMessage
(
handoverRequestMessageTypeIE
.
setTypeOfMessage
(
Ngap_NGAP_PDU_PR_initiatingMessage
);
Ngap_NGAP_PDU_PR_initiatingMessage
);
handoverRequestMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
handoverRequestMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
handoverRequestMessageTypeIE
.
setValuePresent
(
Ngap_InitiatingMessage__value_PR_HandoverRequest
);
handoverRequestMessageTypeIE
.
setValuePresent
(
Ngap_InitiatingMessage__value_PR_HandoverRequest
);
if
(
handoverRequestMessageTypeIE
.
getProcedureCode
()
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
&&
handoverRequestMessageTypeIE
.
getTypeOfMessage
()
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
if
(
handoverRequestMessageTypeIE
.
getProcedureCode
()
handoverRequestMessageTypeIE
.
encode2pdu
(
handoverRequestPdu
);
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
handoverRequestIEs
=
&
(
handoverRequestPdu
->
choice
.
initiatingMessage
->
value
.
choice
.
HandoverRequest
);
&&
handoverRequestMessageTypeIE
.
getTypeOfMessage
()
}
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
else
handoverRequestMessageTypeIE
.
encode2pdu
(
handoverRequestPdu
);
{
handoverRequestIEs
=
&
(
handoverRequestPdu
->
choice
.
initiatingMessage
->
value
cout
<<
"[warning] This information doesn't refer to HandoverRequest Message!!!"
<<
endl
;
.
choice
.
HandoverRequest
);
}
}
else
{
}
cout
void
HandoverRequest
::
setAmfUeNgapId
(
unsigned
long
id
)
<<
"[warning] This information doesn't refer to HandoverRequest Message!!!"
{
<<
endl
;
if
(
!
amfUeNgapId
)
}
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
}
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
void
HandoverRequest
::
setAmfUeNgapId
(
unsigned
long
id
)
{
if
(
!
amfUeNgapId
)
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
amfUeNgapId
->
setAMF_UE_NGAP_ID
(
id
);
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_AMF_UE_NGAP_ID
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
int
ret
=
amfUeNgapId
->
encode2AMF_UE_NGAP_ID
(
ie
->
value
.
choice
.
AMF_UE_NGAP_ID
);
ie
->
id
=
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
;
if
(
!
ret
)
ie
->
criticality
=
Ngap_Criticality_reject
;
{
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_AMF_UE_NGAP_ID
;
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
return
;
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
;
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
return
;
if
(
ret
!=
0
)
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
}
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
void
HandoverRequest
::
setHandoverType
(
long
type
)
//0--intra5gs
if
(
ret
!=
0
)
{
cout
<<
"encode AMF_UE_NGAP_ID IE error"
<<
endl
;
if
(
!
handovertype
)
}
handovertype
=
new
Ngap_HandoverType_t
();
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
void
HandoverRequest
::
setHandoverType
(
long
type
)
//0--intra5gs
ie
->
id
=
Ngap_ProtocolIE_ID_id_HandoverType
;
{
ie
->
criticality
=
Ngap_Criticality_reject
;
if
(
!
handovertype
)
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_HandoverType
;
handovertype
=
new
Ngap_HandoverType_t
();
ie
->
value
.
choice
.
HandoverType
=
type
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
if
(
ret
!=
0
)
cout
<<
"encode HandoverType IE error"
<<
endl
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_HandoverType
;
}
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_HandoverType
;
void
HandoverRequest
::
setCause
(
Ngap_Cause_PR
m_causePresent
,
long
value
)
//
ie
->
value
.
choice
.
HandoverType
=
type
;
{
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
!
cause
)
if
(
ret
!=
0
)
cause
=
new
Cause
;
cout
<<
"encode HandoverType IE error"
<<
endl
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
}
ie
->
id
=
Ngap_ProtocolIE_ID_id_Cause
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
void
HandoverRequest
::
setCause
(
Ngap_Cause_PR
m_causePresent
,
long
value
)
//
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_Cause
;
{
if
(
!
cause
)
cause
->
setChoiceOfCause
(
m_causePresent
);
cause
=
new
Cause
;
cause
->
setValue
(
value
);
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
cause
->
encode2Cause
(
&
(
ie
->
value
.
choice
.
Cause
));
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
ie
->
id
=
Ngap_ProtocolIE_ID_id_Cause
;
if
(
ret
!=
0
)
cout
<<
"encode Cause IE error"
<<
endl
;
ie
->
criticality
=
Ngap_Criticality_ignore
;
}
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_Cause
;
void
HandoverRequest
::
setUEAggregateMaximumBitRate
(
long
bit_rate_downlink
,
long
bit_rate_uplink
)
cause
->
setChoiceOfCause
(
m_causePresent
);
{
cause
->
setValue
(
value
);
if
(
!
ueAggregateMaximumBitRate
)
cause
->
encode2Cause
(
&
(
ie
->
value
.
choice
.
Cause
));
ueAggregateMaximumBitRate
=
new
UEAggregateMaxBitRate
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
ueAggregateMaximumBitRate
->
setUEAggregateMaxBitRate
(
bit_rate_downlink
,
bit_rate_uplink
);
cout
<<
"encode Cause IE error"
<<
endl
;
}
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_UEAggregateMaximumBitRate
;
void
HandoverRequest
::
setUEAggregateMaximumBitRate
(
long
bit_rate_downlink
,
ie
->
criticality
=
Ngap_Criticality_reject
;
long
bit_rate_uplink
)
{
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_UEAggregateMaximumBitRate
;
if
(
!
ueAggregateMaximumBitRate
)
ueAggregateMaximumBitRate
->
encode2UEAggregateMaxBitRate
(
ie
->
value
.
choice
.
UEAggregateMaximumBitRate
);
ueAggregateMaximumBitRate
=
new
UEAggregateMaxBitRate
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
ueAggregateMaximumBitRate
->
setUEAggregateMaxBitRate
(
bit_rate_downlink
,
if
(
ret
!=
0
)
cout
<<
"encode UEAggregateMaximumBitRate IE error"
<<
endl
;
bit_rate_uplink
);
}
void
HandoverRequest
::
setUESecurityCapabilities
(
uint16_t
m_NR_EncryptionAlgs
,
uint16_t
m_NR_IntegrityProtectionAlgs
,
uint16_t
m_E_UTRA_EncryptionAlgs
,
uint16_t
m_E_UTRA_IntegrityProtectionAlgs
)
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
{
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
if
(
!
ueSecurityCapabilities
)
ie
->
id
=
Ngap_ProtocolIE_ID_id_UEAggregateMaximumBitRate
;
ueSecurityCapabilities
=
new
UESecurityCapabilities
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
Ngap_HandoverRequestIEs__value_PR_UEAggregateMaximumBitRate
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_UESecurityCapabilities
;
ueAggregateMaximumBitRate
->
encode2UEAggregateMaxBitRate
(
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
choice
.
UEAggregateMaximumBitRate
);
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_UESecurityCapabilities
;
ueSecurityCapabilities
->
setUESecurityCapabilities
(
m_NR_EncryptionAlgs
,
m_NR_IntegrityProtectionAlgs
,
m_E_UTRA_EncryptionAlgs
,
m_E_UTRA_IntegrityProtectionAlgs
);
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
ueSecurityCapabilities
->
encode2UESecurityCapabilities
((
ie
->
value
.
choice
.
UESecurityCapabilities
));
if
(
ret
!=
0
)
cout
<<
"encode UEAggregateMaximumBitRate IE error"
<<
endl
;
}
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
void
HandoverRequest
::
setUESecurityCapabilities
(
if
(
ret
!=
0
)
cout
<<
"encode UESecurityCapabilities IE error"
<<
endl
;
uint16_t
m_NR_EncryptionAlgs
,
uint16_t
m_NR_IntegrityProtectionAlgs
,
}
uint16_t
m_E_UTRA_EncryptionAlgs
,
uint16_t
m_E_UTRA_IntegrityProtectionAlgs
)
{
void
HandoverRequest
::
setGUAMI
(
PlmnId
*
m_plmnId
,
AMFRegionID
*
m_aMFRegionID
,
AMFSetID
*
m_aMFSetID
,
AMFPointer
*
m_aMFPointer
)
if
(
!
ueSecurityCapabilities
)
{
ueSecurityCapabilities
=
new
UESecurityCapabilities
;
if
(
!
guami
)
guami
=
new
GUAMI
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_UESecurityCapabilities
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_GUAMI
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_UESecurityCapabilities
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_GUAMI
;
ueSecurityCapabilities
->
setUESecurityCapabilities
(
guami
->
setGUAMI
(
m_plmnId
,
m_aMFRegionID
,
m_aMFSetID
,
m_aMFPointer
);
m_NR_EncryptionAlgs
,
m_NR_IntegrityProtectionAlgs
,
guami
->
encode2GUAMI
(
&
(
ie
->
value
.
choice
.
GUAMI
));
m_E_UTRA_EncryptionAlgs
,
m_E_UTRA_IntegrityProtectionAlgs
);
ueSecurityCapabilities
->
encode2UESecurityCapabilities
(
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
(
ie
->
value
.
choice
.
UESecurityCapabilities
));
if
(
ret
!=
0
)
cout
<<
"encode GUAMI IE error"
<<
endl
;
}
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
void
HandoverRequest
::
setAllowedNSSAI
(
std
::
vector
<
S_NSSAI
>
list
)
if
(
ret
!=
0
)
{
cout
<<
"encode UESecurityCapabilities IE error"
<<
endl
;
if
(
!
allowedNSSAI
)
}
allowedNSSAI
=
new
Ngap_AllowedNSSAI_t
();
void
HandoverRequest
::
setGUAMI
(
PlmnId
*
m_plmnId
,
AMFRegionID
*
m_aMFRegionID
,
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
AMFSetID
*
m_aMFSetID
,
AMFPointer
*
m_aMFPointer
)
{
{
if
(
!
guami
)
Ngap_AllowedNSSAI_Item_t
*
item
=
(
Ngap_AllowedNSSAI_Item_t
*
)
calloc
(
1
,
sizeof
(
Ngap_AllowedNSSAI_Item_t
));
guami
=
new
GUAMI
;
//item->s_NSSAI = list[i].s_NSSAI;
//S_NSSAI *s_NSSAI = new S_NSSAI();
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
list
[
i
].
encode2S_NSSAI
(
&
item
->
s_NSSAI
);
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
int
ret
=
ASN_SEQUENCE_ADD
(
&
allowedNSSAI
->
list
,
item
);
ie
->
id
=
Ngap_ProtocolIE_ID_id_GUAMI
;
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceHandoverListItem IE error"
<<
endl
;
ie
->
criticality
=
Ngap_Criticality_reject
;
}
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_GUAMI
;
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_AllowedNSSAI
,
allowedNSSAI
);
guami
->
setGUAMI
(
m_plmnId
,
m_aMFRegionID
,
m_aMFSetID
,
m_aMFPointer
);
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
guami
->
encode2GUAMI
(
&
(
ie
->
value
.
choice
.
GUAMI
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_AllowedNSSAI
;
ie
->
criticality
=
Ngap_Criticality_reject
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_AllowedNSSAI
;
if
(
ret
!=
0
)
ie
->
value
.
choice
.
AllowedNSSAI
=
*
allowedNSSAI
;
cout
<<
"encode GUAMI IE error"
<<
endl
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
}
if
(
ret
!=
0
)
cout
<<
"encode AllowedNSSAI IE error"
<<
endl
;
void
HandoverRequest
::
setAllowedNSSAI
(
std
::
vector
<
S_NSSAI
>
list
)
{
if
(
!
allowedNSSAI
)
allowedNSSAI
=
new
Ngap_AllowedNSSAI_t
();
}
void
HandoverRequest
::
setSecurityContext
(
long
count
,
uint8_t
*
buffer
)
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
{
Ngap_AllowedNSSAI_Item_t
*
item
=
(
Ngap_AllowedNSSAI_Item_t
*
)
calloc
(
if
(
!
SecurityContext
)
1
,
sizeof
(
Ngap_AllowedNSSAI_Item_t
));
SecurityContext
=
new
Ngap_SecurityContext_t
();
//item->s_NSSAI = list[i].s_NSSAI;
//S_NSSAI *s_NSSAI = new S_NSSAI();
SecurityKey
securitykey
;
list
[
i
].
encode2S_NSSAI
(
&
item
->
s_NSSAI
);
securitykey
.
setSecurityKey
(
buffer
);
int
ret
=
ASN_SEQUENCE_ADD
(
&
allowedNSSAI
->
list
,
item
);
securitykey
.
encode2bitstring
(
SecurityContext
->
nextHopNH
);
if
(
ret
!=
0
)
SecurityContext
->
nextHopChainingCount
=
count
;
cout
<<
"encode PDUSessionResourceHandoverListItem IE error"
<<
endl
;
}
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_AllowedNSSAI
,
allowedNSSAI
);
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_SecurityContext
;
ie
->
id
=
Ngap_ProtocolIE_ID_id_AllowedNSSAI
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_SecurityContext
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_AllowedNSSAI
;
ie
->
value
.
choice
.
SecurityContext
=
*
SecurityContext
;
ie
->
value
.
choice
.
AllowedNSSAI
=
*
allowedNSSAI
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode SecurityContext IE error"
<<
endl
;
if
(
ret
!=
0
)
cout
<<
"encode AllowedNSSAI IE error"
<<
endl
;
}
}
void
HandoverRequest
::
setPduSessionResourceSetupList
(
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
)
void
HandoverRequest
::
setSecurityContext
(
long
count
,
uint8_t
*
buffer
)
{
{
if
(
!
SecurityContext
)
if
(
!
PDUSessionResourceSetupList
)
SecurityContext
=
new
Ngap_SecurityContext_t
();
PDUSessionResourceSetupList
=
new
PDUSessionResourceSetupListHOReq
();
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
=
new
PDUSessionResourceSetupItemHOReq
[
list
.
size
()]();
SecurityKey
securitykey
;
securitykey
.
setSecurityKey
(
buffer
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
securitykey
.
encode2bitstring
(
SecurityContext
->
nextHopNH
);
{
SecurityContext
->
nextHopChainingCount
=
count
;
PDUSessionID
*
m_pDUSessionID
=
new
PDUSessionID
();
m_pDUSessionID
->
setPDUSessionID
(
list
[
i
].
pduSessionId
);
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
S_NSSAI
*
m_s_NSSAI
=
new
S_NSSAI
();
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
m_s_NSSAI
->
setSst
(
list
[
i
].
s_nssai
.
sst
);
ie
->
id
=
Ngap_ProtocolIE_ID_id_SecurityContext
;
if
(
list
[
i
].
s_nssai
.
sd
.
size
())
ie
->
criticality
=
Ngap_Criticality_reject
;
m_s_NSSAI
->
setSd
(
list
[
i
].
s_nssai
.
sd
);
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_SecurityContext
;
m_pduSessionResourceSetupItemHOReq
[
i
].
setPDUSessionResourceSetupItemHOReq
(
m_pDUSessionID
,
m_s_NSSAI
,
list
[
i
].
pduSessionResourceSetupRequestTransfer
);
ie
->
value
.
choice
.
SecurityContext
=
*
SecurityContext
;
}
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
PDUSessionResourceSetupList
->
setPDUSessionResourceSetupListHOReq
(
m_pduSessionResourceSetupItemHOReq
,
list
.
size
());
cout
<<
"encode SecurityContext IE error"
<<
endl
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
}
ie
->
id
=
Ngap_ProtocolIE_ID_id_PDUSessionResourceSetupListHOReq
;
ie
->
criticality
=
Ngap_Criticality_reject
;
void
HandoverRequest
::
setPduSessionResourceSetupList
(
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_PDUSessionResourceSetupListHOReq
;
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
)
{
if
(
!
PDUSessionResourceSetupList
)
int
ret
=
PDUSessionResourceSetupList
->
encode2PDUSessionResourceSetupListHOReq
(
&
ie
->
value
.
choice
.
PDUSessionResourceSetupListHOReq
);
PDUSessionResourceSetupList
=
new
PDUSessionResourceSetupListHOReq
();
if
(
!
ret
)
PDUSessionResourceSetupItemHOReq
*
m_pduSessionResourceSetupItemHOReq
=
{
new
PDUSessionResourceSetupItemHOReq
[
list
.
size
()]();
cout
<<
"encode PDUSessionResourceSetupListSUReq IE error"
<<
endl
;
return
;
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++
)
{
}
PDUSessionID
*
m_pDUSessionID
=
new
PDUSessionID
();
m_pDUSessionID
->
setPDUSessionID
(
list
[
i
].
pduSessionId
);
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
S_NSSAI
*
m_s_NSSAI
=
new
S_NSSAI
();
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceSetupListSUReq IE error"
<<
endl
;
m_s_NSSAI
->
setSst
(
list
[
i
].
s_nssai
.
sst
);
}
if
(
list
[
i
].
s_nssai
.
sd
.
size
())
m_s_NSSAI
->
setSd
(
list
[
i
].
s_nssai
.
sd
);
void
HandoverRequest
::
setSourceToTarget_TransparentContainer
(
OCTET_STRING_t
sourceTotarget
)
m_pduSessionResourceSetupItemHOReq
[
i
].
setPDUSessionResourceSetupItemHOReq
(
{
m_pDUSessionID
,
m_s_NSSAI
,
if
(
!
SourceToTarget_TransparentContainer
)
list
[
i
].
pduSessionResourceSetupRequestTransfer
);
SourceToTarget_TransparentContainer
=
new
Ngap_SourceToTarget_TransparentContainer_t
();
}
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
PDUSessionResourceSetupList
->
setPDUSessionResourceSetupListHOReq
(
ie
->
id
=
Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer
;
m_pduSessionResourceSetupItemHOReq
,
list
.
size
());
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_SourceToTarget_TransparentContainer
;
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
ie
->
value
.
choice
.
SourceToTarget_TransparentContainer
=
sourceTotarget
;
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
ie
->
id
=
Ngap_ProtocolIE_ID_id_PDUSessionResourceSetupListHOReq
;
if
(
ret
!=
0
)
cout
<<
"encode SourceToTarget_TransparentContainer IE error"
<<
endl
;
ie
->
criticality
=
Ngap_Criticality_reject
;
}
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_PDUSessionResourceSetupListHOReq
;
int
ret
=
PDUSessionResourceSetupList
->
encode2PDUSessionResourceSetupListHOReq
(
&
ie
->
value
.
choice
.
PDUSessionResourceSetupListHOReq
);
if
(
!
ret
)
{
cout
<<
"encode PDUSessionResourceSetupListSUReq IE error"
<<
endl
;
return
;
}
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode PDUSessionResourceSetupListSUReq IE error"
<<
endl
;
}
void
HandoverRequest
::
setSourceToTarget_TransparentContainer
(
OCTET_STRING_t
sourceTotarget
)
{
if
(
!
SourceToTarget_TransparentContainer
)
SourceToTarget_TransparentContainer
=
new
Ngap_SourceToTarget_TransparentContainer_t
();
Ngap_HandoverRequestIEs_t
*
ie
=
(
Ngap_HandoverRequestIEs_t
*
)
calloc
(
1
,
sizeof
(
Ngap_HandoverRequestIEs_t
));
ie
->
id
=
Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer
;
ie
->
criticality
=
Ngap_Criticality_reject
;
ie
->
value
.
present
=
Ngap_HandoverRequestIEs__value_PR_SourceToTarget_TransparentContainer
;
ie
->
value
.
choice
.
SourceToTarget_TransparentContainer
=
sourceTotarget
;
int
ret
=
ASN_SEQUENCE_ADD
(
&
handoverRequestIEs
->
protocolIEs
.
list
,
ie
);
if
(
ret
!=
0
)
cout
<<
"encode SourceToTarget_TransparentContainer IE error"
<<
endl
;
}
}
}
src/ngap/ngapMsgs/HandoverRequest.hpp
View file @
c6dfe333
...
@@ -12,11 +12,11 @@
...
@@ -12,11 +12,11 @@
#include "RAN-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "Cause.hpp"
#include "Cause.hpp"
#include "UEAggregateMaxBitRate.hpp"
#include "UEAggregateMaxBitRate.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_NGSetupRequest.h"
#include "Ngap_NGSetupRequest.h"
#include "Ngap_AllowedNSSAI-Item.h"
#include "Ngap_AllowedNSSAI-Item.h"
}
}
#include "UESecurityCapabilities.hpp"
#include "UESecurityCapabilities.hpp"
...
@@ -24,58 +24,56 @@ extern "C"{
...
@@ -24,58 +24,56 @@ extern "C"{
#include "GUAMI.hpp"
#include "GUAMI.hpp"
#include "S-NSSAI.hpp"
#include "S-NSSAI.hpp"
#include "SecurityKey.hpp"
#include "SecurityKey.hpp"
namespace
ngap
{
namespace
ngap
{
class
HandoverRequest
{
public:
HandoverRequest
();
virtual
~
HandoverRequest
();
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setHandoverType
(
long
type
);
void
setCause
(
Ngap_Cause_PR
m_causePresent
,
long
value
);
void
setUEAggregateMaximumBitRate
(
long
bit_rate_downlink
,
long
bit_rate_uplink
);
void
setUESecurityCapabilities
(
uint16_t
m_NR_EncryptionAlgs
,
uint16_t
m_NR_IntegrityProtectionAlgs
,
uint16_t
m_E_UTRA_EncryptionAlgs
,
uint16_t
m_E_UTRA_IntegrityProtectionAlgs
);
void
setSecurityContext
(
long
count
,
uint8_t
*
buffer
);
class
HandoverRequest
{
void
setPduSessionResourceSetupList
(
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
);
public:
HandoverRequest
();
virtual
~
HandoverRequest
();
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
void
setSourceToTarget_TransparentContainer
(
OCTET_STRING_t
sourceTotarget
);
void
setAmfUeNgapId
(
unsigned
long
id
);
//40 bits
void
setHandoverType
(
long
type
);
void
setCause
(
Ngap_Cause_PR
m_causePresent
,
long
value
);
void
setUEAggregateMaximumBitRate
(
long
bit_rate_downlink
,
long
bit_rate_uplink
);
void
setUESecurityCapabilities
(
uint16_t
m_NR_EncryptionAlgs
,
uint16_t
m_NR_IntegrityProtectionAlgs
,
uint16_t
m_E_UTRA_EncryptionAlgs
,
uint16_t
m_E_UTRA_IntegrityProtectionAlgs
);
void
setSecurityContext
(
long
count
,
uint8_t
*
buffer
);
void
setPduSessionResourceSetupList
(
std
::
vector
<
PDUSessionResourceSetupRequestItem_t
>
list
);
void
setSourceToTarget_TransparentContainer
(
OCTET_STRING_t
sourceTotarget
);
void
setAllowedNSSAI
(
std
::
vector
<
S_NSSAI
>
list
);
void
setGUAMI
(
PlmnId
*
m_plmnId
,
AMFRegionID
*
m_aMFRegionID
,
AMFSetID
*
m_aMFSetID
,
AMFPointer
*
m_aMFPointer
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
//bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
void
setAllowedNSSAI
(
std
::
vector
<
S_NSSAI
>
list
);
private:
void
setGUAMI
(
PlmnId
*
m_plmnId
,
AMFRegionID
*
m_aMFRegionID
,
AMFSetID
*
m_aMFSetID
,
AMFPointer
*
m_aMFPointer
);
Ngap_NGAP_PDU_t
*
handoverRequestPdu
;
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
Ngap_HandoverRequest_t
*
handoverRequestIEs
;
//bool decodefrompdu(Ngap_NGAP_PDU_t *ngap_msg_pdu);
/***************** for decoding ****************/
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
AMF_UE_NGAP_ID
*
amfUeNgapId
;
Ngap_HandoverType_t
*
handovertype
;
private:
Cause
*
cause
;
Ngap_NGAP_PDU_t
*
handoverRequestPdu
;
UEAggregateMaxBitRate
*
ueAggregateMaximumBitRate
;
Ngap_HandoverRequest_t
*
handoverRequestIEs
;
//Core Network Assistance Information for RRC INACTIVE
/***************** for decoding ****************/
UESecurityCapabilities
*
ueSecurityCapabilities
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
Ngap_SecurityContext_t
*
SecurityContext
;
Ngap_HandoverType_t
*
handovertype
;
//New Security Context Indicator
Cause
*
cause
;
//NASC
UEAggregateMaxBitRate
*
ueAggregateMaximumBitRate
;
PDUSessionResourceSetupListHOReq
*
PDUSessionResourceSetupList
;
//Core Network Assistance Information for RRC INACTIVE
Ngap_AllowedNSSAI_t
*
allowedNSSAI
;
UESecurityCapabilities
*
ueSecurityCapabilities
;
//Trace Activation
Ngap_SecurityContext_t
*
SecurityContext
;
//Masked IMEISV
//New Security Context Indicator
Ngap_SourceToTarget_TransparentContainer_t
*
SourceToTarget_TransparentContainer
;
//NASC
//Mobility Restriction List
PDUSessionResourceSetupListHOReq
*
PDUSessionResourceSetupList
;
//Location Reporting Request Type
Ngap_AllowedNSSAI_t
*
allowedNSSAI
;
//RRC Inactive Transition Report Request
//Trace Activation
GUAMI
*
guami
;
//Masked IMEISV
//Redirection for Voice EPS Fallback
Ngap_SourceToTarget_TransparentContainer_t
*
SourceToTarget_TransparentContainer
;
//CN Assisted RAN Parameters Tuning
//Mobility Restriction List
};
//Location Reporting Request Type
//RRC Inactive Transition Report Request
GUAMI
*
guami
;
//Redirection for Voice EPS Fallback
//CN Assisted RAN Parameters Tuning
};
}
}
...
...
src/ngap/ngapMsgs/HandoverRequestAck.cpp
View file @
c6dfe333
...
@@ -30,8 +30,7 @@
...
@@ -30,8 +30,7 @@
#include "TransportLayerAddress.hpp"
#include "TransportLayerAddress.hpp"
#include "String2Value.hpp"
#include "String2Value.hpp"
#include "GTP-TEID.hpp"
#include "GTP-TEID.hpp"
extern
"C"
extern
"C"
{
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
...
@@ -46,306 +45,313 @@ extern "C"
...
@@ -46,306 +45,313 @@ extern "C"
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
HandoverRequestAck
::
HandoverRequestAck
()
{
HandoverRequestAck
::
HandoverRequestAck
()
amfUeNgapId
=
NULL
;
{
ranUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
pduSessionResourceAdmittedList
=
NULL
;
ranUeNgapId
=
NULL
;
PDUSessionResourceFailedToSetupList
=
NULL
;
pduSessionResourceAdmittedList
=
NULL
;
TargetToSource_TransparentContainer
=
NULL
;
PDUSessionResourceFailedToSetupList
=
NULL
;
CriticalityDiagnostics
=
NULL
;
TargetToSource_TransparentContainer
=
NULL
;
}
CriticalityDiagnostics
=
NULL
;
HandoverRequestAck
::~
HandoverRequestAck
()
{
}
}
HandoverRequestAck
::~
HandoverRequestAck
()
{}
unsigned
long
HandoverRequestAck
::
getAmfUeNgapId
()
{
unsigned
long
HandoverRequestAck
::
getAmfUeNgapId
()
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
{
}
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
void
HandoverRequestAck
::
setMessageType
()
{
}
if
(
!
handoverRequestAckPdu
)
void
HandoverRequestAck
::
setMessageType
()
handoverRequestAckPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
{
sizeof
(
Ngap_NGAP_PDU_t
));
if
(
!
handoverRequestAckPdu
)
handoverRequestAckPdu
=
(
Ngap_NGAP_PDU_t
*
)
calloc
(
1
,
sizeof
(
Ngap_NGAP_PDU_t
));
MessageType
handoverRequestMessageTypeIE
;
handoverRequestMessageTypeIE
.
setProcedureCode
(
MessageType
handoverRequestMessageTypeIE
;
Ngap_ProcedureCode_id_HandoverResourceAllocation
);
handoverRequestMessageTypeIE
.
setProcedureCode
(
Ngap_ProcedureCode_id_HandoverResourceAllocation
);
handoverRequestMessageTypeIE
.
setTypeOfMessage
(
handoverRequestMessageTypeIE
.
setTypeOfMessage
(
Ngap_NGAP_PDU_PR_initiatingMessage
);
Ngap_NGAP_PDU_PR_initiatingMessage
);
handoverRequestMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
handoverRequestMessageTypeIE
.
setCriticality
(
Ngap_Criticality_reject
);
handoverRequestMessageTypeIE
.
setValuePresent
(
Ngap_InitiatingMessage__value_PR_HandoverRequest
);
handoverRequestMessageTypeIE
.
setValuePresent
(
Ngap_InitiatingMessage__value_PR_HandoverRequest
);
if
(
handoverRequestMessageTypeIE
.
getProcedureCode
()
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
&&
handoverRequestMessageTypeIE
.
getTypeOfMessage
()
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
if
(
handoverRequestMessageTypeIE
.
getProcedureCode
()
handoverRequestMessageTypeIE
.
encode2pdu
(
handoverRequestAckPdu
);
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
handoverRequestAckIEs
=
&
(
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverRequestAcknowledge
);
&&
handoverRequestMessageTypeIE
.
getTypeOfMessage
()
}
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
else
handoverRequestMessageTypeIE
.
encode2pdu
(
handoverRequestAckPdu
);
{
handoverRequestAckIEs
=
&
(
handoverRequestAckPdu
->
choice
.
successfulOutcome
cout
<<
"[warning] This information doesn't refer to HandoverRequest Message!!!"
<<
endl
;
->
value
.
choice
.
HandoverRequestAcknowledge
);
}
}
else
{
}
cout
uint32_t
HandoverRequestAck
::
getRanUeNgapId
()
<<
"[warning] This information doesn't refer to HandoverRequest Message!!!"
{
<<
endl
;
return
ranUeNgapId
->
getRanUeNgapId
();
}
}
}
OCTET_STRING_t
HandoverRequestAck
::
getTargetToSource_TransparentContainer
()
uint32_t
HandoverRequestAck
::
getRanUeNgapId
()
{
{
return
ranUeNgapId
->
getRanUeNgapId
();
return
*
TargetToSource_TransparentContainer
;
}
}
OCTET_STRING_t
HandoverRequestAck
::
getTargetToSource_TransparentContainer
()
{
return
*
TargetToSource_TransparentContainer
;
bool
HandoverRequestAck
::
getPDUSessionResourceAdmittedList
(
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>
&
list
)
}
{
if
(
!
pduSessionResourceAdmittedList
)
bool
HandoverRequestAck
::
getPDUSessionResourceAdmittedList
(
return
false
;
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>
&
list
)
{
if
(
!
pduSessionResourceAdmittedList
)
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
;
return
false
;
int
num
=
0
;
pduSessionResourceAdmittedList
->
getPDUSessionResourceAdmittedList
(
m_pduSessionResourceAdmittedItem
,
num
);
PDUSessionResourceAdmittedItem
*
m_pduSessionResourceAdmittedItem
;
int
num
=
0
;
for
(
int
i
=
0
;
i
<
num
;
i
++
)
pduSessionResourceAdmittedList
->
getPDUSessionResourceAdmittedList
(
{
m_pduSessionResourceAdmittedItem
,
num
);
PDUSessionResourceAdmittedItem_t
response
;
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
PDUSessionID
*
m_pDUSessionID
;
PDUSessionResourceAdmittedItem_t
response
;
m_pduSessionResourceAdmittedItem
[
i
].
getPDUSessionResourceAdmittedItem
(
m_pDUSessionID
,
response
.
handoverRequestAcknowledgeTransfer
);
m_pDUSessionID
->
getPDUSessionID
(
response
.
pduSessionId
);
PDUSessionID
*
m_pDUSessionID
;
list
.
push_back
(
response
);
m_pduSessionResourceAdmittedItem
[
i
].
getPDUSessionResourceAdmittedItem
(
}
m_pDUSessionID
,
response
.
handoverRequestAcknowledgeTransfer
);
m_pDUSessionID
->
getPDUSessionID
(
response
.
pduSessionId
);
return
true
;
list
.
push_back
(
response
);
}
}
bool
HandoverRequestAck
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
return
true
;
{
}
handoverRequestAckPdu
=
ngap_msg_pdu
;
bool
HandoverRequestAck
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
if
(
handoverRequestAckPdu
->
present
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
handoverRequestAckPdu
=
ngap_msg_pdu
;
{
if
(
handoverRequestAckPdu
->
choice
.
successfulOutcome
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
value
.
present
==
Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge
)
if
(
handoverRequestAckPdu
->
present
==
Ngap_NGAP_PDU_PR_successfulOutcome
)
{
{
if
(
handoverRequestAckPdu
->
choice
.
successfulOutcome
handoverRequestAckIEs
=
&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
value
.
choice
.
HandoverRequestAcknowledge
;
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
procedureCode
}
==
Ngap_ProcedureCode_id_HandoverResourceAllocation
else
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
criticality
{
==
Ngap_Criticality_reject
cout
<<
"Check handoverRequestAck message error!!!"
<<
endl
;
&&
handoverRequestAckPdu
->
choice
.
successfulOutcome
->
value
.
present
return
false
;
==
Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge
)
{
}
handoverRequestAckIEs
=
&
handoverRequestAckPdu
->
choice
.
successfulOutcome
}
->
value
.
choice
.
HandoverRequestAcknowledge
;
else
}
else
{
{
cout
<<
"Check handoverRequestAck message error!!!"
<<
endl
;
cout
<<
"handoverRequestAck MessageType error!!!"
<<
endl
;
return
false
;
return
false
;
}
}
}
else
{
for
(
int
i
=
0
;
i
<
handoverRequestAckIEs
->
protocolIEs
.
list
.
count
;
i
++
)
cout
<<
"handoverRequestAck MessageType error!!!"
<<
endl
;
{
return
false
;
switch
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
}
{
for
(
int
i
=
0
;
i
<
handoverRequestAckIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
switch
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID
)
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
{
==
Ngap_Criticality_ignore
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID
)
{
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
return
false
;
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
}
.
AMF_UE_NGAP_ID
))
{
}
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
else
return
false
;
{
}
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
}
else
{
return
false
;
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
}
}
break
;
}
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
break
;
{
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID
)
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
{
==
Ngap_Criticality_ignore
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID
)
{
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
return
false
;
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
}
.
RAN_UE_NGAP_ID
))
{
}
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
else
return
false
;
{
}
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
}
else
{
return
false
;
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
}
}
break
;
}
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList
:
break
;
{
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList
:
{
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList
)
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
{
==
Ngap_Criticality_ignore
pduSessionResourceAdmittedList
=
new
PDUSessionResourceAdmittedList
();
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
if
(
!
pduSessionResourceAdmittedList
->
decodefromPDUSessionResourceAdmittedList
(
&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
PDUSessionResourceAdmittedList
))
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList
)
{
{
pduSessionResourceAdmittedList
=
new
PDUSessionResourceAdmittedList
();
cout
<<
"decoded ngap PDUSessionResourceAdmittedList IE error"
<<
endl
;
if
(
!
pduSessionResourceAdmittedList
return
false
;
->
decodefromPDUSessionResourceAdmittedList
(
}
&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
}
.
PDUSessionResourceAdmittedList
))
{
else
cout
<<
"decoded ngap PDUSessionResourceAdmittedList IE error"
{
<<
endl
;
cout
<<
"decoded ngap PDUSessionResourceAdmittedList Type IE error"
<<
endl
;
return
false
;
return
false
;
}
}
}
else
{
}
cout
<<
"decoded ngap PDUSessionResourceAdmittedList Type IE error"
break
;
<<
endl
;
case
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
:
return
false
;
{
}
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer
)
}
{
break
;
TargetToSource_TransparentContainer
=
new
Ngap_TargetToSource_TransparentContainer_t
();
case
Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer
:
{
*
TargetToSource_TransparentContainer
=
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
TargetToSource_TransparentContainer
;
if
(
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
}
==
Ngap_Criticality_reject
else
&&
handoverRequestAckIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
{
==
Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer
)
{
cout
<<
"decoded ngap TargetToSource_TransparentContainer IE error"
<<
endl
;
TargetToSource_TransparentContainer
=
return
false
;
new
Ngap_TargetToSource_TransparentContainer_t
();
}
*
TargetToSource_TransparentContainer
=
handoverRequestAckIEs
}
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
break
;
.
TargetToSource_TransparentContainer
;
default:
}
else
{
{
cout
<<
"decoded ngap TargetToSource_TransparentContainer IE error"
cout
<<
"decoded ngap message pdu error"
<<
endl
;
<<
endl
;
return
false
;
return
false
;
}
}
}
}
}
break
;
default:
{
return
true
;
cout
<<
"decoded ngap message pdu error"
<<
endl
;
}
return
false
;
}
int
HandoverRequestAck
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
}
{
}
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequestAckPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverRequestAckPdu
,
buf
,
buf_size
);
return
true
;
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
}
return
er
.
encoded
;
}
int
HandoverRequestAck
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequestAckPdu
);
/* void HandoverRequestAck::setMessageType()
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
{
handoverRequestAckPdu
,
buf
,
if (!handoverRequestAckPdu) handoverRequestAckPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
MessageType HandoverRequestAckMessageTypeIE;
return
er
.
encoded
;
HandoverRequestAckMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverResourceAllocation);
}
HandoverRequestAckMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_successfulOutcome);
HandoverRequestAckMessageTypeIE.setCriticality(Ngap_Criticality_reject);
/* void HandoverRequestAck::setMessageType()
HandoverRequestAckMessageTypeIE.setValuePresent(Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge);
{
if (!handoverRequestAckPdu) handoverRequestAckPdu = (Ngap_NGAP_PDU_t*)calloc(1, sizeof(Ngap_NGAP_PDU_t));
if (HandoverRequestAckMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverResourceAllocation && HandoverRequestAckMessageTypeIE.getTypeOfMessage() == Ngap_NGAP_PDU_PR_successfulOutcome)
{
MessageType HandoverRequestAckMessageTypeIE;
HandoverRequestAckMessageTypeIE.encode2pdu(handoverRequestAckPdu);
HandoverRequestAckMessageTypeIE.setProcedureCode(Ngap_ProcedureCode_id_HandoverResourceAllocation);
handoverRequestAckIEs = &(handoverRequestAckPdu->choice.successfulOutcome->value.choice.HandoverRequestAcknowledge);
HandoverRequestAckMessageTypeIE.setTypeOfMessage(Ngap_NGAP_PDU_PR_successfulOutcome);
}
HandoverRequestAckMessageTypeIE.setCriticality(Ngap_Criticality_reject);
else
HandoverRequestAckMessageTypeIE.setValuePresent(Ngap_SuccessfulOutcome__value_PR_HandoverRequestAcknowledge);
{
cout << "[warning] This information doesn't refer to HandoverRequestAcknowledge Message!!!" << endl;
if (HandoverRequestAckMessageTypeIE.getProcedureCode() == Ngap_ProcedureCode_id_HandoverResourceAllocation && HandoverRequestAckMessageTypeIE.getTypeOfMessage() == Ngap_NGAP_PDU_PR_successfulOutcome)
}
{
}
HandoverRequestAckMessageTypeIE.encode2pdu(handoverRequestAckPdu);
*/
handoverRequestAckIEs = &(handoverRequestAckPdu->choice.successfulOutcome->value.choice.HandoverRequestAcknowledge);
/* void HandoverRequestAck::setAmfUeNgapId(unsigned long id)
}
{
else
if (!amfUeNgapId)
{
amfUeNgapId = new AMF_UE_NGAP_ID();
cout << "[warning] This information doesn't refer to HandoverRequestAcknowledge Message!!!" << endl;
amfUeNgapId->setAMF_UE_NGAP_ID(id);
}
}
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
*/
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
/* void HandoverRequestAck::setAmfUeNgapId(unsigned long id)
ie->criticality = Ngap_Criticality_reject;
{
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID;
if (!amfUeNgapId)
amfUeNgapId = new AMF_UE_NGAP_ID();
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
amfUeNgapId->setAMF_UE_NGAP_ID(id);
if (!ret)
{
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
cout << "encode AMF_UE_NGAP_ID IE error" << endl;
ie->id = Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID;
return;
ie->criticality = Ngap_Criticality_reject;
}
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_AMF_UE_NGAP_ID;
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
int ret = amfUeNgapId->encode2AMF_UE_NGAP_ID(ie->value.choice.AMF_UE_NGAP_ID);
if (ret != 0) cout << "encode AMF_UE_NGAP_ID IE error" << endl;
if (!ret)
}
{
*/
cout << "encode AMF_UE_NGAP_ID IE error" << endl;
/* void HandoverRequestAck::setRanUeNgapId(uint32_t ran_ue_ngap_id)
return;
{
}
if (!ranUeNgapId)
ranUeNgapId = new RAN_UE_NGAP_ID();
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
ranUeNgapId->setRanUeNgapId(ran_ue_ngap_id);
if (ret != 0) cout << "encode AMF_UE_NGAP_ID IE error" << endl;
}
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
*/
ie->id = Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
/* void HandoverRequestAck::setRanUeNgapId(uint32_t ran_ue_ngap_id)
ie->criticality = Ngap_Criticality_reject;
{
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID;
if (!ranUeNgapId)
ranUeNgapId = new RAN_UE_NGAP_ID();
int ret = ranUeNgapId->encode2RAN_UE_NGAP_ID(ie->value.choice.RAN_UE_NGAP_ID);
ranUeNgapId->setRanUeNgapId(ran_ue_ngap_id);
if (!ret)
{
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
cout << "encode RAN_UE_NGAP_ID IE error" << endl;
ie->id = Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID;
return;
ie->criticality = Ngap_Criticality_reject;
}
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_RAN_UE_NGAP_ID;
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
int ret = ranUeNgapId->encode2RAN_UE_NGAP_ID(ie->value.choice.RAN_UE_NGAP_ID);
if (ret != 0) cout << "encode RAN_UE_NGAP_ID IE error" << endl;
if (!ret)
}
{
cout << "encode RAN_UE_NGAP_ID IE error" << endl;
*/
return;
/* void HandoverRequestAck::setPDUSessionResourceAdmittedList(std::vector<Ngap_PDUSessionResourceAdmittedItem_t> list)
}
{
if (!PDUSessionResourceAdmittedList)
ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
PDUSessionResourceAdmittedList = new Ngap_PDUSessionResourceAdmittedList_t();
if (ret != 0) cout << "encode RAN_UE_NGAP_ID IE error" << endl;
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
}
for (int i = 0; i < list.size(); i++)
*/
{
/* void HandoverRequestAck::setPDUSessionResourceAdmittedList(std::vector<Ngap_PDUSessionResourceAdmittedItem_t> list)
Ngap_PDUSessionResourceAdmittedItem_t *item = (Ngap_PDUSessionResourceAdmittedItem_t *)calloc(1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
{
item->pDUSessionID = list[i].pDUSessionID;
if (!PDUSessionResourceAdmittedList)
PDUSessionResourceAdmittedList = new Ngap_PDUSessionResourceAdmittedList_t();
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
Ngap_HandoverRequestAcknowledgeTransfer_t *handoverrequestacknowledgetransfer;
handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.present = Ngap_UPTransportLayerInformation_PR_gTPTunnel;
for (int i = 0; i < list.size(); i++)
{
TransportLayerAddress transportlayeraddress;
Ngap_PDUSessionResourceAdmittedItem_t *item = (Ngap_PDUSessionResourceAdmittedItem_t *)calloc(1, sizeof(Ngap_PDUSessionResourceAdmittedItem_t));
transportlayeraddress.setTransportLayerAddress("127.0.1.1");
item->pDUSessionID = list[i].pDUSessionID;
transportlayeraddress.encode2TransportLayerAddress((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation).choice.gTPTunnel->transportLayerAddress);
GtpTeid gtpteid;
Ngap_HandoverRequestAcknowledgeTransfer_t *handoverrequestacknowledgetransfer;
gtpteid.setGtpTeid(159);
handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.present = Ngap_UPTransportLayerInformation_PR_gTPTunnel;
gtpteid.encode2GtpTeid((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.choice.gTPTunnel->gTP_TEID));
TransportLayerAddress transportlayeraddress;
transportlayeraddress.setTransportLayerAddress("127.0.1.1");
transportlayeraddress.encode2TransportLayerAddress((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation).choice.gTPTunnel->transportLayerAddress);
item->handoverRequestAcknowledgeTransfer = list[i].handoverRequestAcknowledgeTransfer;
int ret = ASN_SEQUENCE_ADD(&PDUSessionResourceAdmittedList->list, item);
GtpTeid gtpteid;
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
gtpteid.setGtpTeid(159);
}
gtpteid.encode2GtpTeid((handoverrequestacknowledgetransfer->dL_NGU_UP_TNLInformation.choice.gTPTunnel->gTP_TEID));
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList;
ie->criticality = Ngap_Criticality_ignore;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList;
item->handoverRequestAcknowledgeTransfer = list[i].handoverRequestAcknowledgeTransfer;
ie->value.choice.PDUSessionResourceAdmittedList = *PDUSessionResourceAdmittedList;
int ret = ASN_SEQUENCE_ADD(&PDUSessionResourceAdmittedList->list, item);
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
}
}
ie->id = Ngap_ProtocolIE_ID_id_PDUSessionResourceAdmittedList;
*/
ie->criticality = Ngap_Criticality_ignore;
/* void HandoverRequestAck::setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource)
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_PDUSessionResourceAdmittedList;
{
ie->value.choice.PDUSessionResourceAdmittedList = *PDUSessionResourceAdmittedList;
if (!TargetToSource_TransparentContainer)
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
TargetToSource_TransparentContainer = new Ngap_TargetToSource_TransparentContainer_t();
if (ret != 0) cout << "encode PDUSessionResourceAdmittedList IE error" << endl;
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
}
ie->id = Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer;
*/
ie->criticality = Ngap_Criticality_reject;
/* void HandoverRequestAck::setTargetToSource_TransparentContainer(OCTET_STRING_t targetTosource)
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer;
{
ie->value.choice.TargetToSource_TransparentContainer = targetTosource;
if (!TargetToSource_TransparentContainer)
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
TargetToSource_TransparentContainer = new Ngap_TargetToSource_TransparentContainer_t();
if (ret != 0) cout << "encode TargetToSource_TransparentContainer IE error" << endl;
}
Ngap_HandoverRequestAcknowledgeIEs_t *ie = (Ngap_HandoverRequestAcknowledgeIEs_t *)calloc(1, sizeof(Ngap_HandoverRequestAcknowledgeIEs_t));
ie->id = Ngap_ProtocolIE_ID_id_TargetToSource_TransparentContainer;
*/
ie->criticality = Ngap_Criticality_reject;
ie->value.present = Ngap_HandoverRequestAcknowledgeIEs__value_PR_TargetToSource_TransparentContainer;
}
// namespace ngap
ie->value.choice.TargetToSource_TransparentContainer = targetTosource;
int ret = ASN_SEQUENCE_ADD(&handoverRequestAckIEs->protocolIEs.list, ie);
if (ret != 0) cout << "encode TargetToSource_TransparentContainer IE error" << endl;
}
*/
}
// namespace ngap
src/ngap/ngapMsgs/HandoverRequestAck.hpp
View file @
c6dfe333
...
@@ -50,35 +50,36 @@ extern "C" {
...
@@ -50,35 +50,36 @@ extern "C" {
}
}
namespace
ngap
{
namespace
ngap
{
class
HandoverRequestAck
{
public:
HandoverRequestAck
();
virtual
~
HandoverRequestAck
();
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
class
HandoverRequestAck
{
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
public:
HandoverRequestAck
();
virtual
~
HandoverRequestAck
();
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
OCTET_STRING_t
getTargetToSource_TransparentContainer
();
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
bool
getPDUSessionResourceAdmittedList
(
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>&
list
);
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
;
PDUSessionResourceAdmittedList
*
pduSessionResourceAdmittedList
;
void
setMessageType
();
//Initialize the PDU and populate the MessageType;
Ngap_PDUSessionResourceFailedToSetupListHOAck_t
*
PDUSessionResourceFailedToSetupList
;
OCTET_STRING_t
getTargetToSource_TransparentContainer
();
Ngap_TargetToSource_TransparentContainer_t
*
TargetToSource_TransparentContainer
;
bool
getPDUSessionResourceAdmittedList
(
Ngap_CriticalityDiagnostics_t
*
CriticalityDiagnostics
;
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>
&
list
);
};
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
;
PDUSessionResourceAdmittedList
*
pduSessionResourceAdmittedList
;
Ngap_PDUSessionResourceFailedToSetupListHOAck_t
*
PDUSessionResourceFailedToSetupList
;
Ngap_TargetToSource_TransparentContainer_t
*
TargetToSource_TransparentContainer
;
Ngap_CriticalityDiagnostics_t
*
CriticalityDiagnostics
;
};
}
}
...
...
src/ngap/ngapMsgs/HandoverRequiredMsg.cpp
View file @
c6dfe333
#include "HandoverRequiredMsg.hpp"
#include "HandoverRequiredMsg.hpp"
extern
"C"
{
extern
"C"
{
#include "constr_TYPE.h"
#include "constr_TYPE.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "asn_codecs.h"
#include "asn_codecs.h"
#include "per_encoder.h"
#include "per_encoder.h"
#include "per_decoder.h"
#include "per_decoder.h"
#include "constraints.h"
#include "constraints.h"
}
}
#include "TAI.hpp"
#include "TAI.hpp"
#include <iostream>
#include <iostream>
...
@@ -13,258 +13,252 @@ extern "C"{
...
@@ -13,258 +13,252 @@ extern "C"{
using
namespace
std
;
using
namespace
std
;
namespace
ngap
{
namespace
ngap
{
HandoverRequiredMsg
::
HandoverRequiredMsg
()
HandoverRequiredMsg
::
HandoverRequiredMsg
()
{
{
amfUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
ranUeNgapId
=
NULL
;
handovertype
=
NULL
;
handovertype
=
NULL
;
cause
=
NULL
;
cause
=
NULL
;
targetid
=
NULL
;
targetid
=
NULL
;
directforwardingPathAvailability
=
NULL
;
directforwardingPathAvailability
=
NULL
;
PDUSessionResourceList
=
NULL
;
PDUSessionResourceList
=
NULL
;
SourceToTarget_TransparentContainer
=
NULL
;
SourceToTarget_TransparentContainer
=
NULL
;
}
}
HandoverRequiredMsg
::~
HandoverRequiredMsg
()
{
HandoverRequiredMsg
::~
HandoverRequiredMsg
()
{}
}
unsigned
long
HandoverRequiredMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
uint32_t
HandoverRequiredMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
}
Ngap_HandoverType_t
HandoverRequiredMsg
::
getHandoverType
()
{
return
*
handovertype
;
}
Ngap_Cause_PR
HandoverRequiredMsg
::
getChoiceOfCause
()
{
return
cause
->
getChoiceOfCause
();
}
long
HandoverRequiredMsg
::
getCauseValue
()
{
return
cause
->
getValue
();
}
void
HandoverRequiredMsg
::
getGlobalRanNodeId
(
GlobalgNBId
*&
ptr
)
{
ptr
->
decodefromGlobalgNBId
(
targetid
->
choice
.
targetRANNodeID
->
globalRANNodeID
.
choice
.
globalGNB_ID
);
}
void
HandoverRequiredMsg
::
getTAI
(
TAI
*&
ptr
)
{
ptr
->
decodefromTAI
(
&
(
targetid
->
choice
.
targetRANNodeID
->
selectedTAI
));
}
OCTET_STRING_t
HandoverRequiredMsg
::
getSourceToTarget_TransparentContainer
()
{
return
*
SourceToTarget_TransparentContainer
;
}
bool
HandoverRequiredMsg
::
getPDUSessionResourceList
(
std
::
vector
<
PDUSessionResourceItem_t
>
&
list
)
{
if
(
!
PDUSessionResourceList
)
return
false
;
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
;
int
num
=
0
;
PDUSessionResourceList
->
getPDUSessionResourceListHORqd
(
m_pduSessionResourceItemHORqd
,
num
);
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
PDUSessionResourceItem_t
response
;
PDUSessionID
*
m_pDUSessionID
;
m_pduSessionResourceItemHORqd
[
i
].
getPDUSessionResourceItemHORqd
(
m_pDUSessionID
,
response
.
HandoverRequiredTransfer
);
m_pDUSessionID
->
getPDUSessionID
(
response
.
pduSessionId
);
list
.
push_back
(
response
);
}
return
true
;
}
long
HandoverRequiredMsg
::
getDirectForwardingPathAvailability
()
{
return
*
directforwardingPathAvailability
;
}
bool
HandoverRequiredMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
handoverRequiredPdu
=
ngap_msg_pdu
;
if
(
handoverRequiredPdu
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
if
(
handoverRequiredPdu
->
choice
.
initiatingMessage
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
value
.
present
==
Ngap_InitiatingMessage__value_PR_HandoverRequired
)
{
handoverRequiredIEs
=
&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
value
.
choice
.
HandoverRequired
;
}
else
{
cout
<<
"Check HandoverRequired message error!!!"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"HandoverRequired MessageType error!!!"
<<
endl
;
return
false
;
}
for
(
int
i
=
0
;
i
<
handoverRequiredIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
switch
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_AMF_UE_NGAP_ID
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_HandoverType
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_HandoverType
)
{
handovertype
=
new
Ngap_HandoverType_t
();
*
handovertype
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
HandoverType
;
}
else
{
cout
<<
"decoded ngap Handover Type IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_Cause
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_Cause
)
{
cause
=
new
Cause
();
if
(
!
cause
->
decodefromCause
(
&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
Cause
))
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_TargetID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_TargetID
)
{
targetid
=
new
Ngap_TargetID_t
();
*
targetid
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
TargetID
;
}
else
{
cout
<<
"decoded ngap TargetID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_DirectForwardingPathAvailability
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_DirectForwardingPathAvailability
)
{
directforwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
();
*
directforwardingPathAvailability
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
DirectForwardingPathAvailability
;
}
else
{
cout
<<
"decoded ngap DirectForwardingPathAvailability IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceListHORqd
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_PDUSessionResourceListHORqd
)
{
PDUSessionResourceList
=
new
PDUSessionResourceListHORqd
();
if
(
!
PDUSessionResourceList
->
decodefromPDUSessionResourceListHORqd
(
&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
PDUSessionResourceListHORqd
))
{
cout
<<
"decoded ngap PDUSessionResourceSetupListCxtRes IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap PDUSessionResourceListHORqd IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_SourceToTarget_TransparentContainer
)
{
SourceToTarget_TransparentContainer
=
new
Ngap_SourceToTarget_TransparentContainer_t
();
*
SourceToTarget_TransparentContainer
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
SourceToTarget_TransparentContainer
;
}
else
{
cout
<<
"decoded ngap SourceToTarget_TransparentContainer IE error"
<<
endl
;
return
false
;
}
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
return
true
;
}
int
HandoverRequiredMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequiredPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverRequiredPdu
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
unsigned
long
HandoverRequiredMsg
::
getAmfUeNgapId
()
{
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
uint32_t
HandoverRequiredMsg
::
getRanUeNgapId
()
{
return
ranUeNgapId
->
getRanUeNgapId
();
}
Ngap_HandoverType_t
HandoverRequiredMsg
::
getHandoverType
()
{
return
*
handovertype
;
}
Ngap_Cause_PR
HandoverRequiredMsg
::
getChoiceOfCause
()
{
return
cause
->
getChoiceOfCause
();
}
long
HandoverRequiredMsg
::
getCauseValue
()
{
return
cause
->
getValue
();
}
void
HandoverRequiredMsg
::
getGlobalRanNodeId
(
GlobalgNBId
*&
ptr
)
{
ptr
->
decodefromGlobalgNBId
(
targetid
->
choice
.
targetRANNodeID
->
globalRANNodeID
.
choice
.
globalGNB_ID
);
}
void
HandoverRequiredMsg
::
getTAI
(
TAI
*&
ptr
)
{
ptr
->
decodefromTAI
(
&
(
targetid
->
choice
.
targetRANNodeID
->
selectedTAI
));
}
OCTET_STRING_t
HandoverRequiredMsg
::
getSourceToTarget_TransparentContainer
()
{
return
*
SourceToTarget_TransparentContainer
;
}
bool
HandoverRequiredMsg
::
getPDUSessionResourceList
(
std
::
vector
<
PDUSessionResourceItem_t
>
&
list
)
{
if
(
!
PDUSessionResourceList
)
return
false
;
PDUSessionResourceItemHORqd
*
m_pduSessionResourceItemHORqd
;
int
num
=
0
;
PDUSessionResourceList
->
getPDUSessionResourceListHORqd
(
m_pduSessionResourceItemHORqd
,
num
);
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
PDUSessionResourceItem_t
response
;
PDUSessionID
*
m_pDUSessionID
;
m_pduSessionResourceItemHORqd
[
i
].
getPDUSessionResourceItemHORqd
(
m_pDUSessionID
,
response
.
HandoverRequiredTransfer
);
m_pDUSessionID
->
getPDUSessionID
(
response
.
pduSessionId
);
list
.
push_back
(
response
);
}
return
true
;
}
long
HandoverRequiredMsg
::
getDirectForwardingPathAvailability
()
{
return
*
directforwardingPathAvailability
;
}
bool
HandoverRequiredMsg
::
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
handoverRequiredPdu
=
ngap_msg_pdu
;
if
(
handoverRequiredPdu
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
if
(
handoverRequiredPdu
->
choice
.
initiatingMessage
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
procedureCode
==
Ngap_ProcedureCode_id_HandoverPreparation
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
value
.
present
==
Ngap_InitiatingMessage__value_PR_HandoverRequired
)
{
handoverRequiredIEs
=
&
handoverRequiredPdu
->
choice
.
initiatingMessage
->
value
.
choice
.
HandoverRequired
;
}
else
{
cout
<<
"Check HandoverRequired message error!!!"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"HandoverRequired MessageType error!!!"
<<
endl
;
return
false
;
}
for
(
int
i
=
0
;
i
<
handoverRequiredIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
switch
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_AMF_UE_NGAP_ID
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_HandoverType
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_HandoverType
)
{
handovertype
=
new
Ngap_HandoverType_t
();
*
handovertype
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
HandoverType
;
}
else
{
cout
<<
"decoded ngap Handover Type IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_Cause
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_Cause
)
{
cause
=
new
Cause
();
if
(
!
cause
->
decodefromCause
(
&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
Cause
))
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap Cause IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_TargetID
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_TargetID
)
{
targetid
=
new
Ngap_TargetID_t
();
*
targetid
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
TargetID
;
}
else
{
cout
<<
"decoded ngap TargetID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_DirectForwardingPathAvailability
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_ignore
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_DirectForwardingPathAvailability
)
{
directforwardingPathAvailability
=
new
Ngap_DirectForwardingPathAvailability_t
();
*
directforwardingPathAvailability
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
DirectForwardingPathAvailability
;
}
else
{
cout
<<
"decoded ngap DirectForwardingPathAvailability IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_PDUSessionResourceListHORqd
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_PDUSessionResourceListHORqd
)
{
PDUSessionResourceList
=
new
PDUSessionResourceListHORqd
();
if
(
!
PDUSessionResourceList
->
decodefromPDUSessionResourceListHORqd
(
&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
PDUSessionResourceListHORqd
))
{
cout
<<
"decoded ngap PDUSessionResourceSetupListCxtRes IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap PDUSessionResourceListHORqd IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_SourceToTarget_TransparentContainer
:
{
if
(
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_HandoverRequiredIEs__value_PR_SourceToTarget_TransparentContainer
)
{
SourceToTarget_TransparentContainer
=
new
Ngap_SourceToTarget_TransparentContainer_t
();
*
SourceToTarget_TransparentContainer
=
handoverRequiredIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
SourceToTarget_TransparentContainer
;
}
else
{
cout
<<
"decoded ngap SourceToTarget_TransparentContainer IE error"
<<
endl
;
return
false
;
}
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
return
true
;
}
int
HandoverRequiredMsg
::
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
)
{
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
handoverRequiredPdu
);
asn_enc_rval_t
er
=
aper_encode_to_buffer
(
&
asn_DEF_Ngap_NGAP_PDU
,
NULL
,
handoverRequiredPdu
,
buf
,
buf_size
);
cout
<<
"er.encoded("
<<
er
.
encoded
<<
")"
<<
endl
;
return
er
.
encoded
;
}
}
}
src/ngap/ngapMsgs/HandoverRequiredMsg.hpp
View file @
c6dfe333
...
@@ -11,51 +11,49 @@
...
@@ -11,51 +11,49 @@
#include "AMF-UE-NGAP-ID.hpp"
#include "AMF-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "Cause.hpp"
#include "Cause.hpp"
extern
"C"
{
extern
"C"
{
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_ProtocolIE-Field.h"
#include "Ngap_NGSetupRequest.h"
#include "Ngap_NGSetupRequest.h"
}
}
#include "TAI.hpp"
#include "TAI.hpp"
#include "NgapIEsStruct.hpp"
#include "NgapIEsStruct.hpp"
#include "PDUSessionResourceListHORqd.hpp"
#include "PDUSessionResourceListHORqd.hpp"
namespace
ngap
{
namespace
ngap
{
class
HandoverRequiredMsg
{
public:
class
HandoverRequiredMsg
{
HandoverRequiredMsg
();
public:
virtual
~
HandoverRequiredMsg
();
HandoverRequiredMsg
();
virtual
~
HandoverRequiredMsg
();
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
Ngap_HandoverType_t
getHandoverType
();
Ngap_Cause_PR
getChoiceOfCause
();
Ngap_HandoverType_t
getHandoverType
();
long
getCauseValue
();
Ngap_Cause_PR
getChoiceOfCause
();
OCTET_STRING_t
getSourceToTarget_TransparentContainer
();
long
getCauseValue
();
void
getGlobalRanNodeId
(
GlobalgNBId
*&
ptr
);
OCTET_STRING_t
getSourceToTarget_TransparentContainer
();
void
getTAI
(
TAI
*&
ptr
);
void
getGlobalRanNodeId
(
GlobalgNBId
*&
ptr
);
bool
getPDUSessionResourceList
(
std
::
vector
<
PDUSessionResourceItem_t
>
&
list
);
void
getTAI
(
TAI
*&
ptr
);
long
getDirectForwardingPathAvailability
();
bool
getPDUSessionResourceList
(
std
::
vector
<
PDUSessionResourceItem_t
>
&
list
);
long
getDirectForwardingPathAvailability
();
private:
Ngap_NGAP_PDU_t
*
handoverRequiredPdu
;
private:
Ngap_HandoverRequired_t
*
handoverRequiredIEs
;
Ngap_NGAP_PDU_t
*
handoverRequiredPdu
;
/***************** for decoding ****************/
Ngap_HandoverRequired_t
*
handoverRequiredIEs
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
/***************** for decoding ****************/
RAN_UE_NGAP_ID
*
ranUeNgapId
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
Ngap_HandoverType_t
*
handovertype
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
Cause
*
cause
;
Ngap_HandoverType_t
*
handovertype
;
Ngap_TargetID_t
*
targetid
;
Cause
*
cause
;
Ngap_DirectForwardingPathAvailability_t
*
directforwardingPathAvailability
;
Ngap_TargetID_t
*
targetid
;
PDUSessionResourceListHORqd
*
PDUSessionResourceList
;
Ngap_DirectForwardingPathAvailability_t
*
directforwardingPathAvailability
;
Ngap_SourceToTarget_TransparentContainer_t
*
SourceToTarget_TransparentContainer
;
PDUSessionResourceListHORqd
*
PDUSessionResourceList
;
Ngap_SourceToTarget_TransparentContainer_t
*
SourceToTarget_TransparentContainer
;
};
};
}
}
...
...
src/ngap/ngapMsgs/UplinkRANStatusTransfer.cpp
View file @
c6dfe333
...
@@ -31,114 +31,119 @@
...
@@ -31,114 +31,119 @@
#include <vector>
#include <vector>
using
namespace
std
;
using
namespace
std
;
namespace
ngap
namespace
ngap
{
{
UplinkRANStatusTransfer
::
UplinkRANStatusTransfer
()
{
UplinkRANStatusTransfer
::
UplinkRANStatusTransfer
()
amfUeNgapId
=
NULL
;
{
ranUeNgapId
=
NULL
;
amfUeNgapId
=
NULL
;
ranStatusTransfer_TransparentContainer
=
NULL
;
ranUeNgapId
=
NULL
;
}
ranStatusTransfer_TransparentContainer
=
NULL
;
UplinkRANStatusTransfer
::~
UplinkRANStatusTransfer
()
{
}
}
UplinkRANStatusTransfer
::~
UplinkRANStatusTransfer
()
{}
unsigned
long
UplinkRANStatusTransfer
::
getAmfUeNgapId
()
{
unsigned
long
UplinkRANStatusTransfer
::
getAmfUeNgapId
()
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
{
}
return
amfUeNgapId
->
getAMF_UE_NGAP_ID
();
}
uint32_t
UplinkRANStatusTransfer
::
getRanUeNgapId
()
uint32_t
UplinkRANStatusTransfer
::
getRanUeNgapId
()
{
{
return
ranUeNgapId
->
getRanUeNgapId
();
return
ranUeNgapId
->
getRanUeNgapId
();
}
}
void
UplinkRANStatusTransfer
::
getRANStatusTransfer_TransparentContainer
(
void
UplinkRANStatusTransfer
::
getRANStatusTransfer_TransparentContainer
(
RANStatusTransferTransparentContainer
*&
ranstatustransfer_transparentcontainer
)
RANStatusTransferTransparentContainer
*&
ranstatustransfer_transparentcontainer
)
{
{
ranstatustransfer_transparentcontainer
=
ranstatustransfer_transparentcontainer
=
ranStatusTransfer_TransparentContainer
;
ranStatusTransfer_TransparentContainer
;
}
bool
UplinkRANStatusTransfer
::
defromPDU
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
{
UplinkRANStatusTransferPDU
=
ngap_msg_pdu
;
if
(
UplinkRANStatusTransferPDU
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
{
if
(
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
procedureCode
==
Ngap_ProcedureCode_id_UplinkRANStatusTransfer
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
criticality
==
Ngap_Criticality_ignore
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
value
.
present
==
Ngap_InitiatingMessage__value_PR_UplinkRANStatusTransfer
)
{
UplinkRANStatusTransferIEs
=
&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
value
.
choice
.
UplinkRANStatusTransfer
;
}
else
{
cout
<<
"Check uplinkranstatustransfer message error!!!"
<<
endl
;
return
false
;
}
}
bool
UplinkRANStatusTransfer
::
defromPDU
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
)
}
else
{
{
cout
<<
"uplinkranstatustransfer message type error"
<<
endl
;
UplinkRANStatusTransferPDU
=
ngap_msg_pdu
;
return
false
;
if
(
UplinkRANStatusTransferPDU
->
present
==
Ngap_NGAP_PDU_PR_initiatingMessage
)
}
{
for
(
int
i
=
0
;
i
<
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
count
;
i
++
)
{
if
(
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
procedureCode
==
Ngap_ProcedureCode_id_UplinkRANStatusTransfer
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
criticality
==
Ngap_Criticality_ignore
&&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
value
.
present
==
Ngap_InitiatingMessage__value_PR_UplinkRANStatusTransfer
)
switch
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
{
{
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
{
UplinkRANStatusTransferIEs
=
&
UplinkRANStatusTransferPDU
->
choice
.
initiatingMessage
->
value
.
choice
.
UplinkRANStatusTransfer
;
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
}
==
Ngap_Criticality_reject
else
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
{
.
present
cout
<<
"Check uplinkranstatustransfer message error!!!"
<<
endl
;
==
Ngap_UplinkRANStatusTransferIEs__value_PR_AMF_UE_NGAP_ID
)
{
return
false
;
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
}
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
}
{
break
;
cout
<<
"uplinkranstatustransfer message type error"
<<
endl
;
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
{
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkRANStatusTransferIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
for
(
int
i
=
0
;
i
<
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
count
;
i
++
)
}
{
break
;
switch
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
id
)
case
Ngap_ProtocolIE_ID_id_RANStatusTransfer_TransparentContainer
:
{
{
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
case
Ngap_ProtocolIE_ID_id_AMF_UE_NGAP_ID
:
==
Ngap_Criticality_reject
{
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkRANStatusTransferIEs__value_PR_AMF_UE_NGAP_ID
)
.
present
{
==
Ngap_UplinkRANStatusTransferIEs__value_PR_RANStatusTransfer_TransparentContainer
)
{
amfUeNgapId
=
new
AMF_UE_NGAP_ID
();
ranStatusTransfer_TransparentContainer
=
if
(
!
amfUeNgapId
->
decodefromAMF_UE_NGAP_ID
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
AMF_UE_NGAP_ID
))
new
RANStatusTransferTransparentContainer
();
{
if
(
!
ranStatusTransfer_TransparentContainer
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
->
decoderanstatustransfer_transparentcontainer
(
return
false
;
&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
}
.
choice
.
RANStatusTransfer_TransparentContainer
))
{
}
cout
<<
"decoded ngap ranStatusTransfer_TransparentContainer error"
else
<<
endl
;
{
return
false
;
cout
<<
"decoded ngap AMF_UE_NGAP_ID IE error"
<<
endl
;
}
return
false
;
cout
<<
"can get the buffer of RANStatusTransfer_TransparentContainer"
}
<<
endl
;
}
}
else
{
break
;
cout
case
Ngap_ProtocolIE_ID_id_RAN_UE_NGAP_ID
:
<<
"cann't get the buffer of RANStatusTransfer_TransparentContainer"
{
<<
endl
;
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkRANStatusTransferIEs__value_PR_RAN_UE_NGAP_ID
)
{
ranUeNgapId
=
new
RAN_UE_NGAP_ID
();
if
(
!
ranUeNgapId
->
decodefromRAN_UE_NGAP_ID
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RAN_UE_NGAP_ID
))
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
else
{
cout
<<
"decoded ngap RAN_UE_NGAP_ID IE error"
<<
endl
;
return
false
;
}
}
break
;
case
Ngap_ProtocolIE_ID_id_RANStatusTransfer_TransparentContainer
:
{
if
(
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
criticality
==
Ngap_Criticality_reject
&&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
present
==
Ngap_UplinkRANStatusTransferIEs__value_PR_RANStatusTransfer_TransparentContainer
)
{
ranStatusTransfer_TransparentContainer
=
new
RANStatusTransferTransparentContainer
();
if
(
!
ranStatusTransfer_TransparentContainer
->
decoderanstatustransfer_transparentcontainer
(
&
UplinkRANStatusTransferIEs
->
protocolIEs
.
list
.
array
[
i
]
->
value
.
choice
.
RANStatusTransfer_TransparentContainer
))
{
cout
<<
"decoded ngap ranStatusTransfer_TransparentContainer error"
<<
endl
;
return
false
;
}
cout
<<
"can get the buffer of RANStatusTransfer_TransparentContainer"
<<
endl
;
}
else
{
cout
<<
"cann't get the buffer of RANStatusTransfer_TransparentContainer"
<<
endl
;
}
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
}
return
true
;
}
break
;
default:
{
cout
<<
"decoded ngap message pdu error"
<<
endl
;
return
false
;
}
}
}
}
return
true
;
}
}
// namespace ngap
}
// namespace ngap
src/ngap/ngapMsgs/UplinkRANStatusTransfer.hpp
View file @
c6dfe333
...
@@ -31,8 +31,7 @@
...
@@ -31,8 +31,7 @@
#include "RAN-UE-NGAP-ID.hpp"
#include "RAN-UE-NGAP-ID.hpp"
#include "NgapIEsStruct.hpp"
#include "NgapIEsStruct.hpp"
#include "RANStatusTransferTransparentContainer.hpp"
#include "RANStatusTransferTransparentContainer.hpp"
extern
"C"
extern
"C"
{
{
#include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_UplinkRANStatusTransfer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_RANStatusTransfer-TransparentContainer.h"
#include "Ngap_NGAP-PDU.h"
#include "Ngap_NGAP-PDU.h"
...
@@ -41,23 +40,23 @@ extern "C"
...
@@ -41,23 +40,23 @@ extern "C"
}
}
namespace
ngap
namespace
ngap
{
{
class
UplinkRANStatusTransfer
class
UplinkRANStatusTransfer
{
{
public:
public:
UplinkRANStatusTransfer
();
UplinkRANStatusTransfer
();
virtual
~
UplinkRANStatusTransfer
();
virtual
~
UplinkRANStatusTransfer
();
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
unsigned
long
getAmfUeNgapId
();
//return -1;(不存在)
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
uint32_t
getRanUeNgapId
();
//return -1;(不存在)
void
getRANStatusTransfer_TransparentContainer
(
RANStatusTransferTransparentContainer
*&
ranstatustransfer_transparentcontainer
);
void
getRANStatusTransfer_TransparentContainer
(
RANStatusTransferTransparentContainer
*&
ranstatustransfer_transparentcontainer
);
bool
defromPDU
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
bool
defromPDU
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
private:
private:
Ngap_NGAP_PDU_t
*
UplinkRANStatusTransferPDU
;
Ngap_NGAP_PDU_t
*
UplinkRANStatusTransferPDU
;
Ngap_UplinkRANStatusTransfer_t
*
UplinkRANStatusTransferIEs
;
Ngap_UplinkRANStatusTransfer_t
*
UplinkRANStatusTransferIEs
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
AMF_UE_NGAP_ID
*
amfUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
RAN_UE_NGAP_ID
*
ranUeNgapId
;
RANStatusTransferTransparentContainer
*
ranStatusTransfer_TransparentContainer
;
RANStatusTransferTransparentContainer
*
ranStatusTransfer_TransparentContainer
;
};
};
}
// namespace ngap
}
// namespace ngap
#endif
#endif
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