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