Commit 456483a0 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

update SMF_procedures

parent 19226bab
This diff is collapsed.
......@@ -75,9 +75,9 @@ class smf_qos_flow;
class smf_pdu_session;
//------------------------------------------------------------------------------
class sx_session_restore_procedure : public smf_procedure {
class n4_session_restore_procedure : public smf_procedure {
public:
explicit sx_session_restore_procedure(std::set<pfcp::fseid_t>& sessions2restore) : smf_procedure(), pending_sessions(sessions2restore),
explicit n4_session_restore_procedure(std::set<pfcp::fseid_t>& sessions2restore) : smf_procedure(), pending_sessions(sessions2restore),
restored_sessions()
{
sessions2restore.clear();
......@@ -86,7 +86,7 @@ public:
int run();
//void handle_itti_msg (itti_n4_session_establishment_response& resp);
//~sx_session_restore_procedure() {}
//~n4_session_restore_procedure() {}
std::set<pfcp::fseid_t> pending_sessions;
std::set<pfcp::fseid_t> restored_sessions;
......@@ -96,7 +96,7 @@ public:
class session_create_sm_context_procedure : public smf_procedure {
public:
explicit session_create_sm_context_procedure(std::shared_ptr<smf_pdu_session>& sppc) : smf_procedure(), ppc(sppc),
sx_triggered(), n11_triggered_pending(), n11_trigger() {}
n4_triggered(), n11_triggered_pending(), n11_trigger() {}
/*
*
......@@ -107,7 +107,7 @@ public:
void handle_itti_msg (itti_n4_session_establishment_response& resp, std::shared_ptr<smf::smf_context> pc);
std::shared_ptr<itti_n4_session_establishment_request> sx_triggered;
std::shared_ptr<itti_n4_session_establishment_request> n4_triggered;
std::shared_ptr<smf_pdu_session> ppc;
std::shared_ptr<smf::smf_context> pc;
......@@ -119,7 +119,7 @@ public:
class session_update_sm_context_procedure : public smf_procedure {
public:
explicit session_update_sm_context_procedure(std::shared_ptr<smf_pdu_session>& sppc) : smf_procedure(), ppc(sppc),
sx_triggered(), n11_triggered_pending(), n11_trigger() {}
n4_triggered(), n11_triggered_pending(), n11_trigger() {}
/*
*
......@@ -135,7 +135,7 @@ public:
*/
void handle_itti_msg (itti_n4_session_modification_response& resp, std::shared_ptr<smf::smf_context> sc);
std::shared_ptr<itti_n4_session_modification_request> sx_triggered;
std::shared_ptr<itti_n4_session_modification_request> n4_triggered;
std::shared_ptr<smf_pdu_session> ppc;
std::shared_ptr<smf::smf_context> pc;
......
......@@ -50,5 +50,86 @@ size_t multipartparser_execute(multipartparser* parser,
#ifdef __cplusplus
}
#define BOUNDARY "----Boundary"
typedef struct part {
std::map<std::string,std::string> headers;
std::string body;
} part;
static multipartparser_callbacks g_callbacks;
static bool g_body_begin_called;
static std::string g_header_name;
static std::string g_header_value;
static std::list<part> g_parts;
static bool g_body_end_called;
static void init_globals()
{
g_body_begin_called = false;
g_header_name.clear();
g_header_value.clear();
g_parts.clear();
g_body_end_called = false;
}
static int on_body_begin(multipartparser* /*parser*/)
{
g_body_begin_called = true;
return 0;
}
static int on_part_begin(multipartparser* /*parser*/)
{
g_parts.push_back(part());
return 0;
}
static void on_header_done()
{
g_parts.back().headers[g_header_name] = g_header_value;
g_header_name.clear();
g_header_value.clear();
}
static int on_header_field(multipartparser* /*parser*/, const char* data, size_t size)
{
if (g_header_value.size() > 0)
on_header_done();
g_header_name.append(data, size);
return 0;
}
static int on_header_value(multipartparser* /*parser*/, const char* data, size_t size)
{
g_header_value.append(data, size);
return 0;
}
static int on_headers_complete(multipartparser* /*parser*/)
{
if (g_header_value.size() > 0)
on_header_done();
return 0;
}
static int on_data(multipartparser* /*parser*/, const char* data, size_t size)
{
g_parts.back().body.append(data, size);
return 0;
}
static int on_part_end(multipartparser* /*parser*/)
{
return 0;
}
static int on_body_end(multipartparser* /*parser*/)
{
g_body_end_called = true;
return 0;
}
#endif
#endif // MULTIPARTPARSER_H
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment