Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-AMF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-AMF
Commits
977790c3
Commit
977790c3
authored
Jul 16, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up N2 Handover procedure
parent
96e00243
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
58 deletions
+62
-58
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+49
-45
src/amf-app/amf_n2.hpp
src/amf-app/amf_n2.hpp
+1
-1
src/itti/itti_msg.hpp
src/itti/itti_msg.hpp
+1
-1
src/itti/msgs/itti_msg_n2.hpp
src/itti/msgs/itti_msg_n2.hpp
+4
-4
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+7
-7
No files found.
src/amf-app/amf_n2.cpp
View file @
977790c3
...
@@ -186,11 +186,11 @@ void amf_n2_task(void* args_p) {
...
@@ -186,11 +186,11 @@ void amf_n2_task(void* args_p) {
itti_handover_notify
*
m
=
dynamic_cast
<
itti_handover_notify
*>
(
msg
);
itti_handover_notify
*
m
=
dynamic_cast
<
itti_handover_notify
*>
(
msg
);
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
}
break
;
}
break
;
case
UPLINK
RANSTATUS
TRANSFER
:
{
case
UPLINK
_RAN_STATUS_
TRANSFER
:
{
Logger
::
amf_n2
().
info
(
Logger
::
amf_n2
().
info
(
"Received UPLINK
RANSTATUS
TRANSFER message,handling"
);
"Received UPLINK
_RAN_STATUS_
TRANSFER message,handling"
);
itti_uplink
ranstatsu
transfer
*
m
=
itti_uplink
_ran_status_
transfer
*
m
=
dynamic_cast
<
itti_uplink
ranstatsu
transfer
*>
(
msg
);
dynamic_cast
<
itti_uplink
_ran_status_
transfer
*>
(
msg
);
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
amf_n2_inst
->
handle_itti_message
(
ref
(
*
m
));
}
break
;
}
break
;
default:
default:
...
@@ -1113,7 +1113,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1113,7 +1113,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
plmn
->
getMnc
(
mnc
);
plmn
->
getMnc
(
mnc
);
Logger
::
amf_n2
().
debug
(
Logger
::
amf_n2
().
debug
(
"Handover
r
equired: Target ID GlobalRanNodeID PLmn (mcc: %s, mnc: %s, "
"Handover
R
equired: Target ID GlobalRanNodeID PLmn (mcc: %s, mnc: %s, "
"gnbid: %ld)"
,
"gnbid: %ld)"
,
mcc
.
c_str
(),
mnc
.
c_str
(),
gnbid
->
getValue
());
mcc
.
c_str
(),
mnc
.
c_str
(),
gnbid
->
getValue
());
...
@@ -1126,7 +1126,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1126,7 +1126,7 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
plmn
->
getMcc
(
mccOfselectTAI
);
plmn
->
getMcc
(
mccOfselectTAI
);
plmn
->
getMnc
(
mncOfselectTAI
);
plmn
->
getMnc
(
mncOfselectTAI
);
Logger
::
amf_n2
().
debug
(
Logger
::
amf_n2
().
debug
(
"Handover required:Target ID selectedTAI PLmn
=mcc%s mnc%s tac=%x
"
,
"Handover required:Target ID selectedTAI PLmn
(mcc %s, mnc %s, tac %x)
"
,
mccOfselectTAI
.
c_str
(),
mncOfselectTAI
.
c_str
(),
tac
->
getTac
());
mccOfselectTAI
.
c_str
(),
mncOfselectTAI
.
c_str
(),
tac
->
getTac
());
std
::
vector
<
PDUSessionResourceItem_t
>
List_HORqd
;
std
::
vector
<
PDUSessionResourceItem_t
>
List_HORqd
;
...
@@ -1140,26 +1140,36 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1140,26 +1140,36 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
sourceTotarget
=
sourceTotarget
=
itti_msg
.
handoverReq
->
getSourceToTarget_TransparentContainer
();
itti_msg
.
handoverReq
->
getSourceToTarget_TransparentContainer
();
// TODO: T-AMF selection, for now use the same AMF
// TODO: Send PDU Session Update SM Context Request to SMF
// Create HandoverRequest message to be sent to target gNB
// Create HandoverRequest message to be sent to target gNB
std
::
unique_ptr
<
HandoverRequest
>
handoverrequest
=
std
::
unique_ptr
<
HandoverRequest
>
handover
_
request
=
std
::
make_unique
<
HandoverRequest
>
();
std
::
make_unique
<
HandoverRequest
>
();
handoverrequest
->
setMessageType
();
handover
_
request
->
setMessageType
();
handoverrequest
->
setAmfUeNgapId
(
amf_ue_ngap_id
);
handover
_
request
->
setAmfUeNgapId
(
amf_ue_ngap_id
);
handoverrequest
->
setHandoverType
(
0
);
handover
_
request
->
setHandoverType
(
0
);
handoverrequest
->
setCause
(
handover
_
request
->
setCause
(
Ngap_Cause_PR_radioNetwork
,
Ngap_Cause_PR_radioNetwork
,
Ngap_CauseRadioNetwork_handover_desirable_for_radio_reason
);
Ngap_CauseRadioNetwork_handover_desirable_for_radio_reason
);
handoverrequest
->
setUEAggregateMaximumBitRate
(
handover
_
request
->
setUEAggregateMaximumBitRate
(
300000000
,
100000000
);
// TODO: remove hardcoded values
300000000
,
100000000
);
// TODO: remove hardcoded values
handoverrequest
->
setUESecurityCapabilities
(
handover
_
request
->
setUESecurityCapabilities
(
0xe000
,
0xe000
,
0xe000
,
0xe000
);
// TODO: remove hardcoded values
0xe000
,
0xe000
,
0xe000
,
0xe000
);
// TODO: remove hardcoded values
S_NSSAI
s_nssai
=
{};
// Allowed NSSAI
s_nssai
.
setSst
(
"01"
);
// TODO: remove hardcoded values
std
::
vector
<
S_NSSAI
>
Allowed_Nssai
;
std
::
vector
<
S_NSSAI
>
Allowed_Nssai
;
Allowed_Nssai
.
push_back
(
s_nssai
);
for
(
int
i
=
0
;
i
<
amf_cfg
.
plmn_list
.
size
();
i
++
)
{
for
(
int
j
=
0
;
j
<
amf_cfg
.
plmn_list
[
i
].
slice_list
.
size
();
j
++
)
{
SliceSupportItem_t
s_tmp
;
S_NSSAI
s_nssai
=
{};
s_nssai
.
setSst
(
amf_cfg
.
plmn_list
[
i
].
slice_list
[
j
].
sST
);
s_nssai
.
setSd
(
amf_cfg
.
plmn_list
[
i
].
slice_list
[
j
].
sD
);
Allowed_Nssai
.
push_back
(
s_nssai
);
}
}
Guami_t
guami
;
Guami_t
guami
=
{}
;
guami
.
mcc
=
amf_cfg
.
guami
.
mcc
;
guami
.
mcc
=
amf_cfg
.
guami
.
mcc
;
guami
.
mnc
=
amf_cfg
.
guami
.
mnc
;
guami
.
mnc
=
amf_cfg
.
guami
.
mnc
;
guami
.
regionID
=
amf_cfg
.
guami
.
regionID
;
guami
.
regionID
=
amf_cfg
.
guami
.
regionID
;
...
@@ -1180,12 +1190,12 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1180,12 +1190,12 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
uint8_t
*
kamf
=
nc
.
get
()
->
kamf
[
secu
->
vector_pointer
];
uint8_t
*
kamf
=
nc
.
get
()
->
kamf
[
secu
->
vector_pointer
];
uint8_t
kgnb
[
32
];
uint8_t
kgnb
[
32
];
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
uint32_t
ulcount
=
secu
->
ul_count
.
seq_num
|
(
secu
->
ul_count
.
overflow
<<
8
);
Logger
::
amf_n1
().
debug
(
"
uplink count
(%d)"
,
secu
->
ul_count
.
seq_num
);
Logger
::
amf_n1
().
debug
(
"
Uplink count
(%d)"
,
secu
->
ul_count
.
seq_num
);
uint8_t
knh
[
32
];
uint8_t
knh
[
32
];
Authentication_5gaka
::
handover_ncc_derive_knh
(
Authentication_5gaka
::
handover_ncc_derive_knh
(
ulcount
,
0x01
,
kamf
,
kgnb
,
knh
,
unc
.
get
()
->
ncc
);
ulcount
,
0x01
,
kamf
,
kgnb
,
knh
,
unc
.
get
()
->
ncc
);
bstring
knh_bs
=
blk2bstr
(
knh
,
32
);
bstring
knh_bs
=
blk2bstr
(
knh
,
32
);
handoverrequest
->
setSecurityContext
(
handover
_
request
->
setSecurityContext
(
unc
.
get
()
->
ncc
/*NCC count*/
,
(
uint8_t
*
)
bdata
(
knh_bs
));
unc
.
get
()
->
ncc
/*NCC count*/
,
(
uint8_t
*
)
bdata
(
knh_bs
));
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
...
@@ -1220,13 +1230,13 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
...
@@ -1220,13 +1230,13 @@ bool amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
}
}
}
}
handoverrequest
->
setPduSessionResourceSetupList
(
list
);
handover
_
request
->
setPduSessionResourceSetupList
(
list
);
handoverrequest
->
setAllowedNSSAI
(
Allowed_Nssai
);
handover
_
request
->
setAllowedNSSAI
(
Allowed_Nssai
);
handoverrequest
->
setSourceToTarget_TransparentContainer
(
sourceTotarget
);
handover
_
request
->
setSourceToTarget_TransparentContainer
(
sourceTotarget
);
handoverrequest
->
setMobilityRestrictionList
(
m_plmnId
);
handover
_
request
->
setMobilityRestrictionList
(
m_plmnId
);
handoverrequest
->
setGUAMI
(
m_plmnId
,
m_aMFRegionID
,
m_aMFSetID
,
m_aMFPointer
);
handover
_
request
->
setGUAMI
(
m_plmnId
,
m_aMFRegionID
,
m_aMFSetID
,
m_aMFPointer
);
uint8_t
buffer
[
20240
];
uint8_t
buffer
[
20240
];
int
encoded_size
=
handoverrequest
->
encode2buffer
(
buffer
,
20240
);
int
encoded_size
=
handover
_
request
->
encode2buffer
(
buffer
,
20240
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
std
::
shared_ptr
<
gnb_context
>
gc_target
=
{};
std
::
shared_ptr
<
gnb_context
>
gc_target
=
{};
gc_target
=
gnb_id_2_gnb_context
(
gnbid
->
getValue
());
gc_target
=
gnb_id_2_gnb_context
(
gnbid
->
getValue
());
...
@@ -1247,7 +1257,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1247,7 +1257,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
is_assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
))
{
if
(
!
is_assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
))
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
"gNB with assoc_id(%d) is illegal"
,
itti_msg
.
assoc_id
);
"gNB with assoc_id
(%d) is illegal"
,
itti_msg
.
assoc_id
);
return
;
return
;
}
}
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
gc
=
assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
);
...
@@ -1264,7 +1274,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1264,7 +1274,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>
list
;
std
::
vector
<
PDUSessionResourceAdmittedItem_t
>
list
;
if
(
!
itti_msg
.
handoverrequestAck
->
getPDUSessionResourceAdmittedList
(
list
))
{
if
(
!
itti_msg
.
handoverrequestAck
->
getPDUSessionResourceAdmittedList
(
list
))
{
Logger
::
ngap
().
error
(
Logger
::
ngap
().
error
(
"Decoding HandoverRequestACK getPDUSessionResourceList IE
error"
);
"Decoding HandoverRequestACK getPDUSessionResourceList IE error"
);
return
;
return
;
}
}
...
@@ -1274,14 +1284,14 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1274,14 +1284,14 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
PDUSessionResourceHandoverRequestAckTransfer
*
PDUHandoverRequestAckTransfer
=
PDUSessionResourceHandoverRequestAckTransfer
*
PDUHandoverRequestAckTransfer
=
new
PDUSessionResourceHandoverRequestAckTransfer
();
new
PDUSessionResourceHandoverRequestAckTransfer
();
uint8_t
buf
[
1024
];
uint8_t
buf
[
BUFFER_SIZE_
1024
];
memcpy
(
memcpy
(
buf
,
list
[
0
].
handoverRequestAcknowledgeTransfer
.
buf
,
buf
,
list
[
0
].
handoverRequestAcknowledgeTransfer
.
buf
,
list
[
0
].
handoverRequestAcknowledgeTransfer
.
size
);
list
[
0
].
handoverRequestAcknowledgeTransfer
.
size
);
if
(
!
PDUHandoverRequestAckTransfer
->
decodefromHandoverRequestAckTransfer
(
if
(
!
PDUHandoverRequestAckTransfer
->
decodefromHandoverRequestAckTransfer
(
buf
,
list
[
0
].
handoverRequestAcknowledgeTransfer
.
size
))
{
buf
,
list
[
0
].
handoverRequestAcknowledgeTransfer
.
size
))
{
Logger
::
ngap
().
error
(
"Decode
handoverrequestackt
ransfer error"
);
Logger
::
ngap
().
error
(
"Decode
Handover Request Acknowledge T
ransfer error"
);
return
;
return
;
}
}
...
@@ -1314,12 +1324,10 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1314,12 +1324,10 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std
::
shared_ptr
<
nas_context
>
nc
=
std
::
shared_ptr
<
nas_context
>
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
handover_list
;
std
::
vector
<
PDUSessionResourceHandoverItem_t
>
handover_list
;
PDUSessionResourceHandoverItem_t
item
=
{};
PDUSessionResourceHandoverItem_t
item
=
{};
// set pdu id
item
.
pduSessionId
=
list
[
0
].
pduSessionId
;
item
.
pduSessionId
=
list
[
0
].
pduSessionId
;
// qosFLowtobeforwardedlist
// set qosFLowtobeforwardedlist
std
::
vector
<
QosFlowToBeForwardedItem_t
>
forward_list
;
std
::
vector
<
QosFlowToBeForwardedItem_t
>
forward_list
;
QosFlowToBeForwardedItem_t
forward_item
;
QosFlowToBeForwardedItem_t
forward_item
;
forward_item
.
QFI
=
qosflowidentifiervalue
;
forward_item
.
QFI
=
qosflowidentifiervalue
;
...
@@ -1336,7 +1344,6 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1336,7 +1344,6 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
uptlinfo
.
gtp_teid
=
teid
;
uptlinfo
.
gtp_teid
=
teid
;
uptlinfo
.
ip_address
=
n3_ip_address
;
uptlinfo
.
ip_address
=
n3_ip_address
;
handovercommandtransfer
->
setUPTransportLayerInformation
(
uptlinfo
);
handovercommandtransfer
->
setUPTransportLayerInformation
(
uptlinfo
);
// handovercommand->setTargetToSource_TransparentContainer(targetTosource);
uint8_t
buffer2
[
500
];
uint8_t
buffer2
[
500
];
int
encoded_size2
=
int
encoded_size2
=
handovercommandtransfer
->
encodePDUSessionResourceHandoverCommandTransfer
(
handovercommandtransfer
->
encodePDUSessionResourceHandoverCommandTransfer
(
...
@@ -1349,8 +1356,8 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
...
@@ -1349,8 +1356,8 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
handovercommand
->
setPduSessionResourceHandoverList
(
handover_list
);
handovercommand
->
setPduSessionResourceHandoverList
(
handover_list
);
handovercommand
->
setTargetToSource_TransparentContainer
(
targetTosource
);
handovercommand
->
setTargetToSource_TransparentContainer
(
targetTosource
);
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
// setPduSessionResourceHandoverList_PDYSessionID_handovercommandtransfer-end
uint8_t
buffer
[
10240
];
uint8_t
buffer
[
BUFFER_SIZE_1024
];
int
encoded_size
=
handovercommand
->
encode2buffer
(
buffer
,
10240
);
int
encoded_size
=
handovercommand
->
encode2buffer
(
buffer
,
BUFFER_SIZE_1024
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
/*
/*
...
@@ -1416,13 +1423,12 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
...
@@ -1416,13 +1423,12 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
ueContextReleaseCommand
->
setCauseRadioNetwork
(
ueContextReleaseCommand
->
setCauseRadioNetwork
(
Ngap_CauseRadioNetwork_successful_handover
);
Ngap_CauseRadioNetwork_successful_handover
);
uint8_t
buffer
[
10240
];
// TODO: remove hardcoded value
uint8_t
buffer
[
BUFFER_SIZE_1024
];
int
encoded_size
=
ueContextReleaseCommand
->
encode2buffer
(
buffer
,
10240
);
int
encoded_size
=
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
ueContextReleaseCommand
->
encode2buffer
(
buffer
,
BUFFER_SIZE_1024
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
std
::
shared_ptr
<
nas_context
>
nc
=
std
::
shared_ptr
<
nas_context
>
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
// std::shared_ptr<ue_ngap_context> ngc =
// ran_ue_id_2_ue_ngap_context(nc.get()->ran_ue_ngap_id);
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
gnb_assoc_id
,
0
,
&
b
);
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
gnb_assoc_id
,
0
,
&
b
);
/*std::shared_ptr<nas_context> nc =
/*std::shared_ptr<nas_context> nc =
...
@@ -1450,10 +1456,10 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
...
@@ -1450,10 +1456,10 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
amf_n2
::
handle_itti_message
(
itti_uplink
ranstatsu
transfer
&
itti_msg
)
{
void
amf_n2
::
handle_itti_message
(
itti_uplink
_ran_status_
transfer
&
itti_msg
)
{
unsigned
long
amf_ue_ngap_id
=
itti_msg
.
uplinkrantransfer
->
getAmfUeNgapId
();
unsigned
long
amf_ue_ngap_id
=
itti_msg
.
uplinkrantransfer
->
getAmfUeNgapId
();
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
"
uplinkranstatustransfer amf_ue_ngap_id
(%d)"
,
amf_ue_ngap_id
);
"
Uplink RAN Status Transfer amf_ue_ngap_id
(%d)"
,
amf_ue_ngap_id
);
if
(
!
is_assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
))
{
if
(
!
is_assoc_id_2_gnb_context
(
itti_msg
.
assoc_id
))
{
Logger
::
amf_n2
().
error
(
Logger
::
amf_n2
().
error
(
"gNB with assoc_id (%d) is illegal"
,
itti_msg
.
assoc_id
);
"gNB with assoc_id (%d) is illegal"
,
itti_msg
.
assoc_id
);
...
@@ -1513,8 +1519,6 @@ void amf_n2::handle_itti_message(itti_uplinkranstatsutransfer& itti_msg) {
...
@@ -1513,8 +1519,6 @@ void amf_n2::handle_itti_message(itti_uplinkranstatsutransfer& itti_msg) {
uint8_t
buffer
[
1024
];
uint8_t
buffer
[
1024
];
int
encode_size
=
downLinkranstatustransfer
->
encodetobuffer
(
buffer
,
1024
);
int
encode_size
=
downLinkranstatustransfer
->
encodetobuffer
(
buffer
,
1024
);
bstring
b
=
blk2bstr
(
buffer
,
encode_size
);
bstring
b
=
blk2bstr
(
buffer
,
encode_size
);
// std::shared_ptr<ue_ngap_context> ngc =
// ran_ue_id_2_ue_ngap_context(unc.get()->target_ran_ue_ngap_id );
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
target_gnb_assoc_id
,
0
,
&
b
);
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
target_gnb_assoc_id
,
0
,
&
b
);
}
}
...
...
src/amf-app/amf_n2.hpp
View file @
977790c3
...
@@ -61,7 +61,7 @@ class amf_n2 : public ngap::ngap_app {
...
@@ -61,7 +61,7 @@ class amf_n2 : public ngap::ngap_app {
bool
handle_itti_message
(
itti_handover_required
&
itti_msg
);
bool
handle_itti_message
(
itti_handover_required
&
itti_msg
);
void
handle_itti_message
(
itti_handover_request_Ack
&
itti_msg
);
void
handle_itti_message
(
itti_handover_request_Ack
&
itti_msg
);
void
handle_itti_message
(
itti_handover_notify
&
itti_msg
);
void
handle_itti_message
(
itti_handover_notify
&
itti_msg
);
void
handle_itti_message
(
itti_uplink
ranstatsu
transfer
&
itti_msg
);
void
handle_itti_message
(
itti_uplink
_ran_status_
transfer
&
itti_msg
);
void
send_handover_preparation_failure
(
void
send_handover_preparation_failure
(
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
const
unsigned
long
amf_ue_ngap_id
,
const
uint32_t
ran_ue_ngap_id
,
const
sctp_assoc_id_t
&
gnb_assoc_id
);
const
sctp_assoc_id_t
&
gnb_assoc_id
);
...
...
src/itti/itti_msg.hpp
View file @
977790c3
...
@@ -89,7 +89,7 @@ typedef enum {
...
@@ -89,7 +89,7 @@ typedef enum {
HANDOVER_REQUIRED
,
HANDOVER_REQUIRED
,
HANDOVER_REQUEST_ACK
,
HANDOVER_REQUEST_ACK
,
HANDOVER_NOTIFY
,
HANDOVER_NOTIFY
,
UPLINK
RANSTATUS
TRANSFER
,
UPLINK
_RAN_STATUS_
TRANSFER
,
PDU_SESS_RES_SET_RESP
,
PDU_SESS_RES_SET_RESP
,
TIME_OUT
,
TIME_OUT
,
HEALTH_PING
,
HEALTH_PING
,
...
...
src/itti/msgs/itti_msg_n2.hpp
View file @
977790c3
...
@@ -238,12 +238,12 @@ class itti_handover_notify : public itti_msg_n2 {
...
@@ -238,12 +238,12 @@ class itti_handover_notify : public itti_msg_n2 {
HandoverNotifyMsg
*
handovernotify
;
HandoverNotifyMsg
*
handovernotify
;
};
};
class
itti_uplink
ranstatsu
transfer
:
public
itti_msg_n2
{
class
itti_uplink
_ran_status_
transfer
:
public
itti_msg_n2
{
public:
public:
itti_uplink
ranstatsu
transfer
(
itti_uplink
_ran_status_
transfer
(
const
task_id_t
origin
,
const
task_id_t
destination
)
const
task_id_t
origin
,
const
task_id_t
destination
)
:
itti_msg_n2
(
UPLINK
RANSTATUS
TRANSFER
,
origin
,
destination
)
{}
:
itti_msg_n2
(
UPLINK
_RAN_STATUS_
TRANSFER
,
origin
,
destination
)
{}
itti_uplink
ranstatsutransfer
(
const
itti_uplinkranstatsu
transfer
&
i
)
itti_uplink
_ran_status_transfer
(
const
itti_uplink_ran_status_
transfer
&
i
)
:
itti_msg_n2
(
i
)
{}
:
itti_msg_n2
(
i
)
{}
UplinkRANStatusTransfer
*
uplinkrantransfer
;
UplinkRANStatusTransfer
*
uplinkrantransfer
;
};
};
...
...
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
977790c3
...
@@ -872,22 +872,22 @@ int uplink_ran_status_transfer(
...
@@ -872,22 +872,22 @@ int uplink_ran_status_transfer(
const
sctp_assoc_id_t
assoc_id
,
const
sctp_stream_id_t
stream
,
const
sctp_assoc_id_t
assoc_id
,
const
sctp_stream_id_t
stream
,
struct
Ngap_NGAP_PDU
*
message_p
)
{
struct
Ngap_NGAP_PDU
*
message_p
)
{
Logger
::
ngap
().
debug
(
Logger
::
ngap
().
debug
(
"Sending
itti uplink ran status t
ransfer to TASK_AMF_N2"
);
"Sending
ITTI Uplink RAN Status T
ransfer to TASK_AMF_N2"
);
/*receive uplinkranstatustransfer*/
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
message_p
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
message_p
);
UplinkRANStatusTransfer
*
Uplinkranstatustransfer
=
UplinkRANStatusTransfer
*
Uplinkranstatustransfer
=
new
UplinkRANStatusTransfer
();
new
UplinkRANStatusTransfer
();
if
(
!
Uplinkranstatustransfer
->
defromPDU
(
message_p
))
{
if
(
!
Uplinkranstatustransfer
->
defromPDU
(
message_p
))
{
Logger
::
ngap
().
error
(
"Decoding Uplink
ranstatust
ransfer message error"
);
Logger
::
ngap
().
error
(
"Decoding Uplink
RAN Status T
ransfer message error"
);
return
-
1
;
return
-
1
;
}
}
itti_uplink
ranstatsu
transfer
*
itti_uplinkran_sta_tran
=
itti_uplink
_ran_status_
transfer
*
itti_uplinkran_sta_tran
=
new
itti_uplink
ranstatsu
transfer
(
TASK_NGAP
,
TASK_AMF_N2
);
new
itti_uplink
_ran_status_
transfer
(
TASK_NGAP
,
TASK_AMF_N2
);
itti_uplinkran_sta_tran
->
assoc_id
=
assoc_id
;
itti_uplinkran_sta_tran
->
assoc_id
=
assoc_id
;
itti_uplinkran_sta_tran
->
stream
=
stream
;
itti_uplinkran_sta_tran
->
stream
=
stream
;
itti_uplinkran_sta_tran
->
uplinkrantransfer
=
Uplinkranstatustransfer
;
itti_uplinkran_sta_tran
->
uplinkrantransfer
=
Uplinkranstatustransfer
;
std
::
shared_ptr
<
itti_uplink
ranstatsu
transfer
>
i
=
std
::
shared_ptr
<
itti_uplink
_ran_status_
transfer
>
i
=
std
::
shared_ptr
<
itti_uplink
ranstatsu
transfer
>
(
itti_uplinkran_sta_tran
);
std
::
shared_ptr
<
itti_uplink
_ran_status_
transfer
>
(
itti_uplinkran_sta_tran
);
int
ret
=
itti_inst
->
send_msg
(
i
);
int
ret
=
itti_inst
->
send_msg
(
i
);
if
(
0
!=
ret
)
{
if
(
0
!=
ret
)
{
Logger
::
ngap
().
error
(
Logger
::
ngap
().
error
(
...
...
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