aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gb_proxy.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2014-08-12 16:30:30 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-08-24 16:16:39 +0200
commit9057bc3c727e97cd7ff2534bffbd9ba4dcd8d4ea (patch)
treed63a0a24749b5961285515b44c4641b8a13f10ba /openbsc/include/openbsc/gb_proxy.h
parentc53f2a6961780153fbf97910609c827a0e9300c3 (diff)
gbproxy: Track SGSN and BSS TLLI/PTMSI separately
This patch separates BSS side from SGSN side TLLI/PTMSI tracking. When TLLI/PTMSI patching is not enabled, the corresponding states shall be identical. The TLLI/PTMSI state has been moved into the struct gbproxy_tlli_state and is used twice in gbproxy_tlli_info. Since the state handling for uplink and downlink messages is diverging, gbprox_update_state() is replaced by two functions gbprox_update_state_dl/gbprox_update_state_ul and gbprox_process_bssgp_message() is replaced by gbprox_process_bssgp_dl/gbprox_process_bssgp_ul. Sponsored-by: On-Waves ehf
Diffstat (limited to 'openbsc/include/openbsc/gb_proxy.h')
-rw-r--r--openbsc/include/openbsc/gb_proxy.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h
index adc955c8a..468228043 100644
--- a/openbsc/include/openbsc/gb_proxy.h
+++ b/openbsc/include/openbsc/gb_proxy.h
@@ -44,6 +44,7 @@ struct gbproxy_config {
enum gbproxy_patch_mode patch_mode;
int tlli_max_age;
int tlli_max_len;
+ int patch_ptmsi;
/* IMSI checking/matching */
int check_imsi;
@@ -81,17 +82,26 @@ struct gbproxy_peer {
struct gbproxy_patch_state patch_state;
};
+struct gbproxy_tlli_state {
+ uint32_t current;
+ uint32_t assigned;
+ int bss_validated;
+ int net_validated;
+
+ uint32_t ptmsi;
+};
+
struct gbproxy_tlli_info {
struct llist_head list;
- uint32_t tlli;
- uint32_t assigned_tlli;
- int bss_validated;
- int net_validated;
+ struct gbproxy_tlli_state tlli;
+ struct gbproxy_tlli_state sgsn_tlli;
+
time_t timestamp;
uint8_t *mi_data;
size_t mi_data_len;
+
int enable_patching;
};
@@ -132,6 +142,9 @@ struct gbproxy_tlli_info *gbprox_find_tlli(struct gbproxy_peer *peer,
struct gbproxy_tlli_info *gbprox_find_tlli_by_mi(struct gbproxy_peer *peer,
const uint8_t *mi_data,
size_t mi_data_len);
+struct gbproxy_tlli_info *gbprox_find_tlli_by_sgsn_tlli(
+ struct gbproxy_peer *peer,
+ uint32_t tlli);
struct gbproxy_tlli_info *gbprox_register_tlli(
struct gbproxy_peer *peer, uint32_t tlli,
const uint8_t *imsi, size_t imsi_len, time_t now);