gbproxy: Rename PCU port to PCU_PTP; SGSN port to SGSN_PTP

This way it's more obvious that it refers to the PTP BVC, like we
already use PCU_SIG and SGSN_SIG for the signaling BVCs.

Change-Id: Ie8d327b0c6fae0e7963cc5907ab0bc94e97c67f3
This commit is contained in:
Harald Welte 2020-12-09 12:32:32 +01:00
parent 4f91c3b65a
commit 158becf9cb
1 changed files with 31 additions and 31 deletions

View File

@ -283,7 +283,7 @@ type component test_CT {
type component BSSGP_ConnHdlr {
/* array of per-BVC ports on the PCU side */
port BSSGP_PT PCU[NUM_PCU];
port BSSGP_PT PCU_PTP[NUM_PCU];
port BSSGP_PT PCU_SIG[NUM_PCU];
port BSSGP_PROC_PT PCU_PROC[NUM_PCU];
/* component reference to the component to which we're currently connected */
@ -292,7 +292,7 @@ type component BSSGP_ConnHdlr {
var BssgpBvcConfig pcu_bvc_cfg[NUM_PCU];
/* array of per-BVC ports on the SGSN side */
port BSSGP_PT SGSN[NUM_SGSN];
port BSSGP_PT SGSN_PTP[NUM_SGSN];
port BSSGP_PT SGSN_SIG[NUM_SGSN];
port BSSGP_PROC_PT SGSN_PROC[NUM_SGSN];
/* component reference to the component to which we're currently connected */
@ -541,15 +541,15 @@ runs on test_CT return BSSGP_ConnHdlr {
private function f_connect_to_pcu_bvc(integer port_idx, integer nse_idx, integer bvc_idx)
runs on BSSGP_ConnHdlr {
var BSSGP_BVC_CT bvc_ct := g_pars.pcu[nse_idx].vc_BSSGP_BVC[bvc_idx]
if (PCU[port_idx].checkstate("Connected")) {
if (PCU_PTP[port_idx].checkstate("Connected")) {
/* unregister + disconnect from old BVC */
f_client_unregister(g_pars.imsi, PCU_PROC[port_idx]);
disconnect(self:PCU[port_idx], pcu_ct[port_idx]:BSSGP_SP);
disconnect(self:PCU_PTP[port_idx], pcu_ct[port_idx]:BSSGP_SP);
disconnect(self:PCU_SIG[port_idx], pcu_ct[port_idx]:BSSGP_SP_SIG);
disconnect(self:PCU_PROC[port_idx], pcu_ct[port_idx]:BSSGP_PROC);
}
/* connect to new BVC and register us */
connect(self:PCU[port_idx], bvc_ct:BSSGP_SP);
connect(self:PCU_PTP[port_idx], bvc_ct:BSSGP_SP);
connect(self:PCU_SIG[port_idx], bvc_ct:BSSGP_SP_SIG);
connect(self:PCU_PROC[port_idx], bvc_ct:BSSGP_PROC);
f_client_register(g_pars.imsi, g_pars.tlli, PCU_PROC[port_idx]);
@ -559,15 +559,15 @@ runs on BSSGP_ConnHdlr {
/* Connect the SGSN-side per-BVC ports (SGSN/SGSN_SIG/SGSN_PROC) array slot 'port_idx' to specified per-BVC component */
private function f_connect_to_sgsn_bvc(integer port_idx, BSSGP_BVC_CT bvc_ct) runs on BSSGP_ConnHdlr {
if (SGSN[port_idx].checkstate("Connected")) {
if (SGSN_PTP[port_idx].checkstate("Connected")) {
/* unregister + disconnect from old BVC */
f_client_unregister(g_pars.imsi, SGSN_PROC[port_idx]);
disconnect(self:SGSN[port_idx], sgsn_ct[port_idx]:BSSGP_SP);
disconnect(self:SGSN_PTP[port_idx], sgsn_ct[port_idx]:BSSGP_SP);
disconnect(self:SGSN_SIG[port_idx], sgsn_ct[port_idx]:BSSGP_SP_SIG);
disconnect(self:SGSN_PROC[port_idx], sgsn_ct[port_idx]:BSSGP_PROC);
}
/* connect to new BVC and register us */
connect(self:SGSN[port_idx], bvc_ct:BSSGP_SP);
connect(self:SGSN_PTP[port_idx], bvc_ct:BSSGP_SP);
connect(self:SGSN_SIG[port_idx], bvc_ct:BSSGP_SP_SIG);
connect(self:SGSN_PROC[port_idx], bvc_ct:BSSGP_PROC);
f_client_register(g_pars.imsi, g_pars.tlli, SGSN_PROC[port_idx]);
@ -630,7 +630,7 @@ friend function f_pcu2sgsn(template (value) PDU_BSSGP tx, template (present) PDU
if (use_sig) {
PCU_SIG[pcu_idx].send(tx);
} else {
PCU[pcu_idx].send(tx);
PCU_PTP[pcu_idx].send(tx);
}
T.start;
@ -638,10 +638,10 @@ friend function f_pcu2sgsn(template (value) PDU_BSSGP tx, template (present) PDU
[use_sig] SGSN_SIG[sgsn_idx].receive(exp_rx) {
setverdict(pass);
}
[not use_sig] SGSN[sgsn_idx].receive(exp_rx) {
[not use_sig] SGSN_PTP[sgsn_idx].receive(exp_rx) {
setverdict(pass);
}
[] SGSN[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
[] SGSN_PTP[sgsn_idx].receive(PDU_BSSGP:?) -> value rx {
setverdict(fail, "Unexpected BSSGP on SGSN side: ", rx);
mtc.stop;
}
@ -665,7 +665,7 @@ friend function f_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU
if (use_sig) {
SGSN_SIG[sgsn_idx].send(tx);
} else {
SGSN[sgsn_idx].send(tx);
SGSN_PTP[sgsn_idx].send(tx);
}
T.start;
@ -673,10 +673,10 @@ friend function f_sgsn2pcu(template (value) PDU_BSSGP tx, template (present) PDU
[use_sig] PCU_SIG[pcu_idx].receive(exp_rx) {
setverdict(pass);
}
[not use_sig] PCU[pcu_idx].receive(exp_rx) {
[not use_sig] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(pass);
}
[] PCU[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
[] PCU_PTP[pcu_idx].receive(PDU_BSSGP:?) -> value rx {
setverdict(fail, "Unexpected BSSGP on PCU side: ", rx);
mtc.stop;
}
@ -1046,7 +1046,7 @@ private function f_TC_dl_ud_unidir(charstring id) runs on BSSGP_ConnHdlr {
var octetstring payload := f_rnd_octstring(i);
var template (value) PDU_BSSGP pdu_tx :=
ts_BSSGP_DL_UD(g_pars.tlli, payload, omit, ts_BSSGP_IMSI(g_pars.imsi));
SGSN[0].send(pdu_tx);
SGSN_PTP[0].send(pdu_tx);
}
setverdict(pass);
}
@ -1134,7 +1134,7 @@ runs on BSSGP_ConnHdlr return template (present) PDU_BSSGP {
pdu_tx.pDU_BSSGP_PAGING_PS.paging_Field4 := p4;
pdu_rx.pDU_BSSGP_PAGING_PS.paging_Field4 := p4;
if (use_sig == false) {
SGSN[sgsn_idx].send(pdu_tx);
SGSN_PTP[sgsn_idx].send(pdu_tx);
} else {
SGSN_SIG[sgsn_idx].send(pdu_tx);
}
@ -1155,7 +1155,7 @@ runs on BSSGP_ConnHdlr {
timer T := 2.0;
T.start;
alt {
[not use_sig and not test_done] PCU[pcu_idx].receive(exp_rx) {
[not use_sig and not test_done] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(pass);
test_done := true;
repeat;
@ -1168,16 +1168,16 @@ runs on BSSGP_ConnHdlr {
test_done := true;
repeat;
}
[use_sig] PCU[pcu_idx].receive(exp_rx) {
[use_sig] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC");
}
[] any from PCU.receive(exp_rx) {
[] any from PCU_PTP.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU_SIG.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
[] any from PCU_PTP.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
setverdict(fail, "Different Paging than expected received PTP BVC");
}
[] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
@ -1200,13 +1200,13 @@ runs on BSSGP_ConnHdlr {
timer T := 2.0;
T.start;
alt {
[] any from PCU.receive(exp_rx) {
[] any from PCU_PTP.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU_SIG.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
[] any from PCU_PTP.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
setverdict(fail, "Different Paging received on PTP BVC");
}
[] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
@ -1354,13 +1354,13 @@ runs on BSSGP_ConnHdlr {
roi := roi & { pcu_idx };
repeat;
}
[] PCU[pcu_idx].receive(exp_rx) {
[] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC");
}
[] PCU_SIG[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
setverdict(fail, "Different Paging than expected received SIGNALING BVC");
}
[] PCU[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
[] PCU_PTP[pcu_idx].receive(PDU_BSSGP:{pDU_BSSGP_PAGING_PS:=?}) {
setverdict(fail, "Different Paging than expected received PTP BVC");
}
}
@ -1555,7 +1555,7 @@ runs on BSSGP_ConnHdlr return template (present) PDU_BSSGP {
pdu_tx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4;
pdu_rx.pDU_BSSGP_PAGING_CS.paging_Field4 := p4;
if (use_sig == false) {
SGSN[sgsn_idx].send(pdu_tx);
SGSN_PTP[sgsn_idx].send(pdu_tx);
} else {
SGSN_SIG[sgsn_idx].send(pdu_tx);
}
@ -1576,7 +1576,7 @@ runs on BSSGP_ConnHdlr {
timer T := 2.0;
T.start;
alt {
[not use_sig and not test_done] PCU[pcu_idx].receive(exp_rx) {
[not use_sig and not test_done] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(pass);
test_done := true;
repeat;
@ -1589,16 +1589,16 @@ runs on BSSGP_ConnHdlr {
test_done := true;
repeat;
}
[use_sig] PCU[pcu_idx].receive(exp_rx) {
[use_sig] PCU_PTP[pcu_idx].receive(exp_rx) {
setverdict(fail, "Received paging on PTP BVC, expected SIGNALING BVC");
}
[] any from PCU.receive(exp_rx) {
[] any from PCU_PTP.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU_SIG.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {
[] any from PCU_PTP.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {
setverdict(fail, "Different Paging than expected received PTP BVC");
}
[] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {
@ -1621,13 +1621,13 @@ runs on BSSGP_ConnHdlr {
timer T := 2.0;
T.start;
alt {
[] any from PCU.receive(exp_rx) {
[] any from PCU_PTP.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU_SIG.receive(exp_rx) {
setverdict(fail, "Paging received on unexpected BVC");
}
[] any from PCU.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {
[] any from PCU_PTP.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {
setverdict(fail, "Different Paging received on PTP BVC");
}
[] any from PCU_SIG.receive(PDU_BSSGP:{pDU_BSSGP_PAGING_CS:=?}) {