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
456483a0
Commit
456483a0
authored
Feb 24, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update SMF_procedures
parent
19226bab
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
474 additions
and
63 deletions
+474
-63
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+386
-56
src/smf_app/smf_procedure.hpp
src/smf_app/smf_procedure.hpp
+7
-7
src/utils/multipartparser.h
src/utils/multipartparser.h
+81
-0
No files found.
src/smf_app/smf_procedure.cpp
View file @
456483a0
This diff is collapsed.
Click to expand it.
src/smf_app/smf_procedure.hpp
View file @
456483a0
...
...
@@ -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
;
...
...
src/utils/multipartparser.h
View file @
456483a0
...
...
@@ -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
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