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
cf41b622
Commit
cf41b622
authored
Jul 13, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
b3b52792
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+14
-13
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
+2
-2
No files found.
src/amf-app/amf_n2.cpp
View file @
cf41b622
...
...
@@ -69,8 +69,8 @@ extern statistics stacs;
extern
void
print_buffer
(
const
std
::
string
app
,
const
std
::
string
commit
,
uint8_t
*
buf
,
int
len
);
uint32_t
ran_id_global
=
0
;
uint32_t
AMF_TARGET_ran_id_global
=
0
;
uint32_t
source_ran_id_global
=
0
;
uint32_t
target_ran_id_global
=
0
;
sctp_assoc_id_t
downlink_sctp_assoc_id
=
0
;
sctp_assoc_id_t
source_assoc_id
=
0
;
int
ncc
=
0
;
...
...
@@ -1050,7 +1050,7 @@ void amf_n2::handle_itti_message(itti_handover_required& itti_msg) {
ncc
++
;
// TODO: to be verified
unsigned
long
amf_ue_ngap_id
=
itti_msg
.
handoverReq
->
getAmfUeNgapId
();
uint32_t
ran_ue_ngap_id
=
itti_msg
.
handoverReq
->
getRanUeNgapId
();
ran_id_global
=
ran_ue_ngap_id
;
source_ran_id_global
=
ran_ue_ngap_id
;
source_assoc_id
=
itti_msg
.
assoc_id
;
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
...
...
@@ -1236,7 +1236,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
// TODO: Experimental procedure, to be tested
unsigned
long
amf_ue_ngap_id
=
itti_msg
.
handoverrequestAck
->
getAmfUeNgapId
();
uint32_t
ran_ue_ngap_id
=
itti_msg
.
handoverrequestAck
->
getRanUeNgapId
();
AMF_TARGET_ran_id_global
=
ran_ue_ngap_id
;
target_ran_id_global
=
ran_ue_ngap_id
;
Logger
::
amf_n2
().
error
(
"Handover Request Ack ran_ue_ngap_id (0x%d) amf_ue_ngap_id (%d)"
,
ran_ue_ngap_id
,
amf_ue_ngap_id
);
...
...
@@ -1297,7 +1297,7 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
std
::
make_unique
<
HandoverCommandMsg
>
();
handovercommand
->
setMessageType
();
handovercommand
->
setAmfUeNgapId
(
amf_ue_ngap_id
);
handovercommand
->
setRanUeNgapId
(
ran_id_global
);
handovercommand
->
setRanUeNgapId
(
source_
ran_id_global
);
handovercommand
->
setHandoverType
(
Ngap_HandoverType_intra5gs
);
std
::
shared_ptr
<
nas_context
>
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
amf_ue_ngap_id
);
...
...
@@ -1341,21 +1341,21 @@ void amf_n2::handle_itti_message(itti_handover_request_Ack& itti_msg) {
int
encoded_size
=
handovercommand
->
encode2buffer
(
buffer
,
10240
);
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
std
::
shared_ptr
<
ue_ngap_context
>
unc
;
if
(
!
is_ran_ue_id_2_ue_ngap_context
(
ran_id_global
))
{
if
(
!
is_ran_ue_id_2_ue_ngap_context
(
source_
ran_id_global
))
{
Logger
::
amf_n2
().
debug
(
"Create a new ue ngap context with ran_ue_ngap_id(0x%x)"
,
ran_id_global
);
source_
ran_id_global
);
unc
=
std
::
shared_ptr
<
ue_ngap_context
>
(
new
ue_ngap_context
());
set_ran_ue_ngap_id_2_ue_ngap_context
(
ran_id_global
,
unc
);
set_ran_ue_ngap_id_2_ue_ngap_context
(
source_
ran_id_global
,
unc
);
unc
.
get
()
->
gnb_assoc_id
=
source_assoc_id
;
}
else
{
unc
=
ran_ue_id_2_ue_ngap_context
(
ran_id_global
);
unc
=
ran_ue_id_2_ue_ngap_context
(
source_
ran_id_global
);
unc
.
get
()
->
gnb_assoc_id
=
source_assoc_id
;
}
// std::shared_ptr<ue_ngap_context> ngc =
// ran_ue_id_2_ue_ngap_context(nc.get()->ran_ue_ngap_id);
// std::shared_ptr<ue_ngap_context> ngc =
// ran_ue_id_2_ue_ngap_context(ran_id_global);
// ran_ue_id_2_ue_ngap_context(
source_
ran_id_global);
// sctp_s_38412.sctp_send_msg(ngc.get()->gnb_assoc_id, 0, &b);
sctp_s_38412
.
sctp_send_msg
(
unc
.
get
()
->
gnb_assoc_id
,
0
,
&
b
);
}
...
...
@@ -1383,7 +1383,8 @@ void amf_n2::handle_itti_message(itti_handover_notify& itti_msg) {
std
::
unique_ptr
<
UEContextReleaseCommandMsg
>
ueContextReleaseCommand
=
std
::
make_unique
<
UEContextReleaseCommandMsg
>
();
ueContextReleaseCommand
->
setMessageType
();
ueContextReleaseCommand
->
setUeNgapIdPair
(
amf_ue_ngap_id
,
ran_id_global
);
ueContextReleaseCommand
->
setUeNgapIdPair
(
amf_ue_ngap_id
,
source_ran_id_global
);
ueContextReleaseCommand
->
setCauseRadioNetwork
(
Ngap_CauseRadioNetwork_successful_handover
);
...
...
@@ -1467,14 +1468,14 @@ void amf_n2::handle_itti_message(itti_uplinkranstatsutransfer& itti_msg) {
std
::
make_unique
<
DownlinkRANStatusTransfer
>
();
downLinkranstatustransfer
->
setmessagetype
();
downLinkranstatustransfer
->
setAmfUeNgapId
(
amf_ue_ngap_id
);
downLinkranstatustransfer
->
setRanUeNgapId
(
AMF_TARGET
_ran_id_global
);
downLinkranstatustransfer
->
setRanUeNgapId
(
target
_ran_id_global
);
downLinkranstatustransfer
->
setRANStatusTransfer_TransparentContainer
(
amf_drb_id
,
amf_ul_pdcp
,
amf_hfn_ul_pdcp
,
amf_dl_pdcp
,
amf_hfn_dl_pdcp
);
uint8_t
buffer
[
1024
];
int
encode_size
=
downLinkranstatustransfer
->
encodetobuffer
(
buffer
,
1024
);
bstring
b
=
blk2bstr
(
buffer
,
encode_size
);
// std::shared_ptr<ue_ngap_context> ngc =
// ran_ue_id_2_ue_ngap_context(
AMF_TARGET
_ran_id_global);
// ran_ue_id_2_ue_ngap_context(
target
_ran_id_global);
sctp_s_38412
.
sctp_send_msg
(
downlink_sctp_assoc_id
,
0
,
&
b
);
}
...
...
src/ngap/ngapMsgs/HandoverCommandMsg.hpp
View file @
cf41b622
...
...
@@ -60,8 +60,8 @@ class HandoverCommandMsg {
int
encode2buffer
(
uint8_t
*
buf
,
int
buf_size
);
bool
decodefrompdu
(
Ngap_NGAP_PDU_t
*
ngap_msg_pdu
);
unsigned
long
getAmfUeNgapId
();
// return -1;
(不存在)
uint32_t
getRanUeNgapId
();
// return -1;
(不存在)
unsigned
long
getAmfUeNgapId
();
// return -1;
uint32_t
getRanUeNgapId
();
// return -1;
/*void getHandoverType(Ngap_HandoverType_t &handovertype);
void getCause(Cause cause);
void getTargetID(Ngap_TargetID_t targetID);
...
...
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