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
76826d58
Commit
76826d58
authored
Apr 08, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various small updates
parent
a45fb135
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
21 deletions
+53
-21
src/api-server/api/IndividualSMContextApi.cpp
src/api-server/api/IndividualSMContextApi.cpp
+3
-3
src/api-server/impl/IndividualSMContextApiImpl.cpp
src/api-server/impl/IndividualSMContextApiImpl.cpp
+0
-1
src/common/smf.h
src/common/smf.h
+39
-13
src/common/utils/conversions.hpp
src/common/utils/conversions.hpp
+7
-0
src/test/amf_client/amf-client.cpp
src/test/amf_client/amf-client.cpp
+4
-4
No files found.
src/api-server/api/IndividualSMContextApi.cpp
View file @
76826d58
...
...
@@ -186,8 +186,8 @@ void IndividualSMContextApi::update_sm_context_handler(const Pistache::Rest::Req
unsigned
int
str_len
=
request
.
body
().
length
();
unsigned
char
*
data
=
(
unsigned
char
*
)
malloc
(
str_len
+
1
);
memset
(
data
,
0
,
str_len
+
1
);
memcpy
((
void
*
)
data
,
(
void
*
)
request
.
body
().
c_str
(),
str_len
);
memset
(
data
,
0
,
str_len
+
1
);
memcpy
((
void
*
)
data
,
(
void
*
)
request
.
body
().
c_str
(),
str_len
);
//if ((multipartparser_execute(&parser, &g_callbacks, request.body().c_str(), strlen(request.body().c_str())) != strlen(request.body().c_str())) or (!g_body_begin_called)){
if
((
multipartparser_execute
(
&
parser
,
&
g_callbacks
,
reinterpret_cast
<
const
char
*>
(
data
),
str_len
)
!=
strlen
(
request
.
body
().
c_str
()))
or
(
!
g_body_begin_called
)){
...
...
@@ -242,7 +242,7 @@ void IndividualSMContextApi::update_sm_context_handler(const Pistache::Rest::Req
return
;
}
catch
(
std
::
exception
&
e
)
{
//send a 500 error
Logger
::
smf_api_server
().
warn
(
"Error (%s ),
S
end a msg with a 500 error code to AMF"
,
e
.
what
());
Logger
::
smf_api_server
().
warn
(
"Error (%s ),
s
end a msg with a 500 error code to AMF"
,
e
.
what
());
response
.
send
(
Pistache
::
Http
::
Code
::
Internal_Server_Error
,
e
.
what
());
return
;
}
...
...
src/api-server/impl/IndividualSMContextApiImpl.cpp
View file @
76826d58
...
...
@@ -88,7 +88,6 @@ void IndividualSMContextApiImpl::update_sm_context(const std::string &smContextR
Logger
::
smf_api_server
().
info
(
"Received a PDUSession_UpdateSMContext Request from AMF."
);
smf
::
pdu_session_update_sm_context_request
sm_context_req_msg
=
{};
SmContextUpdateData
smContextUpdateData
=
smContextUpdateMessage
.
getJsonData
();
if
(
smContextUpdateData
.
n2SmInfoIsSet
()){
...
...
src/common/smf.h
View file @
76826d58
...
...
@@ -78,7 +78,6 @@ typedef struct s_nssai // section 28.4, TS23.003
typedef
uint8_t
pdu_session_id
;
//should move to 24.501
enum
pdu_session_type_e
{
PDU_SESSION_TYPE_E_UNKNOWN
=
0
,
PDU_SESSION_TYPE_E_IPV4
=
1
,
...
...
@@ -142,11 +141,16 @@ enum class session_management_procedures_type_e {
SERVICE_REQUEST_UE_TRIGGERED_STEP1
=
1
,
SERVICE_REQUEST_UE_TRIGGERED_STEP2
=
2
,
SERVICE_REQUEST_NETWORK_TRIGGERED
=
3
,
PDU_SESSION_MODIFICATION_UE_INITIATED
=
4
,
PDU_SESSION_MODIFICATION_SMF_REQUESTED
=
5
,
PDU_SESSION_MODIFICATION_AN_REQUESTED
=
6
,
PDU_SESSION_RELEASE_UE_REQUESTED
=
7
,
PDU_SESSION_RELEASE_NETWORK_REQUESTED
=
8
PDU_SESSION_MODIFICATION_UE_INITIATED_STEP1
=
4
,
PDU_SESSION_MODIFICATION_UE_INITIATED_STEP2
=
5
,
PDU_SESSION_MODIFICATION_UE_INITIATED_STEP3
=
6
,
PDU_SESSION_MODIFICATION_SMF_REQUESTED
=
7
,
PDU_SESSION_MODIFICATION_AN_REQUESTED
=
8
,
PDU_SESSION_RELEASE_UE_REQUESTED_STEP1
=
9
,
PDU_SESSION_RELEASE_UE_REQUESTED_STEP2
=
10
,
PDU_SESSION_RELEASE_UE_REQUESTED_STEP3
=
11
,
PDU_SESSION_RELEASE_NETWORK_REQUESTED
=
12
,
PDU_SESSION_TEST
=
13
};
static
const
std
::
vector
<
std
::
string
>
session_management_procedures_type_e2str
=
{
...
...
@@ -154,10 +158,14 @@ static const std::vector<std::string> session_management_procedures_type_e2str =
"SERVICE_REQUEST_UE_TRIGGERED_STEP1"
,
"SERVICE_REQUEST_UE_TRIGGERED_STEP2"
,
"SERVICE_REQUEST_NETWORK_TRIGGERED"
,
"PDU_SESSION_MODIFICATION_UE_INITIATED"
,
"PDU_SESSION_MODIFICATION_UE_INITIATED_STEP1"
,
"PDU_SESSION_MODIFICATION_UE_INITIATED_STEP2"
,
"PDU_SESSION_MODIFICATION_UE_INITIATED_STEP3"
,
"PDU_SESSION_MODIFICATION_SMF_REQUESTED"
,
"PDU_SESSION_MODIFICATION_AN_REQUESTED"
,
"PDU_SESSION_RELEASE_UE_REQUESTED"
,
"PDU_SESSION_RELEASE_UE_REQUESTED_STEP1"
,
"PDU_SESSION_RELEASE_UE_REQUESTED_STEP2"
,
"PDU_SESSION_RELEASE_UE_REQUESTED_STEP3"
,
"PDU_SESSION_RELEASE_NETWORK_REQUESTED"
};
...
...
@@ -169,16 +177,34 @@ typedef struct qos_profile_gbr_s {
// Maximum Packet Loss Rate (UL/DL)
}
qos_profile_gbr_t
;
//
enum
class
qos_profile_type_e
{
NON_GBR
=
0
,
GBR
=
1
};
//See Section 5.7.2@3GPP TS 23.501
typedef
struct
qos_profile_s
{
uint8_t
_5qi
;
arp_5gc_t
arp
;
//union flow_bit_rate_type{
// reflective_qos_attribute_e rqa; //Reflective QoS Attribute (RQA)
// qos_profile_gbr_t qos_profile_gbr; //Attributes for GBR
// };
uint8_t
priority_level
;
qos_profile_type_e
profile_type
;
union
parameter
{
reflective_qos_attribute_e
rqa
;
//Reflective QoS Attribute (RQA)
qos_profile_gbr_t
qos_profile_gbr
;
//Attributes for GBR
};
}
qos_profile_t
;
enum
class
multipart_related_content_part_e
{
JSON
=
0
,
NAS
=
1
,
NGAP
=
2
};
static
const
std
::
vector
<
std
::
string
>
multipart_related_content_part_e2str
=
{
"JSON"
,
"NAS"
,
"NGAP"
};
#endif
src/common/utils/conversions.hpp
View file @
76826d58
...
...
@@ -44,6 +44,13 @@
#define IPV4_ADDR_DISPLAY_8(aDDRESS) \
(aDDRESS)[0], (aDDRESS)[1], (aDDRESS)[2], (aDDRESS)[3]
/* Convert an integer on 32 bits to the given bUFFER */
#define INT32_TO_BUFFER(x, buf) \
(buf)[0] = (x) >> 24, \
(buf)[1] = (x) >> 16, \
(buf)[2] = (x) >> 8, \
(buf)[3] = (x)
class
conv
{
public:
...
...
src/test/amf_client/amf-client.cpp
View file @
76826d58
...
...
@@ -72,7 +72,7 @@ void send_pdu_session_establishment_request()
std
::
cout
<<
"[AMF N11] PDU Session Establishment Request"
<<
std
::
endl
;
nlohmann
::
json
pdu_session_establishment_request
;
std
::
string
n1_msg
=
"2e0101c1ffff9
5
"
;
std
::
string
n1_msg
=
"2e0101c1ffff9
1
"
;
std
::
string
n2_msg
;
//format string as hex
...
...
@@ -433,9 +433,9 @@ int main(int argc, char* argv[])
{
send_pdu_session_establishment_request
();
usleep
(
10000
);
//
send_pdu_session_update_sm_context_establishment();
send_pdu_session_update_sm_context_modification
();
usleep
(
10000
0
);
send_pdu_session_update_sm_context_establishment
();
//
send_pdu_session_update_sm_context_modification();
return
0
;
}
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