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
eef626ec
Commit
eef626ec
authored
Jan 23, 2021
by
Tien-Thinh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support ePCO in PDU Session Establishment Accept
parent
bbac9e52
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
110 additions
and
63 deletions
+110
-63
src/common/utils/3gpp_conversions.cpp
src/common/utils/3gpp_conversions.cpp
+25
-0
src/common/utils/3gpp_conversions.hpp
src/common/utils/3gpp_conversions.hpp
+3
-0
src/nas/ies/ExtendedProtocolConfigurationOptions.c
src/nas/ies/ExtendedProtocolConfigurationOptions.c
+22
-36
src/smf_app/smf_app.cpp
src/smf_app/smf_app.cpp
+21
-17
src/smf_app/smf_context.cpp
src/smf_app/smf_context.cpp
+2
-1
src/smf_app/smf_msg.cpp
src/smf_app/smf_msg.cpp
+16
-4
src/smf_app/smf_msg.hpp
src/smf_app/smf_msg.hpp
+14
-5
src/smf_app/smf_n1.cpp
src/smf_app/smf_n1.cpp
+7
-0
No files found.
src/common/utils/3gpp_conversions.cpp
View file @
eef626ec
...
...
@@ -115,3 +115,28 @@ void xgpp_conv::protocol_configuration_options_nas_to_core(
pco
.
protocol_or_container_ids
.
push_back
(
pco_item
);
}
}
void
xgpp_conv
::
protocol_configuration_options_core_to_nas
(
const
protocol_configuration_options_t
&
pco
,
protocol_configuration_options_nas_t
&
pco_nas
)
{
pco_nas
.
ext
=
pco
.
ext
;
pco_nas
.
spare
=
pco
.
spare
;
pco_nas
.
configuration_protocol
=
pco
.
configuration_protocol
;
pco_nas
.
num_protocol_or_container_id
=
pco
.
num_protocol_or_container_id
;
for
(
int
i
=
0
;
i
<
pco
.
num_protocol_or_container_id
;
i
++
)
{
pco_nas
.
protocol_or_container_ids
[
i
].
length
=
pco
.
protocol_or_container_ids
[
i
].
length_of_protocol_id_contents
;
pco_nas
.
protocol_or_container_ids
[
i
].
id
=
pco
.
protocol_or_container_ids
[
i
].
protocol_id
;
pco_nas
.
protocol_or_container_ids
[
i
].
contents
=
bfromcstralloc
(
pco
.
protocol_or_container_ids
[
i
].
protocol_id_contents
.
length
(),
"
\0
"
);
pco_nas
.
protocol_or_container_ids
[
i
].
contents
->
slen
=
pco
.
protocol_or_container_ids
[
i
].
protocol_id_contents
.
length
();
memcpy
(
(
void
*
)
pco_nas
.
protocol_or_container_ids
[
i
].
contents
->
data
,
(
void
*
)
pco
.
protocol_or_container_ids
[
i
].
protocol_id_contents
.
c_str
(),
pco
.
protocol_or_container_ids
[
i
].
protocol_id_contents
.
length
());
}
}
src/common/utils/3gpp_conversions.hpp
View file @
eef626ec
...
...
@@ -49,6 +49,9 @@ void protocol_configuration_options_nas_to_core(
const
protocol_configuration_options_nas_t
&
pco_nas
,
protocol_configuration_options_t
&
pco
);
void
protocol_configuration_options_core_to_nas
(
const
protocol_configuration_options_t
&
pco
,
protocol_configuration_options_nas_t
&
pco_nas
);
}
// namespace xgpp_conv
#endif
/* FILE_3GPP_CONVERSIONS_HPP_SEEN */
src/nas/ies/ExtendedProtocolConfigurationOptions.c
View file @
eef626ec
...
...
@@ -47,15 +47,14 @@ int encode_extended_protocol_configuration_options(
lenPtr
=
(
buffer
+
encoded
);
uint16_t
temp
=
0
;
encoded
+=
2
;
//
ENCODE_U16
encoded
+=
2
;
//
ENCODE_U16
encoded
+=
encode_protocol_configuration_options
(
extendedprotocolconfigurationoptions
,
buffer
+
encoded
,
len
-
encoded
);
uint32_t
len_ie
=
encoded
-
2
-
((
iei
>
0
)
?
1
:
0
);
ENCODE_U16
(
lenPtr
,
len_ie
,
temp
);
ENCODE_U16
(
lenPtr
,
len_ie
,
temp
);
//*lenPtr = encoded - 2 - ((iei > 0) ? 1 : 0);
return
encoded
;
}
...
...
@@ -85,18 +84,17 @@ int encode_protocol_configuration_options(
.
protocol_or_container_ids
[
num_protocol_or_container_id
]
.
length
;
encoded
++
;
if
(
protocolconfigurationoptions
if
(
protocolconfigurationoptions
.
protocol_or_container_ids
[
num_protocol_or_container_id
]
.
length
>
0
)
{
.
length
>
0
)
{
if
((
encode_result
=
encode_bstring
(
protocolconfigurationoptions
.
protocol_or_container_ids
[
num_protocol_or_container_id
]
.
contents
,
buffer
+
encoded
,
protocolconfigurationoptions
buffer
+
encoded
,
protocolconfigurationoptions
.
protocol_or_container_ids
[
num_protocol_or_container_id
]
.
length
))
<
0
)
.
length
))
<
0
)
return
encode_result
;
else
encoded
+=
encode_result
;
...
...
@@ -122,7 +120,7 @@ int decode_extended_protocol_configuration_options(
decoded
++
;
}
DECODE_U16
(
buffer
+
decoded
,
ielen
,
decoded
);
DECODE_U16
(
buffer
+
decoded
,
ielen
,
decoded
);
if
(((
*
(
buffer
+
decoded
)
>>
7
)
&
0x1
)
!=
1
)
{
return
TLV_VALUE_DOESNT_MATCH
;
...
...
@@ -155,19 +153,7 @@ int decode_protocol_configuration_options(
const
uint8_t
*
const
buffer
,
const
const
uint32_t
len
)
{
int
decoded
=
0
;
int
decode_result
=
0
;
/*
if (((*(buffer + decoded) >> 7) & 0x1) != 1) {
return TLV_VALUE_DOESNT_MATCH;
}
// Bits 7 to 4 of octet 3 are spare, read as 0
if (((*(buffer + decoded) & 0x78) >> 3) != 0) {
return TLV_VALUE_DOESNT_MATCH;
}
*/
// protocolconfigurationoptions->configuration_protocol =
// (*(buffer + decoded) >> 1) & 0x7;
// decoded++;
protocolconfigurationoptions
->
num_protocol_or_container_id
=
0
;
while
(
3
<=
((
int32_t
)
len
-
(
int32_t
)
decoded
))
{
...
...
src/smf_app/smf_app.cpp
View file @
eef626ec
...
...
@@ -714,22 +714,26 @@ void smf_app::handle_pdu_session_create_sm_context_request(
// TODO: SMPDUDNRequestContainer
// TODO: ExtendedProtocolConfigurationOptions
Logger
::
smf_app
().
debug
(
"pco ext %d, spare %d, configuration protocol %d,number_ids %d"
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
"pco ext %d, spare %d, configuration protocol %d,number_ids %d"
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
ext
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
spare
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
configuration_protocol
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
num_protocol_or_container_id
);
.
extendedprotocolconfigurationoptions
.
spare
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
configuration_protocol
,
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
.
num_protocol_or_container_id
);
// if (decoded_nas_msg.plain.sm.pdu_session_establishment_request
// .extendedprotocolconfigurationoptions.num_protocol_or_container_id >
// .extendedprotocolconfigurationoptions.num_protocol_or_container_id
// >
// 0) {
protocol_configuration_options_t
pco
=
{};
xgpp_conv
::
protocol_configuration_options_nas_to_core
(
decoded_nas_msg
.
plain
.
sm
.
pdu_session_establishment_request
.
extendedprotocolconfigurationoptions
,
pco
);
smreq
->
req
.
set_
pco
(
pco
);
smreq
->
req
.
set_e
pco
(
pco
);
// }
// Get necessary information
...
...
src/smf_app/smf_context.cpp
View file @
eef626ec
...
...
@@ -1316,7 +1316,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
// TODO: PCO
protocol_configuration_options_t
pco_req
=
{};
smreq
->
req
.
get_pco
(
pco_req
);
smreq
->
req
.
get_
e
pco
(
pco_req
);
protocol_configuration_options_t
pco_resp
=
{};
protocol_configuration_options_ids_t
pco_ids
=
{
.
pi_ipcp
=
0
,
...
...
@@ -1326,6 +1326,7 @@ void smf_context::handle_pdu_session_create_sm_context_request(
.
ci_ipv4_link_mtu_request
=
0
};
smf_app_inst
->
process_pco_request
(
pco_req
,
pco_resp
,
pco_ids
);
sm_context_resp_pending
->
res
.
set_epco
(
pco_resp
);
// Step 7. Address allocation based on PDN type
Logger
::
smf_app
().
debug
(
"UE Address Allocation"
);
...
...
src/smf_app/smf_msg.cpp
View file @
eef626ec
...
...
@@ -341,15 +341,15 @@ std::string pdu_session_create_sm_context_request::get_sm_context_status_uri()
}
//-----------------------------------------------------------------------------
void
pdu_session_create_sm_context_request
::
set_pco
(
void
pdu_session_create_sm_context_request
::
set_
e
pco
(
const
protocol_configuration_options_t
&
p
)
{
epco
=
p
;
m_
epco
=
p
;
}
//-----------------------------------------------------------------------------
void
pdu_session_create_sm_context_request
::
get_pco
(
void
pdu_session_create_sm_context_request
::
get_
e
pco
(
protocol_configuration_options_t
&
p
)
const
{
p
=
epco
;
p
=
m_
epco
;
}
/*
...
...
@@ -400,6 +400,18 @@ std::string pdu_session_create_sm_context_response::get_smf_context_uri()
return
m_smf_context_uri
;
}
//-----------------------------------------------------------------------------
void
pdu_session_create_sm_context_response
::
set_epco
(
const
protocol_configuration_options_t
&
p
)
{
m_epco
=
p
;
}
//-----------------------------------------------------------------------------
void
pdu_session_create_sm_context_response
::
get_epco
(
protocol_configuration_options_t
&
p
)
const
{
p
=
m_epco
;
}
/*
* class: PDU Session Update SM Context Request
*/
...
...
src/smf_app/smf_msg.hpp
View file @
eef626ec
...
...
@@ -247,12 +247,16 @@ class pdu_session_create_sm_context_request
public:
pdu_session_create_sm_context_request
()
:
pdu_session_sm_context_request
(
PDU_SESSION_CREATE_SM_CONTEXT_REQUEST
),
m_unauthenticated_supi
(
true
)
{}
m_unauthenticated_supi
(
true
)
{
m_epco
=
{};
}
pdu_session_create_sm_context_request
(
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
:
pdu_session_sm_context_request
(
PDU_SESSION_CREATE_SM_CONTEXT_REQUEST
,
supi
,
pdi
,
dnn
,
snssai
),
m_unauthenticated_supi
(
true
)
{}
m_unauthenticated_supi
(
true
)
{
m_epco
=
{};
}
std
::
string
get_serving_nf_id
()
const
;
void
set_serving_nf_id
(
const
std
::
string
&
value
);
...
...
@@ -262,8 +266,8 @@ class pdu_session_create_sm_context_request
std
::
string
get_dnn_selection_mode
()
const
;
void
set_sm_context_status_uri
(
const
std
::
string
&
value
);
std
::
string
get_sm_context_status_uri
()
const
;
void
set_pco
(
const
protocol_configuration_options_t
&
p
);
void
get_pco
(
protocol_configuration_options_t
&
p
)
const
;
void
set_
e
pco
(
const
protocol_configuration_options_t
&
p
);
void
get_
e
pco
(
protocol_configuration_options_t
&
p
)
const
;
private:
bool
m_unauthenticated_supi
;
...
...
@@ -274,7 +278,7 @@ class pdu_session_create_sm_context_request
std
::
string
m_an_type
;
std
::
string
m_dnn_selection_mode
;
// SelMode
std
::
string
m_sm_context_status_uri
;
protocol_configuration_options_t
epco
;
protocol_configuration_options_t
m_
epco
;
};
//---------------------------------------------------------------------------------------
...
...
@@ -286,6 +290,7 @@ class pdu_session_create_sm_context_response
PDU_SESSION_CREATE_SM_CONTEXT_RESPONSE
)
{
m_paa
=
{};
m_qos_flow_context
=
{};
m_epco
=
{};
}
pdu_session_create_sm_context_response
(
supi_t
supi
,
pdu_session_id_t
pdi
,
std
::
string
dnn
,
snssai_t
snssai
)
...
...
@@ -293,6 +298,7 @@ class pdu_session_create_sm_context_response
PDU_SESSION_CREATE_SM_CONTEXT_RESPONSE
,
supi
,
pdi
,
dnn
,
snssai
)
{
m_paa
=
{};
m_qos_flow_context
=
{};
m_epco
=
{};
}
void
set_paa
(
const
paa_t
&
paa
);
...
...
@@ -303,12 +309,15 @@ class pdu_session_create_sm_context_response
std
::
string
get_amf_url
()
const
;
void
set_smf_context_uri
(
const
std
::
string
&
value
);
std
::
string
get_smf_context_uri
()
const
;
void
set_epco
(
const
protocol_configuration_options_t
&
p
);
void
get_epco
(
protocol_configuration_options_t
&
p
)
const
;
private:
paa_t
m_paa
;
qos_flow_context_updated
m_qos_flow_context
;
std
::
string
m_amf_url
;
std
::
string
m_smf_context_uri
;
protocol_configuration_options_t
m_epco
;
};
//---------------------------------------------------------------------------------------
...
...
src/smf_app/smf_n1.cpp
View file @
eef626ec
...
...
@@ -35,6 +35,7 @@
#include "smf.h"
#include "smf_app.hpp"
#include "3gpp_conversions.hpp"
extern
"C"
{
#include "dynamic_memory_check.h"
...
...
@@ -217,6 +218,12 @@ bool smf_n1::create_n1_pdu_session_establishment_accept(
}
// TODO: ExtendedProtocolConfigurationOptions
protocol_configuration_options_t
pco_res
=
{};
sm_context_res
.
get_epco
(
pco_res
);
// sm_msg->pdu_session_establishment_accept.
xgpp_conv
::
protocol_configuration_options_core_to_nas
(
pco_res
,
sm_msg
->
pdu_session_establishment_accept
.
extendedprotocolconfigurationoptions
);
// DNN
util
::
string_to_bstring
(
...
...
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