Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 1 | module L3_Templates { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from MobileL3_Types all; |
| 5 | import from MobileL3_CommonIE_Types all; |
| 6 | import from MobileL3_MM_Types all; |
| 7 | import from MobileL3_RRM_Types all; |
| 8 | |
| 9 | type enumerated CmServiceType { |
| 10 | CM_TYPE_MO_CALL ('0001'B), |
| 11 | CM_TYPE_EMERG_CALL ('0010'B), |
| 12 | CM_TYPE_MO_SMS ('0100'B), |
| 13 | CM_TYPE_SS_ACT ('1000'B) |
| 14 | } |
| 15 | |
| 16 | |
| 17 | /* send template fro Mobile Identity (TMSI) */ |
| 18 | template MobileIdentityLV ts_MI_TMSI_LV(OCT4 tmsi) := { |
| 19 | lengthIndicator := 0, /* overwritten */ |
| 20 | mobileIdentityV := { |
| 21 | typeOfIdentity := '000'B, /* overwritten */ |
| 22 | oddEvenInd_identity := { |
| 23 | tmsi_ptmsi := { |
| 24 | oddevenIndicator := '0'B, |
| 25 | fillerDigit := '1111'B, |
| 26 | octets := tmsi |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | private function f_enc_IMSI_L3(hexstring digits) return IMSI_L3 { |
| 33 | var IMSI_L3 l3; |
| 34 | var integer len := lengthof(digits); |
| 35 | if (len rem 2 == 1) { /* modulo remainder */ |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 36 | l3.oddevenIndicator := '1'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 37 | l3.fillerDigit := '1111'B; |
| 38 | } else { |
Harald Welte | 365f4ed | 2017-11-23 00:00:43 +0100 | [diff] [blame] | 39 | l3.oddevenIndicator := '0'B; |
Harald Welte | c76f29f | 2017-11-22 12:46:46 +0100 | [diff] [blame] | 40 | l3.fillerDigit := omit; |
| 41 | } |
| 42 | l3.digits := digits; |
| 43 | return l3; |
| 44 | } |
| 45 | |
| 46 | /* send template fro Mobile Identity (IMSI) */ |
| 47 | template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { |
| 48 | lengthIndicator := 0, /* overwritten */ |
| 49 | mobileIdentityV := { |
| 50 | typeOfIdentity := '000'B, /* overwritten */ |
| 51 | oddEvenInd_identity := { |
| 52 | imsi := f_enc_IMSI_L3(imsi_digits) |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | /* Send template for Classmark 2 */ |
| 58 | template (value) MobileStationClassmark2_LV ts_CM2 := { |
| 59 | lengthIndicator := 0, |
| 60 | rf_PowerCapability := '000'B, |
| 61 | a5_1 := '0'B, |
| 62 | esind := '1'B, |
| 63 | revisionLevel := '10'B, |
| 64 | spare1_1 := '0'B, |
| 65 | mobileStationClassmark2_oct4 := omit, |
| 66 | mobileStationClassmark2_oct5 := omit |
| 67 | }; |
| 68 | |
| 69 | /* Send template for CM SERVICE REQUEST */ |
| 70 | template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := { |
| 71 | discriminator := '0000'B, /* overwritten */ |
| 72 | tiOrSkip := { |
| 73 | skipIndicator := '0000'B |
| 74 | }, |
| 75 | msgs := { |
| 76 | mm := { |
| 77 | cMServiceRequest := { |
| 78 | messageType := '000000'B, /* overwritten */ |
| 79 | nsd := '00'B, |
| 80 | cm_ServiceType := serv_type, |
| 81 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 82 | mobileStationClassmark2 := ts_CM2, |
| 83 | mobileIdentity := mi_lv, |
| 84 | priorityLevel := omit, |
| 85 | additionalUpdateParameterTV := omit, |
| 86 | deviceProperties := omit |
| 87 | } |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /* Send template for PAGING RESPONSE */ |
| 93 | template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { |
| 94 | discriminator := '0000'B, /* overwritten */ |
| 95 | tiOrSkip := { |
| 96 | skipIndicator := '0000'B |
| 97 | }, |
| 98 | msgs := { |
| 99 | rrm := { |
| 100 | pagingResponse := { |
| 101 | messageType := '00000000'B, /* overwritten */ |
| 102 | cipheringKeySequenceNumber := { '000'B, '0'B }, |
| 103 | spare1_4 := '0000'B, |
| 104 | mobileStationClassmark := ts_CM2, |
| 105 | mobileIdentity := mi_lv, |
| 106 | additionalUpdateParameters := omit |
| 107 | } |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | } |