Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-Spgwu-Tiny-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-Spgwu-Tiny-Simple
Commits
7cb55cbd
Commit
7cb55cbd
authored
Aug 12, 2019
by
gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP PGW-C send CSResp MISSING or UNKNOWN APN
parent
61a95d7b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
12 deletions
+40
-12
src/common/3gpp_29.274.h
src/common/3gpp_29.274.h
+14
-0
src/gtpv2c/3gpp_29.274.cpp
src/gtpv2c/3gpp_29.274.cpp
+3
-1
src/pgwc/pgw_app.cpp
src/pgwc/pgw_app.cpp
+2
-2
src/sgwc/sgwc_app.cpp
src/sgwc/sgwc_app.cpp
+16
-9
src/sgwc/sgwc_eps_bearer_context.hpp
src/sgwc/sgwc_eps_bearer_context.hpp
+1
-0
src/sgwc/sgwc_procedure.cpp
src/sgwc/sgwc_procedure.cpp
+4
-0
No files found.
src/common/3gpp_29.274.h
View file @
7cb55cbd
...
...
@@ -104,6 +104,20 @@ public:
virtual
~
gtpc_ie_exception
()
throw
(){}
};
struct
gtpc_missing_ie_exception
:
public
gtpc_exception
{
public:
gtpc_missing_ie_exception
(
uint8_t
gtpc_msg
,
uint8_t
ie_type
)
throw
()
{
phrase
=
fmt
::
format
(
"GTPV2-C msg {} missing IE {} Exception"
,
gtpc_msg
,
ie_type
);
}
gtpc_missing_ie_exception
(
const
char
*
gtpc_msg
,
const
char
*
ie_type
)
throw
()
{
phrase
=
fmt
::
format
(
"GTPV2-C msg {} missing IE {} Exception"
,
gtpc_msg
,
ie_type
);
}
gtpc_missing_ie_exception
(
std
::
string
&
aphrase
)
throw
()
{
phrase
=
aphrase
;
}
virtual
~
gtpc_missing_ie_exception
()
throw
(){}
};
struct
gtpc_ie_unimplemented_exception
:
public
gtpc_ie_exception
{
public:
gtpc_ie_unimplemented_exception
(
uint8_t
ie_type
)
throw
()
:
gtpc_ie_exception
(
ie_type
)
{
...
...
src/gtpv2c/3gpp_29.274.cpp
View file @
7cb55cbd
...
...
@@ -520,7 +520,9 @@ gtpv2c_msg::gtpv2c_msg(const gtpv2c_create_session_response& gtp_ies) : gtpv2c_m
ies
=
{};
set_message_type
(
GTP_CREATE_SESSION_RESPONSE
);
if
(
gtp_ies
.
cause
.
first
)
{
std
::
shared_ptr
<
gtpv2c_cause_ie
>
sie
(
new
gtpv2c_cause_ie
(
gtp_ies
.
cause
.
second
));
add_ie
(
sie
);}
if
(
gtp_ies
.
cause
.
first
)
{
std
::
shared_ptr
<
gtpv2c_cause_ie
>
sie
(
new
gtpv2c_cause_ie
(
gtp_ies
.
cause
.
second
));
add_ie
(
sie
);
}
else
throw
gtpc_missing_ie_exception
(
"GTP_CREATE_SESSION_RESPONSE"
,
"GTP_IE_CAUSE"
);
//if (gtp_ies.ie_presence_mask & GTPV2C_CREATE_SESSION_RESPONSE_PR_IE_CHANGE_REPORTING_ACTION) {std::shared_ptr<xxx> sie(new xxx(gtp_ies.xxx)); add_ie(sie);}
//if (gtp_ies.ie_presence_mask & GTPV2C_CREATE_SESSION_RESPONSE_PR_IE_CSG_INFORMATION_REPORTING_ACTION) {std::shared_ptr<xxx> sie(new xxx(gtp_ies.xxx)); add_ie(sie);}
//if (gtp_ies.ie_presence_mask & GTPV2C_CREATE_SESSION_RESPONSE_PR_IE_HENB_INFORMATION_REPORTING) {std::shared_ptr<xxx> sie(new xxx(gtp_ies.xxx)); add_ie(sie);}
...
...
src/pgwc/pgw_app.cpp
View file @
7cb55cbd
...
...
@@ -429,7 +429,7 @@ void pgw_app::handle_itti_msg (std::shared_ptr<itti_s5s8_create_session_request>
if
((
csreq
->
teid
)
&&
(
not
pgw_app_inst
->
is_s5s8c_teid_exist
(
csreq
->
teid
)))
{
Logger
::
pgwc_app
().
warn
(
"Received S5_S8 CREATE_SESSION_REQUEST with dest teid "
TEID_FMT
" unknown, ignore message"
,
csreq
->
teid
);
cause_t
cause
=
{.
cause_value
=
CONTEXT_NOT_FOUND
,
.
pce
=
0
,
.
bce
=
0
,
.
cs
=
0
};
send_create_session_response_cause
(
csreq
->
gtpc_tx_id
,
csreq
->
teid
,
csreq
->
r_endpoint
,
cause
);
send_create_session_response_cause
(
csreq
->
gtpc_tx_id
,
csreq
->
gtp_ies
.
sender_fteid_for_cp
.
teid_gre_key
,
csreq
->
r_endpoint
,
cause
);
return
;
}
...
...
@@ -438,7 +438,7 @@ void pgw_app::handle_itti_msg (std::shared_ptr<itti_s5s8_create_session_request>
Logger
::
pgwc_app
().
warn
(
"Received CREATE_SESSION_REQUEST unknown requested APN %s, ignore message"
,
csreq
->
gtp_ies
.
apn
.
access_point_name
.
c_str
());
// TODO send reply
cause_t
cause
=
{.
cause_value
=
MISSING_OR_UNKNOWN_APN
,
.
pce
=
0
,
.
bce
=
0
,
.
cs
=
0
};
send_create_session_response_cause
(
csreq
->
gtpc_tx_id
,
csreq
->
teid
,
csreq
->
r_endpoint
,
cause
);
send_create_session_response_cause
(
csreq
->
gtpc_tx_id
,
csreq
->
gtp_ies
.
sender_fteid_for_cp
.
teid_gre_key
,
csreq
->
r_endpoint
,
cause
);
return
;
}
...
...
src/sgwc/sgwc_app.cpp
View file @
7cb55cbd
...
...
@@ -467,20 +467,27 @@ void sgwc_app::handle_itti_msg (itti_s11_downlink_data_notification_acknowledge&
void
sgwc_app
::
handle_itti_msg
(
itti_s5s8_create_session_response
&
m
)
{
Logger
::
sgwc_app
().
debug
(
"Received S5S8 CREATE_SESSION_RESPONSE sender teid "
TEID_FMT
" gtpc_tx_id "
PROC_ID_FMT
" "
,
m
.
teid
,
m
.
gtpc_tx_id
);
if
(
m
.
gtp_ies
.
s5_s8_pgw_fteid
.
second
.
interface_type
!=
S5_S8_PGW_GTP_C
)
{
Logger
::
sgwc_app
().
warn
(
"Received S5S8 CREATE_SESSION_RESPONSE with s5_s8_pgw_fteid.interface_type != S5_S8_PGW_GTP_C %d, ignore CSResp"
,
m
.
gtp_ies
.
sender_fteid_for_cp
.
second
.
interface_type
);
return
;
}
if
(
m
.
gtp_ies
.
s5_s8_pgw_fteid
.
second
.
teid_gre_key
==
0
)
{
// MME sent request with teid = 0. This is not valid...
Logger
::
sgwc_app
().
warn
(
"Received S5S8 CREATE_SESSION_RESPONSE with s5_s8_pgw_fteid.teid = 0, ignore CSResp"
);
return
;
if
(
m
.
gtp_ies
.
cause
.
second
.
cause_value
<
CONTEXT_NOT_FOUND
)
{
if
(
m
.
gtp_ies
.
s5_s8_pgw_fteid
.
second
.
interface_type
!=
S5_S8_PGW_GTP_C
)
{
Logger
::
sgwc_app
().
warn
(
"Received S5S8 CREATE_SESSION_RESPONSE with s5_s8_pgw_fteid.interface_type != S5_S8_PGW_GTP_C %d, ignore CSResp"
,
m
.
gtp_ies
.
sender_fteid_for_cp
.
second
.
interface_type
);
return
;
}
if
(
m
.
gtp_ies
.
s5_s8_pgw_fteid
.
second
.
teid_gre_key
==
0
)
{
// MME sent request with teid = 0. This is not valid...
Logger
::
sgwc_app
().
warn
(
"Received S5S8 CREATE_SESSION_RESPONSE with s5_s8_pgw_fteid.teid = 0, ignore CSResp"
);
return
;
}
}
if
(
is_s5s8sgw_teid_2_sgw_contexts
(
m
.
teid
))
{
std
::
pair
<
std
::
shared_ptr
<
sgw_eps_bearer_context
>
,
std
::
shared_ptr
<
sgw_pdn_connection
>>
p
=
s5s8sgw_teid_2_sgw_contexts
(
m
.
teid
);
if
((
p
.
first
.
get
())
&&
(
p
.
second
.
get
()))
{
p
.
first
->
handle_itti_msg
(
m
,
p
.
second
);
Logger
::
sgwc_app
().
debug
(
"sgw_eps_bearer_context: %s!"
,
p
.
first
->
toString
().
c_str
());
// cleanup
if
(
0
==
p
.
first
->
get_num_pdn_connections
())
{
delete_sgw_eps_bearer_context
(
p
.
first
);
}
else
{
Logger
::
sgwc_app
().
debug
(
"sgw_eps_bearer_context: %s!"
,
p
.
first
->
toString
().
c_str
());
}
}
else
{
Logger
::
sgwc_app
().
debug
(
"Received S5S8 CREATE_SESSION_RESPONSE with dest teid "
TEID_FMT
", SGW contexts not found, ignore CSResp"
,
m
.
teid
);
}
...
...
src/sgwc/sgwc_eps_bearer_context.hpp
View file @
7cb55cbd
...
...
@@ -144,6 +144,7 @@ public:
void
remove_eps_bearer
(
const
ebi_t
&
ebi
);
void
remove_eps_bearer
(
std
::
shared_ptr
<
sgw_eps_bearer
>
bearer
);
void
delete_bearers
();
int
get_num_bearers
()
{
return
sgw_eps_bearers
.
size
();};
bool
is_released
()
const
{
return
is_dl_up_tunnels_released
;}
//fteid_t generate_s5s8_up_fteid(const struct in_addr ipv4_address, const bearer_qos_t& bearer_qos);
...
...
src/sgwc/sgwc_procedure.cpp
View file @
7cb55cbd
...
...
@@ -258,6 +258,10 @@ void create_session_request_procedure::handle_itti_msg (itti_s5s8_create_session
}
}
}
}
else
if
(
csresp
.
gtp_ies
.
cause
.
second
.
cause_value
>=
CONTEXT_NOT_FOUND
)
{
if
(
pdn
->
get_num_bearers
())
{
ebc
->
delete_pdn_connection
(
pdn
);
}
}
...
...
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