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
280954f5
Commit
280954f5
authored
Mar 08, 2023
by
Tien Thinh NGUYEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unnecessary info for log/debug
parent
2d0fe283
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
21 deletions
+51
-21
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+21
-19
src/amf-app/amf_statistics.cpp
src/amf-app/amf_statistics.cpp
+15
-0
src/amf-app/amf_statistics.hpp
src/amf-app/amf_statistics.hpp
+7
-0
src/contexts/gNB_context.hpp
src/contexts/gNB_context.hpp
+2
-0
src/ngap/ngap_app/ngap_message_callback.hpp
src/ngap/ngap_app/ngap_message_callback.hpp
+6
-2
No files found.
src/amf-app/amf_n2.cpp
View file @
280954f5
...
...
@@ -310,7 +310,8 @@ void amf_n2::handle_itti_message(itti_new_sctp_association& new_assoc) {}
//------------------------------------------------------------------------------
void
amf_n2
::
handle_itti_message
(
std
::
shared_ptr
<
itti_ng_setup_request
>&
itti_msg
)
{
Logger
::
amf_n2
().
debug
(
"Handle NG Setup Request..."
);
Logger
::
amf_n2
().
debug
(
"[gNB Assoc ID %d] Handle NG Setup Request..."
,
itti_msg
->
assoc_id
);
Logger
::
amf_n2
().
debug
(
"Parameters: assoc_id %d, stream %d"
,
itti_msg
->
assoc_id
,
itti_msg
->
stream
);
...
...
@@ -318,45 +319,46 @@ void amf_n2::handle_itti_message(
std
::
shared_ptr
<
gnb_context
>
gc
=
{};
if
(
!
assoc_id_2_gnb_context
(
itti_msg
->
assoc_id
,
gc
))
{
Logger
::
amf_n2
().
error
(
"No existed gNB context with assoc_id(%d)"
,
itti_msg
->
assoc_id
);
"No existed gNB context with assoc_id
(%d)"
,
itti_msg
->
assoc_id
);
return
;
}
if
(
gc
->
ng_state
==
NGAP_RESETING
||
gc
->
ng_state
==
NGAP_SHUTDOWN
)
{
Logger
::
amf_n2
().
warn
(
"Received a new association request on an association that is being "
"[gNB Assoc ID %d] Received a new association request on an "
"association that is being "
"%s, "
"ignoring"
,
ng_gnb_state_str
[
gc
->
ng_state
]);
itti_msg
->
assoc_id
,
ng_gnb_state_str
[
gc
->
ng_state
]);
}
else
{
Logger
::
amf_n2
().
debug
(
"Update gNB context with assoc id (%d)"
,
itti_msg
->
assoc_id
);
}
gnb_infos
gnbItem
=
{};
// Get IE Global RAN Node ID
uint32_t
gnb_id
=
{};
std
::
string
gnb_mcc
=
{};
std
::
string
gnb_mnc
=
{};
if
(
!
itti_msg
->
ngSetupReq
->
getGlobalGnbID
(
gnb_id
,
gnb_mcc
,
gnb_mnc
))
{
Logger
::
amf_n2
().
error
(
"Missing Mandatory IE Global RAN Node ID"
);
Logger
::
amf_n2
().
error
(
"[gNB Assoc ID %d] Missing Mandatory IE Global RAN Node ID"
,
itti_msg
->
assoc_id
);
return
;
}
Logger
::
amf_n2
().
debug
(
"RAN Node Info, Global RAN Node ID: 0x%x, MCC %s, MNC %s"
,
gnb_id
,
gnb_mcc
.
c_str
(),
gnb_mnc
.
c_str
());
// Store GNB info in the gNB context
gc
->
globalRanNodeId
=
gnb_id
;
gnbItem
.
gnb_id
=
gnb_id
;
gnbItem
.
mcc
=
gnb_mcc
;
gnbItem
.
mnc
=
gnb_mnc
;
gc
->
plmn
.
mcc
=
gnb_mcc
;
gc
->
plmn
.
mnc
=
gnb_mnc
;
std
::
string
gnb_name
=
{};
if
(
!
itti_msg
->
ngSetupReq
->
getRanNodeName
(
gnb_name
))
{
Logger
::
amf_n2
().
warn
(
"Missing IE RanNodeName"
);
}
else
{
gc
->
gnb_name
=
gnb_name
;
gnbItem
.
gnb_name
=
gnb_name
;
gc
->
gnb_name
=
gnb_name
;
Logger
::
amf_n2
().
debug
(
"IE RanNodeName: %s"
,
gnb_name
.
c_str
());
}
...
...
@@ -395,14 +397,11 @@ void amf_n2::handle_itti_message(
bstring
b
=
blk2bstr
(
buffer
,
encoded
);
sctp_s_38412
.
sctp_send_msg
(
itti_msg
->
assoc_id
,
itti_msg
->
stream
,
&
b
);
Logger
::
amf_n2
().
error
(
"No common PLMN, encoding NG_SETUP_FAILURE with cause (Unknown PLMN)"
);
"[gNB ID %d] No common PLMN between gNB and AMF, encoding "
"NG_SETUP_FAILURE with cause (Unknown PLMN)"
,
gc
->
globalRanNodeId
);
bdestroy_wrapper
(
&
b
);
return
;
}
else
{
for
(
auto
i
:
gc
->
s_ta_list
)
{
gnbItem
.
plmn_list
.
push_back
(
i
);
}
}
set_gnb_id_2_gnb_context
(
gnb_id
,
gc
);
...
...
@@ -455,7 +454,10 @@ void amf_n2::handle_itti_message(
Logger
::
amf_n2
().
debug
(
"gNB with gNB_id 0x%x, assoc_id %d has been attached to AMF"
,
gc
->
globalRanNodeId
,
itti_msg
->
assoc_id
);
stacs
.
add_gnb
(
gnbItem
.
gnb_id
,
gnbItem
);
// store gNB info for statistic purpose
stacs
.
add_gnb
(
gc
);
bdestroy_wrapper
(
&
b
);
return
;
}
...
...
src/amf-app/amf_statistics.cpp
View file @
280954f5
...
...
@@ -149,6 +149,21 @@ void statistics::add_gnb(const uint32_t& gnb_id, const gnb_infos& gnb) {
gNB_connected
+=
1
;
}
//------------------------------------------------------------------------------
void
statistics
::
add_gnb
(
const
std
::
shared_ptr
<
gnb_context
>&
gc
)
{
gnb_infos
gnb
=
{};
gnb
.
gnb_id
=
gc
->
globalRanNodeId
;
gnb
.
mcc
=
gc
->
plmn
.
mcc
;
gnb
.
mnc
=
gc
->
plmn
.
mnc
;
gnb
.
gnb_name
=
gc
->
gnb_name
;
for
(
auto
i
:
gc
->
s_ta_list
)
{
gnb
.
plmn_list
.
push_back
(
i
);
}
std
::
unique_lock
lock
(
m_gnbs
);
gnbs
.
insert
(
std
::
pair
<
uint32_t
,
gnb_infos
>
(
gc
->
globalRanNodeId
,
gnb
));
gNB_connected
+=
1
;
}
//------------------------------------------------------------------------------
void
statistics
::
update_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
)
{
std
::
unique_lock
lock
(
m_gnbs
);
...
...
src/amf-app/amf_statistics.hpp
View file @
280954f5
...
...
@@ -109,6 +109,13 @@ class statistics {
*/
void
add_gnb
(
const
uint32_t
&
gnb_id
,
const
gnb_infos
&
gnb
);
/*
* Add gNB to the list connected gNB to this AMF
* @param [const std::shared_ptr<gnb_context> &] gc: pointer to gNB Context
* @return void
*/
void
add_gnb
(
const
std
::
shared_ptr
<
gnb_context
>&
gc
);
/*
* Update gNB info
* @param [const uint32_t&] gnb_id: gNB ID
...
...
src/contexts/gNB_context.hpp
View file @
280954f5
...
...
@@ -29,6 +29,7 @@
#include "NgapIEsStruct.hpp"
#include "sctp_server.hpp"
#include "3gpp_23.003.h"
extern
"C"
{
#include "Ngap_PagingDRX.h"
...
...
@@ -54,6 +55,7 @@ class gnb_context {
std
::
string
gnb_name
;
long
globalRanNodeId
;
plmn_t
plmn
;
e_Ngap_PagingDRX
default_paging_drx
;
// v32, v64, v128, v256
std
::
vector
<
SupportedTaItem_t
>
s_ta_list
;
bstring
ue_radio_cap_ind
;
...
...
src/ngap/ngap_app/ngap_message_callback.hpp
View file @
280954f5
...
...
@@ -59,7 +59,9 @@ constexpr uint8_t NGAP_PRESENT_MAX_VALUE = 3;
int
ngap_amf_handle_ng_setup_request
(
const
sctp_assoc_id_t
assoc_id
,
const
sctp_stream_id_t
stream
,
struct
Ngap_NGAP_PDU
*
message_p
)
{
Logger
::
ngap
().
debug
(
"Sending ITTI NG Setup Request message to TASK_AMF_N2"
);
Logger
::
ngap
().
debug
(
"[gNB Assoc Id %d] Sending ITTI NG Setup Request message to TASK_AMF_N2"
,
assoc_id
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
message_p
);
NGSetupRequestMsg
*
ng_setup_req
=
new
NGSetupRequestMsg
();
if
(
!
ng_setup_req
->
decodeFromPdu
(
message_p
))
{
...
...
@@ -105,7 +107,9 @@ int ngap_handle_ng_setup_failure(
int
ngap_amf_handle_initial_ue_message
(
const
sctp_assoc_id_t
assoc_id
,
const
sctp_stream_id_t
stream
,
struct
Ngap_NGAP_PDU
*
message_p
)
{
Logger
::
ngap
().
debug
(
"Sending ITTI Initial UE Message to TASK_AMF_N2"
);
Logger
::
ngap
().
debug
(
"[gNB Assoc ID %d] Sending ITTI Initial UE Message to TASK_AMF_N2"
,
assoc_id
);
asn_fprint
(
stderr
,
&
asn_DEF_Ngap_NGAP_PDU
,
message_p
);
InitialUEMessageMsg
*
init_ue_msg
=
new
InitialUEMessageMsg
();
...
...
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