Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-SMF
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-SMF
Commits
2716d4c0
Commit
2716d4c0
authored
Jun 03, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add function header
parent
2816b551
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
12 deletions
+48
-12
src/smf_app/smf_sbi.cpp
src/smf_app/smf_sbi.cpp
+0
-9
src/smf_app/smf_sbi.hpp
src/smf_app/smf_sbi.hpp
+48
-3
No files found.
src/smf_app/smf_sbi.cpp
View file @
2716d4c0
...
...
@@ -777,16 +777,7 @@ void smf_sbi::subscribe_upf_status_notify(
bool
smf_sbi
::
get_sm_data
(
const
supi64_t
&
supi
,
const
std
::
string
&
dnn
,
const
snssai_t
&
snssai
,
std
::
shared_ptr
<
session_management_subscription
>
subscription
)
{
// retrieve a UE's Session Management Subscription Data
nlohmann
::
json
jsonData
=
{};
curl_global_init
(
CURL_GLOBAL_DEFAULT
);
struct
curl_slist
*
headers
=
nullptr
;
headers
=
curl_slist_append
(
headers
,
"Accept: application/json"
);
headers
=
curl_slist_append
(
headers
,
"Content-Type: application/json"
);
headers
=
curl_slist_append
(
headers
,
"charsets: utf-8"
);
CURL
*
curl
=
curl_easy_init
();
std
::
string
url
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
smf_cfg
.
udm_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
smf_cfg
.
udm_addr
.
port
)
+
NUDM_SDM_BASE
+
...
...
src/smf_app/smf_sbi.hpp
View file @
2716d4c0
...
...
@@ -170,21 +170,42 @@ class smf_sbi {
/*
* Create Curl handle for multi curl
* @param [const std::string &] uri: URI of the subscribed NF
* @param [std::string &] data: data to be sent
* @param [const char* ] data: pointer to the data to be sent
* @param [uint32_t] data_len: len of data to be sent
* @param [std::string &] response_data: response data
* @return pointer to the created curl
* @param [uint32_t* ] promise_id: pointer to the promise id
* @param [const std::string&] method: HTTP method
* @param [bool] is_multipart: use multipart or json format
* @return void
*/
void
curl_create_handle
(
const
std
::
string
&
uri
,
const
char
*
data
,
uint32_t
data_len
,
std
::
string
&
response_data
,
uint32_t
*
promise_id
,
const
std
::
string
&
method
,
bool
is_multipart
);
/*
* Create Curl handle for multi curl
* @param [const std::string &] uri: URI of the subscribed NF
* @param [const std::string& ] data: data to be sent
* @param [std::string &] response_data: response data
* @param [uint32_t* ] promise_id: pointer to the promise id
* @param [const std::string&] method: HTTP method
* @param [bool] is_multipart: use multipart or json format
* @return void
*/
void
curl_create_handle
(
const
std
::
string
&
uri
,
const
std
::
string
&
data
,
std
::
string
&
response_data
,
uint32_t
*
promise_id
,
const
std
::
string
&
method
);
/*
* Create Curl handle for multi curl
* @param [const std::string &] uri: URI of the subscribed NF
* @param [std::string &] response_data: response data
* @param [uint32_t* ] promise_id: pointer to the promise id
* @param [const std::string&] method: HTTP method
* @return void
*/
void
curl_create_handle
(
const
std
::
string
&
uri
,
std
::
string
&
response_data
,
uint32_t
*
promise_id
,
const
std
::
string
&
method
);
...
...
@@ -203,11 +224,35 @@ class smf_sbi {
*/
void
curl_release_handles
();
/*
* Wait for the promise ready
* @param [boost::shared_future<uint32_t>&] f: future
* @return future value
*/
uint32_t
get_available_response
(
boost
::
shared_future
<
uint32_t
>&
f
);
/*
* Store the promise
* @param [uint32_t] pid: promise id
* @param [boost::shared_ptr<boost::promise<uint32_t>>&] p: promise
* @return void
*/
void
add_promise
(
uint32_t
pid
,
boost
::
shared_ptr
<
boost
::
promise
<
uint32_t
>>&
p
);
/*
* Set the value of the promise to make it ready
* @param [uint32_t] pid: promise id
* @param [uint32_t ] http_code: http response code
* @return void
*/
void
trigger_process_response
(
uint32_t
pid
,
uint32_t
http_code
);
/*
* Generate an unique value for promise id
* @param void
* @return generated promise id
*/
static
uint64_t
generate_promise_id
()
{
return
util
::
uint_uid_generator
<
uint64_t
>::
get_instance
().
get_uid
();
}
...
...
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