Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-NRF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
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-NRF
Commits
f4e86ad1
Commit
f4e86ad1
authored
Dec 18, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update NRF subscription
parent
03fad3c2
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
101 additions
and
12 deletions
+101
-12
src/api-server/model/SubscriptionData.h
src/api-server/model/SubscriptionData.h
+1
-1
src/common/3gpp_29.510.h
src/common/3gpp_29.510.h
+73
-0
src/common/utils/api_conversions.cpp
src/common/utils/api_conversions.cpp
+2
-0
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+1
-10
src/nrf_app/nrf_app.hpp
src/nrf_app/nrf_app.hpp
+0
-1
src/nrf_app/nrf_subscription.cpp
src/nrf_app/nrf_subscription.cpp
+19
-0
src/nrf_app/nrf_subscription.hpp
src/nrf_app/nrf_subscription.hpp
+5
-0
No files found.
src/api-server/model/SubscriptionData.h
View file @
f4e86ad1
...
...
@@ -84,7 +84,7 @@ typedef struct subscription_condition_api_s {
bool
operator
==
(
const
uint8_t
&
t
)
const
{
return
(
t
==
type
);
}
subscription_condition_api_s
&
operator
=
(
subscription_condition_api_s
s
)
{
subscription_condition_api_s
&
operator
=
(
subscription_condition_api_s
&
s
)
{
// TODO:
}
...
...
src/common/3gpp_29.510.h
View file @
f4e86ad1
...
...
@@ -78,12 +78,85 @@ typedef struct subscription_condition_s {
subscription_condition_s
(
uint8_t
t
)
:
type
(
t
)
{}
subscription_condition_s
(
const
subscription_condition_s
&
s
)
{
type
=
s
.
type
;
switch
(
s
.
type
)
{
case
NF_INSTANCE_ID_COND
:
{
nf_instance_id
=
s
.
nf_instance_id
;
}
break
;
case
NF_TYPE_COND
:
{
nf_type
=
s
.
nf_type
;
}
break
;
case
SERVICE_NAME_COND
:
{
service_name
=
s
.
service_name
;
}
break
;
case
AMF_COND
:
{
amf_info
.
amf_set_id
=
s
.
amf_info
.
amf_set_id
;
amf_info
.
amf_region_id
=
s
.
amf_info
.
amf_region_id
;
}
break
;
case
GUAMI_LIST_COND
:
{
// TODO:
}
break
;
case
NETWOTK_SLICE_COND
:
{
// TODO:
}
break
;
case
NF_GROUP_COND
:
{
// TODO:
}
break
;
default:
{
// TODO:
}
}
// TODO:
}
bool
operator
==
(
const
struct
subscription_condition_s
&
s
)
const
{
return
(
s
.
type
==
type
);
}
bool
operator
==
(
const
uint8_t
&
t
)
const
{
return
(
t
==
type
);
}
subscription_condition_s
&
operator
=
(
const
subscription_condition_s
&
s
)
{
type
=
s
.
type
;
switch
(
s
.
type
)
{
case
NF_INSTANCE_ID_COND
:
{
nf_instance_id
=
s
.
nf_instance_id
;
}
break
;
case
NF_TYPE_COND
:
{
nf_type
=
s
.
nf_type
;
}
break
;
case
SERVICE_NAME_COND
:
{
service_name
=
s
.
service_name
;
}
break
;
case
AMF_COND
:
{
amf_info
.
amf_set_id
=
s
.
amf_info
.
amf_set_id
;
amf_info
.
amf_region_id
=
s
.
amf_info
.
amf_region_id
;
}
break
;
case
GUAMI_LIST_COND
:
{
// TODO:
}
break
;
case
NETWOTK_SLICE_COND
:
{
// TODO:
}
break
;
case
NF_GROUP_COND
:
{
// TODO:
}
break
;
default:
{
// TODO:
}
}
// TODO:
}
virtual
~
subscription_condition_s
(){};
}
subscription_condition_t
;
...
...
src/common/utils/api_conversions.cpp
View file @
f4e86ad1
...
...
@@ -282,6 +282,8 @@ bool api_conv::subscription_api_to_nrf_subscription(
Logger
::
nrf_app
().
debug
(
"Subscription condition type: %s"
,
subscription_condition_type_e2str
[
sub_condition
.
type
].
c_str
());
sub
.
get
()
->
set_sub_condition
(
sub_condition
);
}
// TODO:
return
true
;
...
...
src/nrf_app/nrf_app.cpp
View file @
f4e86ad1
...
...
@@ -535,16 +535,6 @@ void nrf_app::subscribe_nf_status(const std::string &sub_id) {
subscribe_nf_status_profile_changed
();
}
/*
//------------------------------------------------------------------------------
void nrf_app::handle_nf_status(const std::string &profile_id) {
Logger::nrf_app().info("Handle NF status, profile id %s",
profile_id.c_str()); std::vector<std::string> notification_uris = {};
get_subscription_list(profile_id, notification_uris);
}
*/
//------------------------------------------------------------------------------
void
nrf_app
::
subscribe_nf_status_registered
()
{
Logger
::
nrf_app
().
debug
(
"Subscribe to NF status registered"
);
...
...
@@ -599,5 +589,6 @@ void nrf_app::handle_nf_status_profile_changed(const std::string &profile_id) {
void
nrf_app
::
get_subscription_list
(
const
std
::
string
&
profile_id
,
uint8_t
notification_type
,
std
::
vector
<
std
::
string
>
&
uris
)
{
// TODO:
}
src/nrf_app/nrf_app.hpp
View file @
f4e86ad1
...
...
@@ -213,7 +213,6 @@ class nrf_app {
evsub_id_t
generate_ev_subscription_id
();
void
subscribe_nf_status
(
const
std
::
string
&
sub_id
);
// void handle_nf_status(const std::string &profile_id);
void
subscribe_nf_status_registered
();
void
handle_nf_status_registered
(
const
std
::
string
&
profile_id
);
void
subscribe_nf_status_deregistered
();
...
...
src/nrf_app/nrf_subscription.cpp
View file @
f4e86ad1
...
...
@@ -48,16 +48,32 @@ std::string nrf_subscription::get_subscription_id() const {
return
subscription_id
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
set_notification_uri
(
const
std
::
string
&
notification_uri
)
{
nf_status_notification_uri
=
notification_uri
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
get_notification_uri
(
std
::
string
&
notification_uri
)
const
{
notification_uri
=
nf_status_notification_uri
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
set_sub_condition
(
const
subscription_condition_t
&
c
)
{
sub_condition
=
c
;
}
void
nrf_subscription
::
get_sub_condition
(
subscription_condition_t
&
c
)
const
{
c
=
sub_condition
;
}
/*
//------------------------------------------------------------------------------
subscription_condition_t nrf_subscription::get_sub_condition() const {
return sub_condition;
}
*/
//------------------------------------------------------------------------------
void
nrf_subscription
::
display
()
{
Logger
::
nrf_app
().
debug
(
"Subscription ID: %s"
,
subscription_id
.
c_str
());
...
...
@@ -90,3 +106,6 @@ void nrf_subscription::handle_nf_status_change(const std::shared_ptr<nrf_profile
}
src/nrf_app/nrf_subscription.hpp
View file @
f4e86ad1
...
...
@@ -34,6 +34,7 @@
#include "nrf_event.hpp"
#include "nrf_profile.hpp"
#include "logger.hpp"
#include "3gpp_29.510.h"
namespace
oai
{
namespace
nrf
{
...
...
@@ -56,12 +57,16 @@ class nrf_subscription {
void
set_notification_uri
(
const
std
::
string
&
notification_uri
);
void
get_notification_uri
(
std
::
string
&
notification_uri
)
const
;
void
display
();
void
set_sub_condition
(
const
subscription_condition_t
&
c
);
void
get_sub_condition
(
subscription_condition_t
&
c
)
const
;
// subscription_condition_t get_sub_condition() const;
void
subscribe_nf_status_change
();
void
handle_nf_status_change
(
const
std
::
shared_ptr
<
nrf_profile
>
&
profile
);
private:
std
::
string
nf_status_notification_uri
;
std
::
string
subscription_id
;
subscription_condition_t
sub_condition
;
nrf_event
&
m_event_sub
;
bs2
::
connection
ev_connection
;
};
...
...
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