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
3322d832
Commit
3322d832
authored
Mar 16, 2023
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix_supi_format' into 'develop'
Use IMSI as SUPI See merge request oai/cn5g/oai-cn5g-smf!185
parents
67635041
ce320395
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
18 deletions
+38
-18
src/common/smf.h
src/common/smf.h
+11
-0
src/common/utils/3gpp_conversions.cpp
src/common/utils/3gpp_conversions.cpp
+9
-2
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+14
-12
src/smf_app/smf_n7.hpp
src/smf_app/smf_n7.hpp
+4
-4
No files found.
src/common/smf.h
View file @
3322d832
...
@@ -60,6 +60,17 @@ static std::string smf_supi_to_string(supi_t const supi) {
...
@@ -60,6 +60,17 @@ static std::string smf_supi_to_string(supi_t const supi) {
return
supi_str
;
return
supi_str
;
}
}
static
std
::
string
smf_get_supi_with_prefix
(
const
std
::
string
&
prefix
,
const
std
::
string
&
supi
)
{
std
::
string
supi_str
=
{};
if
(
!
prefix
.
empty
())
{
supi_str
=
prefix
+
"-"
+
supi
;
}
else
{
supi_str
=
supi
;
}
return
supi_str
;
}
// TODO should we just replace the other function? Because this null chars are
// TODO should we just replace the other function? Because this null chars are
// annoying
// annoying
static
std
::
string
smf_supi_to_string_without_nulls
(
supi_t
const
supi
)
{
static
std
::
string
smf_supi_to_string_without_nulls
(
supi_t
const
supi
)
{
...
...
src/common/utils/3gpp_conversions.cpp
View file @
3322d832
...
@@ -184,9 +184,16 @@ void xgpp_conv::sm_context_create_from_openapi(
...
@@ -184,9 +184,16 @@ void xgpp_conv::sm_context_create_from_openapi(
if
(
context_data
.
supiIsSet
())
{
if
(
context_data
.
supiIsSet
())
{
// supi
// supi
supi_t
supi
=
{.
length
=
0
};
supi_t
supi
=
{.
length
=
0
};
std
::
string
supi_str
=
{};
std
::
string
supi_prefix
=
{};
std
::
size_t
pos
=
context_data
.
getSupi
().
find
(
"-"
);
std
::
size_t
pos
=
context_data
.
getSupi
().
find
(
"-"
);
std
::
string
supi_str
=
context_data
.
getSupi
().
substr
(
pos
+
1
);
if
(
pos
!=
std
::
string
::
npos
)
{
std
::
string
supi_prefix
=
context_data
.
getSupi
().
substr
(
0
,
pos
);
supi_str
=
context_data
.
getSupi
().
substr
(
pos
+
1
);
supi_prefix
=
context_data
.
getSupi
().
substr
(
0
,
pos
);
}
else
{
supi_str
=
context_data
.
getSupi
();
}
smf_string_to_supi
(
&
supi
,
supi_str
.
c_str
());
smf_string_to_supi
(
&
supi
,
supi_str
.
c_str
());
pcr
.
set_supi
(
supi
);
pcr
.
set_supi
(
supi
);
pcr
.
set_supi_prefix
(
supi_prefix
);
pcr
.
set_supi_prefix
(
supi_prefix
);
...
...
src/smf_app/smf_context.cpp
View file @
3322d832
...
@@ -895,8 +895,9 @@ void smf_context::handle_itti_msg(
...
@@ -895,8 +895,9 @@ void smf_context::handle_itti_msg(
// get supi and put into URL
// get supi and put into URL
std
::
string
supi_prefix
=
{};
std
::
string
supi_prefix
=
{};
get_supi_prefix
(
supi_prefix
);
get_supi_prefix
(
supi_prefix
);
std
::
string
supi_str
=
supi_prefix
+
"-"
+
smf_supi_to_string
(
supi
);
std
::
string
supi_str
=
std
::
string
url
=
"http://"
+
get_amf_addr
()
+
smf_get_supi_with_prefix
(
supi_prefix
,
smf_supi_to_string
(
supi
));
std
::
string
url
=
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
NAMF_COMMUNICATION_BASE
+
smf_cfg
.
amf_addr
.
api_version
+
smf_cfg
.
amf_addr
.
api_version
+
fmt
::
format
(
fmt
::
format
(
...
@@ -1483,8 +1484,8 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1483,8 +1484,8 @@ void smf_context::handle_pdu_session_create_sm_context_request(
bool
use_pcf_policy
=
false
;
bool
use_pcf_policy
=
false
;
sp
.
get
()
->
policy_ptr
->
set_context
(
sp
.
get
()
->
policy_ptr
->
set_context
(
smf_supi_to_string_without_nulls
(
smreq
->
req
.
get_supi
()),
smf_supi_to_string_without_nulls
(
smreq
->
req
.
get_supi
()),
smreq
->
req
.
get_
dnn
(),
snssai
,
plmn
,
smreq
->
req
.
get_pdu_session_id
()
,
smreq
->
req
.
get_
supi_prefix
(),
smreq
->
req
.
get_dnn
(),
snssai
,
plmn
,
smreq
->
req
.
get_pdu_session_type
());
smreq
->
req
.
get_pdu_session_
id
(),
smreq
->
req
.
get_pdu_session_
type
());
// TODO what is the exact meaning of SCID? Is this unique per registration
// TODO what is the exact meaning of SCID? Is this unique per registration
// or unique per PDU session?
// or unique per PDU session?
...
@@ -1815,8 +1816,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1815,8 +1816,9 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// Get SUPI and put into URL
// Get SUPI and put into URL
std
::
string
supi_str
=
{};
std
::
string
supi_str
=
{};
supi_t
supi
=
sm_context_resp_pending
->
res
.
get_supi
();
supi_t
supi
=
sm_context_resp_pending
->
res
.
get_supi
();
supi_str
=
sm_context_resp_pending
->
res
.
get_supi_prefix
()
+
"-"
+
supi_str
=
smf_get_supi_with_prefix
(
smf_supi_to_string
(
supi
);
sm_context_resp_pending
->
res
.
get_supi_prefix
(),
smf_supi_to_string
(
supi
));
std
::
string
url
=
std
::
string
url
=
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
smf_cfg
.
amf_addr
.
api_version
+
smf_cfg
.
amf_addr
.
api_version
+
...
@@ -3300,9 +3302,9 @@ void smf_context::handle_pdu_session_modification_network_requested(
...
@@ -3300,9 +3302,9 @@ void smf_context::handle_pdu_session_modification_network_requested(
// Fill N1N2MesasgeTransferRequestData
// Fill N1N2MesasgeTransferRequestData
// get supi and put into URL
// get supi and put into URL
supi_t
supi
=
itti_msg
->
msg
.
get_supi
();
supi_t
supi
=
itti_msg
->
msg
.
get_supi
();
std
::
string
supi_str
=
std
::
string
supi_str
=
smf_get_supi_with_prefix
(
itti_msg
->
msg
.
get_supi_prefix
()
+
"-"
+
smf_supi_to_string
(
supi
);
itti_msg
->
msg
.
get_supi_prefix
()
,
smf_supi_to_string
(
supi
)
);
std
::
string
url
=
std
::
string
url
=
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
smf_cfg
.
amf_addr
.
api_version
+
smf_cfg
.
amf_addr
.
api_version
+
...
@@ -4943,9 +4945,9 @@ void smf_context::send_pdu_session_create_response(
...
@@ -4943,9 +4945,9 @@ void smf_context::send_pdu_session_create_response(
// Fill N1N2MesasgeTransferRequestData
// Fill N1N2MesasgeTransferRequestData
// get SUPI and put into URL
// get SUPI and put into URL
supi_t
supi
=
resp
->
res
.
get_supi
();
supi_t
supi
=
resp
->
res
.
get_supi
();
std
::
string
supi_str
=
std
::
string
supi_str
=
smf_get_supi_with_prefix
(
resp
->
res
.
get_supi_prefix
()
+
"-"
+
smf_supi_to_string
(
supi
);
resp
->
res
.
get_supi_prefix
()
,
smf_supi_to_string
(
supi
)
);
std
::
string
url
=
std
::
string
url
=
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
"http://"
+
get_amf_addr
()
+
NAMF_COMMUNICATION_BASE
+
smf_cfg
.
amf_addr
.
api_version
+
smf_cfg
.
amf_addr
.
api_version
+
...
...
src/smf_app/smf_n7.hpp
View file @
3322d832
...
@@ -72,8 +72,9 @@ struct policy_association {
...
@@ -72,8 +72,9 @@ struct policy_association {
std
::
string
pcf_location
;
std
::
string
pcf_location
;
void
set_context
(
void
set_context
(
const
std
::
string
&
supi
,
const
std
::
string
&
dnn
,
const
snssai_t
&
snssai
,
const
std
::
string
&
supi
,
const
std
::
string
&
supi_prefix
,
const
plmn_t
&
plmn
,
const
uint8_t
pdu_session_id
,
const
std
::
string
&
dnn
,
const
snssai_t
&
snssai
,
const
plmn_t
&
plmn
,
const
uint8_t
pdu_session_id
,
const
pdu_session_type_t
&
pdu_session_type
)
{
const
pdu_session_type_t
&
pdu_session_type
)
{
oai
::
smf_server
::
model
::
Snssai
snssai_model
;
oai
::
smf_server
::
model
::
Snssai
snssai_model
;
snssai_model
.
setSst
(
snssai
.
sst
);
snssai_model
.
setSst
(
snssai
.
sst
);
...
@@ -90,8 +91,7 @@ struct policy_association {
...
@@ -90,8 +91,7 @@ struct policy_association {
context
=
{};
context
=
{};
context
.
setPduSessionId
(
pdu_session_id
);
context
.
setPduSessionId
(
pdu_session_id
);
// TODO only support imsi SUPI, not NAI
context
.
setSupi
(
smf_get_supi_with_prefix
(
supi_prefix
,
supi
));
context
.
setSupi
(
"imsi-"
+
supi
);
oai
::
smf_server
::
model
::
PduSessionType
pdu_session_type_model
;
oai
::
smf_server
::
model
::
PduSessionType
pdu_session_type_model
;
// hacky
// hacky
from_json
(
pdu_session_type
.
to_string
(),
pdu_session_type_model
);
from_json
(
pdu_session_type
.
to_string
(),
pdu_session_type_model
);
...
...
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