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
450e72c5
Commit
450e72c5
authored
Mar 12, 2021
by
luhan Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
try to support 5G Phone
parent
4c4ff252
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
12 deletions
+36
-12
src/common/utils/string.cpp
src/common/utils/string.cpp
+25
-3
src/nas/ies/SNSSAI.c
src/nas/ies/SNSSAI.c
+1
-0
src/nas/ies/_PDUSessionType.c
src/nas/ies/_PDUSessionType.c
+2
-2
src/nas/sm/msg/PDUSessionEstablishmentAccept.c
src/nas/sm/msg/PDUSessionEstablishmentAccept.c
+1
-0
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+7
-7
No files found.
src/common/utils/string.cpp
View file @
450e72c5
...
@@ -146,7 +146,29 @@ void util::string_to_bstring(const std::string& str, bstring bstr) {
...
@@ -146,7 +146,29 @@ void util::string_to_bstring(const std::string& str, bstring bstr) {
}
}
void
util
::
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
)
{
void
util
::
string_to_dnn
(
const
std
::
string
&
str
,
bstring
bstr
)
{
std
::
string
tmp
=
std
::
to_string
(
str
.
length
())
+
str
;
//std::string tmp = str + ".mnc011.mcc460.gprs";//for test ctnet
bstr
->
slen
=
tmp
.
length
();
//std::string tmp = std::to_string(str.length()) + str;
memcpy
((
void
*
)
bstr
->
data
,
(
void
*
)
tmp
.
c_str
(),
tmp
.
length
());
//bstr->slen = str.length()+sizeof(".mnc011.mcc110.gprs");
/*
int n = 0, i=0;
bstr->data[i] = str.length(); i++;
n = str.length();
memcpy((void*) (bstr->data+i+1), (void*) str.c_str(), n); i += n;
bstr->data[i] = n;
std::string tmp = "mnc011"; n = tmp.length();
memcpy((void*) (bstr->data+i+1), (void*) tmp.c_str(), n); i += n;
bstr->data[i] = n;
tmp = "mcc460"; n = tmp.length();
memcpy((void*) (bstr->data+i+1), (void*) tmp.c_str(), n); i += n;
tmp = "gprs"; n = tmp.length();
memcpy((void*) (bstr->data+i+1), (void*) tmp.c_str(), n); i += n;
*/
//19 05 63 74 6e 65
uint8_t
strB
[
6
]
=
{
0
};
strB
[
0
]
=
str
.
length
();
memcpy
(
strB
+
1
,
str
.
c_str
(),
str
.
length
());
bstr
->
slen
=
str
.
length
()
+
20
;
uint8_t
dnn
[
19
]
=
{
0x06
,
0x6d
,
0x6e
,
0x63
,
0x30
,
0x31
,
0x31
,
0x06
,
0x6d
,
0x63
,
0x63
,
0x34
,
0x36
,
0x30
,
0x04
,
0x67
,
0x70
,
0x72
,
0x73
};
memcpy
((
void
*
)(
bstr
->
data
),
(
void
*
)
strB
,
str
.
length
()
+
1
);
memcpy
((
void
*
)(
bstr
->
data
+
str
.
length
()
+
1
),
(
void
*
)
dnn
,
19
);
}
}
src/nas/ies/SNSSAI.c
View file @
450e72c5
...
@@ -44,6 +44,7 @@ int encode_snssai(SNSSAI snssai, uint8_t iei, uint8_t* buffer, uint32_t len) {
...
@@ -44,6 +44,7 @@ int encode_snssai(SNSSAI snssai, uint8_t iei, uint8_t* buffer, uint32_t len) {
}
}
ielen
=
snssai
.
len
;
ielen
=
snssai
.
len
;
ielen
=
1
;
*
(
buffer
+
encoded
)
=
ielen
;
*
(
buffer
+
encoded
)
=
ielen
;
encoded
++
;
encoded
++
;
...
...
src/nas/ies/_PDUSessionType.c
View file @
450e72c5
...
@@ -36,10 +36,10 @@ int encode__pdu_session_type(
...
@@ -36,10 +36,10 @@ int encode__pdu_session_type(
buffer
,
_PDU_SESSION_TYPE_MINIMUM_LENGTH
,
len
);
buffer
,
_PDU_SESSION_TYPE_MINIMUM_LENGTH
,
len
);
if
(
iei
>
0
)
{
if
(
iei
>
0
)
{
bitStream
|=
(
iei
&
0xf0
);
bitStream
|=
(
iei
&
0xf0
)
;
}
}
bitStream
|=
(
_pdusessiontype
.
pdu_session_type_value
&
0x07
);
bitStream
|=
(
(
_pdusessiontype
.
pdu_session_type_value
&
0x07
)
|
0x10
);
ENCODE_U8
(
buffer
+
encoded
,
bitStream
,
encoded
);
ENCODE_U8
(
buffer
+
encoded
,
bitStream
,
encoded
);
return
encoded
;
return
encoded
;
...
...
src/nas/sm/msg/PDUSessionEstablishmentAccept.c
View file @
450e72c5
...
@@ -215,6 +215,7 @@ int encode_pdu_session_establishment_accept(
...
@@ -215,6 +215,7 @@ int encode_pdu_session_establishment_accept(
CHECK_PDU_POINTER_AND_LENGTH_ENCODER
(
CHECK_PDU_POINTER_AND_LENGTH_ENCODER
(
buffer
,
PDU_SESSION_ESTABLISHMENT_ACCEPT_MINIMUM_LENGTH
,
len
);
buffer
,
PDU_SESSION_ESTABLISHMENT_ACCEPT_MINIMUM_LENGTH
,
len
);
if
((
encoded_result
=
encode__pdu_session_type
(
if
((
encoded_result
=
encode__pdu_session_type
(
pdu_session_establishment_accept
->
_pdusessiontype
,
0
,
pdu_session_establishment_accept
->
_pdusessiontype
,
0
,
buffer
+
encoded
,
len
-
encoded
))
<
0
)
buffer
+
encoded
,
len
-
encoded
))
<
0
)
...
...
src/smf_app/smf_n1.cpp
View file @
450e72c5
...
@@ -102,11 +102,11 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
...
@@ -102,11 +102,11 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
"PDU Session Type: %d"
,
sm_msg
->
pdu_session_establishment_accept
"PDU Session Type: %d"
,
sm_msg
->
pdu_session_establishment_accept
.
_pdusessiontype
.
pdu_session_type_value
);
.
_pdusessiontype
.
pdu_session_type_value
);
sm_msg
->
pdu_session_establishment_accept
.
sscmode
.
ssc_mode_value
=
//
sm_msg->pdu_session_establishment_accept.sscmode.ssc_mode_value =
SSC_MODE_1
;
// TODO: get from sm_context_res
//
SSC_MODE_1; // TODO: get from sm_context_res
Logger
::
smf_n1
().
debug
(
//
Logger::smf_n1().debug(
"SSC Mode: %d"
,
//
"SSC Mode: %d",
sm_msg
->
pdu_session_establishment_accept
.
sscmode
.
ssc_mode_value
);
//
sm_msg->pdu_session_establishment_accept.sscmode.ssc_mode_value);
// authorized QoS rules of the PDU session: QOSRules (Section 6.2.5@3GPP
// authorized QoS rules of the PDU session: QOSRules (Section 6.2.5@3GPP
// TS 24.501) (Section 6.4.1.3@3GPP TS 24.501 V16.1.0) Make sure that the
// TS 24.501) (Section 6.4.1.3@3GPP TS 24.501 V16.1.0) Make sure that the
...
@@ -152,7 +152,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
...
@@ -152,7 +152,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
return
false
;
return
false
;
}
}
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x03
9
a
;
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x03
8
a
;
if
(
static_cast
<
uint8_t
>
(
sm_cause
)
>
0
)
{
if
(
static_cast
<
uint8_t
>
(
sm_cause
)
>
0
)
{
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x039b
;
sm_msg
->
pdu_session_establishment_accept
.
presence
=
0x039b
;
sm_msg
->
pdu_session_establishment_accept
.
_5gsmcause
=
sm_msg
->
pdu_session_establishment_accept
.
_5gsmcause
=
...
@@ -253,7 +253,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
...
@@ -253,7 +253,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
// DNN
// DNN
sm_msg
->
pdu_session_establishment_accept
.
dnn
=
sm_msg
->
pdu_session_establishment_accept
.
dnn
=
bfromcstralloc
(
sm_context_res
.
get_dnn
().
length
()
+
1
,
"
\0
"
);
bfromcstralloc
(
sm_context_res
.
get_dnn
().
length
()
+
1
+
2
+
sizeof
(
".mnc011.mcc110.gprs"
)
,
"
\0
"
);
util
::
string_to_dnn
(
util
::
string_to_dnn
(
sm_context_res
.
get_dnn
(),
sm_msg
->
pdu_session_establishment_accept
.
dnn
);
sm_context_res
.
get_dnn
(),
sm_msg
->
pdu_session_establishment_accept
.
dnn
);
Logger
::
smf_n1
().
debug
(
"DNN %s"
,
sm_context_res
.
get_dnn
().
c_str
());
Logger
::
smf_n1
().
debug
(
"DNN %s"
,
sm_context_res
.
get_dnn
().
c_str
());
...
...
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