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
b81d4895
Commit
b81d4895
authored
Sep 21, 2020
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add 3GPP Interface Type
parent
8a13bafd
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
105 additions
and
23 deletions
+105
-23
src/common/3gpp_29.244.h
src/common/3gpp_29.244.h
+22
-17
src/pfcp/3gpp_29.244.cpp
src/pfcp/3gpp_29.244.cpp
+7
-0
src/pfcp/3gpp_29.244.hpp
src/pfcp/3gpp_29.244.hpp
+54
-0
src/pfcp/msg_pfcp.hpp
src/pfcp/msg_pfcp.hpp
+8
-0
src/smf_app/smf_procedure.cpp
src/smf_app/smf_procedure.cpp
+14
-6
No files found.
src/common/3gpp_29.244.h
View file @
b81d4895
...
...
@@ -320,6 +320,7 @@ struct pfcp_ie_value_exception : public pfcp_ie_exception {
#define PFCP_IE_FRAMED_ROUTE (153)
#define PFCP_IE_FRAMED_ROUTING (154)
#define PFCP_IE_FRAMED_IPV6_ROUTE (155)
#define PFCP_IE_3GPP_INTERFACE_TYPE (160)
#define PFCP_MESSAGE_RESERVED (0)
// PFCP_NODE_RELATED_MESSAGES
...
...
@@ -409,8 +410,8 @@ typedef struct source_interface_s {
struct
fteid_s
{
uint8_t
chid
:
1
;
uint8_t
ch
:
1
;
uint8_t
v4
:
1
;
uint8_t
v6
:
1
;
uint8_t
v4
:
1
;
teid_t
teid
;
struct
in_addr
ipv4_address
;
struct
in6_addr
ipv6_address
;
...
...
@@ -1613,24 +1614,28 @@ typedef struct framed_ipv6_route_s {
//-------------------------------------
// 8.2.118. 3GPP Interface Type
enum
_3gpp_interface_type_e
{
S1_U
=
0
,
S5_S8_U
=
1
,
S4_U
=
2
,
S11_U
=
3
,
S12_U
=
4
,
GN_GP_U
=
5
,
S2A_U
=
6
,
S2B_U
=
7
,
ENODEB_GTP_U_DL
=
8
,
ENODEB_GTP_U_UL
=
9
,
SGW_UPF_GTP_U_DL
=
10
,
N3_3GPP_ACCESS
=
11
,
N3_TRUSTED_NON_3GPP_ACCESS
=
12
,
N3_UNTRUSTED_NON_3GPP_ACCESS
=
13
,
N3
=
14
,
N9
=
15
_3GPP_INTERFACE_TYPE_
S1_U
=
0
,
_3GPP_INTERFACE_TYPE_
S5_S8_U
=
1
,
_3GPP_INTERFACE_TYPE_
S4_U
=
2
,
_3GPP_INTERFACE_TYPE_
S11_U
=
3
,
_3GPP_INTERFACE_TYPE_
S12_U
=
4
,
_3GPP_INTERFACE_TYPE_
GN_GP_U
=
5
,
_3GPP_INTERFACE_TYPE_
S2A_U
=
6
,
_3GPP_INTERFACE_TYPE_
S2B_U
=
7
,
_3GPP_INTERFACE_TYPE_
ENODEB_GTP_U_DL
=
8
,
_3GPP_INTERFACE_TYPE_
ENODEB_GTP_U_UL
=
9
,
_3GPP_INTERFACE_TYPE_
SGW_UPF_GTP_U_DL
=
10
,
_3GPP_INTERFACE_TYPE_
N3_3GPP_ACCESS
=
11
,
_3GPP_INTERFACE_TYPE_
N3_TRUSTED_NON_3GPP_ACCESS
=
12
,
_3GPP_INTERFACE_TYPE_
N3_UNTRUSTED_NON_3GPP_ACCESS
=
13
,
_3GPP_INTERFACE_TYPE_
N3
=
14
,
_3GPP_INTERFACE_TYPE_
N9
=
15
};
typedef
struct
_3gpp_interface_type_s
{
uint8_t
spare
:
2
;
uint8_t
interface_type_value
:
6
;
}
_3gpp_interface_type_t
;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Specific IEs
...
...
src/pfcp/3gpp_29.244.cpp
View file @
b81d4895
...
...
@@ -969,6 +969,13 @@ pfcp_ie * pfcp_ie::new_pfcp_ie_from_stream(std::istream& is) {
// return ie;
// }
// break;
case
PFCP_IE_3GPP_INTERFACE_TYPE
:
{
pfcp_3gpp_interface_type_ie
*
ie
=
new
pfcp_3gpp_interface_type_ie
(
tlv
);
ie
->
load_from
(
is
);
return
ie
;
}
break
;
default:
Logger
::
pfcp
().
error
(
"Unknown PFCP IE type %d (length %d)"
,
tlv
.
get_type
(),
tlv
.
get_length
());
return
nullptr
;
...
...
src/pfcp/3gpp_29.244.hpp
View file @
b81d4895
...
...
@@ -7782,6 +7782,60 @@ public:
// }
//};
// IE 3gpp_interface_type
class
pfcp_3gpp_interface_type_ie
:
public
pfcp_ie
{
public:
struct
{
uint8_t
spare
:
2
;
uint8_t
_3gpp_interface_type
:
6
;
}
interface_type
;
union
{
struct
{
uint8_t
spare
:
2
;
uint8_t
_3gpp_interface_type
:
6
;
}
bf
;
uint8_t
b
;
}
u1
;
//--------
explicit
pfcp_3gpp_interface_type_ie
(
const
pfcp
::
_3gpp_interface_type_t
&
b
)
:
pfcp_ie
(
PFCP_IE_3GPP_INTERFACE_TYPE
){
u1
.
b
=
b
.
interface_type_value
;
tlv
.
set_length
(
1
);
}
//--------
pfcp_3gpp_interface_type_ie
()
:
pfcp_ie
(
PFCP_IE_3GPP_INTERFACE_TYPE
){
}
//--------
pfcp_3gpp_interface_type_ie
(
const
pfcp_tlv
&
t
)
:
pfcp_ie
(
t
)
{
};
//--------
void
to_core_type
(
pfcp
::
_3gpp_interface_type_t
&
b
)
{
b
.
interface_type_value
=
u1
.
bf
.
_3gpp_interface_type
;
}
//--------
void
dump_to
(
std
::
ostream
&
os
)
{
tlv
.
dump_to
(
os
);
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
u1
.
b
),
sizeof
(
u1
.
b
));
}
//--------
void
load_from
(
std
::
istream
&
is
)
{
if
(
tlv
.
get_length
()
!=
sizeof
(
interface_type
))
{
throw
pfcp_tlv_bad_length_exception
(
tlv
.
type
,
tlv
.
get_length
(),
__FILE__
,
__LINE__
);
}
is
.
read
(
reinterpret_cast
<
char
*>
(
&
u1
.
b
),
sizeof
(
u1
.
b
));
}
//--------
void
to_core_type
(
pfcp_ies_container
&
s
)
{
pfcp
::
_3gpp_interface_type_t
v
=
{};
to_core_type
(
v
);
s
.
set
(
v
);
}
}
;
//-------------------------------------
// IE PDI
class
pfcp_pdi_ie
:
public
pfcp_grouped_ie
{
...
...
src/pfcp/msg_pfcp.hpp
View file @
b81d4895
...
...
@@ -558,6 +558,10 @@ namespace pfcp {
// PFCP_IE_FRAMED_IPV6_ROUTE
virtual
bool
get
(
pfcp
::
framed_ipv6_route_t
&
v
)
const
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_FRAMED_IPV6_ROUTE
,
__FILE__
,
__LINE__
);}
virtual
void
set
(
const
pfcp
::
framed_ipv6_route_t
&
v
)
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_FRAMED_IPV6_ROUTE
,
__FILE__
,
__LINE__
);}
// PFCP_IE_3GPP_INTERFACE_TYPE
virtual
bool
get
(
pfcp
::
_3gpp_interface_type_t
&
v
)
const
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_3GPP_INTERFACE_TYPE
,
__FILE__
,
__LINE__
);}
virtual
void
set
(
const
pfcp
::
_3gpp_interface_type_t
&
v
)
{
throw
pfcp_msg_illegal_ie_exception
(
0
,
PFCP_IE_3GPP_INTERFACE_TYPE
,
__FILE__
,
__LINE__
);}
virtual
~
pfcp_ies_container
()
{};
};
...
...
@@ -692,6 +696,8 @@ namespace pfcp {
std
::
pair
<
bool
,
pfcp
::
framed_route_t
>
framed_route
;
std
::
pair
<
bool
,
pfcp
::
framed_routing_t
>
framed_routing
;
std
::
pair
<
bool
,
pfcp
::
framed_ipv6_route_t
>
framed_ipv6_route
;
std
::
pair
<
bool
,
pfcp
::
_3gpp_interface_type_t
>
_3gpp_interface_type
;
pdi
()
:
...
...
@@ -737,6 +743,7 @@ namespace pfcp {
void
set
(
const
pfcp
::
framed_route_t
&
v
)
{
framed_route
.
first
=
true
;
framed_route
.
second
=
v
;}
void
set
(
const
pfcp
::
framed_routing_t
&
v
)
{
framed_routing
.
first
=
true
;
framed_routing
.
second
=
v
;}
void
set
(
const
pfcp
::
framed_ipv6_route_t
&
v
)
{
framed_ipv6_route
.
first
=
true
;
framed_ipv6_route
.
second
=
v
;}
void
set
(
const
pfcp
::
_3gpp_interface_type_t
&
v
)
{
_3gpp_interface_type
.
first
=
true
;
_3gpp_interface_type
.
second
=
v
;}
bool
get
(
pfcp
::
source_interface_t
&
v
)
const
{
if
(
source_interface
.
first
)
{
v
=
source_interface
.
second
;
return
true
;}
return
false
;}
bool
get
(
pfcp
::
fteid_t
&
v
)
const
{
if
(
local_fteid
.
first
)
{
v
=
local_fteid
.
second
;
return
true
;}
return
false
;}
...
...
@@ -750,6 +757,7 @@ namespace pfcp {
bool
get
(
pfcp
::
framed_route_t
&
v
)
const
{
if
(
framed_route
.
first
)
{
v
=
framed_route
.
second
;
return
true
;}
return
false
;}
bool
get
(
pfcp
::
framed_routing_t
&
v
)
const
{
if
(
framed_routing
.
first
)
{
v
=
framed_routing
.
second
;
return
true
;}
return
false
;}
bool
get
(
pfcp
::
framed_ipv6_route_t
&
v
)
const
{
if
(
framed_ipv6_route
.
first
)
{
v
=
framed_ipv6_route
.
second
;
return
true
;}
return
false
;}
bool
get
(
pfcp
::
_3gpp_interface_type_t
&
v
)
const
{
if
(
_3gpp_interface_type
.
first
)
{
v
=
_3gpp_interface_type
.
second
;
return
true
;}
return
false
;}
};
//------------------------------------------------------------------------------
...
...
src/smf_app/smf_procedure.cpp
View file @
b81d4895
...
...
@@ -179,9 +179,11 @@ int session_create_sm_context_procedure::run(
pfcp
::
sdf_filter_t
sdf_filter
=
{
};
pfcp
::
application_id_t
application_id
=
{
};
pfcp
::
qfi_t
qfi
=
{
};
pfcp
::
_3gpp_interface_type_t
source_interface_type
=
{
};
source_interface_type
.
interface_type_value
=
pfcp
::
_3GPP_INTERFACE_TYPE_N3
;
source_interface
.
interface_value
=
pfcp
::
INTERFACE_VALUE_ACCESS
;
local_fteid
.
ch
=
1
;
local_fteid
.
ch
=
1
;
// SMF requests the UPF to assign a local F-TEID to the PDR
//TODO required?: local_fteid.v4 = 1;
//local_fteid.chid = 1;
...
...
@@ -201,16 +203,22 @@ int session_create_sm_context_procedure::run(
qfi
.
qfi
=
default_qos
.
_5qi
;
Logger
::
smf_app
().
info
(
"Default qfi %d"
,
qfi
.
qfi
);
//Packet detection information
//Packet detection information
(see Table 7.5.2.2-2: PDI IE within PFCP Session Establishment Request, 3GPP TS 29.244 V16.0.0)
pdi
.
set
(
source_interface
);
//source interface
pdi
.
set
(
ue_ip_address
);
//UE IP address
//TODO: Network Instance (no need in this version)
pdi
.
set
(
local_fteid
);
// CN tunnel info
//TODO: Packet Filter Set
//TODO: Network Instance
pdi
.
set
(
ue_ip_address
);
//UE IP address
//TODO: Traffic Endpoint ID
//TODO: SDF Filter
//TODO: Application ID
pdi
.
set
(
qfi
);
//QoS Flow ID
//TODO: Ethernet PDU Session Information
//TODO: Ethernet Packet Filter
pdi
.
set
(
qfi
);
//QFI - QoS Flow ID
//TODO: Framed Route Information
//TODO: Framed-Routing
//TODO: Framed-IPv6-Route
//Source Interface Type - N3
pdi
.
set
(
source_interface_type
);
outer_header_removal
.
outer_header_removal_description
=
OUTER_HEADER_REMOVAL_GTPU_UDP_IPV4
;
...
...
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