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
cfb25c3a
Commit
cfb25c3a
authored
Dec 29, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add function to generate NRF UUID
parent
97a1cf75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
src/nrf_app/nrf_app.cpp
src/nrf_app/nrf_app.cpp
+7
-0
src/nrf_app/nrf_app.hpp
src/nrf_app/nrf_app.hpp
+16
-6
No files found.
src/nrf_app/nrf_app.cpp
View file @
cfb25c3a
...
@@ -34,6 +34,8 @@
...
@@ -34,6 +34,8 @@
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/date_time/posix_time/time_formatters.hpp>
#include <boost/date_time/posix_time/time_formatters.hpp>
#include <boost/uuid/random_generator.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <chrono>
#include <chrono>
#include "3gpp_29.500.h"
#include "3gpp_29.500.h"
...
@@ -77,6 +79,11 @@ nrf_app::nrf_app(const std::string &config_file, nrf_event &ev)
...
@@ -77,6 +79,11 @@ nrf_app::nrf_app(const std::string &config_file, nrf_event &ev)
Logger
::
nrf_app
().
startup
(
"Started"
);
Logger
::
nrf_app
().
startup
(
"Started"
);
}
}
//------------------------------------------------------------------------------
void
nrf_app
::
generate_uuid
()
{
instance_id
=
to_string
(
boost
::
uuids
::
random_generator
()());
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void
nrf_app
::
handle_register_nf_instance
(
void
nrf_app
::
handle_register_nf_instance
(
const
std
::
string
&
nf_instance_id
,
const
std
::
string
&
nf_instance_id
,
...
...
src/nrf_app/nrf_app.hpp
View file @
cfb25c3a
...
@@ -31,18 +31,17 @@
...
@@ -31,18 +31,17 @@
#define FILE_NRF_APP_HPP_SEEN
#define FILE_NRF_APP_HPP_SEEN
#include <string>
#include <string>
#include "AccessTokenRsp.h"
#include "NFProfile.h"
#include "NFProfile.h"
#include "PatchItem.h"
#include "PatchItem.h"
#include "ProblemDetails.h"
#include "ProblemDetails.h"
#include "SubscriptionData.h"
#include "SubscriptionData.h"
#include "AccessTokenRsp.h"
#include "nrf_event.hpp"
#include "nrf_event.hpp"
#include "nrf_profile.hpp"
#include "nrf_profile.hpp"
#include "nrf_search_result.hpp"
#include "nrf_search_result.hpp"
#include "nrf_subscription.hpp"
#include "nrf_subscription.hpp"
#include "uint_generator.hpp"
#include "uint_generator.hpp"
namespace
oai
{
namespace
oai
{
namespace
nrf
{
namespace
nrf
{
namespace
app
{
namespace
app
{
...
@@ -62,6 +61,13 @@ class nrf_app {
...
@@ -62,6 +61,13 @@ class nrf_app {
}
}
}
}
/*
* Generate a random UUID for NRF instance
* @param [void]
* @return void
*/
void
generate_uuid
();
/*
/*
* Handle a Register NF Instance request
* Handle a Register NF Instance request
* @param [const std::string &] nf_instance_id: Instance ID
* @param [const std::string &] nf_instance_id: Instance ID
...
@@ -181,7 +187,8 @@ class nrf_app {
...
@@ -181,7 +187,8 @@ class nrf_app {
* @param [const std::string &] requester_nf_type: Requester NF type
* @param [const std::string &] requester_nf_type: Requester NF type
* @param [const std::string &] requester_nf_instance_id: Requester NF
* @param [const std::string &] requester_nf_instance_id: Requester NF
* instance id
* instance id
* @param [uint32_t &] limit_nfs: Maximum number of NFProfiles to be returned in the response:
* @param [uint32_t &] limit_nfs: Maximum number of NFProfiles to be returned
* in the response:
* @param [std::string &] search_id: Store search result ID
* @param [std::string &] search_id: Store search result ID
* @param [int &] http_code: HTTP code used to return to the consumer
* @param [int &] http_code: HTTP code used to return to the consumer
* @param [const uint8_t] http_version: HTTP version
* @param [const uint8_t] http_version: HTTP version
...
@@ -416,7 +423,8 @@ class nrf_app {
...
@@ -416,7 +423,8 @@ class nrf_app {
/*
/*
* Add a search result to the DB
* Add a search result to the DB
* @param [const std::string &] id: Search ID
* @param [const std::string &] id: Search ID
* @param [const std::shared_ptr<nrf_search_result> &] s: Pointer to the search result
* @param [const std::shared_ptr<nrf_search_result> &] s: Pointer to the
* search result
* @return void
* @return void
*/
*/
bool
add_search_result
(
const
std
::
string
&
id
,
bool
add_search_result
(
const
std
::
string
&
id
,
...
@@ -425,13 +433,15 @@ class nrf_app {
...
@@ -425,13 +433,15 @@ class nrf_app {
/*
/*
* Find a search result with its ID
* Find a search result with its ID
* @param [const std::string &] search_id: Search ID
* @param [const std::string &] search_id: Search ID
* @param [std::shared_ptr<nrf_search_result> &] s: Pointer to the search result
* @param [std::shared_ptr<nrf_search_result> &] s: Pointer to the search
* result
* @return true if found, otherwise false
* @return true if found, otherwise false
*/
*/
bool
find_search_result
(
const
std
::
string
&
search_id
,
bool
find_search_result
(
const
std
::
string
&
search_id
,
std
::
shared_ptr
<
nrf_search_result
>
&
p
)
const
;
std
::
shared_ptr
<
nrf_search_result
>
&
p
)
const
;
private:
private:
std
::
string
instance_id
;
// NRF instance id
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
nrf_profile
>>
instance_id2nrf_profile
;
std
::
map
<
std
::
string
,
std
::
shared_ptr
<
nrf_profile
>>
instance_id2nrf_profile
;
mutable
std
::
shared_mutex
m_instance_id2nrf_profile
;
mutable
std
::
shared_mutex
m_instance_id2nrf_profile
;
...
...
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