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
febbc8c6
Commit
febbc8c6
authored
Oct 12, 2019
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unncessary files/functions/variables
parent
9b5d9a80
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
223 additions
and
381 deletions
+223
-381
build/scripts/smf_conf.sh
build/scripts/smf_conf.sh
+0
-1
etc/smf.conf
etc/smf.conf
+1
-77
src/nas/3gpp_24.501.h
src/nas/3gpp_24.501.h
+1
-1
src/nas/sm/msg/sm_msg.c
src/nas/sm/msg/sm_msg.c
+2
-2
src/pgwc/pgw_app.cpp
src/pgwc/pgw_app.cpp
+17
-63
src/pgwc/pgw_app.hpp
src/pgwc/pgw_app.hpp
+9
-24
src/pgwc/pgw_context.cpp
src/pgwc/pgw_context.cpp
+8
-5
src/pgwc/pgw_context.hpp
src/pgwc/pgw_context.hpp
+3
-12
src/pgwc/smf_procedure.cpp
src/pgwc/smf_procedure.cpp
+182
-196
No files found.
build/scripts/smf_conf.sh
View file @
febbc8c6
...
...
@@ -18,7 +18,6 @@ SMF_CONF[@INSTANCE@]=$INSTANCE
SMF_CONF[@PREFIX@]
=
$PREFIX
SMF_CONF[@PID_DIRECTORY@]
=
'/var/run'
SMF_CONF[@SGW_INTERFACE_NAME_FOR_S11@]
=
'eno1:s11'
SMF_CONF[@SGW_INTERFACE_NAME_FOR_S5_S8_CP@]
=
'eno1:s5c'
SMF_CONF[@PGW_INTERFACE_NAME_FOR_S5_S8_CP@]
=
'eno1:p5c'
SMF_CONF[@PGW_INTERFACE_NAME_FOR_SX@]
=
'eno1:sxc'
SMF_CONF[@DEFAULT_DNS_IPV4_ADDRESS@]
=
'8.8.8.8'
...
...
etc/smf.conf
View file @
febbc8c6
...
...
@@ -18,82 +18,6 @@
# For more information about the OpenAirInterface (OAI) Software Alliance:
# contact@openairinterface.org
################################################################################
S
-
GW
=
{
INSTANCE
= @
INSTANCE
@;
# 0 is the default
PID_DIRECTORY
=
"@PID_DIRECTORY@"
;
# /var/run is the default
#ITTI_TASKS :
#{
#ITTI_TIMER_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 85;
#};
#S11_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#S5S8_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SX_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#SGW_APP_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#ASYNC_CMD_SCHED_PARAMS :
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 84;
#};
#};
INTERFACES
:
{
S11_CP
:
{
# S-GW binded interface for S11 communication (GTPV2-C), if none selected the ITTI message interface is used
INTERFACE_NAME
=
"@SGW_INTERFACE_NAME_FOR_S11@"
;
# STRING, interface name, YOUR NETWORK CONFIG HERE
IPV4_ADDRESS
=
"read"
;
# STRING, CIDR or "read" to let app read interface configured IP address, YOUR NETWORK CONFIG HERE
#PORT = 2123; # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
S5_S8_CP
:
{
# S-GW binded interface for S5 or S8 communication
INTERFACE_NAME
=
"@SGW_INTERFACE_NAME_FOR_S5_S8_CP@"
;
# STRING, interface name
IPV4_ADDRESS
=
"read"
;
# STRING, CIDR or "read" to let app read interface configured IP address
#PORT = 2123; # INTEGER, port number, PREFER NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING
#SCHED_PARAMS : # SCHEADULING PARAMS OF THE LOOPING RECEIVER THREAD BOUND TO THIS INTERFACE/PROTOCOL
#{
#CPU_ID = 1;
#SCHED_POLICY = "SCHED_FIFO"; # Values in { SCHED_OTHER, SCHED_IDLE, SCHED_BATCH, SCHED_FIFO, SCHED_RR }
#SCHED_PRIORITY = 95;
#};
};
};
};
P
-
GW
=
{
INSTANCE
= @
INSTANCE
@;
# 0 is the default
...
...
@@ -196,7 +120,7 @@ P-GW =
{
APN_NI
=
"apn1"
;
PDN_TYPE
=
"IPv4"
;
IPV4_POOL
=
1
;
IPV6_POOL
= -
1
},
{
APN_NI
=
"apn2"
;
PDN_TYPE
=
"IPv4"
;
IPV4_POOL
=
2
;
IPV6_POOL
= -
1
},
{
APN_NI
=
"apn3"
;
PDN_TYPE
=
"IPv4"
;
IPV4_POOL
=
3
;
IPV6_POOL
= -
1
},
{
APN_NI
=
"apn
2
"
;
PDN_TYPE
=
"IPv4"
;
IPV4_POOL
=
4
;
IPV6_POOL
= -
1
}
{
APN_NI
=
"apn
4
"
;
PDN_TYPE
=
"IPv4"
;
IPV4_POOL
=
4
;
IPV6_POOL
= -
1
}
);
# DNS address communicated to UEs
...
...
src/nas/3gpp_24.501.h
View file @
febbc8c6
...
...
@@ -100,7 +100,7 @@ extern "C" {
#define PDU_SESSION_RELEASE_COMMAND 0b11010011
#define PDU_SESSION_RELEASE_COMPLETE 0b11010100
#define _5GSM_STAUS 0b11010110
#define _5GSM_STA
T
US 0b11010110
...
...
src/nas/sm/msg/sm_msg.c
View file @
febbc8c6
...
...
@@ -119,7 +119,7 @@ sm_msg_decode (
case
PDU_SESSION_RELEASE_COMPLETE
:
decode_result
=
decode_pdu_session_release_complete
(
&
msg
->
specific_msg
.
pdu_session_release_complete
,
buffer
,
len
);
break
;
case
_5GSM_STAUS
:
case
_5GSM_STA
T
US
:
decode_result
=
decode__5gsm_status
(
&
msg
->
specific_msg
.
_5gsm_status
,
buffer
,
len
);
break
;
...
...
@@ -235,7 +235,7 @@ fivegsm_msg_encode (
case
PDU_SESSION_RELEASE_COMPLETE
:
encode_result
=
encode_pdu_session_release_complete
(
&
msg
->
specific_msg
.
pdu_session_release_complete
,
buffer
,
len
);
break
;
case
_5GSM_STAUS
:
case
_5GSM_STA
T
US
:
encode_result
=
encode__5gsm_status
(
&
msg
->
specific_msg
.
_5gsm_status
,
buffer
,
len
);
break
;
...
...
src/pgwc/pgw_app.cpp
View file @
febbc8c6
...
...
@@ -84,29 +84,33 @@ int pgw_app::apply_config (const smf_config& cfg)
}
//------------------------------------------------------------------------------
teid_t
pgw_app
::
generate_s5s8_cp_t
eid
()
{
std
::
unique_lock
<
std
::
mutex
>
ls
(
m_s
5s8_cp_teid
_generator
);
teid_t
teid
=
++
teid_s5s8_cp
_generator
;
while
((
is_s
5s8c_teid_exist
(
teid
))
||
(
teid
==
UNASSIGNED_T
EID
))
{
teid
=
++
teid_s5s8_cp
_generator
;
uint64_t
pgw_app
::
generate_s
eid
()
{
std
::
unique_lock
<
std
::
mutex
>
ls
(
m_s
eid_n4
_generator
);
uint64_t
seid
=
++
seid_n4
_generator
;
while
((
is_s
eid_n4_exist
(
seid
))
||
(
seid
==
UNASSIGNED_S
EID
))
{
seid
=
++
seid_n4
_generator
;
}
s
5s8cplteid
.
insert
(
t
eid
);
s
et_seid_n4
.
insert
(
s
eid
);
ls
.
unlock
();
return
t
eid
;
return
s
eid
;
}
//------------------------------------------------------------------------------
bool
pgw_app
::
is_s
5s8c_teid_exist
(
const
teid_t
&
teid_s5s8_cp
)
const
bool
pgw_app
::
is_s
eid_n4_exist
(
const
uint64_t
&
seid
)
const
{
return
bool
{
s
5s8cplteid
.
count
(
teid_s5s8_cp
)
>
0
};
return
bool
{
s
et_seid_n4
.
count
(
seid
)
>
0
};
}
//------------------------------------------------------------------------------
void
pgw_app
::
free_s
5s8c_teid
(
const
teid_t
&
teid_s5s8_cp
)
void
pgw_app
::
free_s
eid_n4
(
const
uint64_t
&
seid
)
{
s5s8cplteid
.
erase
(
teid_s5s8_cp
);
// can return value of erase
std
::
unique_lock
<
std
::
mutex
>
ls
(
m_seid_n4_generator
);
set_seid_n4
.
erase
(
seid
);
ls
.
unlock
();
}
//------------------------------------------------------------------------------
bool
pgw_app
::
is_imsi64_2_pgw_context
(
const
imsi64_t
&
imsi64
)
const
{
...
...
@@ -143,54 +147,6 @@ bool pgw_app::seid_2_pgw_context(const seid_t& seid, std::shared_ptr<pgw_context
return
false
;
}
//------------------------------------------------------------------------------
fteid_t
pgw_app
::
build_s5s8_cp_fteid
(
const
struct
in_addr
ipv4_address
,
const
teid_t
teid
)
{
fteid_t
fteid
=
{};
fteid
.
interface_type
=
S5_S8_PGW_GTP_C
;
fteid
.
v4
=
1
;
fteid
.
ipv4_address
=
ipv4_address
;
fteid
.
v6
=
0
;
fteid
.
ipv6_address
=
in6addr_any
;
fteid
.
teid_gre_key
=
teid
;
return
fteid
;
}
//------------------------------------------------------------------------------
fteid_t
pgw_app
::
generate_s5s8_cp_fteid
(
const
struct
in_addr
ipv4_address
)
{
teid_t
teid
=
generate_s5s8_cp_teid
();
return
build_s5s8_cp_fteid
(
ipv4_address
,
teid
);
}
//------------------------------------------------------------------------------
void
pgw_app
::
free_s5s8_cp_fteid
(
const
fteid_t
&
fteid
)
{
std
::
unique_lock
lock
(
m_s5s8lteid2pgw_context
);
s5s8lteid2pgw_context
.
erase
(
fteid
.
teid_gre_key
);
free_s5s8c_teid
(
fteid
.
teid_gre_key
);
}
//------------------------------------------------------------------------------
bool
pgw_app
::
is_s5s8cpgw_fteid_2_pgw_context
(
const
fteid_t
&
ls5s8_fteid
)
const
{
std
::
shared_lock
lock
(
m_s5s8lteid2pgw_context
);
return
bool
{
s5s8lteid2pgw_context
.
count
(
ls5s8_fteid
.
teid_gre_key
)
>
0
};
}
//------------------------------------------------------------------------------
std
::
shared_ptr
<
pgw_context
>
pgw_app
::
s5s8cpgw_fteid_2_pgw_context
(
fteid_t
&
ls5s8_fteid
)
{
if
(
is_s5s8cpgw_fteid_2_pgw_context
(
ls5s8_fteid
))
{
return
s5s8lteid2pgw_context
.
at
(
ls5s8_fteid
.
teid_gre_key
);
}
else
{
return
std
::
shared_ptr
<
pgw_context
>
(
nullptr
);
}
}
//------------------------------------------------------------------------------
void
pgw_app
::
set_s5s8cpgw_fteid_2_pgw_context
(
fteid_t
&
ls5s8_fteid
,
std
::
shared_ptr
<
pgw_context
>
spc
)
{
std
::
unique_lock
lock
(
m_s5s8lteid2pgw_context
);
s5s8lteid2pgw_context
[
ls5s8_fteid
.
teid_gre_key
]
=
spc
;
}
//------------------------------------------------------------------------------
void
pgw_app
::
delete_pgw_context
(
std
::
shared_ptr
<
pgw_context
>
spc
)
{
...
...
@@ -257,14 +213,12 @@ void pgw_app_task (void*)
}
//------------------------------------------------------------------------------
pgw_app
::
pgw_app
(
const
std
::
string
&
config_file
)
:
m_
s5s8_cp_teid_generator
(),
m_imsi2pgw_context
(),
m_s5s8lteid
2pgw_context
(),
m_seid2pgw_context
()
pgw_app
::
pgw_app
(
const
std
::
string
&
config_file
)
:
m_
imsi
2pgw_context
(),
m_seid2pgw_context
()
{
Logger
::
pgwc_app
().
startup
(
"Starting..."
);
teid_s5s8_cp_generator
=
0
;
imsi2pgw_context
=
{};
s5s8lteid2pgw_context
=
{};
s5s8cplteid
=
{};
set_seid_n4
=
{};
apply_config
(
smf_cfg
);
...
...
src/pgwc/pgw_app.hpp
View file @
febbc8c6
...
...
@@ -49,26 +49,22 @@
namespace
pgwc
{
//typedef std::pair<shared_ptr<pgw_context>,shared_ptr<pgw_pdn_connection>> zzz;
class
smf_config
;
// same namespace
class
pgw_app
{
private:
std
::
thread
::
id
thread_id
;
std
::
thread
thread
;
// teid generators (linear)
teid_t
teid_s5s8_cp_generator
;
//seid generator
uint64_t
seid_n4_generator
;
std
::
mutex
m_seid_n4_generator
;
std
::
set
<
uint64_t
>
set_seid_n4
;
std
::
map
<
imsi64_t
,
std
::
shared_ptr
<
pgw_context
>>
imsi2pgw_context
;
std
::
map
<
teid_t
,
std
::
shared_ptr
<
pgw_context
>>
s5s8lteid2pgw_context
;
std
::
map
<
seid_t
,
std
::
shared_ptr
<
pgw_context
>>
seid2pgw_context
;
std
::
set
<
teid_t
>
s5s8cplteid
;
std
::
mutex
m_s5s8_cp_teid_generator
;
mutable
std
::
shared_mutex
m_imsi2pgw_context
;
mutable
std
::
shared_mutex
m_s5s8lteid2pgw_context
;
mutable
std
::
shared_mutex
m_seid2pgw_context
;
//for SMF
...
...
@@ -78,15 +74,6 @@ private:
int
apply_config
(
const
smf_config
&
cfg
);
teid_t
generate_s5s8_cp_teid
();
void
free_s5s8c_teid
(
const
teid_t
&
teid_s5s8_cp
);
bool
is_s5s8c_teid_exist
(
const
teid_t
&
teid_s5s8_cp
)
const
;
//teid_t generate_s5s8_up_teid();
//void free_s5s8u_teid(const teid_t& teid_s5s8_up);
//bool is_s5s8u_teid_exist(teid_t& teid_s5s8_up);
// s5s8crteid2pgw_eps_bearer_context collection
bool
is_s5s8cpgw_fteid_2_pgw_context
(
const
fteid_t
&
ls5s8_fteid
)
const
;
bool
is_imsi64_2_pgw_context
(
const
imsi64_t
&
imsi64
)
const
;
std
::
shared_ptr
<
pgw_context
>
imsi64_2_pgw_context
(
const
imsi64_t
&
imsi64
)
const
;
void
set_imsi64_2_pgw_context
(
const
imsi64_t
&
imsi64
,
std
::
shared_ptr
<
pgw_context
>
pc
);
...
...
@@ -103,12 +90,6 @@ public:
pgw_app
(
pgw_app
const
&
)
=
delete
;
void
operator
=
(
pgw_app
const
&
)
=
delete
;
fteid_t
build_s5s8_cp_fteid
(
const
struct
in_addr
ipv4_address
,
const
teid_t
teid
);
fteid_t
generate_s5s8_cp_fteid
(
const
struct
in_addr
ipv4_address
);
void
free_s5s8_cp_fteid
(
const
fteid_t
&
fteid
);
void
set_s5s8cpgw_fteid_2_pgw_context
(
fteid_t
&
rs5s8_fteid
,
std
::
shared_ptr
<
pgw_context
>
spc
);
std
::
shared_ptr
<
pgw_context
>
s5s8cpgw_fteid_2_pgw_context
(
fteid_t
&
ls5s8_fteid
);
void
set_seid_2_pgw_context
(
const
seid_t
&
seid
,
std
::
shared_ptr
<
pgw_context
>&
pc
);
bool
seid_2_pgw_context
(
const
seid_t
&
seid
,
std
::
shared_ptr
<
pgw_context
>&
pc
)
const
;
...
...
@@ -133,6 +114,10 @@ public:
void
restore_sx_sessions
(
const
seid_t
&
seid
)
const
;
uint64_t
generate_seid
();
bool
is_seid_n4_exist
(
const
uint64_t
&
s
)
const
;
void
free_seid_n4
(
const
uint64_t
&
seid
);
/*
* Handle PDUSession_CreateSMContextRequest from AMF
* @param [std::shared_ptr<itti_n11_create_sm_context_request>&] Request message
...
...
src/pgwc/pgw_context.cpp
View file @
febbc8c6
...
...
@@ -172,15 +172,20 @@ void pgw_pdn_connection::deallocate_ressources(const std::string& apn)
if
(
ipv4
)
{
paa_dynamic
::
get_instance
().
release_paa
(
apn
,
ipv4_address
);
}
pgw_app_inst
->
free_s5s8_cp_fteid
(
pgw_fteid_s5_s8_cp
);
//
pgw_app_inst->free_s5s8_cp_fteid(pgw_fteid_s5_s8_cp);
clear
();
}
//------------------------------------------------------------------------------
void
pgw_pdn_connection
::
generate_seid
()
{
// DO it simple now:
seid
=
pgw_fteid_s5_s8_cp
.
teid_gre_key
|
(((
uint64_t
)
smf_cfg
.
instance
)
<<
32
);
//
seid = pgw_fteid_s5_s8_cp.teid_gre_key | (((uint64_t)smf_cfg.instance) << 32);
}
void
pgw_pdn_connection
::
set_seid
(
const
uint64_t
&
s
){
seid
=
s
;
}
//------------------------------------------------------------------------------
// TODO check if prd_id should be uniq in the (S)PGW-U or in the context of a pdn connection
void
pgw_pdn_connection
::
generate_far_id
(
pfcp
::
far_id_t
&
far_id
)
...
...
@@ -216,8 +221,6 @@ std::string pgw_pdn_connection::toString() const
s
.
append
(
"
\t
PAA IPv4:
\t\t\t
"
).
append
(
conv
::
toString
(
ipv4_address
)).
append
(
"
\n
"
);
if
(
ipv6
)
s
.
append
(
"
\t
PAA IPv6:
\t\t\t
"
).
append
(
conv
::
toString
(
ipv6_address
)).
append
(
"
\n
"
);
s
.
append
(
"
\t
SGW FTEID S5S8 CP:
\t\t
"
).
append
(
sgw_fteid_s5_s8_cp
.
toString
()).
append
(
"
\n
"
);
s
.
append
(
"
\t
PGW FTEID S5S8 CP:
\t\t
"
).
append
(
pgw_fteid_s5_s8_cp
.
toString
()).
append
(
"
\n
"
);
s
.
append
(
"
\t
Default EBI:
\t\t\t
"
).
append
(
std
::
to_string
(
default_bearer
.
ebi
)).
append
(
"
\n
"
);
s
.
append
(
"
\t
SEID:
\t\t\t
"
).
append
(
std
::
to_string
(
seid
)).
append
(
"
\n
"
);
for
(
auto
it
:
eps_bearers
)
{
...
...
@@ -639,7 +642,7 @@ std::string dnn_context::toString() const
std
::
string
s
=
{};
s
.
append
(
"DNN CONTEXT:
\n
"
);
s
.
append
(
"
\t
In use:
\t\t\t\t
"
).
append
(
std
::
to_string
(
in_use
)).
append
(
"
\n
"
);
s
.
append
(
"
\t
AP
N:
\t\t\t\t
"
).
append
(
dnn_in_use
).
append
(
"
\n
"
);
s
.
append
(
"
\t
DN
N:
\t\t\t\t
"
).
append
(
dnn_in_use
).
append
(
"
\n
"
);
//s.append("\tAPN AMBR Bitrate Uplink:\t").append(std::to_string(apn_ambr.br_ul)).append("\n");
//s.append("\tAPN AMBR Bitrate Downlink:\t").append(std::to_string(apn_ambr.br_dl)).append("\n");
for
(
auto
it
:
pdn_connections
)
{
...
...
src/pgwc/pgw_context.hpp
View file @
febbc8c6
...
...
@@ -85,6 +85,8 @@ public:
//teid_t pgw_teid_s5_s8_up; // P-GW Tunnel Endpoint Identifier for the GTP Based S5/S8 interface for user plane.
fteid_t
pgw_fteid_s5_s8_up
;
fteid_t
ul_fteid
;
//Uplink fteid of UPF
bearer_qos_t
eps_bearer_qos
;
// EPS Bearer QoS: ARP, GBR, MBR, QCI.
// NOT NEEDED charging_id // Charging Id: Charging identifier, identifies charging records generated by S-GW and PDN GW.
...
...
@@ -116,8 +118,6 @@ public:
ipv4_address
.
s_addr
=
INADDR_ANY
;
ipv6_address
=
in6addr_any
;
pdn_type
=
{};
sgw_fteid_s5_s8_cp
=
{};
pgw_fteid_s5_s8_cp
=
{};
default_bearer
.
ebi
=
EPS_BEARER_IDENTITY_UNASSIGNED
;
seid
=
0
;
up_fseid
=
{};
...
...
@@ -182,6 +182,7 @@ public:
void
generate_seid
();
void
set_seid
(
const
uint64_t
&
seid
);
void
generate_pdr_id
(
pfcp
::
pdr_id_t
&
pdr_id
);
void
release_pdr_id
(
const
pfcp
::
pdr_id_t
&
pdr_id
);
void
generate_far_id
(
pfcp
::
far_id_t
&
far_id
);
...
...
@@ -194,16 +195,6 @@ public:
struct
in_addr
ipv4_address
;
// IP Address(es): IPv4 address and/or IPv6 prefix
struct
in6_addr
ipv6_address
;
// IP Address(es): IPv4 address and/or IPv6 prefix
pdn_type_t
pdn_type
;
// IPv4, IPv6, IPv4v6 or Non-IP
// S-GW Address in Use (control plane): The IP address of the S-GW currently used for sending control plane signalling.
// S-GW TEID for S5/S8 (control plane): S-GW Tunnel Endpoint Identifier for the S5/S8 interface for the control plane. (For GTP-based S5/S8 only).
fteid_t
sgw_fteid_s5_s8_cp
;
// S-GW GRE Key for downlink traffic (user plane): Serving GW assigned GRE Key for the S5/S8 interface for the user plane for downlink traffic.
// (For PMIP-based S5/S8 only).
// P-GW IP address for S5/S8 (control plane): P-GW IP address for the S5/S8 for the control plane signalling.
// P-GW TEID for S5/S8 (control plane): P-GW Tunnel Endpoint Identifier for the S5/S8 control plane interface. (For GTP-based S5/S8 only).
fteid_t
pgw_fteid_s5_s8_cp
;
// P-GW Address in Use (user plane): The IP address of the P-GW currently used for sending user plane traffic. (For PMIP-based S5/S8 only).
// P-GW GRE Key for uplink traffic (user plane): PDN GW assigned GRE Key for the S5/S8 interface for the user plane for uplink traffic.
// (For PMIP-based S5/S8 only).
// MS Info Change Reporting support indication: The MME and/or SGSN serving the UE support(s) procedures for reporting User Location Information
// and/or User CSG Information.
...
...
src/pgwc/smf_procedure.cpp
View file @
febbc8c6
...
...
@@ -93,7 +93,9 @@ int session_create_sm_context_procedure::run(std::shared_ptr<itti_n11_create_sm_
//-------------------
n11_trigger
=
sm_context_req
;
n11_triggered_pending
=
sm_context_resp
;
ppc
->
generate_seid
();
//ppc->generate_seid();
uint64_t
seid
=
pgw_app_inst
->
generate_seid
();
ppc
->
set_seid
(
seid
);
itti_n4_session_establishment_request
*
sx_ser
=
new
itti_n4_session_establishment_request
(
TASK_PGWC_APP
,
TASK_SMF_N4
);
sx_ser
->
seid
=
0
;
sx_ser
->
trxn_id
=
this
->
trxn_id
;
...
...
@@ -237,6 +239,9 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
if
(
it
.
get
(
local_up_fteid
))
{
xgpp_conv
::
pfcp_to_core_fteid
(
local_up_fteid
,
b
.
pgw_fteid_s5_s8_up
);
b
.
pgw_fteid_s5_s8_up
.
interface_type
=
S5_S8_PGW_GTP_U
;
//set tunnel id
xgpp_conv
::
pfcp_to_core_fteid
(
local_up_fteid
,
b
.
ul_fteid
);
b
.
ul_fteid
.
interface_type
=
S1_U_SGW_GTP_U
;
// comment if SPGW-C allocate up fteid
pgw_eps_bearer
b2
=
b
;
ppc
->
add_eps_bearer
(
b2
);
...
...
@@ -259,48 +264,29 @@ void session_create_sm_context_procedure::handle_itti_msg (itti_n4_session_estab
if
(
not
ppc
->
get_eps_bearer
(
ebi
,
b
))
{
bcc_cause
.
cause_value
=
SYSTEM_FAILURE
;
}
else
{
if
(
b
.
pgw_fteid_s5_s8_up
.
is_zero
())
{
if
(
b
.
ul_fteid
.
is_zero
())
{
bcc_cause
.
cause_value
=
SYSTEM_FAILURE
;
}
else
{
bcc
.
set
(
b
.
pgw_fteid_s5_s8_up
,
2
);
bcc
.
set
_s1_u_sgw_fteid
(
b
.
ul_fteid
);
}
}
bcc
.
set
(
b
.
ebi
);
bcc
.
set
(
bcc_cause
);
// only if modified bcc.set(bearer_level_qos);
// s5_triggered_pending->gtp_ies.add_bearer_context_created(bcc);
// }
/*
//Send reply to AMF
Logger::pgwc_app().info( "Sending response to AMF!");
nlohmann::json jsonData;
oai::smf::model::SmContextCreatedData smContextCreatedData;
//PduSessionId
smContextCreatedData.setPduSessionId(n11_trigger.get()->get_pdu_session_id());
//Snssai
oai::smf::model::Snssai snssai;
snssai.setSst(n11_trigger.get()->get_snssai().sST);
snssai.setSd(n11_trigger.get()->get_snssai().sD);
smContextCreatedData.setSNssai(snssai);
//UpCnxState
//N2SmInfo (use NAS to encode)
//TODO:
//N2SmInfoType
//TODO: smContextCreatedData.setN2SmInfoType();
//std::vector<EbiArpMapping> m_AllocatedEbiList
//HoState
//Gpsi
//SmfServiceInstanceId - SMF instance ID
//RecoveryTime;
//SupportedFeatures
to_json(jsonData, smContextCreatedData);
std::string resBody = jsonData.dump();
//issue: httpResponse has been free!!!
n11_triggered_pending.get()->set_http_code(Pistache::Http::Code::Created);
n11_triggered_pending.get()->send_msg_to_amf(resBody);
*/
//TODO: for qos bearer bearer_qos_t bearer_qos = {}; if(b.get(bearer_qos)){bcc.set(bearer_level_qos)};
//TODO
//should send information of created bearer to AMF
//n11_triggered_pending->add_bearer_context_created(bcc);
//N1N2MessageTransferReqData
//Step 11, section 4.3.2.2.1@TS 23.502
//Namf_Communication_N1N2MessageTransfer (PDU Session ID,
// N2 SM information (PDU Session ID, QFI(s), QoS Profile(s), CN Tunnel Info, S-NSSAI from the Allowed NSSAI, Session-AMBR, PDU
//Session Type, User Plane Security Enforcement information, UE Integrity Protection Maximum Data Rate),
//N1 SM container (PDU Session Establishment Accept (QoS Rule(s) and QoS Flow level QoS parameters if needed
//for the QoS Flow(s) associated with the QoS rule(s), selected SSC mode, S-NSSAI(s), DNN, allocated IPv4
//address, interface identifier, Session-AMBR, selected PDU Session Type, Reflective QoS Timer (if available),
//P-CSCF address(es), [Always-on PDU Session])))
//send ITTI message to APP to trigger N1N2MessageTransfer towards AMFs
Logger
::
pgwc_app
().
info
(
"Sending ITTI message %s to task TASK_SMF_N11"
,
n11_triggered_pending
->
get_msg_name
());
...
...
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