aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_gb_parse.c
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-12 15:09:56 +0200
committerJacob Erlbeck <jerlbeck@sysmocom.de>2014-09-19 10:46:23 +0200
commit7430da621a25337d614cd08acb578905aa52337d (patch)
tree0def31a783b198da3bf6b4c894377191743ce9f6 /openbsc/src/gprs/gprs_gb_parse.c
parentcba4c0cc600da7b9548e9267cb0486806820a9ef (diff)
gbproxy: Keep tlli_info after detach
Currently a tlli_info entry is deleted when the TLLI gets invalidated by a Detach message. This patch introduces the possibility to keep tlli_info entries in the list. Those entries then have cleared TLLI fields, are marked as de-registered, and can only be retrieved by a message containing an IMSI or a P-TMSI. The following VTY configuration commands are added to the gbproxy node: - tlli-list keep-mode never : Don't keep the entries (default) - tlli-list keep-mode re-attach : Only keep them, when a Detach message with re-attach required has been received - tlli-list keep-mode identified : Only keep entries which are associated with an IMSI - tlli-list keep-mode always : Keep all entries Note that at least one of max-length or max-age should be set when this feature is used to limit the number of entries. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/src/gprs/gprs_gb_parse.c')
-rw-r--r--openbsc/src/gprs/gprs_gb_parse.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/openbsc/src/gprs/gprs_gb_parse.c
index f361951a1..7ae792a62 100644
--- a/openbsc/src/gprs/gprs_gb_parse.c
+++ b/openbsc/src/gprs/gprs_gb_parse.c
@@ -224,6 +224,7 @@ static int gprs_gb_parse_gmm_detach_req(uint8_t *data, size_t data_len,
{
uint8_t *value;
size_t value_len;
+ int detach_type;
int power_off;
parse_ctx->llc_msg_name = "DETACH_REQ";
@@ -234,9 +235,14 @@ static int gprs_gb_parse_gmm_detach_req(uint8_t *data, size_t data_len,
/* invalid */
return 0;
+ detach_type = *value & 0x07;
power_off = *value & 0x08 ? 1 : 0;
- if (!parse_ctx->to_bss) {
+ if (parse_ctx->to_bss) {
+ /* Network originated */
+ if (detach_type == GPRS_DET_T_MT_REATT_REQ)
+ parse_ctx->await_reattach = 1;
+ } else {
/* Mobile originated */
if (power_off)
@@ -651,6 +657,10 @@ void gprs_gb_log_parse_context(struct gprs_gb_parse_context *parse_ctx,
LOGP(DGPRS, LOGL_DEBUG, "%s invalidate", sep);
sep = ",";
}
+ if (parse_ctx->await_reattach) {
+ LOGP(DGPRS, LOGL_DEBUG, "%s re-attach", sep);
+ sep = ",";
+ }
LOGP(DGPRS, LOGL_DEBUG, "\n");
}