gbproxy: Register IMSI + TLLI with BSSGP_Emulation

If we don't do that, the BSSGP code will not know what to route to us
and what not.

Change-Id: Ife8b8918f0eb69c6dc502d67d2566e78975c9f91
This commit is contained in:
Harald Welte 2020-11-15 20:02:59 +01:00 committed by daniel
parent b419d0e614
commit 1e834f3230
1 changed files with 23 additions and 0 deletions

View File

@ -396,11 +396,19 @@ private altstep as_Tguard() runs on BSSGP_ConnHdlr {
/* first function called in every ConnHdlr */
private function f_handler_init(void_fn fn, charstring id, BSSGP_ConnHdlrPars pars)
runs on BSSGP_ConnHdlr {
var integer i;
/* do some common stuff like setting up g_pars */
g_pars := pars;
llc := f_llc_create(false);
/* register for our IMSI + TLLI */
for (i := 0; i < sizeof(SGSN_PROC); i := i+1) {
f_client_register(g_pars.imsi, g_pars.tlli, SGSN_PROC[i]);
}
for (i := 0; i < sizeof(PCU_PROC); i := i+1) {
f_client_register(g_pars.imsi, g_pars.tlli, PCU_PROC[i]);
}
g_Tguard.start(pars.t_guard);
activate(as_Tguard());
@ -409,6 +417,21 @@ runs on BSSGP_ConnHdlr {
fn.apply(id);
}
private function f_client_register(hexstring imsi, OCT4 tlli, BSSGP_PROC_PT PT)
runs on BSSGP_ConnHdlr {
PT.call(BSSGP_register_client:{imsi, tlli}) {
[] PT.getreply(BSSGP_register_client:{imsi, tlli}) {};
}
}
private function f_client_unregister(hexstring imsi, BSSGP_PROC_PT PT)
runs on BSSGP_ConnHdlr {
PT.call(BSSGP_unregister_client:{imsi}) {
[] PT.getreply(BSSGP_unregister_client:{imsi}) {};
}
}
/* TODO:
* Detach without Attach
* SM procedures without attach / RAU