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
2c4796bc
Commit
2c4796bc
authored
Mar 05, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support PDN Session Type IPv4v6
parent
fd198951
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
10 deletions
+58
-10
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+5
-2
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+52
-7
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+1
-1
No files found.
src/smf_app/smf_app.cpp
View file @
2c4796bc
...
@@ -506,7 +506,7 @@ void smf_app::handle_itti_msg(std::shared_ptr<itti_n4_node_failure> snf) {
...
@@ -506,7 +506,7 @@ void smf_app::handle_itti_msg(std::shared_ptr<itti_n4_node_failure> snf) {
"Remove the associated PDU session (SUPI "
SUPI_64_FMT
"Remove the associated PDU session (SUPI "
SUPI_64_FMT
", PDU Sessin Id %d)"
,
", PDU Sessin Id %d)"
,
supi64
,
it
.
second
->
pdu_session_id
);
supi64
,
it
.
second
->
pdu_session_id
);
//TODO: remove the session
//
TODO: remove the session
}
}
}
}
}
}
...
@@ -729,6 +729,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
...
@@ -729,6 +729,7 @@ void smf_app::handle_pdu_session_create_sm_context_request(
// Get necessary info from NAS
// Get necessary info from NAS
xgpp_conv
::
sm_context_request_from_nas
(
decoded_nas_msg
,
smreq
->
req
);
xgpp_conv
::
sm_context_request_from_nas
(
decoded_nas_msg
,
smreq
->
req
);
pdu_session_type
.
pdu_session_type
=
smreq
->
req
.
get_pdu_session_type
();
// TODO: Support IPv4 only for now
// TODO: Support IPv4 only for now
if
(
pdu_session_type
.
pdu_session_type
==
PDU_SESSION_TYPE_E_IPV6
)
{
if
(
pdu_session_type
.
pdu_session_type
==
PDU_SESSION_TYPE_E_IPV6
)
{
cause_n1
=
cause_value_5gsm_e
::
CAUSE_50_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED
;
cause_n1
=
cause_value_5gsm_e
::
CAUSE_50_PDU_SESSION_TYPE_IPV4_ONLY_ALLOWED
;
...
@@ -737,7 +738,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(
...
@@ -737,7 +738,9 @@ void smf_app::handle_pdu_session_create_sm_context_request(
(
pdu_session_type
.
pdu_session_type
==
PDU_SESSION_TYPE_E_UNSTRUCTURED
))
{
(
pdu_session_type
.
pdu_session_type
==
PDU_SESSION_TYPE_E_UNSTRUCTURED
))
{
cause_n1
=
cause_value_5gsm_e
::
CAUSE_28_UNKNOWN_PDU_SESSION_TYPE
;
cause_n1
=
cause_value_5gsm_e
::
CAUSE_28_UNKNOWN_PDU_SESSION_TYPE
;
}
}
if
(
pdu_session_type
.
pdu_session_type
!=
PDU_SESSION_TYPE_E_IPV4
)
{
if
((
pdu_session_type
.
pdu_session_type
!=
PDU_SESSION_TYPE_E_IPV4
)
and
(
pdu_session_type
.
pdu_session_type
!=
PDU_SESSION_TYPE_E_IPV4V6
))
{
// PDU Session Establishment Reject
// PDU Session Establishment Reject
if
(
smf_n1
::
get_instance
().
create_n1_pdu_session_establishment_reject
(
if
(
smf_n1
::
get_instance
().
create_n1_pdu_session_establishment_reject
(
smreq
->
req
,
n1_sm_message
,
cause_n1
))
{
smreq
->
req
,
n1_sm_message
,
cause_n1
))
{
...
...
src/smf_app/smf_context.cpp
View file @
2c4796bc
...
@@ -1338,8 +1338,56 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1338,8 +1338,56 @@ void smf_context::handle_pdu_session_create_sm_context_request(
bool
set_paa
=
false
;
bool
set_paa
=
false
;
paa_t
paa
=
{};
paa_t
paa
=
{};
Logger
::
smf_app
().
debug
(
"UE Address Allocation"
);
Logger
::
smf_app
().
debug
(
"UE Address Allocation"
);
switch
(
sp
->
pdu_session_type
.
pdu_session_type
)
{
switch
(
sp
->
pdu_session_type
.
pdu_session_type
)
{
case
PDU_SESSION_TYPE_E_IPV4V6
:
{
Logger
::
smf_app
().
debug
(
"PDU Session Type IPv4v6, select PDU Session Type IPv4"
);
bool
paa_res
=
false
;
/*
//TODO: Verified if use default session type or requested session type
std::shared_ptr<session_management_subscription> ss = {};
std::shared_ptr<dnn_configuration_t> sdc = {};
find_dnn_subscription(snssai, ss);
if (nullptr != ss.get()) {
ss.get()->find_dnn_configuration(sd->dnn_in_use, sdc);
if (nullptr != sdc.get()) {
paa.pdu_session_type.pdu_session_type =
sdc.get()
->pdu_session_types.default_session_type.pdu_session_type;
}
}
*/
paa
.
pdu_session_type
.
pdu_session_type
=
PDU_SESSION_TYPE_E_IPV4V6
;
if
((
not
paa_res
)
||
(
not
paa
.
is_ip_assigned
()))
{
bool
success
=
paa_dynamic
::
get_instance
().
get_free_paa
(
sd
->
dnn_in_use
,
paa
);
if
(
success
)
{
set_paa
=
true
;
}
else
{
// ALL_DYNAMIC_ADDRESSES_ARE_OCCUPIED;
set_paa
=
false
;
request_accepted
=
false
;
sm_context_resp
->
res
.
set_cause
(
static_cast
<
uint8_t
>
(
cause_value_5gsm_e
::
CAUSE_26_INSUFFICIENT_RESOURCES
));
}
// TODO: Static IP address allocation
}
else
if
((
paa_res
)
&&
(
paa
.
is_ip_assigned
()))
{
set_paa
=
true
;
}
Logger
::
smf_app
().
info
(
"PAA, Ipv4 Address: %s"
,
inet_ntoa
(
*
((
struct
in_addr
*
)
&
paa
.
ipv4_address
)));
char
str_addr6
[
INET6_ADDRSTRLEN
];
if
(
inet_ntop
(
AF_INET6
,
&
paa
.
ipv6_address
,
str_addr6
,
sizeof
(
str_addr6
)))
{
Logger
::
smf_app
().
info
(
"PAA, IPv6 Address: %s"
,
str_addr6
);
}
};
break
;
case
PDU_SESSION_TYPE_E_IPV4
:
{
case
PDU_SESSION_TYPE_E_IPV4
:
{
Logger
::
smf_app
().
debug
(
"PDU Session Type IPv4"
);
if
(
!
pco_ids
.
ci_ipv4_address_allocation_via_dhcpv4
)
{
if
(
!
pco_ids
.
ci_ipv4_address_allocation_via_dhcpv4
)
{
// use SM NAS signalling
// use SM NAS signalling
// static or dynamic address allocation
// static or dynamic address allocation
...
@@ -1357,7 +1405,10 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1357,7 +1405,10 @@ void smf_context::handle_pdu_session_create_sm_context_request(
if
(
nullptr
!=
sdc
.
get
())
{
if
(
nullptr
!=
sdc
.
get
())
{
paa
.
pdu_session_type
.
pdu_session_type
=
paa
.
pdu_session_type
.
pdu_session_type
=
sdc
.
get
()
sdc
.
get
()
->
pdu_session_types
.
default_session_type
.
pdu_session_type
;
->
pdu_session_types
.
default_session_type
.
pdu_session_type
;
// TODO: Verified if use default session
// type or requested session type
// TODO: static ip address
// TODO: static ip address
}
}
}
}
...
@@ -1395,11 +1446,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1395,11 +1446,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
Logger
::
smf_app
().
debug
(
"IPv6 has not been supported yet!"
);
Logger
::
smf_app
().
debug
(
"IPv6 has not been supported yet!"
);
}
break
;
}
break
;
case
PDU_SESSION_TYPE_E_IPV4V6
:
{
// TODO:
Logger
::
smf_app
().
debug
(
"IPv4/v6 has not been supported yet!"
);
}
break
;
default:
{
default:
{
Logger
::
smf_app
().
error
(
Logger
::
smf_app
().
error
(
"Unknown PDN type %d"
,
sp
->
pdu_session_type
.
pdu_session_type
);
"Unknown PDN type %d"
,
sp
->
pdu_session_type
.
pdu_session_type
);
...
@@ -1546,7 +1592,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
...
@@ -1546,7 +1592,6 @@ void smf_context::handle_pdu_session_create_sm_context_request(
paa_dynamic
::
get_instance
().
release_paa
(
paa_dynamic
::
get_instance
().
release_paa
(
sd
->
dnn_in_use
,
free_paa
.
ipv4_address
);
sd
->
dnn_in_use
,
free_paa
.
ipv4_address
);
break
;
break
;
case
PDU_SESSION_TYPE_E_IPV6
:
case
PDU_SESSION_TYPE_E_IPV6
:
case
PDU_SESSION_TYPE_E_UNSTRUCTURED
:
case
PDU_SESSION_TYPE_E_UNSTRUCTURED
:
case
PDU_SESSION_TYPE_E_ETHERNET
:
case
PDU_SESSION_TYPE_E_ETHERNET
:
...
...
src/smf_app/smf_n1.cpp
View file @
2c4796bc
...
@@ -166,7 +166,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
...
@@ -166,7 +166,7 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
paa
.
ipv4_address
,
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
paa
.
ipv4_address
,
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
.
pdu_address_information
);
.
pdu_address_information
);
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
.
pdu_session_type_value
=
sm_msg
->
pdu_session_establishment_accept
.
pduaddress
.
pdu_session_type_value
=
static_cast
<
uint8_t
>
(
PDU_SESSION_TYPE_E_IPV4
);
static_cast
<
uint8_t
>
(
paa
.
pdu_session_type
.
pdu_session_type
);
Logger
::
smf_n1
().
debug
(
Logger
::
smf_n1
().
debug
(
"UE Address %s"
,
conv
::
toString
(
paa
.
ipv4_address
).
c_str
());
"UE Address %s"
,
conv
::
toString
(
paa
.
ipv4_address
).
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