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
19bd6d87
Commit
19bd6d87
authored
Jun 11, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issues for N11 interface integration test (dsTester)
parent
9a00386f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
25 deletions
+41
-25
src/api-server/impl/SMContextsCollectionApiImpl.cpp
src/api-server/impl/SMContextsCollectionApiImpl.cpp
+7
-3
src/common/smf.h
src/common/smf.h
+3
-1
src/common/utils/mime_parser.cpp
src/common/utils/mime_parser.cpp
+2
-2
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+1
-1
src/smf_app/smf_n1_n2.cpp
src/smf_app/smf_n1_n2.cpp
+10
-9
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+10
-1
src/test/amf_client/amf-client.cpp
src/test/amf_client/amf-client.cpp
+8
-8
No files found.
src/api-server/impl/SMContextsCollectionApiImpl.cpp
View file @
19bd6d87
...
@@ -173,11 +173,15 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
...
@@ -173,11 +173,15 @@ void SMContextsCollectionApiImpl::post_sm_contexts(
Logger
::
smf_api_server
().
debug
(
"Got result for promise ID %d"
,
promise_id
);
Logger
::
smf_api_server
().
debug
(
"Got result for promise ID %d"
,
promise_id
);
nlohmann
::
json
json_data
=
{
};
nlohmann
::
json
json_data
=
{
};
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
Location
>
(
sm_context_response
.
get_smf_context_uri
());
//Location header
sm_context_response
.
get_json_data
(
json_data
);
sm_context_response
.
get_json_data
(
json_data
);
if
(
!
json_data
.
empty
())
{
if
(
!
json_data
.
empty
())
{
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
>
(
response
.
headers
().
add
<
Pistache
::
Http
::
Header
::
ContentType
Pistache
::
Http
::
Mime
::
MediaType
(
"application/json"
));
>
(
Pistache
::
Http
::
Mime
::
MediaType
(
"application/json"
));
response
.
send
(
Pistache
::
Http
::
Code
(
sm_context_response
.
get_http_code
()),
json_data
.
dump
().
c_str
());
response
.
send
(
Pistache
::
Http
::
Code
(
sm_context_response
.
get_http_code
()),
json_data
.
dump
().
c_str
());
}
else
{
}
else
{
response
.
send
(
Pistache
::
Http
::
Code
(
sm_context_response
.
get_http_code
()));
response
.
send
(
Pistache
::
Http
::
Code
(
sm_context_response
.
get_http_code
()));
}
}
...
...
src/common/smf.h
View file @
19bd6d87
...
@@ -175,7 +175,9 @@ typedef struct qos_profile_s {
...
@@ -175,7 +175,9 @@ typedef struct qos_profile_s {
#define NUDM_SDM_GET_SM_DATA_URL "/nudm-sdm/v2/{}/sm-data" //may get from configuration file
#define NUDM_SDM_GET_SM_DATA_URL "/nudm-sdm/v2/{}/sm-data" //may get from configuration file
#define N1_SM_CONTENT_ID "n1SmMsg"
#define N1_SM_CONTENT_ID "n1SmMsg"
#define N1N2_MESSAGE_CLASS "SM"
#define N1N2_MESSAGE_CLASS "SM"
#define N2_SM_CONTENT_ID "n2SmMsg"
#define N2_SM_CONTENT_ID "n2msg"
#define NSMF_CALLBACK_N1N2_MESSAGE_TRANSFER_FAILURE "/nsmf-pdusession/v2/callback/N1N2MsgTxfrFailureNotification/{}" //may get from configuration file
//for CURL
//for CURL
#define AMF_CURL_TIMEOUT_MS 100L
#define AMF_CURL_TIMEOUT_MS 100L
...
...
src/common/utils/mime_parser.cpp
View file @
19bd6d87
...
@@ -119,7 +119,7 @@ void mime_parser::create_multipart_related_content(std::string &body,
...
@@ -119,7 +119,7 @@ void mime_parser::create_multipart_related_content(std::string &body,
body
.
append
(
std
::
string
((
char
*
)
n1_msg_hex
,
n1_message
.
length
()
/
2
)
+
CRLF
);
body
.
append
(
std
::
string
((
char
*
)
n1_msg_hex
,
n1_message
.
length
()
/
2
)
+
CRLF
);
body
.
append
(
"--"
+
boundary
+
CRLF
);
body
.
append
(
"--"
+
boundary
+
CRLF
);
body
.
append
(
body
.
append
(
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
SmM
sg"
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
m
sg"
+
CRLF
);
+
CRLF
);
body
.
append
(
CRLF
);
body
.
append
(
CRLF
);
body
.
append
(
std
::
string
((
char
*
)
n2_msg_hex
,
n2_message
.
length
()
/
2
)
+
CRLF
);
body
.
append
(
std
::
string
((
char
*
)
n2_msg_hex
,
n2_message
.
length
()
/
2
)
+
CRLF
);
...
@@ -148,7 +148,7 @@ void mime_parser::create_multipart_related_content(
...
@@ -148,7 +148,7 @@ void mime_parser::create_multipart_related_content(
+
"Content-Id: n1SmMsg"
+
CRLF
);
+
"Content-Id: n1SmMsg"
+
CRLF
);
}
else
if
(
content_type
==
multipart_related_content_part_e
::
NGAP
)
{
//NGAP
}
else
if
(
content_type
==
multipart_related_content_part_e
::
NGAP
)
{
//NGAP
body
.
append
(
body
.
append
(
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
SmM
sg"
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
m
sg"
+
CRLF
);
+
CRLF
);
}
}
body
.
append
(
CRLF
);
body
.
append
(
CRLF
);
...
...
src/smf_app/smf_context.cpp
View file @
19bd6d87
...
@@ -1364,7 +1364,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1364,7 +1364,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
json_data
[
"cause"
]
=
0
;
json_data
[
"cause"
]
=
0
;
sm_context_response
.
set_json_data
(
json_data
);
sm_context_response
.
set_json_data
(
json_data
);
sm_context_response
.
set_http_code
(
sm_context_response
.
set_http_code
(
http_status_code_e
::
HTTP_STATUS_CODE_20
0_OK
);
http_status_code_e
::
HTTP_STATUS_CODE_20
1_CREATED
);
itti_msg
->
res
=
sm_context_response
;
itti_msg
->
res
=
sm_context_response
;
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
int
ret
=
itti_inst
->
send_msg
(
itti_msg
);
...
...
src/smf_app/smf_n1_n2.cpp
View file @
19bd6d87
...
@@ -801,7 +801,8 @@ void smf_n1_n2::create_n2_sm_information(pdu_session_msg &msg,
...
@@ -801,7 +801,8 @@ void smf_n1_n2::create_n2_sm_information(pdu_session_msg &msg,
pduSessionType
->
criticality
=
Ngap_Criticality_reject
;
pduSessionType
->
criticality
=
Ngap_Criticality_reject
;
pduSessionType
->
value
.
present
=
pduSessionType
->
value
.
present
=
Ngap_PDUSessionResourceSetupRequestTransferIEs__value_PR_PDUSessionType
;
Ngap_PDUSessionResourceSetupRequestTransferIEs__value_PR_PDUSessionType
;
pduSessionType
->
value
.
choice
.
PDUSessionType
=
msg
.
get_pdu_session_type
();
//TODO: different between Ngap_PDUSessionType_ipv4 vs pdu_session_type_e::PDU_SESSION_TYPE_E_IPV4
pduSessionType
->
value
.
choice
.
PDUSessionType
=
msg
.
get_pdu_session_type
()
-
1
;
//TODO: dirty code, difference between Ngap_PDUSessionType_ipv4 vs pdu_session_type_e::PDU_SESSION_TYPE_E_IPV4 (TS 38.413 vs TS 24.501)
ASN_SEQUENCE_ADD
(
&
ngap_IEs
->
protocolIEs
.
list
,
pduSessionType
);
ASN_SEQUENCE_ADD
(
&
ngap_IEs
->
protocolIEs
.
list
,
pduSessionType
);
//SecurityIndication
//SecurityIndication
...
@@ -1606,9 +1607,9 @@ int smf_n1_n2::decode_n2_sm_information(
...
@@ -1606,9 +1607,9 @@ int smf_n1_n2::decode_n2_sm_information(
if
(
rc
.
code
!=
RC_OK
)
{
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
return
RETURNerror
;
}
}
return
RETURNok
;
return
RETURNok
;
}
}
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
...
@@ -1635,9 +1636,9 @@ int smf_n1_n2::decode_n2_sm_information(
...
@@ -1635,9 +1636,9 @@ int smf_n1_n2::decode_n2_sm_information(
if
(
rc
.
code
!=
RC_OK
)
{
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
return
RETURNerror
;
}
}
return
RETURNok
;
return
RETURNok
;
}
}
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
...
@@ -1664,9 +1665,9 @@ int smf_n1_n2::decode_n2_sm_information(
...
@@ -1664,9 +1665,9 @@ int smf_n1_n2::decode_n2_sm_information(
if
(
rc
.
code
!=
RC_OK
)
{
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
return
RETURNerror
;
}
}
return
RETURNok
;
return
RETURNok
;
}
}
//---------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------
...
@@ -1693,7 +1694,7 @@ int smf_n1_n2::decode_n2_sm_information(
...
@@ -1693,7 +1694,7 @@ int smf_n1_n2::decode_n2_sm_information(
if
(
rc
.
code
!=
RC_OK
)
{
if
(
rc
.
code
!=
RC_OK
)
{
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
Logger
::
smf_app
().
warn
(
"asn_decode failed with code %d"
,
rc
.
code
);
return
RETURNerror
;
return
RETURNerror
;
}
}
return
RETURNok
;
return
RETURNok
;
}
}
src/smf_app/smf_procedure.cpp
View file @
19bd6d87
...
@@ -465,7 +465,7 @@ void session_create_sm_context_procedure::handle_itti_msg(
...
@@ -465,7 +465,7 @@ void session_create_sm_context_procedure::handle_itti_msg(
if
(
n11_triggered_pending
->
res
.
get_cause
()
==
REQUEST_ACCEPTED
)
{
if
(
n11_triggered_pending
->
res
.
get_cause
()
==
REQUEST_ACCEPTED
)
{
json_data
[
"n2InfoContainer"
][
"n2InformationClass"
]
=
json_data
[
"n2InfoContainer"
][
"n2InformationClass"
]
=
N1N2_MESSAGE_CLASS
;
N1N2_MESSAGE_CLASS
;
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"
P
duSessionId"
]
=
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"
p
duSessionId"
]
=
n11_triggered_pending
->
res
.
get_pdu_session_id
();
n11_triggered_pending
->
res
.
get_pdu_session_id
();
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
//N2InfoContent (section 6.1.6.2.27@3GPP TS 29.518)
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapIeType"
]
=
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"n2InfoContent"
][
"ngapIeType"
]
=
...
@@ -477,6 +477,15 @@ void session_create_sm_context_procedure::handle_itti_msg(
...
@@ -477,6 +477,15 @@ void session_create_sm_context_procedure::handle_itti_msg(
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"sNssai"
][
"sd"
]
=
json_data
[
"n2InfoContainer"
][
"smInfo"
][
"sNssai"
][
"sd"
]
=
n11_triggered_pending
->
res
.
get_snssai
().
sD
;
n11_triggered_pending
->
res
.
get_snssai
().
sD
;
json_data
[
"n2InfoContainer"
][
"ranInfo"
]
=
"SM"
;
json_data
[
"n2InfoContainer"
][
"ranInfo"
]
=
"SM"
;
//N1N2MsgTxfrFailureNotification
std
::
string
callback_uri
=
std
::
string
(
inet_ntoa
(
*
((
struct
in_addr
*
)
&
smf_cfg
.
amf_addr
.
ipv4_addr
)))
+
":"
+
std
::
to_string
(
smf_cfg
.
amf_addr
.
port
)
+
fmt
::
format
(
NSMF_CALLBACK_N1N2_MESSAGE_TRANSFER_FAILURE
,
supi_str
.
c_str
());
json_data
[
"n1n2FailureTxfNotifURI"
]
=
callback_uri
.
c_str
();
//json_data["n1n2FailureTxfNotifURI"] = "http://192.168.122.1/namf-comm/callback/N1N2MsgTxfrFailureNotification/imsi-310410000000001-1";
}
}
//Others information
//Others information
//n11_triggered_pending->res.n1n2_message_transfer_data["pti"] = 1; //Don't need this info for the moment
//n11_triggered_pending->res.n1n2_message_transfer_data["pti"] = 1; //Don't need this info for the moment
...
...
src/test/amf_client/amf-client.cpp
View file @
19bd6d87
...
@@ -129,7 +129,7 @@ void create_multipart_related_content(std::string &body, std::string &json_part,
...
@@ -129,7 +129,7 @@ void create_multipart_related_content(std::string &body, std::string &json_part,
body
.
append
(
"--"
+
boundary
+
CRLF
);
body
.
append
(
"--"
+
boundary
+
CRLF
);
body
.
append
(
body
.
append
(
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
SmM
sg"
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
m
sg"
+
CRLF
);
+
CRLF
);
body
.
append
(
CRLF
);
body
.
append
(
CRLF
);
body
.
append
(
n2_message
+
CRLF
);
body
.
append
(
n2_message
+
CRLF
);
...
@@ -154,7 +154,7 @@ void create_multipart_related_content(
...
@@ -154,7 +154,7 @@ void create_multipart_related_content(
+
"Content-Id: n1SmMsg"
+
CRLF
);
+
"Content-Id: n1SmMsg"
+
CRLF
);
}
else
if
(
content_type
==
multipart_related_content_part_e
::
NGAP
)
{
//NGAP
}
else
if
(
content_type
==
multipart_related_content_part_e
::
NGAP
)
{
//NGAP
body
.
append
(
body
.
append
(
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
SmM
sg"
"Content-Type: application/vnd.3gpp.ngap"
+
CRLF
+
"Content-Id: n2
m
sg"
+
CRLF
);
+
CRLF
);
}
}
body
.
append
(
CRLF
);
body
.
append
(
CRLF
);
...
@@ -334,10 +334,10 @@ void send_pdu_session_update_sm_context_establishment(
...
@@ -334,10 +334,10 @@ void send_pdu_session_update_sm_context_establishment(
//Fill the json part
//Fill the json part
pdu_session_update_request
[
"n2SmInfoType"
]
=
"PDU_RES_SETUP_RSP"
;
pdu_session_update_request
[
"n2SmInfoType"
]
=
"PDU_RES_SETUP_RSP"
;
pdu_session_update_request
[
"n2SmInfo"
][
"contentId"
]
=
"n2
SmM
sg"
;
//NGAP
pdu_session_update_request
[
"n2SmInfo"
][
"contentId"
]
=
"n2
m
sg"
;
//NGAP
//pdu_session_update_request["n2InfoContainer"]["n2InformationClass"] = "SM";
//pdu_session_update_request["n2InfoContainer"]["n2InformationClass"] = "SM";
//pdu_session_update_request["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2
SmM
sg";
//pdu_session_update_request["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2
m
sg";
// pdu_session_update_request["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
// pdu_session_update_request["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
// "PDU_RES_SETUP_RSP"; //NGAP message
// "PDU_RES_SETUP_RSP"; //NGAP message
...
@@ -603,7 +603,7 @@ void send_pdu_session_modification_request_step2(std::string smf_ip_address,
...
@@ -603,7 +603,7 @@ void send_pdu_session_modification_request_step2(std::string smf_ip_address,
//Fill the json part
//Fill the json part
pdu_session_modification
[
"n2SmInfoType"
]
=
"PDU_RES_MOD_RSP"
;
//"PDU_RES_SETUP_RSP"
pdu_session_modification
[
"n2SmInfoType"
]
=
"PDU_RES_MOD_RSP"
;
//"PDU_RES_SETUP_RSP"
pdu_session_modification
[
"n2SmInfo"
][
"contentId"
]
=
"n2
SmM
sg"
;
//NGAP
pdu_session_modification
[
"n2SmInfo"
][
"contentId"
]
=
"n2
m
sg"
;
//NGAP
std
::
string
body
;
std
::
string
body
;
std
::
string
boundary
=
"----Boundary"
;
std
::
string
boundary
=
"----Boundary"
;
...
@@ -933,7 +933,7 @@ void send_pdu_session_release_resource_release_ack(std::string smf_ip_address,
...
@@ -933,7 +933,7 @@ void send_pdu_session_release_resource_release_ack(std::string smf_ip_address,
//Fill the json part
//Fill the json part
pdu_session_release_ack
[
"n2SmInfoType"
]
=
"PDU_RES_REL_RSP"
;
pdu_session_release_ack
[
"n2SmInfoType"
]
=
"PDU_RES_REL_RSP"
;
pdu_session_release_ack
[
"n2SmInfo"
][
"contentId"
]
=
"n2
SmM
sg"
;
//NGAP
pdu_session_release_ack
[
"n2SmInfo"
][
"contentId"
]
=
"n2
m
sg"
;
//NGAP
std
::
string
body
;
std
::
string
body
;
std
::
string
boundary
=
"----Boundary"
;
std
::
string
boundary
=
"----Boundary"
;
...
@@ -1253,10 +1253,10 @@ void send_pdu_session_update_sm_context_ue_service_request_step2(
...
@@ -1253,10 +1253,10 @@ void send_pdu_session_update_sm_context_ue_service_request_step2(
//Fill the json part
//Fill the json part
service_requests
[
"n2SmInfoType"
]
=
"PDU_RES_SETUP_RSP"
;
service_requests
[
"n2SmInfoType"
]
=
"PDU_RES_SETUP_RSP"
;
service_requests
[
"n2SmInfo"
][
"contentId"
]
=
"n2
SmM
sg"
;
//NGAP
service_requests
[
"n2SmInfo"
][
"contentId"
]
=
"n2
m
sg"
;
//NGAP
//service_requests["n2InfoContainer"]["n2InformationClass"] = "SM";
//service_requests["n2InfoContainer"]["n2InformationClass"] = "SM";
//service_requests["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2
SmM
sg";
//service_requests["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapData"]["contentId"] = "n2
m
sg";
// service_requests["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
// service_requests["n2InfoContainer"]["smInfo"]["n2InfoContent"]["ngapIeType"] =
// "PDU_RES_SETUP_RSP"; //NGAP message
// "PDU_RES_SETUP_RSP"; //NGAP message
...
...
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