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
f9dbcb5d
Commit
f9dbcb5d
authored
May 28, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test curl multiple interface with Communication_N1N2MessageTransfer
parent
0162e7a8
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
305 additions
and
12 deletions
+305
-12
src/common/smf.h
src/common/smf.h
+2
-3
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+1
-0
src/smf_app/smf_sbi.cpp
src/smf_app/smf_sbi.cpp
+242
-9
src/smf_app/smf_sbi.hpp
src/smf_app/smf_sbi.hpp
+60
-0
No files found.
src/common/smf.h
View file @
f9dbcb5d
...
...
@@ -194,12 +194,11 @@ typedef struct qos_profile_s {
#define NNRF_NFM_BASE "/nnrf-nfm/"
#define NNRF_NF_REGISTER_URL "/nf-instances/"
#define NNRF_NF_STATUS_SUBSCRIBE_URL "/subscriptions"
#define NRF_CURL_TIMEOUT_MS 100L
// for CURL
#define AMF_CURL_TIMEOUT_MS 100L
#define NF_CURL_TIMEOUT_MS 100L
#define MAX_WAIT_MSECS 10000 // 1 second
#define AMF_NUMBER_RETRIES 3
#define UDM_CURL_TIMEOUT_MS 100L
#define UDM_NUMBER_RETRIES 3
constexpr
auto
CURL_MIME_BOUNDARY
=
"----Boundary"
;
...
...
src/smf_app/smf_context.cpp
View file @
f9dbcb5d
...
...
@@ -3264,6 +3264,7 @@ bool dnn_context::remove_pdu_session(const uint32_t pdu_session_id) {
}
return
false
;
}
//------------------------------------------------------------------------------
size_t
dnn_context
::
get_number_pdu_sessions
()
const
{
std
::
shared_lock
lock
(
m_context
);
...
...
src/smf_app/smf_sbi.cpp
View file @
f9dbcb5d
This diff is collapsed.
Click to expand it.
src/smf_app/smf_sbi.hpp
View file @
f9dbcb5d
...
...
@@ -32,6 +32,8 @@
#include <map>
#include <thread>
#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
#include <curl/curl.h>
#include "3gpp_29.503.h"
#include "smf.h"
...
...
@@ -43,11 +45,21 @@ namespace smf {
class
smf_sbi
{
private:
CURLM
*
curl_multi
;
std
::
vector
<
CURL
*>
handles
;
struct
curl_slist
*
headers
;
mutable
std
::
shared_mutex
m_curl_handle_promises
;
std
::
map
<
std
::
string
,
boost
::
shared_ptr
<
boost
::
promise
<
std
::
string
>>>
curl_handle_promises
;
std
::
thread
::
id
thread_id
;
std
::
thread
thread
;
public:
smf_sbi
();
virtual
~
smf_sbi
();
smf_sbi
(
smf_sbi
const
&
)
=
delete
;
void
operator
=
(
smf_sbi
const
&
)
=
delete
;
...
...
@@ -162,6 +174,54 @@ class smf_sbi {
*
*/
void
subscribe_sm_data
();
/*
* 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 [std::string &] response_data: response data
* @return pointer to the created curl
*/
CURL
*
curl_create_handle
(
const
std
::
string
&
uri
,
const
std
::
string
&
data
,
std
::
string
&
response_data
);
/*
* Prepare to send a request using curl multi
* @param [const std::string &] uri: URI of the subscribed NF
* @param [std::string &] data: data to be sent
* @param [std::string &] response_data: response data
* @return void
*/
void
send_curl_multi
(
const
std
::
string
&
uri
,
const
std
::
string
&
data
,
std
::
string
&
response_data
);
/*
* Perform curl multi to actually process the available data
* @param [uint64_t ms] ms: current time
* @return void
*/
void
perform_curl_multi
(
uint64_t
ms
);
/*
* Finish all the curl transfers
* @param void
* @return void
*/
void
wait_curl_end
();
/*
* Release all the handles
* @param void
* @return void
*/
void
curl_release_handles
();
void
send_n1n2_message_transfer_request_curl_multi
(
std
::
shared_ptr
<
itti_n11_create_sm_context_response
>
sm_context_res
);
void
add_promise
(
std
::
string
id
,
boost
::
shared_ptr
<
boost
::
promise
<
std
::
string
>>&
p
);
};
}
// namespace smf
#endif
/* FILE_SMF_SBI_HPP_SEEN */
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