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
fc007600
Commit
fc007600
authored
Aug 05, 2022
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'event_exposure' into 'develop'
Events exposure See merge request oai/cn5g/oai-cn5g-amf!137
parents
cd5e1a41
9743bbc4
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
861 additions
and
28 deletions
+861
-28
src/amf-app/amf_event.cpp
src/amf-app/amf_event.cpp
+10
-0
src/amf-app/amf_event.hpp
src/amf-app/amf_event.hpp
+20
-1
src/amf-app/amf_event_sig.hpp
src/amf-app/amf_event_sig.hpp
+17
-1
src/amf-app/amf_n1.cpp
src/amf-app/amf_n1.cpp
+239
-18
src/amf-app/amf_n1.hpp
src/amf-app/amf_n1.hpp
+34
-7
src/amf-app/amf_n2.cpp
src/amf-app/amf_n2.cpp
+90
-1
src/amf-app/amf_sbi.cpp
src/amf-app/amf_sbi.cpp
+21
-0
src/contexts/nas_context.hpp
src/contexts/nas_context.hpp
+12
-0
src/sbi/amf_server/model/AmfEventReport.cpp
src/sbi/amf_server/model/AmfEventReport.cpp
+69
-0
src/sbi/amf_server/model/AmfEventReport.h
src/sbi/amf_server/model/AmfEventReport.h
+28
-0
src/sbi/amf_server/model/LossOfConnectivityReason.cpp
src/sbi/amf_server/model/LossOfConnectivityReason.cpp
+71
-0
src/sbi/amf_server/model/LossOfConnectivityReason.h
src/sbi/amf_server/model/LossOfConnectivityReason.h
+68
-0
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.cpp
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.cpp
+104
-0
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.h
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.h
+78
-0
No files found.
src/amf-app/amf_event.cpp
View file @
fc007600
...
...
@@ -44,3 +44,13 @@ bs2::connection amf_event::subscribe_ue_connectivity_state(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
)
{
return
ue_connectivity_state
.
connect
(
sig
);
}
bs2
::
connection
amf_event
::
subscribe_ue_loss_of_connectivity
(
const
ue_loss_of_connectivity_sig_t
::
slot_type
&
sig
)
{
return
ue_loss_of_connectivity
.
connect
(
sig
);
}
//------------------------------------------------------------------------------
bs2
::
connection
amf_event
::
subscribe_ue_communication_failure
(
const
ue_communication_failure_sig_t
::
slot_type
&
sig
)
{
return
ue_communication_failure
.
connect
(
sig
);
}
src/amf-app/amf_event.hpp
View file @
fc007600
...
...
@@ -82,7 +82,22 @@ class amf_event {
bs2
::
connection
subscribe_ue_connectivity_state
(
const
ue_connectivity_state_sig_t
::
slot_type
&
sig
);
private:
/*
* Subscribe to UE Loss of Connectivity Notification signal
* @param [const ue_loss_of_connectivity_sig_t::slot_type&] sig: slot_type*/
bs2
::
connection
subscribe_ue_loss_of_connectivity
(
const
ue_loss_of_connectivity_sig_t
::
slot_type
&
sig
);
/*
* Subscribe to UE Communication Failure Notification signal
* @param [const ue_communication_failure_sig_t::slot_type&] sig: slot_type
* parameter
* @return boost::signals2::connection: the connection between the signal and
* the slot
*/
bs2
::
connection
subscribe_ue_communication_failure
(
const
ue_communication_failure_sig_t
::
slot_type
&
sig
);
ue_location_report_sig_t
ue_location_report
;
// Signal for UE Location Report
ue_reachability_status_sig_t
ue_reachability_status
;
// Signal for UE Reachability Report
...
...
@@ -90,5 +105,9 @@ class amf_event {
ue_registration_state
;
// Signal for UE Registration State Report
ue_connectivity_state_sig_t
ue_connectivity_state
;
// Signal for UE Connectivity State Report
ue_loss_of_connectivity_sig_t
ue_loss_of_connectivity
;
// Signal for UE Loss of Connectivity
ue_communication_failure_sig_t
ue_communication_failure
;
// Signal for UE Communication Failure Report
};
}
// namespace amf_application
src/amf-app/amf_event_sig.hpp
View file @
fc007600
...
...
@@ -26,6 +26,7 @@
#include <string>
#include "UserLocation.h"
#include "CommunicationFailure.h"
namespace
bs2
=
boost
::
signals2
;
...
...
@@ -62,9 +63,24 @@ typedef bs2::signal_type<
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_connectivity_state_sig_t
;
// Signal for Loss of Connectivity
// SUPI, status, HTTP version,
// RAN UE NGAP ID, AMF UE NGAP ID
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
uint8_t
,
uint8_t
,
uint32_t
,
long
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_loss_of_connectivity_sig_t
;
// TODO: Communication-Failure-Report
// Signal for Communication Failure Report
// SUPI, Communication Failure codes, HTTP version
typedef
bs2
::
signal_type
<
void
(
std
::
string
,
oai
::
amf
::
model
::
CommunicationFailure
,
uint8_t
),
bs2
::
keywords
::
mutex_type
<
bs2
::
dummy_mutex
>>::
type
ue_communication_failure_sig_t
;
// TODO: UEs-In-Area-Report
// TODO: Loss-of-Connectivity
}
// namespace amf_application
#endif
src/amf-app/amf_n1.cpp
View file @
fc007600
...
...
@@ -162,6 +162,15 @@ amf_n1::amf_n1() {
ee_ue_connectivity_state_connection
=
event_sub
.
subscribe_ue_connectivity_state
(
boost
::
bind
(
&
amf_n1
::
handle_ue_connectivity_state_change
,
this
,
_1
,
_2
,
_3
));
// EventExposure: subscribe to UE Loss of Connectivity change
ee_ue_loss_of_connectivity_connection
=
event_sub
.
subscribe_ue_loss_of_connectivity
(
boost
::
bind
(
&
amf_n1
::
handle_ue_loss_of_connectivity_change
,
this
,
_1
,
_2
,
_3
,
_4
,
_5
));
// EventExposure: subscribe to UE Communication Failure Report
ee_ue_communication_failure_connection
=
event_sub
.
subscribe_ue_communication_failure
(
boost
::
bind
(
&
amf_n1
::
handle_ue_communication_failure_change
,
this
,
_1
,
_2
,
_3
));
}
//------------------------------------------------------------------------------
...
...
@@ -175,6 +184,10 @@ amf_n1::~amf_n1() {
ee_ue_registration_state_connection
.
disconnect
();
if
(
ee_ue_connectivity_state_connection
.
connected
())
ee_ue_connectivity_state_connection
.
disconnect
();
if
(
ee_ue_loss_of_connectivity_connection
.
connected
())
ee_ue_loss_of_connectivity_connection
.
disconnect
();
if
(
ee_ue_communication_failure_connection
.
connected
())
ee_ue_communication_failure_connection
.
disconnect
();
}
//------------------------------------------------------------------------------
...
...
@@ -760,13 +773,6 @@ void amf_n1::identity_response_handle(
set_5gmm_state
(
nc
,
_5GMM_COMMON_PROCEDURE_INITIATED
);
// stacs.display();
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Registration State Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_registration_state
(
supi
,
_5GMM_COMMON_PROCEDURE_INITIATED
,
1
);
nc
.
get
()
->
is_stacs_available
=
true
;
}
// TODO: Trigger UE Location Report
...
...
@@ -886,6 +892,12 @@ void amf_n1::service_request_handle(
pdu_session_status
=
(
uint16_t
)
service_request_nas
->
getPduSessionStatus
();
}
// Trigger UE Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Connectivity Status Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_connectivity_state
(
supi
,
CM_CONNECTED
,
1
);
}
break
;
default:
...
...
@@ -1089,13 +1101,6 @@ void amf_n1::registration_request_handle(
set_5gmm_state
(
nc
,
_5GMM_COMMON_PROCEDURE_INITIATED
);
// stacs.display();
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Registration State Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_registration_state
(
supi
,
_5GMM_COMMON_PROCEDURE_INITIATED
,
1
);
nc
.
get
()
->
is_stacs_available
=
true
;
}
}
...
...
@@ -1161,6 +1166,16 @@ void amf_n1::registration_request_handle(
// Stop Mobile Reachable Timer/Implicit Deregistration Timer
itti_inst
->
timer_remove
(
nc
.
get
()
->
mobile_reachable_timer
);
itti_inst
->
timer_remove
(
nc
.
get
()
->
implicit_deregistration_timer
);
// Trigger UE Reachability Status Notify
if
(
!
nc
.
get
()
->
imsi
.
empty
())
{
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Reachability Status Event notification for SUPI "
"%s"
,
supi
.
c_str
());
event_sub
.
ue_reachability_status
(
supi
,
CM_CONNECTED
,
1
);
}
}
}
break
;
...
...
@@ -1620,6 +1635,21 @@ void amf_n1::send_registration_reject_msg(
bstring
b
=
blk2bstr
(
buffer
,
encoded_size
);
itti_send_dl_nas_buffer_to_task_n2
(
b
,
ran_ue_ngap_id
,
amf_ue_ngap_id
);
// Trigger CommunicationFailure Report notify
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
=
{};
std
::
shared_ptr
<
ue_context
>
uc
=
{};
if
(
!
find_ue_context
(
ran_ue_ngap_id
,
amf_ue_ngap_id
,
uc
))
{
Logger
::
amf_n1
().
warn
(
"Cannot find the UE context, unable to notify CommunicationFailure Report"
);
return
;
}
string
supi
=
uc
.
get
()
->
supi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE CommunicationFailure Report Event notification for SUPI %s"
,
supi
.
c_str
());
comm_failure
.
setNasReleaseCode
(
std
::
to_string
(
cause_value
));
event_sub
.
ue_communication_failure
(
supi
,
comm_failure
,
1
);
}
//------------------------------------------------------------------------------
...
...
@@ -2588,12 +2618,19 @@ void amf_n1::security_mode_complete_handle(
set_5gmm_state
(
nc
,
_5GMM_REGISTERED
);
stacs
.
display
();
// Trigger UE Registration Status Notify
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Registration State Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_registration_state
(
supi
,
_5GMM_REGISTERED
,
1
);
// Trigger UE Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Connectivity Status Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_connectivity_state
(
supi
,
CM_CONNECTED
,
1
);
set_guti_2_nas_context
(
guti
,
nc
);
nc
.
get
()
->
is_common_procedure_for_security_mode_control_running
=
false
;
nas_secu_ctx
*
secu
=
nc
.
get
()
->
security_ctx
;
...
...
@@ -3052,11 +3089,24 @@ void amf_n1::ue_initiate_de_registration_handle(
stacs
.
display
();
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
// Trigger UE Registration Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Registration State Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_registration_state
(
supi
,
_5GMM_DEREGISTERED
,
1
);
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
DEREGISTERED
,
1
,
ran_ue_ngap_id
,
amf_ue_ngap_id
);
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
PURGED
,
1
,
ran_ue_ngap_id
,
amf_ue_ngap_id
);
if
(
nc
.
get
()
->
is_stacs_available
)
{
stacs
.
update_5gmm_state
(
nc
.
get
()
->
imsi
,
"5GMM-DEREGISTERED"
);
}
...
...
@@ -3114,6 +3164,13 @@ void amf_n1::ue_initiate_de_registration_handle(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg
->
get_msg_name
());
}
// Trigger UE Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Connectivity Status Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_connectivity_state
(
supi
,
CM_IDLE
,
1
);
}
//------------------------------------------------------------------------------
...
...
@@ -3477,6 +3534,10 @@ void amf_n1::handle_ue_location_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
...
...
@@ -3532,6 +3593,10 @@ void amf_n1::handle_ue_reachability_status_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
...
...
@@ -3592,6 +3657,10 @@ void amf_n1::handle_ue_registration_state_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
...
...
@@ -3610,11 +3679,15 @@ void amf_n1::handle_ue_registration_state_change(
std
::
vector
<
oai
::
amf
::
model
::
RmInfo
>
rm_infos
;
oai
::
amf
::
model
::
RmInfo
rm_info
=
{};
oai
::
amf
::
model
::
RmState
rm_state
=
{};
if
(
status
==
_5GMM_DEREGISTERED
)
rm_state
.
set_value
(
"DEREGISTERED"
);
else
if
(
status
==
_5GMM_REGISTERED
)
rm_state
.
set_value
(
"REGISTERED"
);
rm_info
.
setRmState
(
rm_state
);
oai
::
amf
::
model
::
AccessType
access_type
=
{};
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
// hard-coded
rm_info
.
setAccessType
(
access_type
);
rm_infos
.
push_back
(
rm_info
);
...
...
@@ -3659,6 +3732,10 @@ void amf_n1::handle_ue_connectivity_state_change(
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
...
...
@@ -3677,11 +3754,14 @@ void amf_n1::handle_ue_connectivity_state_change(
std
::
vector
<
oai
::
amf
::
model
::
CmInfo
>
cm_infos
;
oai
::
amf
::
model
::
CmInfo
cm_info
=
{};
oai
::
amf
::
model
::
CmState
cm_state
=
{};
if
(
status
==
CM_IDLE
)
cm_state
.
set_value
(
"IDLE"
);
else
if
(
status
==
CM_CONNECTED
)
cm_state
.
set_value
(
"CONNECTED"
);
cm_info
.
setCmState
(
cm_state
);
oai
::
amf
::
model
::
AccessType
access_type
=
{};
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
access_type
.
setValue
(
AccessType
::
eAccessType
::
_3GPP_ACCESS
);
// hard-coded
cm_info
.
setAccessType
(
access_type
);
cm_infos
.
push_back
(
cm_info
);
event_report
.
setCmInfoList
(
cm_infos
);
...
...
@@ -3701,6 +3781,133 @@ void amf_n1::handle_ue_connectivity_state_change(
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_communication_failure_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
,
uint8_t
http_version
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to trigger UE Communication Failure Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
COMMUNICATION_FAILURE_REPORT
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_n1
().
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_SBI
);
itti_msg
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
// 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
(
"COMMUNICATION_FAILURE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
event_report
.
setCommFailure
(
comm_failure
);
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_SBI"
,
itti_msg
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
handle_ue_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
,
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
)
{
Logger
::
amf_n1
().
debug
(
"Send request to SBI to trigger UE Loss of Connectivity (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
LOSS_OF_CONNECTIVITY
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_n1
().
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_SBI
);
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_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
// 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
(
"LOSS_OF_CONNECTIVITY"
);
event_report
.
setType
(
amf_event_type
);
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
oai
::
amf
::
model
::
LossOfConnectivityReason
ue_loss_of_connectivity_reason
=
{};
if
(
status
==
DEREGISTERED
)
ue_loss_of_connectivity_reason
.
set_value
(
"DEREGISTERED"
);
else
if
(
status
==
MAX_DETECTION_TIME_EXPIRED
)
ue_loss_of_connectivity_reason
.
set_value
(
"MAX_DETECTION_TIME_EXPIRED"
);
else
if
(
status
==
PURGED
)
ue_loss_of_connectivity_reason
.
set_value
(
"PURGED"
);
event_report
.
setLossOfConnectReason
(
ue_loss_of_connectivity_reason
);
event_report
.
setRanUeNgapId
(
ran_ue_ngap_id
);
event_report
.
setAmfUeNgapId
(
amf_ue_ngap_id
);
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_SBI"
,
itti_msg
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
void
amf_n1
::
get_pdu_session_to_be_activated
(
const
uint16_t
pdu_session_status
,
...
...
@@ -3882,6 +4089,13 @@ void amf_n1::mobile_reachable_timer_timeout(
}
set_mobile_reachable_timer_timeout
(
nc
,
true
);
// Trigger UE Loss of Connectivity Status Notify
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_loss_of_connectivity
(
supi
,
MAX_DETECTION_TIME_EXPIRED
,
1
,
nc
.
get
()
->
ran_ue_ngap_id
,
amf_ue_ngap_id
);
// TODO: Start the implicit de-registration timer
timer_id_t
tid
=
itti_inst
->
timer_setup
(
IMPLICIT_DEREGISTRATION_TIMER_MIN
*
60
,
0
,
TASK_AMF_N1
,
...
...
@@ -3956,6 +4170,13 @@ void amf_n1::implicit_deregistration_timer_timeout(
"Could not send ITTI message %s to task TASK_AMF_N2"
,
itti_msg_cxt_release
->
get_msg_name
());
}
// Trigger UE Connectivity Status Notify
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n1
().
debug
(
"Signal the UE Connectivity Status Event notification for SUPI %s"
,
supi
.
c_str
());
event_sub
.
ue_connectivity_state
(
supi
,
CM_IDLE
,
1
);
}
//------------------------------------------------------------------------------
...
...
src/amf-app/amf_n1.hpp
View file @
fc007600
...
...
@@ -806,6 +806,40 @@ class amf_n1 {
void
handle_ue_connectivity_state_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
);
/*
* Handle the UE Loss of Connectivity Change event to trigger the notification
* to the subscribed NFs
* @param [std::string] supi: SUPI
* @param [uint8_t] status: UE Loss of Connectivity status
* @param [uint8_t] http_version: HTTP version (for the notification)
* @param [uint32_t] ran_ue_ngap_id: RAN UE NGAP ID
* @param [long] amf_ue_ngap_id: AMF UE NGAP ID
* @return void
*/
void
handle_ue_loss_of_connectivity_change
(
std
::
string
supi
,
uint8_t
status
,
uint8_t
http_version
,
uint32_t
ran_ue_ngap_id
,
long
amf_ue_ngap_id
);
/*
* Handle the UE Communication Failure event to trigger the notification to the
* subscribed NFs
* @param [std::string] supi: SUPI
* @param [oai::amf::model::CommunicationFailure] comm_failure: Communication Failure reason
* @param [uint8_t] http_version: HTTP version (for the notification)
* @return void
*/
void
handle_ue_communication_failure_change
(
std
::
string
supi
,
oai
::
amf
::
model
::
CommunicationFailure
,
uint8_t
http_version
);
// for Event Handling
amf_event
event_sub
;
bs2
::
connection
ee_ue_location_report_connection
;
bs2
::
connection
ee_ue_reachability_status_connection
;
bs2
::
connection
ee_ue_registration_state_connection
;
bs2
::
connection
ee_ue_connectivity_state_connection
;
bs2
::
connection
ee_ue_loss_of_connectivity_connection
;
bs2
::
connection
ee_ue_communication_failure_connection
;
private:
/*
* Handle UE-initiated Deregistration Request message
...
...
@@ -967,13 +1001,6 @@ class amf_n1 {
static
uint8_t
no_random_delta
;
random_state_t
random_state
;
database_t
*
db_desc
;
// for Event Handling
amf_event
event_sub
;
bs2
::
connection
ee_ue_location_report_connection
;
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/amf-app/amf_n2.cpp
View file @
fc007600
...
...
@@ -1343,6 +1343,84 @@ void amf_n2::handle_itti_message(itti_ue_context_release_command& itti_msg) {
sctp_s_38412
.
sctp_send_msg
(
gc
.
get
()
->
sctp_assoc_id
,
unc
.
get
()
->
sctp_stream_send
,
&
b
);
return
;
/*
* Send ITTI to N11 SBI, notify CommunicationFailure Report, RAN Cause
*/
std
::
shared_ptr
<
nas_context
>
nc
=
{};
if
(
amf_n1_inst
->
is_amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
))
nc
=
amf_n1_inst
->
amf_ue_id_2_nas_context
(
itti_msg
.
amf_ue_ngap_id
);
else
{
Logger
::
amf_n2
().
warn
(
"Could not notify RAN caused CommunicationFailure."
"No existing nas_context with amf_ue_ngap_id("
AMF_UE_NGAP_ID_FMT
")"
,
itti_msg
.
amf_ue_ngap_id
);
return
;
}
string
supi
=
"imsi-"
+
nc
.
get
()
->
imsi
;
Logger
::
amf_n2
().
debug
(
"Send request to SBI to trigger UE Communication Failure Report (SUPI "
"%s )"
,
supi
.
c_str
());
std
::
vector
<
std
::
shared_ptr
<
amf_subscription
>>
subscriptions
=
{};
amf_app_inst
->
get_ee_subscriptions
(
amf_event_type_t
::
COMMUNICATION_FAILURE_REPORT
,
subscriptions
);
if
(
subscriptions
.
size
()
>
0
)
{
// Send request to SBI to trigger the notification to the subscribed event
Logger
::
amf_n1
().
debug
(
"Send ITTI msg to AMF SBI to trigger the event notification"
);
std
::
shared_ptr
<
itti_sbi_notify_subscribed_event
>
itti_msg_ev
=
std
::
make_shared
<
itti_sbi_notify_subscribed_event
>
(
TASK_AMF_N2
,
TASK_AMF_SBI
);
itti_msg_ev
->
http_version
=
1
;
for
(
auto
i
:
subscriptions
)
{
// Avoid repeated notifications
// TODO: use the anyUE field from the subscription request
if
(
i
.
get
()
->
supi_is_set
&&
std
::
strcmp
(
i
.
get
()
->
supi
.
c_str
(),
supi
.
c_str
()))
continue
;
event_notification
ev_notif
=
{};
ev_notif
.
set_notify_correlation_id
(
i
.
get
()
->
notify_correlation_id
);
ev_notif
.
set_notify_uri
(
i
.
get
()
->
notify_uri
);
// Direct subscription
// 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
(
"COMMUNICATION_FAILURE_REPORT"
);
event_report
.
setType
(
amf_event_type
);
oai
::
amf
::
model
::
AmfEventState
amf_event_state
=
{};
amf_event_state
.
setActive
(
true
);
event_report
.
setState
(
amf_event_state
);
oai
::
amf
::
model
::
CommunicationFailure
comm_failure
=
{};
NgApCause
ngap_cause
=
{};
ngap_cause
.
setGroup
(
itti_msg
.
cause
.
getChoiceOfCause
());
ngap_cause
.
setValue
(
itti_msg
.
cause
.
getValue
());
comm_failure
.
setRanReleaseCode
(
ngap_cause
);
event_report
.
setCommFailure
(
comm_failure
);
event_report
.
setSupi
(
supi
);
ev_notif
.
add_report
(
event_report
);
itti_msg_ev
->
event_notifs
.
push_back
(
ev_notif
);
}
int
ret
=
itti_inst
->
send_msg
(
itti_msg_ev
);
if
(
0
!=
ret
)
{
Logger
::
amf_n2
().
error
(
"Could not send ITTI message %s to task TASK_AMF_SBI"
,
itti_msg_ev
->
get_msg_name
());
}
}
}
//------------------------------------------------------------------------------
...
...
@@ -2282,6 +2360,12 @@ void amf_n2::remove_ue_context_with_ran_ue_ngap_id(
if
(
nc
.
get
()
->
is_stacs_available
)
{
stacs
.
update_5gmm_state
(
nc
.
get
()
->
imsi
,
"5GMM-DEREGISTERED"
);
}
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
amf_n1_inst
->
event_sub
.
ue_loss_of_connectivity
(
supi
,
DEREGISTERED
,
1
,
ran_ue_ngap_id
,
unc
.
get
()
->
amf_ue_ngap_id
);
amf_n1_inst
->
remove_imsi_2_nas_context
(
supi
);
// TODO: remove_guti_2_nas_context(guti);
...
...
@@ -2358,6 +2442,11 @@ void amf_n2::remove_ue_context_with_amf_ue_ngap_id(
if
(
nc
.
get
()
->
is_stacs_available
)
{
stacs
.
update_5gmm_state
(
nc
.
get
()
->
imsi
,
"5GMM-DEREGISTERED"
);
}
// Trigger UE Loss of Connectivity Status Notify
Logger
::
amf_n1
().
debug
(
"Signal the UE Loss of Connectivity Event notification for SUPI %s"
,
supi
.
c_str
());
amf_n1_inst
->
event_sub
.
ue_loss_of_connectivity
(
supi
,
DEREGISTERED
,
1
,
nc
.
get
()
->
ran_ue_ngap_id
,
amf_ue_ngap_id
);
amf_n1_inst
->
remove_imsi_2_nas_context
(
supi
);
// TODO: remove_guti_2_nas_context(guti);
...
...
src/amf-app/amf_sbi.cpp
View file @
fc007600
...
...
@@ -571,9 +571,30 @@ void amf_sbi::handle_itti_message(itti_sbi_notify_subscribed_event& itti_msg) {
if
(
r
.
supiIsSet
())
{
report
[
"supi"
]
=
r
.
getSupi
();
}
if
(
r
.
locationIsSet
())
{
report
[
"location"
]
=
r
.
getLocation
();
// get eutraLocation, nrLocation, n3gaLocation?
}
if
(
r
.
rmInfoListIsSet
())
{
report
[
"rmInfoList"
]
=
r
.
getRmInfoList
();
}
if
(
r
.
cmInfoListIsSet
())
{
report
[
"cmInfoList"
]
=
r
.
getCmInfoList
();
}
if
(
r
.
reachabilityIsSet
())
{
report
[
"reachability"
]
=
r
.
getReachability
().
get_value
();
}
if
(
r
.
lossOfConnectReasonIsSet
())
{
report
[
"lossOfConnectReason"
]
=
r
.
getLossOfConnectReason
().
get_value
();
}
if
(
r
.
ranUeNgapIdIsSet
())
{
report
[
"ranUeNgapId"
]
=
r
.
getRanUeNgapId
();
}
if
(
r
.
amfUeNgapIdIsSet
())
{
report
[
"amfUeNgapId"
]
=
r
.
getAmfUeNgapId
();
}
if
(
r
.
commFailureIsSet
())
{
report
[
"commFailure"
]
=
r
.
getCommFailure
();
}
// Timestamp
std
::
time_t
time_epoch_ntp
=
std
::
time
(
nullptr
);
...
...
src/contexts/nas_context.hpp
View file @
fc007600
...
...
@@ -55,6 +55,18 @@ typedef enum { CM_IDLE = 0, CM_CONNECTED } cm_state_t;
static
const
std
::
vector
<
std
::
string
>
cm_state_e2str
=
{
"CM_IDLE"
,
"CM_CONNECTED"
};
typedef
enum
{
DEREGISTERED
=
0
,
MAX_DETECTION_TIME_EXPIRED
,
PURGED
}
loss_of_connectivity_status_t
;
static
const
std
::
vector
<
std
::
string
>
loss_of_connectivity_status_e2str
=
{
"DEREGISTERED"
,
"MAX_DETECTION_TIME_EXPIRED"
,
"PURGED"
};
class
nas_context
{
public:
nas_context
();
...
...
src/sbi/amf_server/model/AmfEventReport.cpp
View file @
fc007600
...
...
@@ -41,6 +41,9 @@ AmfEventReport::AmfEventReport() {
m_CmInfoListIsSet
=
false
;
m_ReachabilityIsSet
=
false
;
m_CommFailureIsSet
=
false
;
m_LossOfConnectReasonIsSet
=
false
;
m_RanUeNgapIdIsSet
=
false
;
m_AmfUeNgapIdIsSet
=
false
;
m_NumberOfUes
=
0
;
m_NumberOfUesIsSet
=
false
;
m_r_5gsUserStateListIsSet
=
false
;
...
...
@@ -256,6 +259,18 @@ bool AmfEventReport::operator==(const AmfEventReport& rhs) const {
(
commFailureIsSet
()
&&
rhs
.
commFailureIsSet
()
&&
getCommFailure
()
==
rhs
.
getCommFailure
()))
&&
((
!
lossOfConnectReasonIsSet
()
&&
!
rhs
.
lossOfConnectReasonIsSet
())
||
(
lossOfConnectReasonIsSet
()
&&
rhs
.
lossOfConnectReasonIsSet
()
&&
getLossOfConnectReason
()
==
rhs
.
getLossOfConnectReason
()))
&&
((
!
ranUeNgapIdIsSet
()
&&
!
rhs
.
ranUeNgapIdIsSet
())
||
(
ranUeNgapIdIsSet
()
&&
rhs
.
ranUeNgapIdIsSet
()
&&
getRanUeNgapId
()
==
rhs
.
getRanUeNgapId
()))
&&
((
!
amfUeNgapIdIsSet
()
&&
!
rhs
.
amfUeNgapIdIsSet
())
||
(
amfUeNgapIdIsSet
()
&&
rhs
.
amfUeNgapIdIsSet
()
&&
getAmfUeNgapId
()
==
rhs
.
getAmfUeNgapId
()))
&&
((
!
numberOfUesIsSet
()
&&
!
rhs
.
numberOfUesIsSet
())
||
(
numberOfUesIsSet
()
&&
rhs
.
numberOfUesIsSet
()
&&
getNumberOfUes
()
==
rhs
.
getNumberOfUes
()))
&&
...
...
@@ -293,6 +308,9 @@ void to_json(nlohmann::json& j, const AmfEventReport& o) {
j
[
"cmInfoList"
]
=
o
.
m_CmInfoList
;
if
(
o
.
reachabilityIsSet
())
j
[
"reachability"
]
=
o
.
m_Reachability
;
if
(
o
.
commFailureIsSet
())
j
[
"commFailure"
]
=
o
.
m_CommFailure
;
if
(
o
.
lossOfConnectReasonIsSet
())
j
[
"lossOfConnectReason"
]
=
o
.
m_LossOfConnectReason
;
if
(
o
.
ranUeNgapIdIsSet
())
j
[
"ranUeNgapId"
]
=
o
.
m_RanUeNgapId
;
if
(
o
.
amfUeNgapIdIsSet
())
j
[
"amfUeNgapId"
]
=
o
.
m_AmfUeNgapId
;
if
(
o
.
numberOfUesIsSet
())
j
[
"numberOfUes"
]
=
o
.
m_NumberOfUes
;
if
(
o
.
r5gsUserStateListIsSet
()
||
!
o
.
m_r_5gsUserStateList
.
empty
())
j
[
"5gsUserStateList"
]
=
o
.
m_r_5gsUserStateList
;
...
...
@@ -358,6 +376,18 @@ void from_json(const nlohmann::json& j, AmfEventReport& o) {
j
.
at
(
"commFailure"
).
get_to
(
o
.
m_CommFailure
);
o
.
m_CommFailureIsSet
=
true
;
}
if
(
j
.
find
(
"lossOfConnectReason"
)
!=
j
.
end
())
{
j
.
at
(
"lossOfConnectReason"
).
get_to
(
o
.
m_LossOfConnectReason
);
o
.
m_LossOfConnectReasonIsSet
=
true
;
}
if
(
j
.
find
(
"ranUeNgapId"
)
!=
j
.
end
())
{
j
.
at
(
"ranUeNgapId"
).
get_to
(
o
.
m_RanUeNgapId
);
o
.
m_RanUeNgapIdIsSet
=
true
;
}
if
(
j
.
find
(
"amfUeNgapId"
)
!=
j
.
end
())
{
j
.
at
(
"amfUeNgapId"
).
get_to
(
o
.
m_AmfUeNgapId
);
o
.
m_AmfUeNgapIdIsSet
=
true
;
}
if
(
j
.
find
(
"numberOfUes"
)
!=
j
.
end
())
{
j
.
at
(
"numberOfUes"
).
get_to
(
o
.
m_NumberOfUes
);
o
.
m_NumberOfUesIsSet
=
true
;
...
...
@@ -568,6 +598,45 @@ bool AmfEventReport::commFailureIsSet() const {
void
AmfEventReport
::
unsetCommFailure
()
{
m_CommFailureIsSet
=
false
;
}
LossOfConnectivityReason
AmfEventReport
::
getLossOfConnectReason
()
const
{
return
m_LossOfConnectReason
;
}
void
AmfEventReport
::
setLossOfConnectReason
(
LossOfConnectivityReason
const
&
value
)
{
m_LossOfConnectReason
=
value
;
m_LossOfConnectReasonIsSet
=
true
;
}
bool
AmfEventReport
::
lossOfConnectReasonIsSet
()
const
{
return
m_LossOfConnectReasonIsSet
;
}
void
AmfEventReport
::
unsetLossOfConnectReason
()
{
m_LossOfConnectReasonIsSet
=
false
;
}
uint32_t
AmfEventReport
::
getRanUeNgapId
()
const
{
return
m_RanUeNgapId
;
}
void
AmfEventReport
::
setRanUeNgapId
(
uint32_t
const
value
)
{
m_RanUeNgapId
=
value
;
m_RanUeNgapIdIsSet
=
true
;
}
bool
AmfEventReport
::
ranUeNgapIdIsSet
()
const
{
return
m_RanUeNgapIdIsSet
;
}
void
AmfEventReport
::
unsetRanUeNgapId
()
{
m_RanUeNgapIdIsSet
=
false
;
}
long
AmfEventReport
::
getAmfUeNgapId
()
const
{
return
m_AmfUeNgapId
;
}
void
AmfEventReport
::
setAmfUeNgapId
(
long
const
value
)
{
m_AmfUeNgapId
=
value
;
m_AmfUeNgapIdIsSet
=
true
;
}
bool
AmfEventReport
::
amfUeNgapIdIsSet
()
const
{
return
m_AmfUeNgapIdIsSet
;
}
void
AmfEventReport
::
unsetAmfUeNgapId
()
{
m_AmfUeNgapIdIsSet
=
false
;
}
int32_t
AmfEventReport
::
getNumberOfUes
()
const
{
return
m_NumberOfUes
;
}
...
...
src/sbi/amf_server/model/AmfEventReport.h
View file @
fc007600
...
...
@@ -31,6 +31,7 @@
#include "AmfEventType.h"
#include "CmInfo.h"
#include "CommunicationFailure.h"
#include "LossOfConnectivityReason.h"
#include <nlohmann/json.hpp>
namespace
oai
::
amf
::
model
{
...
...
@@ -177,6 +178,27 @@ class AmfEventReport {
/// <summary>
///
/// </summary>
LossOfConnectivityReason
getLossOfConnectReason
()
const
;
void
setLossOfConnectReason
(
LossOfConnectivityReason
const
&
value
);
bool
lossOfConnectReasonIsSet
()
const
;
void
unsetLossOfConnectReason
();
/// <summary>
///
/// </summary>
uint32_t
getRanUeNgapId
()
const
;
void
setRanUeNgapId
(
uint32_t
const
value
);
bool
ranUeNgapIdIsSet
()
const
;
void
unsetRanUeNgapId
();
/// <summary>
///
/// </summary>
long
getAmfUeNgapId
()
const
;
void
setAmfUeNgapId
(
long
const
value
);
bool
amfUeNgapIdIsSet
()
const
;
void
unsetAmfUeNgapId
();
/// <summary>
///
/// </summary>
int32_t
getNumberOfUes
()
const
;
void
setNumberOfUes
(
int32_t
const
value
);
bool
numberOfUesIsSet
()
const
;
...
...
@@ -230,6 +252,12 @@ class AmfEventReport {
bool
m_ReachabilityIsSet
;
CommunicationFailure
m_CommFailure
;
bool
m_CommFailureIsSet
;
LossOfConnectivityReason
m_LossOfConnectReason
;
bool
m_LossOfConnectReasonIsSet
;
uint32_t
m_RanUeNgapId
;
bool
m_RanUeNgapIdIsSet
;
long
m_AmfUeNgapId
;
bool
m_AmfUeNgapIdIsSet
;
int32_t
m_NumberOfUes
;
bool
m_NumberOfUesIsSet
;
std
::
vector
<
_5GsUserStateInfo
>
m_r_5gsUserStateList
;
...
...
src/sbi/amf_server/model/LossOfConnectivityReason.cpp
0 → 100644
View file @
fc007600
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
* NOTE: This class is auto generated by OpenAPI-Generator 6.0.1.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "LossOfConnectivityReason.h"
#include "Helpers.h"
#include <sstream>
namespace
oai
::
amf
::
model
{
LossOfConnectivityReason
::
LossOfConnectivityReason
()
{}
void
LossOfConnectivityReason
::
validate
()
const
{
std
::
stringstream
msg
;
if
(
!
validate
(
msg
))
{
throw
oai
::
amf
::
helpers
::
ValidationException
(
msg
.
str
());
}
}
bool
LossOfConnectivityReason
::
validate
(
std
::
stringstream
&
msg
)
const
{
return
validate
(
msg
,
""
);
}
bool
LossOfConnectivityReason
::
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
{
bool
success
=
true
;
const
std
::
string
_pathPrefix
=
pathPrefix
.
empty
()
?
"LossOfConnectivityReason"
:
pathPrefix
;
return
success
;
}
bool
LossOfConnectivityReason
::
operator
==
(
const
LossOfConnectivityReason
&
rhs
)
const
{
return
true
;
// TODO
;
}
bool
LossOfConnectivityReason
::
operator
!=
(
const
LossOfConnectivityReason
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
void
LossOfConnectivityReason
::
set_value
(
std
::
string
value
)
{
this
->
value
=
value
;
}
void
LossOfConnectivityReason
::
get_value
(
std
::
string
&
value
)
const
{
value
=
this
->
value
;
}
std
::
string
LossOfConnectivityReason
::
get_value
()
const
{
return
value
;
}
void
to_json
(
nlohmann
::
json
&
j
,
const
LossOfConnectivityReason
&
o
)
{
j
=
o
.
get_value
();
}
void
from_json
(
const
nlohmann
::
json
&
j
,
LossOfConnectivityReason
&
o
)
{
o
.
set_value
(
j
.
get
<
std
::
string
>
());
}
}
// namespace oai::amf::model
src/sbi/amf_server/model/LossOfConnectivityReason.h
0 → 100644
View file @
fc007600
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
* NOTE: This class is auto generated by OpenAPI-Generator 6.0.1.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* LossOfConnectivityReason.h
*
*
*/
#ifndef LossOfConnectivityReason_H_
#define LossOfConnectivityReason_H_
#include "LossOfConnectivityReason_anyOf.h"
#include <nlohmann/json.hpp>
namespace
oai
::
amf
::
model
{
/// <summary>
///
/// </summary>
class
LossOfConnectivityReason
{
public:
LossOfConnectivityReason
();
virtual
~
LossOfConnectivityReason
()
=
default
;
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void
validate
()
const
;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
)
const
;
bool
operator
==
(
const
LossOfConnectivityReason
&
rhs
)
const
;
bool
operator
!=
(
const
LossOfConnectivityReason
&
rhs
)
const
;
/////////////////////////////////////////////
/// LossOfConnectivityReason members
void
set_value
(
std
::
string
value
);
void
get_value
(
std
::
string
&
value
)
const
;
std
::
string
get_value
()
const
;
friend
void
to_json
(
nlohmann
::
json
&
j
,
const
LossOfConnectivityReason
&
o
);
friend
void
from_json
(
const
nlohmann
::
json
&
j
,
LossOfConnectivityReason
&
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
;
};
}
// namespace oai::amf::model
#endif
/* LossOfConnectivityReason_H_ */
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.cpp
0 → 100644
View file @
fc007600
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
* NOTE: This class is auto generated by OpenAPI-Generator 6.0.1.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include "LossOfConnectivityReason_anyOf.h"
#include "Helpers.h"
#include <stdexcept>
#include <sstream>
namespace
oai
::
amf
::
model
{
LossOfConnectivityReason_anyOf
::
LossOfConnectivityReason_anyOf
()
{}
void
LossOfConnectivityReason_anyOf
::
validate
()
const
{
std
::
stringstream
msg
;
if
(
!
validate
(
msg
))
{
throw
oai
::
amf
::
helpers
::
ValidationException
(
msg
.
str
());
}
}
bool
LossOfConnectivityReason_anyOf
::
validate
(
std
::
stringstream
&
msg
)
const
{
return
validate
(
msg
,
""
);
}
bool
LossOfConnectivityReason_anyOf
::
validate
(
std
::
stringstream
&
msg
,
const
std
::
string
&
pathPrefix
)
const
{
bool
success
=
true
;
const
std
::
string
_pathPrefix
=
pathPrefix
.
empty
()
?
"LossOfConnectivityReason_anyOf"
:
pathPrefix
;
if
(
m_value
==
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
::
INVALID_VALUE_OPENAPI_GENERATED
)
{
success
=
false
;
msg
<<
_pathPrefix
<<
": has no value;"
;
}
return
success
;
}
bool
LossOfConnectivityReason_anyOf
::
operator
==
(
const
LossOfConnectivityReason_anyOf
&
rhs
)
const
{
return
getValue
()
==
rhs
.
getValue
();
}
bool
LossOfConnectivityReason_anyOf
::
operator
!=
(
const
LossOfConnectivityReason_anyOf
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
}
void
to_json
(
nlohmann
::
json
&
j
,
const
LossOfConnectivityReason_anyOf
&
o
)
{
j
=
nlohmann
::
json
();
switch
(
o
.
getValue
())
{
case
LossOfConnectivityReason_anyOf
:
:
eLossOfConnectivityReason_anyOf
::
INVALID_VALUE_OPENAPI_GENERATED:
j
=
"INVALID_VALUE_OPENAPI_GENERATED"
;
break
;
case
LossOfConnectivityReason_anyOf
:
:
eLossOfConnectivityReason_anyOf
::
DEREGISTERED
:
j
=
"DEREGISTERED"
;
break
;
case
LossOfConnectivityReason_anyOf
:
:
eLossOfConnectivityReason_anyOf
::
MAX_DETECTION_TIME_EXPIRED
:
j
=
"MAX_DETECTION_TIME_EXPIRED"
;
break
;
case
LossOfConnectivityReason_anyOf
:
:
eLossOfConnectivityReason_anyOf
::
PURGED
:
j
=
"PURGED"
;
break
;
}
}
void
from_json
(
const
nlohmann
::
json
&
j
,
LossOfConnectivityReason_anyOf
&
o
)
{
auto
s
=
j
.
get
<
std
::
string
>
();
if
(
s
==
"DEREGISTERED"
)
{
o
.
setValue
(
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
::
DEREGISTERED
);
}
else
if
(
s
==
"MAX_DETECTION_TIME_EXPIRED"
)
{
o
.
setValue
(
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
::
MAX_DETECTION_TIME_EXPIRED
);
}
else
if
(
s
==
"PURGED"
)
{
o
.
setValue
(
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
::
PURGED
);
}
else
{
std
::
stringstream
ss
;
ss
<<
"Unexpected value "
<<
s
<<
" in json"
<<
" cannot be converted to enum of type"
<<
" LossOfConnectivityReason_anyOf::eLossOfConnectivityReason_anyOf"
;
throw
std
::
invalid_argument
(
ss
.
str
());
}
}
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
LossOfConnectivityReason_anyOf
::
getValue
()
const
{
return
m_value
;
}
void
LossOfConnectivityReason_anyOf
::
setValue
(
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
value
)
{
m_value
=
value
;
}
}
// namespace oai::amf::model
src/sbi/amf_server/model/LossOfConnectivityReason_anyOf.h
0 → 100644
View file @
fc007600
/**
* Namf_EventExposure
* AMF Event Exposure Service © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
*
* The version of the OpenAPI document: 1.1.7
*
* NOTE: This class is auto generated by OpenAPI-Generator 6.0.1.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/*
* LossOfConnectivityReason_anyOf.h
*
*
*/
#ifndef LossOfConnectivityReason_anyOf_H_
#define LossOfConnectivityReason_anyOf_H_
#include <nlohmann/json.hpp>
namespace
oai
::
amf
::
model
{
/// <summary>
///
/// </summary>
class
LossOfConnectivityReason_anyOf
{
public:
LossOfConnectivityReason_anyOf
();
virtual
~
LossOfConnectivityReason_anyOf
()
=
default
;
enum
class
eLossOfConnectivityReason_anyOf
{
// To have a valid default value.
// Avoiding nameclashes with user defined
// enum values
INVALID_VALUE_OPENAPI_GENERATED
=
0
,
DEREGISTERED
,
MAX_DETECTION_TIME_EXPIRED
,
PURGED
};
/// <summary>
/// Validate the current data in the model. Throws a ValidationException on
/// failure.
/// </summary>
void
validate
()
const
;
/// <summary>
/// Validate the current data in the model. Returns false on error and writes
/// an error message into the given stringstream.
/// </summary>
bool
validate
(
std
::
stringstream
&
msg
)
const
;
bool
operator
==
(
const
LossOfConnectivityReason_anyOf
&
rhs
)
const
;
bool
operator
!=
(
const
LossOfConnectivityReason_anyOf
&
rhs
)
const
;
/////////////////////////////////////////////
/// LossOfConnectivityReason_anyOf members
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
getValue
()
const
;
void
setValue
(
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
value
);
friend
void
to_json
(
nlohmann
::
json
&
j
,
const
LossOfConnectivityReason_anyOf
&
o
);
friend
void
from_json
(
const
nlohmann
::
json
&
j
,
LossOfConnectivityReason_anyOf
&
o
);
protected:
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
m_value
=
LossOfConnectivityReason_anyOf
::
eLossOfConnectivityReason_anyOf
::
INVALID_VALUE_OPENAPI_GENERATED
;
// 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
;
};
}
// namespace oai::amf::model
#endif
/* LossOfConnectivityReason_anyOf_H_ */
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