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
a2b4161c
Commit
a2b4161c
authored
Dec 21, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update display/add validity time
parent
4311598c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
137 additions
and
46 deletions
+137
-46
src/common/utils/api_conversions.cpp
src/common/utils/api_conversions.cpp
+22
-15
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+43
-10
src/nrf_app/nrf_profile.cpp
src/nrf_app/nrf_profile.cpp
+15
-14
src/nrf_app/nrf_subscription.cpp
src/nrf_app/nrf_subscription.cpp
+25
-4
src/nrf_app/nrf_subscription.hpp
src/nrf_app/nrf_subscription.hpp
+30
-1
src/oai-nrf/CMakeLists.txt
src/oai-nrf/CMakeLists.txt
+1
-1
yaml/cmd.txt
yaml/cmd.txt
+1
-1
No files found.
src/common/utils/api_conversions.cpp
View file @
a2b4161c
...
...
@@ -35,6 +35,8 @@
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/time_parsers.hpp>
#include <nlohmann/json.hpp>
#include <regex>
...
...
@@ -58,20 +60,20 @@ bool api_conv::profile_api_to_nrf_profile(
profile
.
get
()
->
set_nf_instance_id
(
api_profile
.
getNfInstanceId
());
profile
.
get
()
->
set_nf_instance_name
(
api_profile
.
getNfInstanceName
());
Logger
::
nrf_app
().
debug
(
"
............
Instance name: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Instance name: %s"
,
profile
.
get
()
->
get_nf_instance_name
().
c_str
());
profile
.
get
()
->
set_nf_status
(
api_profile
.
getNfStatus
());
Logger
::
nrf_app
().
debug
(
"
............
Status: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Status: %s"
,
profile
.
get
()
->
get_nf_status
().
c_str
());
profile
.
get
()
->
set_nf_heartBeat_timer
(
api_profile
.
getHeartBeatTimer
());
Logger
::
nrf_app
().
debug
(
"
............
HeartBeart timer: %d"
,
Logger
::
nrf_app
().
debug
(
"
\t
HeartBeart timer: %d"
,
profile
.
get
()
->
get_nf_heartBeat_timer
());
profile
.
get
()
->
set_nf_priority
(
api_profile
.
getPriority
());
Logger
::
nrf_app
().
debug
(
"
............
Priority: %d"
,
Logger
::
nrf_app
().
debug
(
"
\t
Priority: %d"
,
profile
.
get
()
->
get_nf_priority
());
profile
.
get
()
->
set_nf_capacity
(
api_profile
.
getCapacity
());
Logger
::
nrf_app
().
debug
(
"
............
Capacity: %d"
,
Logger
::
nrf_app
().
debug
(
"
\t
Capacity: %d"
,
profile
.
get
()
->
get_nf_capacity
());
// SNSSAIs
std
::
vector
<
Snssai
>
snssai
=
api_profile
.
getSNssais
();
...
...
@@ -80,7 +82,7 @@ bool api_conv::profile_api_to_nrf_profile(
sn
.
sD
=
s
.
getSd
();
sn
.
sST
=
s
.
getSst
();
profile
.
get
()
->
add_snssai
(
sn
);
Logger
::
nrf_app
().
debug
(
"
............
SNSSAI (SD, SST): %d, %s"
,
sn
.
sST
,
Logger
::
nrf_app
().
debug
(
"
\t
SNSSAI (SD, SST): %d, %s"
,
sn
.
sST
,
sn
.
sD
.
c_str
());
}
...
...
@@ -95,7 +97,7 @@ bool api_conv::profile_api_to_nrf_profile(
util
::
trim
(
address
).
c_str
());
}
Logger
::
nrf_app
().
debug
(
"
............
IPv4 Addr: %s"
,
address
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
\t
IPv4 Addr: %s"
,
address
.
c_str
());
profile
.
get
()
->
add_nf_ipv4_addresses
(
addr4
);
}
...
...
@@ -103,14 +105,14 @@ bool api_conv::profile_api_to_nrf_profile(
switch
(
nf_type
)
{
case
NF_TYPE_AMF
:
{
Logger
::
nrf_app
().
debug
(
"
............
AMF profile, AMF Info"
);
Logger
::
nrf_app
().
debug
(
"
\t
AMF profile, AMF Info"
);
profile
.
get
()
->
set_nf_type
(
NF_TYPE_AMF
);
amf_info_t
info
=
{};
AmfInfo
amf_info_api
=
api_profile
.
getAmfInfo
();
info
.
amf_region_id
=
amf_info_api
.
getAmfRegionId
();
info
.
amf_set_id
=
amf_info_api
.
getAmfSetId
();
Logger
::
nrf_app
().
debug
(
"
............
AMF Set ID: %s, AMF Region ID: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t\t
AMF Set ID: %s, AMF Region ID: %s"
,
info
.
amf_set_id
.
c_str
(),
info
.
amf_region_id
.
c_str
());
...
...
@@ -120,10 +122,10 @@ bool api_conv::profile_api_to_nrf_profile(
guami
.
plmn
.
mcc
=
g
.
getPlmnId
().
getMcc
();
guami
.
plmn
.
mnc
=
g
.
getPlmnId
().
getMnc
();
info
.
guami_list
.
push_back
(
guami
);
Logger
::
nrf_app
().
debug
(
"
............
AMF GUAMI, AMF_ID: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t\t
AMF GUAMI, AMF_ID: %s"
,
guami
.
amf_id
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
.....................
, PLMN (MCC: %s, MNC: %s)"
,
"
\t\t
AMF GUAMI
, PLMN (MCC: %s, MNC: %s)"
,
guami
.
plmn
.
mcc
.
c_str
(),
guami
.
plmn
.
mnc
.
c_str
());
}
(
std
::
static_pointer_cast
<
amf_profile
>
(
profile
))
...
...
@@ -131,7 +133,7 @@ bool api_conv::profile_api_to_nrf_profile(
->
add_amf_info
(
info
);
}
break
;
case
NF_TYPE_SMF
:
{
Logger
::
nrf_app
().
debug
(
"
............
SMF profile, SMF Info"
);
Logger
::
nrf_app
().
debug
(
"
\t
SMF profile, SMF Info"
);
profile
.
get
()
->
set_nf_type
(
NF_TYPE_SMF
);
smf_info_t
info
=
{};
SmfInfo
smf_info_api
=
api_profile
.
getSmfInfo
();
...
...
@@ -140,13 +142,13 @@ bool api_conv::profile_api_to_nrf_profile(
snssai_smf_info_item_t
snssai
=
{};
snssai
.
snssai
.
sD
=
s
.
getSNssai
().
getSd
();
snssai
.
snssai
.
sST
=
s
.
getSNssai
().
getSst
();
Logger
::
nrf_app
().
debug
(
"
.......................
NSSAI SD: %s, SST: %d"
,
Logger
::
nrf_app
().
debug
(
"
\t\t
NSSAI SD: %s, SST: %d"
,
snssai
.
snssai
.
sD
.
c_str
(),
snssai
.
snssai
.
sST
);
for
(
auto
d
:
s
.
getDnnSmfInfoList
())
{
dnn_smf_info_item_t
dnn
=
{};
dnn
.
dnn
=
d
.
getDnn
();
snssai
.
dnn_smf_info_list
.
push_back
(
dnn
);
Logger
::
nrf_app
().
debug
(
"
......................
DNN: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t\t
DNN: %s"
,
dnn
.
dnn
.
c_str
());
}
info
.
snssai_smf_info_list
.
push_back
(
snssai
);
...
...
@@ -301,10 +303,15 @@ bool api_conv::subscription_api_to_nrf_subscription(
}
else
{
sub
.
get
()
->
add_notif_event
(
NOTIFICATION_TYPE_UNKNOWN_EVENT
);
}
//Logger::nrf_app().debug("ReqNotifEvents: %s", n.c_str());
}
}
if
(
api_sub
.
validityTimeIsSet
())
{
std
::
string
str
=
api_sub
.
getValidityTime
();
boost
::
posix_time
::
ptime
p
(
boost
::
posix_time
::
from_iso_string
(
str
));
sub
.
get
()
->
set_validity_time
(
p
);
Logger
::
nrf_app
().
debug
(
"Validity Time: %s"
,
str
.
c_str
());
}
// TODO:
return
true
;
}
...
...
src/nrf_app/nrf_app.cpp
View file @
a2b4161c
...
...
@@ -28,7 +28,11 @@
*/
#include "nrf_app.hpp"
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/time_formatters.hpp>
#include <chrono>
#include "3gpp_29.500.h"
#include "3gpp_29.510.h"
#include "api_conversions.hpp"
...
...
@@ -406,7 +410,7 @@ bool nrf_app::update_nf_profile(const std::string &profile_id,
//------------------------------------------------------------------------------
std
::
shared_ptr
<
nrf_profile
>
nrf_app
::
find_nf_profile
(
const
std
::
string
&
profile_id
)
const
{
Logger
::
nrf_app
().
info
(
"Find a NF profile with ID %s"
,
profile_id
.
c_str
());
//
Logger::nrf_app().info("Find a NF profile with ID %s", profile_id.c_str());
std
::
shared_lock
lock
(
m_instance_id2nrf_profile
);
if
(
instance_id2nrf_profile
.
count
(
profile_id
)
>
0
)
{
...
...
@@ -420,7 +424,7 @@ std::shared_ptr<nrf_profile> nrf_app::find_nf_profile(
//------------------------------------------------------------------------------
bool
nrf_app
::
find_nf_profile
(
const
std
::
string
&
profile_id
,
std
::
shared_ptr
<
nrf_profile
>
&
p
)
const
{
Logger
::
nrf_app
().
info
(
"Find a NF profile with ID %s"
,
profile_id
.
c_str
());
//
Logger::nrf_app().info("Find a NF profile with ID %s", profile_id.c_str());
std
::
shared_lock
lock
(
m_instance_id2nrf_profile
);
if
(
instance_id2nrf_profile
.
count
(
profile_id
)
>
0
)
{
...
...
@@ -572,16 +576,20 @@ void nrf_app::handle_nf_status_registered(const std::string &profile_id) {
profile_id
.
c_str
());
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
Logger
::
nrf_app
().
info
(
"
\t
Find a NF profile with ID %s"
,
profile_id
.
c_str
());
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
!=
nullptr
)
{
std
::
vector
<
std
::
string
>
notification_uris
=
{};
get_subscription_list
(
profile_id
,
NOTIFICATION_TYPE_NF_REGISTERED
,
notification_uris
);
// send notifications
nrf_client_inst
->
notify_subscribed_event
(
profile
,
notification_uris
);
if
(
notification_uris
.
size
()
>
0
)
nrf_client_inst
->
notify_subscribed_event
(
profile
,
notification_uris
);
else
Logger
::
nrf_app
().
debug
(
"
\t
No subscription found"
);
}
else
{
Logger
::
nrf_app
().
error
(
"NF profile not found, profile id %s"
,
Logger
::
nrf_app
().
error
(
"
\t
NF profile not found, profile id %s"
,
profile_id
.
c_str
());
}
}
...
...
@@ -648,19 +656,45 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
const
uint8_t
&
notification_type
,
std
::
vector
<
std
::
string
>
&
uris
)
const
{
Logger
::
nrf_app
().
debug
(
"Get the list of subscriptions related to this profile, profile id %s"
,
"
\t
Get the list of subscriptions related to this profile, profile id %s"
,
profile_id
.
c_str
());
std
::
shared_ptr
<
nrf_profile
>
profile
=
{};
find_nf_profile
(
profile_id
,
profile
);
if
(
profile
.
get
()
==
nullptr
)
{
// error
return
;
}
for
(
auto
s
:
instance_id2nrf_subscription
)
{
Logger
::
nrf_app
().
info
(
"
\t
Verifying subscription, subscription id %s"
,
s
.
first
.
c_str
());
std
::
string
uri
;
s
.
second
.
get
()
->
get_notification_uri
(
uri
);
//check notification event type
bool
match_notif_type
=
false
;
for
(
auto
i
:
s
.
second
.
get
()
->
get_notif_events
())
{
if
(
i
==
notification_type
)
{
match_notif_type
=
true
;
break
;
}
}
if
(
!
match_notif_type
)
continue
;
// check validity time
boost
::
posix_time
::
ptime
t
(
boost
::
posix_time
::
microsec_clock
::
local_time
());
Logger
::
nrf_app
().
debug
(
"
\t
Current time %s"
,
boost
::
posix_time
::
to_iso_string
(
t
).
c_str
());
if
(
t
>
s
.
second
.
get
()
->
get_validity_time
())
{
Logger
::
nrf_app
().
debug
(
"
\t
This subscription expires, current time %s, validity time %s"
,
boost
::
posix_time
::
to_iso_string
(
t
).
c_str
(),
boost
::
posix_time
::
to_iso_string
(
s
.
second
.
get
()
->
get_validity_time
()).
c_str
());
continue
;
}
subscription_condition_t
condition
=
{};
s
.
second
.
get
()
->
get_sub_condition
(
condition
);
...
...
@@ -668,7 +702,7 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
case
NF_INSTANCE_ID_COND
:
{
if
(
profile_id
.
compare
(
condition
.
nf_instance_id
)
==
0
)
{
uris
.
push_back
(
uri
);
Logger
::
nrf_app
().
debug
(
"Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
Logger
::
nrf_app
().
debug
(
"
\t
Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
uri
.
c_str
());
}
...
...
@@ -677,7 +711,7 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
std
::
string
nf_type
=
nf_type_e2str
[
profile
.
get
()
->
get_nf_type
()];
if
(
nf_type
.
compare
(
condition
.
nf_type
)
==
0
)
{
uris
.
push_back
(
uri
);
Logger
::
nrf_app
().
debug
(
"Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
Logger
::
nrf_app
().
debug
(
"
\t
Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
uri
.
c_str
());
}
}
break
;
...
...
@@ -687,7 +721,7 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
profile
.
get
()
->
get_nf_instance_name
(
service_name
);
if
(
service_name
.
compare
(
condition
.
service_name
)
==
0
)
{
uris
.
push_back
(
uri
);
Logger
::
nrf_app
().
debug
(
"Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
Logger
::
nrf_app
().
debug
(
"
\t
Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
uri
.
c_str
());
}
...
...
@@ -702,7 +736,7 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
0
)
and
(
info
.
amf_set_id
.
compare
(
condition
.
amf_info
.
amf_set_id
)
==
0
))
{
uris
.
push_back
(
uri
);
Logger
::
nrf_app
().
debug
(
"Subscription id %s, uri %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Subscription id %s, uri %s"
,
s
.
first
.
c_str
(),
uri
.
c_str
());
}
}
...
...
@@ -725,7 +759,6 @@ void nrf_app::get_subscription_list(const std::string &profile_id,
}
}
//TODO: reqNotifEvents
}
// TODO:
...
...
src/nrf_app/nrf_profile.cpp
View file @
a2b4161c
...
...
@@ -178,31 +178,32 @@ void nrf_profile::get_json_data(nlohmann::json &data) const {
//------------------------------------------------------------------------------
void
nrf_profile
::
display
()
{
Logger
::
nrf_app
().
debug
(
"NF instance info"
);
Logger
::
nrf_app
().
debug
(
"
............
Instance ID: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Instance ID: %s"
,
nf_instance_id
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
............
Instance name: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Instance name: %s"
,
nf_instance_name
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
............
Instance type: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Instance type: %s"
,
nf_type_e2str
[
nf_type
].
c_str
());
Logger
::
nrf_app
().
debug
(
"
............
Status: %s"
,
nf_status
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
............
HeartBeat timer: %d"
,
heartBeat_timer
);
Logger
::
nrf_app
().
debug
(
"
............
Priority: %d"
,
priority
);
Logger
::
nrf_app
().
debug
(
"
............
Capacity: %d"
,
capacity
);
Logger
::
nrf_app
().
debug
(
"
\t
Status: %s"
,
nf_status
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
\t
HeartBeat timer: %d"
,
heartBeat_timer
);
Logger
::
nrf_app
().
debug
(
"
\t
Priority: %d"
,
priority
);
Logger
::
nrf_app
().
debug
(
"
\t
Capacity: %d"
,
capacity
);
//SNSSAIs
for
(
auto
s
:
snssais
)
{
Logger
::
nrf_app
().
debug
(
"
............
NNSSAI(SST, SD): %d, %s"
,
s
.
sST
,
Logger
::
nrf_app
().
debug
(
"
\t
NNSSAI(SST, SD): %d, %s"
,
s
.
sST
,
s
.
sD
.
c_str
());
}
//IPv4 Addresses
for
(
auto
address
:
ipv4_addresses
)
{
Logger
::
nrf_app
().
debug
(
"
............
IPv4 Addr: %s"
,
inet_ntoa
(
address
));
Logger
::
nrf_app
().
debug
(
"
\t
IPv4 Addr: %s"
,
inet_ntoa
(
address
));
}
if
(
!
json_data
.
empty
())
{
Logger
::
nrf_app
().
debug
(
"
............
Json Data: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Json Data: %s"
,
json_data
.
dump
().
c_str
());
}
}
...
...
@@ -496,16 +497,16 @@ void amf_profile::get_amf_info(amf_info_t &info) const {
void
amf_profile
::
display
()
{
nrf_profile
::
display
();
Logger
::
nrf_app
().
debug
(
"
............
AMF Info"
);
Logger
::
nrf_app
().
debug
(
"
\t
AMF Info"
);
Logger
::
nrf_app
().
debug
(
"
.....................
AMF Set ID: %s, AMF Region ID: %s"
,
"
\t\t
AMF Set ID: %s, AMF Region ID: %s"
,
amf_info
.
amf_set_id
.
c_str
(),
amf_info
.
amf_region_id
.
c_str
());
for
(
auto
g
:
amf_info
.
guami_list
)
{
Logger
::
nrf_app
().
debug
(
"
.....................
AMF GUAMI List, AMF_ID: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t\t
AMF GUAMI List, AMF_ID: %s"
,
g
.
amf_id
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
........................
AMF GUAMI List, PLMN (MCC: %s, MNC: %s)"
,
"
\t\t
AMF GUAMI List, PLMN (MCC: %s, MNC: %s)"
,
g
.
plmn
.
mcc
.
c_str
(),
g
.
plmn
.
mnc
.
c_str
());
}
}
...
...
src/nrf_app/nrf_subscription.cpp
View file @
a2b4161c
...
...
@@ -28,7 +28,10 @@
*/
#include "nrf_subscription.hpp"
#include <boost/date_time/posix_time/time_formatters.hpp>
#include <nlohmann/json.hpp>
#include "logger.hpp"
using
namespace
oai
::
nrf
::
app
;
...
...
@@ -97,14 +100,29 @@ std::vector<uint8_t> nrf_subscription::get_notif_events() const {
return
notif_events
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
set_validity_time
(
const
boost
::
posix_time
::
ptime
&
t
)
{
validity_time
=
t
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
get_validity_time
(
boost
::
posix_time
::
ptime
&
t
)
const
{
t
=
validity_time
;
}
//------------------------------------------------------------------------------
boost
::
posix_time
::
ptime
nrf_subscription
::
get_validity_time
()
const
{
return
validity_time
;
}
//------------------------------------------------------------------------------
void
nrf_subscription
::
display
()
{
Logger
::
nrf_app
().
debug
(
"Subscription information"
);
Logger
::
nrf_app
().
debug
(
"
.............
Sub ID: %s"
,
subscription_id
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
\t
Sub ID: %s"
,
subscription_id
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
.............
Notification URI: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Notification URI: %s"
,
nf_status_notification_uri
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
.............
Subscription condition: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Subscription condition: %s"
,
sub_condition
.
to_string
().
c_str
());
std
::
string
notif_events_str
=
{};
...
...
@@ -112,8 +130,11 @@ void nrf_subscription::display() {
notif_events_str
.
append
(
notification_event_type_e2str
[
n
]);
notif_events_str
.
append
(
", "
);
}
Logger
::
nrf_app
().
debug
(
"
.............
Notification Events: %s"
,
Logger
::
nrf_app
().
debug
(
"
\t
Notification Events: %s"
,
notif_events_str
.
c_str
());
Logger
::
nrf_app
().
debug
(
"
\t
Validity time: %s"
,
boost
::
posix_time
::
to_iso_string
(
validity_time
).
c_str
());
}
//------------------------------------------------------------------------------
...
...
src/nrf_app/nrf_subscription.hpp
View file @
a2b4161c
...
...
@@ -30,6 +30,8 @@
#ifndef FILE_NRF_SUBSCRIPTION_HPP_SEEN
#define FILE_NRF_SUBSCRIPTION_HPP_SEEN
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/time_parsers.hpp>
#include "3gpp_29.510.h"
#include "logger.hpp"
#include "nrf_event.hpp"
...
...
@@ -42,7 +44,11 @@ using namespace std;
class
nrf_subscription
{
public:
nrf_subscription
(
nrf_event
&
ev
)
:
m_event_sub
(
ev
){};
nrf_subscription
(
nrf_event
&
ev
)
:
m_event_sub
(
ev
){
validity_time
=
boost
::
posix_time
::
from_iso_string
(
"20991231T235959Z"
);
};
nrf_subscription
(
nrf_subscription
const
&
)
=
delete
;
...
...
@@ -133,6 +139,27 @@ class nrf_subscription {
*/
std
::
vector
<
uint8_t
>
get_notif_events
()
const
;
/*
* Set the validity time
* @param [const boost::posix_time::ptime &]t: validity time
* @return
*/
void
set_validity_time
(
const
boost
::
posix_time
::
ptime
&
t
);
/*
* Get the validity time
* @param [boost::posix_time::ptime &]t: validity time
* @return
*/
void
get_validity_time
(
boost
::
posix_time
::
ptime
&
t
)
const
;
/*
* Get the validity time
* @param [void]
* @return [boost::posix_time::ptime &] validity time
*/
boost
::
posix_time
::
ptime
get_validity_time
()
const
;
/*
* Subscribe to be notified when a new NF registered to the NRF
* @param void
...
...
@@ -162,6 +189,8 @@ class nrf_subscription {
std
::
vector
<
uint8_t
>
notif_events
;
nrf_event
&
m_event_sub
;
bs2
::
connection
ev_connection
;
boost
::
posix_time
::
ptime
validity_time
;
};
}
// namespace app
}
// namespace nrf
...
...
src/oai-nrf/CMakeLists.txt
View file @
a2b4161c
...
...
@@ -314,5 +314,5 @@ IF(STATIC_LINKING)
ENDIF
(
STATIC_LINKING
)
target_link_libraries
(
nrf
${
ASAN
}
-Wl,--start-group NRF 3GPP_COMMON_TYPES NRF_API CN_UTILS -lnettle
${
NETTLE_LIBRARIES
}
${
CRYPTO_LIBRARIES
}
-lnghttp2_asio -lboost_system -lboost_thread -lssl -lcrypto gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl
)
-Wl,--start-group NRF 3GPP_COMMON_TYPES NRF_API CN_UTILS -lnettle
${
NETTLE_LIBRARIES
}
${
CRYPTO_LIBRARIES
}
-lnghttp2_asio -lboost_system -lboost_thread -l
boost_date_time -l
ssl -lcrypto gflags glog dl double-conversion folly -Wl,--end-group pthread m rt config++ event boost_system pistache curl
)
\ No newline at end of file
yaml/cmd.txt
View file @
a2b4161c
...
...
@@ -9,4 +9,4 @@ curl -X POST http://192.168.1.23/nnrf-nfm/v1/subscriptions -d '{"nfStatusNotific
curl -X POST http://192.168.1.23/nnrf-nfm/v1/subscriptions -d '{"nfStatusNotificationUri":"http://192.168.1.23/nnrf-nfm/v1/nf-instances/343a924e-6494-4927-860b-d45692c95c2d", "subscrCond": {"NfTypeCond": {"nfType":"AMF"} } }'
curl -X POST -H "Content-Type: application/json" "http://192.168.1.23/nnrf-nfm/v1/subscriptions" -d '{"nfStatusNotificationUri":"http://192.168.1.23/nnrf-nfm/v1/nf-instances/343a924e-6494-4927-860b-d45692c95c2d", "subscrCond": {"NfTypeCond": {"nfType":"AMF"}}, "reqNotifEvents":["NF_REGISTERED", "NF_DEREGISTERED"] }'
\ No newline at end of file
curl -X POST -H "Content-Type: application/json" "http://192.168.1.23/nnrf-nfm/v1/subscriptions" -d '{"nfStatusNotificationUri":"http://192.168.1.23/nnrf-nfm/v1/nf-instances/343a924e-6494-4927-860b-d45692c95c2d", "subscrCond": {"NfTypeCond": {"nfType":"AMF"}}, "reqNotifEvents":["NF_REGISTERED", "NF_DEREGISTERED"], "validityTime":"20020131T235959" }'
\ No newline at end of file
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