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
e102d11f
Commit
e102d11f
authored
Dec 03, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First version for Connectivity State Report
parent
ff529b87
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
14 deletions
+137
-14
src/amf-app/amf_event.cpp
src/amf-app/amf_event.cpp
+8
-3
src/amf-app/amf_event.hpp
src/amf-app/amf_event.hpp
+16
-3
src/amf-app/amf_event_sig.hpp
src/amf-app/amf_event_sig.hpp
+10
-3
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+81
-3
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+4
-0
src/sbi/amf_server/model/CmState.cpp
src/sbi/amf_server/model/CmState.cpp
+13
-2
src/sbi/amf_server/model/CmState.h
src/sbi/amf_server/model/CmState.h
+5
-0
No files found.
src/amf-app/amf_event.cpp
View file @
e102d11f
...
...
@@ -21,10 +21,10 @@
/*! \file amf_event.cpp
\brief
\author Shivam Gandhi
\company
KCL
\author Shivam Gandhi
(KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email:
shivam.gandhi@kcl.ac.uk
\email:
contact@openairinterface.org
*/
#include "amf_event.hpp"
...
...
@@ -40,3 +40,8 @@ bs2::connection amf_event::subscribe_ue_registration_state(
const
ue_registration_state_sig_t
::
slot_type
&
sig
)
{
return
ue_registration_state
.
connect
(
sig
);
}
bs2
::
connection
amf_event
::
subscribe_ue_connectivity_state
(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
)
{
return
ue_connectivity_state
.
connect
(
sig
);
}
src/amf-app/amf_event.hpp
View file @
e102d11f
...
...
@@ -21,10 +21,10 @@
/*! \file amf_event.hpp
\brief
\author Shivam Gandhi
\company
KCL
\author Shivam Gandhi
(KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email:
shivam.gandhi@kcl.ac.uk
\email:
contact@openairinterface.org
*/
#include <boost/signals2.hpp>
...
...
@@ -70,11 +70,24 @@ class amf_event {
bs2
::
connection
subscribe_ue_registration_state
(
const
ue_registration_state_sig_t
::
slot_type
&
sig
);
/*
* Subscribe to UE Connectivity State Notification signal
* @param [const ue_connectivity_state_sig_t::slot_type&] sig: slot_type
* parameter
* @return boost::signals2::connection: the connection between the signal and
* the slot
*/
bs2
::
connection
subscribe_ue_connectivity_state
(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
);
private:
ue_reachability_status_sig_t
ue_reachability_status
;
// Signal for UE Reachability Report
ue_registration_state_sig_t
ue_registration_state
;
// Signal for UE Registration State Report
ue_connectivity_state_sig_t
ue_connectivity_state
;
// Signal for UE Connectivity State Report
};
}
// namespace amf_application
src/amf-app/amf_event_sig.hpp
View file @
e102d11f
...
...
@@ -21,10 +21,10 @@
/*! \file amf_event_sig.hpp
\brief
\author Shivam Gandhi
\company
KCL
\author Shivam Gandhi
(KCL), Tien-Thinh NGUYEN (EURECOM)
\company
\date 2021
\email:
shivam.gandhi@kcl.ac.uk
\email:
contact@openairinterface.org
*/
#ifndef FILE_SMF_EVENT_SIG_HPP_SEEN
...
...
@@ -51,5 +51,12 @@ typedef bs2::signal_type<
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_registration_state_sig_t
;
// Signal for Connectivity State Report
// SUPI, connectivity state, HTTP version
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
uint8_t
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_connectivity_state_sig_t
;
}
// namespace amf_application
#endif
src/amf-app/amf_n1.cpp
View file @
e102d11f
...
...
@@ -161,10 +161,23 @@ amf_n1::amf_n1() {
ee_ue_registration_state_connection
=
event_sub
.
subscribe_ue_registration_state
(
boost
::
bind
(
&
amf_n1
::
handle_ue_registration_state_change
,
this
,
_1
,
_2
,
_3
));
// EventExposure: subscribe to UE Connectivity State change
ee_ue_connectivity_state_connection
=
event_sub
.
subscribe_ue_connectivity_state
(
boost
::
bind
(
&
amf_n1
::
handle_ue_connectivity_state_change
,
this
,
_1
,
_2
,
_3
));
}
//------------------------------------------------------------------------------
amf_n1
::~
amf_n1
()
{}
amf_n1
::~
amf_n1
()
{
// Disconnect the boost connection
if
(
ee_ue_reachability_status_connection
.
connected
())
ee_ue_reachability_status_connection
.
disconnect
();
if
(
ee_ue_registration_state_connection
.
connected
())
ee_ue_registration_state_connection
.
disconnect
();
if
(
ee_ue_connectivity_state_connection
.
connected
())
ee_ue_connectivity_state_connection
.
disconnect
();
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_itti_message
(
itti_downlink_nas_transfer
&
itti_msg
)
{
...
...
@@ -3172,13 +3185,12 @@ void amf_n1::handle_ue_registration_state_change(
// ev_notif.set_subs_change_notify_correlation_id(i.get()->notify_uri);
oai
::
amf
::
model
::
AmfEventReport
event_report
=
{};
oai
::
amf
::
model
::
AmfEventType
amf_event_type
=
{};
amf_event_type
.
set_value
(
"REGISTRATION_STATE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
std
::
vector
<
oai
::
amf
::
model
::
RmInfo
>
rm_infos
;
oai
::
amf
::
model
::
RmInfo
rm_info
=
{};
oai
::
amf
::
model
::
RmState
rm_state
=
{};
rm_state
.
set_value
(
"REGISTERED"
);
...
...
@@ -3188,6 +3200,72 @@ void amf_n1::handle_ue_registration_state_change(
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
rm_info
.
setAccessType
(
access_type
);
rm_infos
.
push_back
(
rm_info
);
event_report
.
setRmInfoList
(
rm_infos
);
event_report
.
setSupi
(
supi
);
ev_notif
.
add_report
(
event_report
);
itti_msg
->
event_notifs
.
push_back
(
ev_notif
);
}
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
if
(
0
!=
ret
)
{
Logger
::
amf_n1
().
error
(
"Could not send ITTI message %s to task TASK_AMF_N11"
,
itti_msg
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_connectivity_state_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to triger UE Connectivity State Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
CONNECTIVITY_STATE_REPORT
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_app
().
debug
(
"Send ITTI msg to AMF SBI to trigger the event notification"
);
std
::
shared_ptr
<
itti_sbi_notify_subscribed_event
>
itti_msg
=
std
::
make_shared
<
itti_sbi_notify_subscribed_event
>
(
TASK_AMF_N1
,
TASK_AMF_N11
);
// TODO:
// itti_msg->notif_id = "";
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
// ev_notif.set_subs_change_notify_correlation_id(i.get()->notify_uri);
oai
::
amf
::
model
::
AmfEventReport
event_report
=
{};
oai
::
amf
::
model
::
AmfEventType
amf_event_type
=
{};
amf_event_type
.
set_value
(
"CONNECTIVITY_STATE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
std
::
vector
<
oai
::
amf
::
model
::
CmInfo
>
cm_infos
;
oai
::
amf
::
model
::
CmInfo
cm_info
=
{};
oai
::
amf
::
model
::
CmState
cm_state
=
{};
cm_state
.
set_value
(
"CONNECTED"
);
cm_info
.
setCmState
(
cm_state
);
oai
::
amf
::
model
::
AccessType
access_type
=
{};
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
cm_info
.
setAccessType
(
access_type
);
cm_infos
.
push_back
(
cm_info
);
event_report
.
setCmInfoList
(
cm_infos
);
event_report
.
setSupi
(
supi
);
ev_notif
.
add_report
(
event_report
);
...
...
src/amf-app/amf_n1.hpp
View file @
e102d11f
...
...
@@ -179,6 +179,9 @@ class amf_n1 {
void
handle_ue_registration_state_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
void
handle_ue_connectivity_state_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
void
get_pdu_session_to_be_activated
(
uint16_t
pdu_session_status
,
std
::
vector
<
uint8_t
>&
pdu_session_to_be_activated
);
...
...
@@ -249,6 +252,7 @@ class amf_n1 {
amf_event
event_sub
;
bs2
::
connection
ee_ue_reachability_status_connection
;
bs2
::
connection
ee_ue_registration_state_connection
;
bs2
::
connection
ee_ue_connectivity_state_connection
;
};
}
// namespace amf_application
...
...
src/sbi/amf_server/model/CmState.cpp
View file @
e102d11f
...
...
@@ -49,10 +49,21 @@ bool CmState::operator!=(const CmState& rhs) const {
return
!
(
*
this
==
rhs
);
}
void
CmState
::
set_value
(
std
::
string
value
)
{
this
->
value
=
value
;
}
void
CmState
::
get_value
(
std
::
string
&
value
)
const
{
value
=
this
->
value
;
}
std
::
string
CmState
::
get_value
()
const
{
return
value
;
}
void
to_json
(
nlohmann
::
json
&
j
,
const
CmState
&
o
)
{
j
=
nlohmann
::
json
();
j
=
o
.
get_value
();
}
void
from_json
(
const
nlohmann
::
json
&
j
,
CmState
&
o
)
{}
void
from_json
(
const
nlohmann
::
json
&
j
,
CmState
&
o
)
{
o
.
set_value
(
j
.
get
<
std
::
string
>
());
}
}
// namespace oai::amf::model
src/sbi/amf_server/model/CmState.h
View file @
e102d11f
...
...
@@ -38,6 +38,10 @@ class CmState {
/// </summary>
void
validate
()
const
;
void
set_value
(
std
::
string
value
);
void
get_value
(
std
::
string
&
value
)
const
;
std
::
string
get_value
()
const
;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
...
...
@@ -54,6 +58,7 @@ class CmState {
friend
void
from_json
(
const
nlohmann
::
json
&
j
,
CmState
&
o
);
protected:
std
::
string
value
;
// Helper overload for validate. Used when one model stores another model and
// calls it's validate.
bool
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
;
...
...
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