fr: Implement per-UE guard timeout

Change-Id: Ie52b1923ca81f7717be446891df1bfdb67ed7ed7
This commit is contained in:
Harald Welte 2021-01-28 18:49:42 +01:00
parent 056858ac62
commit 681949b047
1 changed files with 13 additions and 2 deletions

View File

@ -89,15 +89,25 @@ type record of UE_CT ro_ue;
type record UE_Pars {
hexstring imsi,
OCT4 tlli
OCT4 tlli,
float tguard
};
type function void_fn(charstring id) runs on UE_CT;
private altstep as_ue_tguard() runs on UE_CT {
[] g_Tguard.timeout {
setverdict(fail, "Tguard timeout after ", g_pars.tguard);
self.stop;
}
}
function f_handler_init(void_fn fn, charstring id, UE_Pars pars) runs on UE_CT {
g_pars := pars;
llc := f_llc_create(false);
f_bssgp_client_register(g_pars.imsi, g_pars.tlli);
g_Tguard.start(g_pars.tguard);
activate(as_ue_tguard());
fn.apply(id);
f_bssgp_client_unregister(g_pars.imsi);
@ -126,7 +136,8 @@ runs on test_CT return UE_CT
var UE_CT ue_comp;
var UE_Pars ue_pars := {
imsi := f_gen_imsi(imsi_suffix),
tlli := f_gprs_tlli_random()
tlli := f_gprs_tlli_random(),
tguard := t_guard
};
ue_comp := UE_CT.create(id);