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-Simple
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
CommunityXG
OpenXG-SMF-Simple
Commits
07852f13
Commit
07852f13
authored
Mar 17, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with APN Operator Identifier
parent
3bae76aa
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
13 deletions
+25
-13
src/common/utils/conversions.cpp
src/common/utils/conversions.cpp
+3
-0
src/common/utils/epc.cpp
src/common/utils/epc.cpp
+5
-1
src/common/utils/string.cpp
src/common/utils/string.cpp
+10
-4
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+7
-8
No files found.
src/common/utils/conversions.cpp
View file @
07852f13
...
...
@@ -133,6 +133,7 @@ bool conv::plmnFromString(
p
.
mcc_digit3
=
mcc
[
2
]
-
'0'
;
else
return
false
;
// MNC
if
(
isdigit
(
mnc
[
0
]))
p
.
mnc_digit1
=
mnc
[
0
]
-
'0'
;
...
...
@@ -147,6 +148,8 @@ bool conv::plmnFromString(
p
.
mnc_digit3
=
mnc
[
2
]
-
'0'
;
else
return
false
;
}
else
{
p
.
mnc_digit3
=
0x0
;
}
return
true
;
}
...
...
src/common/utils/epc.cpp
View file @
07852f13
...
...
@@ -51,13 +51,17 @@ std::string Utility::home_network_gprs(const char* mnc, const char* mcc) {
}
std
::
string
Utility
::
home_network_gprs
(
const
plmn_t
&
plmn
)
{
// '.mnc(\d{3})\.mcc(\d{3})\.gprs'
std
::
string
s
;
uint16_t
mcc
=
0
;
uint16_t
mnc
=
0
;
uint16_t
mnc_len
=
0
;
PLMN_T_TO_MCC_MNC
(
plmn
,
mcc
,
mnc
,
mnc_len
);
mcc
=
plmn
.
mcc_digit1
*
100
+
plmn
.
mcc_digit2
*
10
+
plmn
.
mcc_digit3
;
mnc_len
=
(
plmn
.
mnc_digit3
==
0x0
?
2
:
3
);
mnc
=
plmn
.
mnc_digit1
*
10
+
plmn
.
mnc_digit2
;
mnc
=
(
mnc_len
==
2
?
mnc
:
mnc
*
10
+
plmn
.
mnc_digit3
);
s
.
append
(
".mnc"
);
if
(
mnc_len
==
2
)
s
.
append
(
"0"
);
...
...
src/common/utils/string.cpp
View file @
07852f13
...
...
@@ -174,12 +174,18 @@ bool util::string_to_dotted(const std::string& str, std::string& dotted) {
};
void
util
::
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
)
{
std
::
string
tmp
=
std
::
to_string
(
str
.
length
())
+
str
;
bstr
->
slen
=
tmp
.
length
();
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
tmp
.
c_str
(),
tmp
.
length
());
uint8_t
tmp
[
str
.
length
()
+
1
];
tmp
[
0
]
=
str
.
length
();
memcpy
((
void
*
)
&
tmp
[
1
],
(
void
*
)
str
.
c_str
(),
str
.
length
());
bstr
->
slen
=
str
.
length
()
+
1
;
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
tmp
,
str
.
length
()
+
1
);
/*
printf("\n");
for (int i = 0; i < str.length() + 1; i++) {
printf(" %02x", tmp[i]);
}
uint8_t tmp[str.length() + 1];
tmp[0] = str.length();
memcpy((void*) &tmp[1], (void*) str.c_str(), tmp.length());
...
...
src/smf_app/smf_n1.cpp
View file @
07852f13
...
...
@@ -256,16 +256,15 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
plmn_t
plmn
=
{};
sc
.
get
()
->
get_plmn
(
plmn
);
std
::
string
gprs
=
EPC
::
Utility
::
home_network_gprs
(
plmn
);
std
::
string
dotted
;
util
::
string_to_dotted
(
gprs
,
dotted
);
std
::
string
full_dnn
=
sm_context_res
.
get_dnn
()
+
dotted
;
//".mnc011.mcc110.gprs";
Logger
::
smf_n1
().
debug
(
"Full DNN %s"
,
full_dnn
.
c_str
());
sm_context_res
.
get_dnn
()
+
gprs
;
//".mnc011.mcc110.gprs";
std
::
string
dotted
;
util
::
string_to_dotted
(
full_dnn
,
dotted
);
Logger
::
smf_n1
().
debug
(
"Full DNN %s, dotted DNN %s"
,
full_dnn
.
c_str
(),
dotted
.
c_str
());
sm_msg
->
pdu_session_establishment_accept
.
dnn
=
bfromcstralloc
(
full_dnn
.
length
()
+
1
,
"
\0
"
);
util
::
string_to_dnn
(
full_dnn
,
sm_msg
->
pdu_session_establishment_accept
.
dnn
);
bfromcstralloc
(
dotted
.
length
()
+
1
,
"
\0
"
);
util
::
string_to_dnn
(
dotted
,
sm_msg
->
pdu_session_establishment_accept
.
dnn
);
/*
sm_msg->pdu_session_establishment_accept.dnn = bfromcstralloc(
...
...
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