BSSMAP: Fix L3 sequence number for ComplL3(Paging Response)
The existing code generating L3 sequence numbers in MO direction made the assumption that the L3 message inside ComplL3 would always be MM/CM, and increment the sequence number. However, in case of a paging response, it is actually RR, which does *not* have L3 sequence counters. So we must make the sequence counter increment dependant on the L3 protocol discriminator. Change-Id: I25a5dd0c180c9acfa870984c6b122ac0c46383b3
This commit is contained in:
parent
1823cb18a1
commit
49518bf842
|
@ -446,6 +446,19 @@ function f_ML3_patch_seq(inout ConnectionData cd, in PDU_ML3_MS_NW dtap, inout o
|
|||
log("patched enc_l3: ", enc_l3);
|
||||
}
|
||||
|
||||
private function f_bssap_l3_is_rr(PDU_BSSAP bssap) return boolean {
|
||||
var template octetstring l3 := f_bssap_extract_l3(bssap);
|
||||
if (not isvalue(l3)) {
|
||||
return false;
|
||||
}
|
||||
var octetstring l3v := valueof(l3);
|
||||
/* lower 4 bits of first octet are protocol discriminator */
|
||||
if ((oct2bit(l3v[0]) and4b '00001111'B) == '00000110'B) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT {
|
||||
|
||||
g_bssmap_id := id;
|
||||
|
@ -553,7 +566,9 @@ function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT {
|
|||
BSSAP.send(ts_BSSAP_DATA_req(conn_id, creq.bssap));
|
||||
}
|
||||
|
||||
if (g_bssmap_ops.role_ms) {
|
||||
/* InitialL3 contains RR (PAG RESP) or MM (CM SRV REQ), we must increment
|
||||
* counter only on MM/CC/SS, but not on RR */
|
||||
if (g_bssmap_ops.role_ms and not f_bssap_l3_is_rr(creq.bssap)) {
|
||||
/* we have just sent the first MM message, increment the counter */
|
||||
var integer idx := f_idx_by_comp(vc_conn);
|
||||
ConnectionTable[idx].n_sd[0] := 1;
|
||||
|
|
|
@ -921,6 +921,32 @@ modifies tr_BSSAP_BSSMAP := {
|
|||
}
|
||||
}
|
||||
|
||||
/* return Layer3 octetstring inside BSSAP PDU */
|
||||
function f_bssap_extract_l3(PDU_BSSAP bssap) return template octetstring {
|
||||
if (ischosen(bssap.pdu.bssmap)) {
|
||||
var PDU_BSSMAP bssmap := bssap.pdu.bssmap;
|
||||
if (ischosen(bssmap.completeLayer3Information)) {
|
||||
return bssmap.completeLayer3Information.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.handoverRequestAck)) {
|
||||
return bssmap.handoverRequestAck.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.handoverCommand)) {
|
||||
return bssmap.handoverCommand.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.uplinkRequest)) {
|
||||
return bssmap.uplinkRequest.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.uplinkRequestConfirmation)) {
|
||||
return bssmap.uplinkRequestConfirmation.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.uplinkApplicationData)) {
|
||||
return bssmap.uplinkApplicationData.layer3Information.layer3info;
|
||||
} else if (ischosen(bssmap.rerouteCommand)) {
|
||||
return bssmap.rerouteCommand.initialLayer3Information.layer3info;
|
||||
} else {
|
||||
return omit;
|
||||
}
|
||||
} else {
|
||||
return bssap.pdu.dtap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue