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
53cbf6ec
Commit
53cbf6ec
authored
Dec 15, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup
parent
cac0624f
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
208 additions
and
315 deletions
+208
-315
src/.clang-format
src/.clang-format
+91
-101
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+72
-103
src/smf_app/smf_app.hpp
src/smf_app/smf_app.hpp
+10
-9
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+33
-94
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+2
-8
No files found.
src/.clang-format
View file @
53cbf6ec
#
# Copyright (c) 2015, EURECOM (www.eurecom.fr)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are those
# of the authors and should not be interpreted as representing official policies,
# either expressed or implied, of the FreeBSD Project.
#
# see https://clang.llvm.org/docs/ClangFormatStyleOptions.html for explanation
# of style options
BasedOnStyle: Google
---
Language: Cpp
IndentWidth: 2
ColumnLimit: 80
IncludeBlocks: Preserve
SortIncludes: false
# alignment
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: true
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines:
Righ
t
AlignEscapedNewlines:
Lef
t
AlignOperands: true
AlignTrailingComments: true
DerivePointerAlignment: false
PointerAlignment: Left
# function style
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Inline
AlwaysBreakAfterReturnType: None
IndentWrappedFunctionNames: false
# template style
#AlwaysBreakTemplateDeclarations: Yes
# preprocessor style
IndentPPDirectives: None
# block style
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
KeepEmptyLinesAtTheStartOfBlocks: false
# break style
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: false
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
# spacing style
UseTab: Never
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# class style
BreakConstructorInitializers: BeforeColon
#BreakInheritanceList: BeforeColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
# case statements
IndentCaseLabels: true
# cpp
Cpp11BracedListStyle: true
FixNamespaceComments: true
NamespaceIndentation: None
SortUsingDeclarations: true
# todo
# AlwaysBreakBeforeMultilineStrings: bool
# PenaltyBreakAssignment (unsigned)
# PenaltyBreakBeforeFirstCallParameter (unsigned)
# PenaltyBreakComment (unsigned)
# PenaltyBreakFirstLessLess (unsigned)
# PenaltyBreakString (unsigned)
# PenaltyBreakTemplateDeclaration (unsigned)
# PenaltyExcessCharacter (unsigned)
# PenaltyReturnTypeOnItsOwnLine (unsigned)
Standard: Auto
TabWidth: 8
UseTab: Never
...
src/smf_app/smf_app.cpp
View file @
53cbf6ec
This diff is collapsed.
Click to expand it.
src/smf_app/smf_app.hpp
View file @
53cbf6ec
...
...
@@ -636,43 +636,44 @@ class smf_app {
/*
* To trigger the response to the HTTP server by set the value of the corresponding promise to ready
* @param [const uint32_t &] http_code: Status code of HTTP response
* @param [const
oai::smf_server::model::SmContextCreateError &] smContextCreateError: store the json content of response messag
e
* @param [const
uint8_t&] cause: Error caus
e
* @param [const std::string &] n1_sm_msg: N1 SM message
* @param [uint32_t &] promise_id: Promise Id
* @return void
*/
void
trigger_
http
_response
(
void
trigger_
create_context_error
_response
(
const
uint32_t
&
http_code
,
const
oai
::
smf_server
::
model
::
SmContextCreateError
&
smContextCreateError
,
const
uint8_t
&
cause
,
const
std
::
string
&
n1_sm_msg
,
uint32_t
&
promise_id
);
/*
* To trigger the response to the HTTP server by set the value of the corresponding promise to ready
* @param [const uint32_t &] http_code: Status code of HTTP response
* @param [const
oai::smf_server::model::SmContextCreateError &] smContextCreateError: store the json content of response messag
e
* @param [const
uint8_t &] cause: Error caus
e
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void
trigger_
http
_response
(
void
trigger_
update_context_error
_response
(
const
uint32_t
&
http_code
,
const
oai
::
smf_server
::
model
::
SmContextUpdateError
&
smContextUpdateError
,
const
uint8_t
&
cause
,
uint32_t
&
promise_id
);
/*
* To trigger the response to the HTTP server by set the value of the corresponding promise to ready
* @param [const uint32_t &] http_code: Status code of HTTP response
* @param [const
oai::smf_server::model::SmContextUpdateError &] smContextUpdateError: store the json content of response messag
e
* @param [const
uint8_t &] cause: caus
e
* @param [const std::string &] n1_sm_msg: N1 SM message
* @param [uint32_t &] promise_id: Promise Id
* @param [uint8_t] msg_type: Type of HTTP message (Update/Release)
* @return void
*/
void
trigger_
http
_response
(
void
trigger_
update_context_error
_response
(
const
uint32_t
&
http_code
,
const
oai
::
smf_server
::
model
::
SmContextUpdateError
&
smContextUpdateError
,
const
uint8_t
&
cause
,
const
std
::
string
&
n1_sm_msg
,
uint32_t
&
promise_id
);
/*
* To trigger the response to the HTTP server by set the value of the corresponding promise to ready
* @param [const uint32_t &] http_code: Status code of HTTP response
...
...
src/smf_app/smf_context.cpp
View file @
53cbf6ec
This diff is collapsed.
Click to expand it.
src/smf_app/smf_procedure.cpp
View file @
53cbf6ec
...
...
@@ -959,16 +959,10 @@ void session_update_sm_context_procedure::handle_itti_msg(
}
else
{
Logger
::
smf_app
().
info
(
"PDU Session Update SM Context, rejected by UPF"
);
//send response to AMF
oai
::
smf_server
::
model
::
SmContextUpdateError
smContextUpdateError
=
{
};
oai
::
smf_server
::
model
::
ProblemDetails
problem_details
=
{
};
problem_details
.
setCause
(
pdu_session_application_error_e2str
[
PDU_SESSION_APPLICATION_ERROR_NETWORK_FAILURE
]);
smContextUpdateError
.
setError
(
problem_details
);
//trigger to send reply to AMF
smf_app_inst
->
trigger_
http
_response
(
smf_app_inst
->
trigger_
update_context_error
_response
(
http_status_code_e
::
HTTP_STATUS_CODE_403_FORBIDDEN
,
smContextUpdateError
,
n11_triggered_pending
->
pid
);
PDU_SESSION_APPLICATION_ERROR_NETWORK_FAILURE
,
n11_triggered_pending
->
pid
);
return
;
}
}
...
...
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