[PATCH] osmo-ttcn3-hacks[master]: L3_Templates: More GMM related templates

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Feb 16 17:21:19 UTC 2018


Review at  https://gerrit.osmocom.org/6534

L3_Templates: More GMM related templates

Change-Id: Idf305731afb9a4c316e7320553705946c3edb633
---
M library/L3_Templates.ttcn
1 file changed, 158 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/34/6534/1

diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn
index 76725fc..db0ea6e 100644
--- a/library/L3_Templates.ttcn
+++ b/library/L3_Templates.ttcn
@@ -71,6 +71,12 @@
 	mobileIdentityLV := ts_MI_TMSI_LV(tmsi)
 }
 
+template MobileIdentityTLV ts_MI_IMEISV_TLV(hexstring imeisv) := {
+	elementIdentifier := '0100011'B,
+	spare1 := '0'B,
+	mobileIdentityLV := ts_MI_IMEISV_LV(imeisv)
+}
+
 private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 {
 	var IMSI_L3 l3;
 	var integer len := lengthof(digits);
@@ -97,6 +103,19 @@
 	return l3;
 }
 
+private function f_enc_IMEI_SV(hexstring digits) return IMEI_SV {
+	var IMEI_SV l3;
+	var integer len := lengthof(digits);
+	if (len rem 2 == 1) {	/* modulo remainder */
+		l3.oddevenIndicator := '1'B;
+	} else {
+		l3.oddevenIndicator := '0'B;
+	}
+	l3.digits := digits;
+	l3.fillerDigit := '1111'B;
+	return l3;
+}
+
 /* send template fro Mobile Identity (IMSI) */
 template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := {
 	lengthIndicator := 0, /* overwritten */
@@ -115,6 +134,17 @@
 		typeOfIdentity := '000'B, /* overwritten */
 		oddEvenInd_identity := {
 			imei := f_enc_IMEI_L3(imei_digits)
+		}
+	}
+}
+
+/* send template fro Mobile Identity (IMEISV) */
+template (value) MobileIdentityLV ts_MI_IMEISV_LV(hexstring imei_digits) := {
+	lengthIndicator := 0, /* overwritten */
+	mobileIdentityV := {
+		typeOfIdentity := '011'B,
+		oddEvenInd_identity := {
+			imei_sv := f_enc_IMEI_SV(imei_digits)
 		}
 	}
 }
@@ -1312,6 +1342,71 @@
 	}
 }
 
+private function tr_MI_TMSI_TLV(template OCT4 tmsi) return template MobileIdentityTLV {
+	if (istemplatekind(tmsi, "*")) {
+		return *;
+	} else if (istemplatekind(tmsi, "?")) {
+		return ?;
+	} else {
+		var template MobileIdentityTLV mi := {
+			elementIdentifier := '0011000'B,
+			spare1 := '0'B,
+			mobileIdentityLV := {
+				lengthIndicator := 4,
+				mobileIdentityV := {
+					typeOfIdentity := '100'B,
+					oddEvenInd_identity := {
+						tmsi_ptmsi := {
+							oddevenIndicator := '1'B,
+							fillerDigit := '1111'B,
+							octets := tmsi
+						}
+					}
+				}
+			}
+		};
+		return mi;
+	}
+}
+
+template PDU_L3_SGSN_MS tr_GMM_ATTACH_ACCEPT(template BIT3 res := ?,
+					     template RoutingAreaIdentificationV ra := ?,
+					     template OCT4 ptmsi := *) := {
+	discriminator := '1000'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		gprs_mm := {
+			attachAccept := {
+				messageType := '00000010'B,
+				attachResult := { res, ? },
+				forceToStandby := ?,
+				updateTimer := ?,
+				radioPriority := ?,
+				radioPriorityTOM8 := ?,
+				routingAreaIdentification := ra,
+				ptmsiSignature := *,
+				readyTimer := *,
+				allocatedPTMSI := tr_MI_TMSI_TLV(ptmsi),
+				msIdentity := *,
+				gmmCause := *,
+				t3302 := *,
+				cellNotification := *,
+				equivalentPLMNs := *,
+				networkFeatureSupport := *,
+				emergencyNumberList := *,
+				requestedMSInformation := *,
+				t3319 := *,
+				t3323 := *,
+				t3312_ExtendedValue := *,
+				additionalNetworkFeatureSupport := *,
+				t3324 := *,
+				extendedDRXParameters := *
+			}
+		}
+	}
+}
 
 template (value) PDU_L3_MS_SGSN ts_GMM_ATTACH_COMPL := {
 	discriminator := '0000'B, /* overwritten */
@@ -1430,6 +1525,22 @@
 	}
 }
 
+template PDU_L3_SGSN_MS tr_GMM_ID_REQ(template BIT3 id_type := ?) := {
+	discriminator := '1000'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		gprs_mm := {
+			identityRequest := {
+				messageType := '00010101'B,
+				identityType := { id_type, '0'B },
+				forceToStandby := ?
+			}
+		}
+	}
+}
+
 template (value) PDU_L3_MS_SGSN ts_GMM_ID_RESP(MobileIdentityLV mi_lv) := {
 	discriminator := '0000'B, /* overwritten */
 	tiOrSkip := {
@@ -1445,6 +1556,53 @@
 	}
 }
 
+template PDU_L3_SGSN_MS tr_GMM_AUTH_REQ(template OCT16 rand := ?, template BIT3 ciph_alg := ?) := {
+	discriminator := '1000'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		gprs_mm := {
+			authenticationAndCipheringRequest := {
+				messageType := '00010010'B,
+				cipheringAlgorithm := { ciph_alg, '0'B },
+				imeisvRequest := ?,
+				forceToStandby := ?,
+				acReferenceNumber := ?,
+				authenticationParameterRAND := {
+					elementIdentifier := '21'O,
+					randValue := rand
+				},
+				cipheringKeySequenceNumber := *,
+				authenticationParameterAUTN := *
+			}
+		}
+	}
+}
+
+template (value) PDU_L3_MS_SGSN ts_GMM_AUTH_RESP_2G(BIT4 ac_ref, OCT4 sres) := {
+	discriminator := '1000'B,
+	tiOrSkip := {
+		skipIndicator := '0000'B
+	},
+	msgs := {
+		gprs_mm := {
+			authenticationAndCipheringResponse := {
+				messageType := '00010011'B,
+				acReferenceNumber := { valueField := ac_ref },
+				spare := '0000'B,
+				authenticationParResp := {
+					elementIdentifier := '22'O,
+					valueField := sres
+				},
+				imeisv := omit,
+				authenticationRespParExt := omit
+			}
+		}
+	}
+}
+
+
 const BIT3 c_GMM_DTT_MO_GPRS := '001'B;
 const BIT3 c_GMM_DTT_MO_IMSI := '010'B;
 const BIT3 c_GMM_DTT_MO_GPRS_IMSI_COMBINED := '011'B;

-- 
To view, visit https://gerrit.osmocom.org/6534
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf305731afb9a4c316e7320553705946c3edb633
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list