diff options
Diffstat (limited to 'library/GSM_RR_Types.ttcn')
-rw-r--r-- | library/GSM_RR_Types.ttcn | 543 |
1 files changed, 165 insertions, 378 deletions
diff --git a/library/GSM_RR_Types.ttcn b/library/GSM_RR_Types.ttcn index b4aff10a..464d060c 100644 --- a/library/GSM_RR_Types.ttcn +++ b/library/GSM_RR_Types.ttcn @@ -15,6 +15,7 @@ module GSM_RR_Types { import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; + import from GSM_RestOctets all; import from RLCMAC_CSN1_Types all; import from MobileL3_CommonIE_Types all; import from MobileL3_RRM_Types all; @@ -82,8 +83,16 @@ module GSM_RR_Types { EXTENDED_MEASUREMENT_REPORT ('00110110'B), EXTENDED_MEASUREMENT_ORDER ('00110111'B), GPRS_SUSPENSION_REQUEST ('00110100'B), - //MBMS_ANNOUNCEMENT ('00010110'B), duplicate? - //SERVICE_INFORMATION ('00110110'B), duplicate? + //MBMS_ANNOUNCEMENT ('00010110'B), duplicate, DL only + //SERVICE_INFORMATION ('00110110'B), duplicate, DL only + + VGCS_UPLINK_GRANT ('00001001'B), + UPLINK_RELEASE ('00001110'B), + UPLINK_BUSY ('00101010'B), + TALKER_INDICATION ('00010001'B), + PRIORITY_UPLINK_REQUEST ('01100110'B), + DATA_INDICATION ('01100111'B), + DATA_INDICATION2 ('01101000'B), APPLICATION_INFORMATION ('00111000'B), @@ -110,10 +119,27 @@ module GSM_RR_Types { CDMA2000_CLASSMARK_CHANGE ('01100010'B), INTERSYS_TO_UTRAN_HO_CMD ('01100011'B), INTERSYS_TO_CDMA2000_HO_CMD ('01100100'B), - GERAN_IU_MODE_CLASSMARK_CHG ('01100101'B), - INTERSYS_TO_EUTRAN_HO_CMD ('01100110'B) + GERAN_IU_MODE_CLASSMARK_CHG ('01100101'B) + //INTERSYS_TO_EUTRAN_HO_CMD ('01100110'B) duplicate, DL only } with { variant "FIELDLENGTH(8)" }; + /* Table 10.4.2 of Section 10.4 / 3GPP TS 44.018 */ + type enumerated RrShortDisc { + SYSTEM_INFORMATION_TYPE_10 ('00000'B), + NOTIFICATION_FACCH ('00001'B), + UPLINK_FREE ('00010'B), + ENHAN_MEAS_REP_UL ('00100'B), + MEAS_INFO_DL ('00101'B), + VBS_VGCS_RECON ('00110'B), + VBS_VGCS_RECON2 ('00111'B), + VGCS_ADD_INFO ('01000'B), + VGCS_SMS_INFO ('01001'B), + SYSTEM_INFORMATION_TYPE_10bis ('01010'B), + SYSTEM_INFORMATION_TYPE_10ter ('01011'B), + VGCS_NEIGH_CELL_INFO ('01100'B), + NOTIFY_APP_DATA ('01101'B) + } with { variant "FIELDLENGTH(5)" }; + type enumerated RR_Cause { GSM48_RR_CAUSE_NORMAL ('00'O), GSM48_RR_CAUSE_ABNORMAL_UNSPEC ('01'O), @@ -198,7 +224,10 @@ module GSM_RR_Types { external function dec_SacchL1Header(in octetstring stream) return SacchL1Header with { extension "prototype(convert) decode(RAW)" }; - template (value) SacchL1Header ts_SacchL1Header(uint5_t ms_power_lvl, boolean fpc, uint8_t actual_ta) := { + template (value) SacchL1Header + ts_SacchL1Header(uint5_t ms_power_lvl, + uint8_t actual_ta, + boolean fpc := false) := { reserved := 0, fpc := fpc, ms_power_lvl := ms_power_lvl, @@ -418,219 +447,6 @@ module GSM_RR_Types { uint3_t non_drx_timer } with { variant "" }; - /* 44.018 10.5.2.16 */ - type record IaRestOctHL { - uint6_t freq_par_len, - BIT2 padding ('00'B) optional, - uint6_t maio optional, - octetstring mobile_allocation optional - } with { - variant (freq_par_len) "LENGTHTO(mobile_allocation,maio,padding)" -/* - variant (padding) "PRESENCE(freq_par_len != 0)" - variant (maio) "PRESENCE(freq_par_len != 0)" - variant (mobile_allocation) "PRESENCE(freq_par_len != 0)" -*/ - }; - type record SecondPartAssign { - BIT1 r99, /* L / H */ - BIT1 presence optional, - BIT5 ext_ra optional - } with { - variant (r99) "CSN.1 L/H" - variant (presence) "PRESENCE(r99 = '1'B)" /* H */ - variant (ext_ra) "PRESENCE(presence = '1'B)" - /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ - variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first - }; - type union PacketUlDlAssignUnion { - PacketUlAssign ul, - PacketDlAssign dl - }; - type record PacketUlDlAssign { - BIT1 ass_disc, - PacketUlDlAssignUnion ass - } with { - variant (ass) "CROSSTAG(dl, ass_disc = '1'B; ul, ass_disc = '0'B)" - }; - type union PacketAssignUnion { - SecondPartAssign spa, - PacketUlDlAssign uldl - }; - type record IaRestOctHH { - /* Packet Assignment discriminator: - * Packet Uplink / Downlink Assignment (0) - * Second Part Packet Assignment (1) */ - BIT1 pa_disc, - PacketAssignUnion pa - } with { - variant (pa) "CROSSTAG(spa, pa_disc = '1'B; uldl, pa_disc = '0'B)" - }; - type record PacketUlAssignDyn { - uint5_t tfi_assignment, - BIT1 polling, - BIT1 spare ('0'B), - uint3_t usf, - BIT1 usf_granularity, - BIT1 p0_present, - uint4_t p0 optional, - BIT1 pr_mode optional, - ChCodingCommand ch_coding_cmd, - BIT1 tlli_block_chan_coding, - BIT1 alpha_present, - uint4_t alpha optional, - uint5_t gamma, - BIT1 ta_index_present, - uint4_t ta_index optional, - BIT1 tbf_starting_time_present, - uint16_t tbf_starting_time optional - } with { - variant (p0) "PRESENCE(p0_present = '1'B)" - variant (pr_mode) "PRESENCE(p0_present = '1'B)" - variant (alpha) "PRESENCE(alpha_present = '1'B)" - variant (ta_index) "PRESENCE(ta_index_present = '1'B)" - variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" - }; - type record PacketUlAssignSgl { - BIT1 alpha_present, - uint4_t alpha optional, - uint5_t gamma, - BIT2 padding ('01'B), - uint16_t tbf_starting_time - /* TODO: P0 / PR_MODE */ - } with { - variant (alpha) "PRESENCE(alpha_present = '1'B)" - }; - type record PacketUlAssign { - BIT1 presence, - PacketUlAssignDyn dynamic optional, - PacketUlAssignSgl single optional - /* TODO: Estended RA, PFI */ - } with { - variant (dynamic) "PRESENCE(presence = '1'B)" - variant (single) "PRESENCE(presence = '0'B)" - }; - type record PacketDlAssG1 { - uint5_t tfi_assignment, - BIT1 rlc_mode, - BIT1 alpha_present, - uint4_t alpha optional, - uint5_t gamma, - BIT1 polling, - BIT1 ta_valid - } with { variant "" }; - type record PacketDlAssign { - GprsTlli tlli, - BIT1 group1_present, - PacketDlAssG1 group1 optional, - BIT1 ta_index_present, - uint4_t ta_index optional, - BIT1 tbf_starting_time_present, - uint16_t tbf_starting_time optional, - BIT1 p0_present, - uint4_t p0 optional, - BIT1 pr_mode optional - /* TODO: EGPRS window size, etc. */ - } with { - variant (group1) "PRESENCE(group1_present = '1'B)" - variant (ta_index) "PRESENCE(ta_index_present = '1'B)" - variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" - variant (p0) "PRESENCE(p0_present = '1'B)" - variant (pr_mode) "PRESENCE(p0_present = '1'B)" - }; - type record IaRestOctLL { - BIT1 compressed_irat_ho_info_ind - } with { - variant (compressed_irat_ho_info_ind) "CSN.1 L/H" - }; - type record EgprsUlAssignDyn { - uint5_t tfi_assignment, - BIT1 polling, - BIT1 spare ('0'B), - uint3_t usf, - BIT1 usf_granularity, - BIT1 p0_present, - uint4_t p0 optional, - BIT1 pr_mode optional, - EgprsChCodingCommand egprs_ch_coding_cmd, - BIT1 tlli_block_chan_coding, - BIT1 bep_period2_present, - BIT4 bep_period2 optional, - BIT1 resegment, - EgprsWindowSize egprs_window_size, - BIT1 alpha_present, - uint4_t alpha optional, - uint5_t gamma, - BIT1 ta_index_present, - uint4_t ta_index optional, - BIT1 tbf_starting_time_present, - uint16_t tbf_starting_time optional - /* TODO: Additions for Rel-7 */ - } with { - variant (p0) "PRESENCE(p0_present = '1'B)" - variant (pr_mode) "PRESENCE(p0_present = '1'B)" - variant (bep_period2) "PRESENCE(bep_period2_present = '1'B)" - variant (alpha) "PRESENCE(alpha_present = '1'B)" - variant (ta_index) "PRESENCE(ta_index_present = '1'B)" - variant (tbf_starting_time) "PRESENCE(tbf_starting_time_present = '1'B)" - }; - type record EgprsUlAssignMultiblock { - BIT1 alpha_present, - uint4_t alpha optional, - uint5_t gamma, - uint16_t tbf_starting_time, - BIT2 nr_radio_blocks_allocated, - BIT1 p0_present, - uint4_t p0 optional, - BIT1 spare ('0'B) optional, - BIT1 pr_mode optional - /* TDO: Additions for Rel-6 */ - } with { - variant (alpha) "PRESENCE(alpha_present = '1'B)" - variant (p0) "PRESENCE(p0_present = '1'B)" - variant (spare) "PRESENCE(p0_present = '1'B)" - variant (pr_mode) "PRESENCE(p0_present = '1'B)" - }; - /* 3GPP TS 44.018 version 13.3.2 10.5.2.16, "EGPRS Packet Uplink Assignment" */ - type record EgprsUlAss { - BIT5 ext_ra, - BIT1 ats_present, - AccessTechnologiesRequestRepetition ats optional, - BIT1 presence, - EgprsUlAssignDyn dynamic optional, - EgprsUlAssignMultiblock multiblock optional - } with { - variant (ats) "PRESENCE(ats_present = '1'B)" - variant (dynamic) "PRESENCE(presence = '1'B)" - variant (multiblock) "PRESENCE(presence = '0'B)" - /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ - variant (ext_ra) "BYTEORDER(last)" // FIXME: should be first - }; - - type octetstring MblkDlAss; /* TODO */ - type record IaRestOctLH { - BIT2 presence, - EgprsUlAss egprs_ul optional, - MblkDlAss multiblock_dl_ass optional - } with { - variant (egprs_ul) "PRESENCE(presence = '00'B)" - variant (multiblock_dl_ass) "PRESENCE(presence = '01'B)" - }; - type record IaRestOctets { - BIT2 presence, - IaRestOctLL ll optional, - IaRestOctLH lh optional, - IaRestOctHL hl optional, - IaRestOctHH hh optional - } with { - variant (presence) "CSN.1 L/H" - variant (ll) "PRESENCE(presence = '00'B)" - variant (lh) "PRESENCE(presence = '01'B)" - variant (hl) "PRESENCE(presence = '10'B)" - variant (hh) "PRESENCE(presence = '11'B)" - variant "PADDING(yes), PADDING_PATTERN('00101011'B)" - }; - type record MeasurementResults { BIT1 ba_used, BIT1 dtx_used, @@ -645,8 +461,7 @@ module GSM_RR_Types { NcellReports ncell_reports optional } with { variant (no_ncell_m) "LENGTHTO(ncell_reports)" variant (no_ncell_m) "UNIT(elements)" - variant "PADDING(yes)" - variant "FIELDLENGTH(16)" + /* FIXME: pad to 16 octets */ }; type record NcellReport { @@ -737,34 +552,6 @@ module GSM_RR_Types { IARRestOctets rest_octets } with { variant "" }; - /* 10.5.2.17 IAR (Immediate Assignment Reject) Rest Octets */ - type record IARRestOctets { - ExtRAList ext_ra_list, - BIT1 rel13_ind, // L/H - uint3_t rcc optional - /* Addition in Rel-15: PEO IMM Cell Group Details struct */ - } with { - variant (rel13_ind) "CSN.1 L/H" - variant (rcc) "PRESENCE(rel13_ind = '1'B)" - - /* The TITAN's RAW encoder generates an octet-aligned octetstring, - * so we should make sure that unused bits contain proper padding. */ - variant "PADDING(yes), PADDING_PATTERN('00101011'B)" - }; - - /* Optional extended RA: 0 | 1 < Extended RA 1 : bit (5) > */ - type record ExtRAOpt { - BIT1 presence, // L/H - BIT5 ext_ra optional - } with { - variant (presence) "CSN.1 L/H" - variant (ext_ra) "PRESENCE(presence = '1'B)" - /* See https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488 */ - variant (ext_ra) "BYTEORDER(last)" - }; - - type record length(4) of ExtRAOpt ExtRAList; - /* 9.1.21 */ type record MeasurementReport { MeasurementResults meas_res @@ -798,6 +585,92 @@ module GSM_RR_Types { RestOctets rest_octets } with { variant "" }; + /* 9.1.44 */ + type record CipheringKeySeqNrTV { + HEX1 tag, + CipheringKeySeqNr cksn + } + type record TalkerIndication { + MsClassmark2LV cm2, + MobileIdentityLV mi, + CipheringKeySeqNrTV cksn optional + } with { variant "TAG(cksn, tag = 'B'H)" }; + + /* 9.1.44a */ + type record PriorityUplinkRequest { + OCT1 est_cause, + OCT4 token, + OCT4 reduced_gcr, + MobileIdentityLV mi + } with { variant "" }; + + /* 9.1.44b */ + type record DataIndication { + GsmTmsi tmsi, + OCT9 app_data, + OCT1 data_id + } with { variant "" }; + + /* 9.1.44c */ + type record DataIndication2 { + GsmTmsi tmsi, + OCT4 reduced_gcr, + OCT9 app_data, + OCT1 data_id + } with { variant "" }; + + /* 9.1.46 */ + type record UplinkBusy { + TalkerPrioEmergIndTLV prio optional, + TokenTV token optional, + TalkerIdentityTLV talker_id optional, + UplinkAccessIndTV ul_access_ind optional + } with { variant "" }; + + /* 9.1.48 */ + type record UplinkRelease { + RR_Cause cause + } with { variant "" }; + + /* 9.1.49 */ + type record VgcsUplinkGrant { + RequestReference req_ref, + TimingAdvance ta + } with { variant "" }; + + + /* 10.5.2.64 */ + type record TalkerPrioEmergIndTLV { + OCT1 iei ('31'O), + uint8_t len, + boolean es, + BIT3 spare, + boolean uai_rach, + uint3_t priority + } with { variant (len) "LENGTHTO(es,spare,uai_rach,priority)" + variant "PRESENCE(iei = '31'O)" }; + + /* 10.5.2.65 */ + type record TokenTV { + OCT1 iei ('32'O), + OCT4 token + } with { variant "PRESENCE(iei = '32'O)" }; + + /* 10.5.2.66 */ + type record TalkerIdentityTLV { + OCT1 iei ('33'O), + uint8_t len, + octetstring talker_id + } with { variant (len) "LENGTHTO(talker_id)" + variant "PRESENCE(iei = '33'O)" }; + + /* 10.5.2.74 */ + type record UplinkAccessIndTV { + HEX1 iei ('8'H), + BIT3 spare ('000'B), + boolean uai_rach + } with { variant "PRESENCE(iei = '8'H)" }; + type union RrUnion { /* SystemInformationType1 si1, @@ -869,6 +742,13 @@ module GSM_RR_Types { MeasurementReport meas_rep, AssignmentCommand ass_cmd, HandoverCommand ho_cmd, + TalkerIndication talker_ind, + PriorityUplinkRequest priority_ul_req, + UplinkBusy uplink_busy, + UplinkRelease uplink_release, + VgcsUplinkGrant vgcs_ul_grant, + DataIndication data_ind, + DataIndication2 data_ind2, octetstring other }; @@ -880,6 +760,13 @@ module GSM_RR_Types { meas_rep, header.message_type = MEASUREMENT_REPORT; ass_cmd, header.message_type = ASSIGNMENT_COMMAND; ho_cmd, header.message_type = HANDOVER_COMMAND; + talker_ind, header.message_type = TALKER_INDICATION; + priority_ul_req, header.message_type = PRIORITY_UPLINK_REQUEST; + uplink_busy, header.message_type = UPLINK_BUSY; + uplink_release, header.message_type = UPLINK_RELEASE; + vgcs_ul_grant, header.message_type = VGCS_UPLINK_GRANT; + data_ind, header.message_type = DATA_INDICATION; + data_ind2, header.message_type = DATA_INDICATION2; other, OTHERWISE; )" } @@ -889,119 +776,6 @@ module GSM_RR_Types { with { extension "prototype(convert) decode(RAW)" }; - template PacketDlAssign tr_PacketDlAssign(template GprsTlli tlli) := { - tlli := tlli, - group1_present := ?, - group1 := *, - ta_index_present := ?, - ta_index := *, - tbf_starting_time_present := ?, - tbf_starting_time := *, - p0_present := ?, - p0 := *, - pr_mode := * - }; - - template IaRestOctets tr_IaRestOctets_DLAss(template PacketDlAssign dl_ass) := { - presence := '11'B, /* HH */ - ll := omit, lh := omit, hl := omit, - hh := { - pa_disc := '0'B, /* Packet Assignment (0) */ - pa := { - uldl := { - ass_disc := '1'B, /* Downlink Assignment (1) */ - ass := { dl := dl_ass } - } - } - } - }; - - template PacketUlAssign tr_PacketUlDynAssign(template uint5_t tfi := ?, - template BIT1 polling := ?, - template uint3_t usf := ?, - template BIT1 usf_granularity := ?, - template ChCodingCommand cs := ?) := { - presence := '1'B, /* Dynamic Block Allocation */ - dynamic := { - tfi_assignment := tfi, - polling := polling, - spare := '0'B, /* Dynamic Block Allocation (mandatory after Rel-4) */ - usf := usf, - usf_granularity := usf_granularity, - p0_present := ?, - p0 := *, - pr_mode := *, - ch_coding_cmd := cs, - tlli_block_chan_coding := ?, - alpha_present := ?, - alpha := *, - gamma := ?, - /* TODO: add to parameters */ - ta_index_present := ?, - ta_index := *, - tbf_starting_time_present := ?, - tbf_starting_time := * - }, - single := omit - }; - - template PacketUlAssign tr_PacketUlSglAssign := { - presence := '0'B, /* Single Block Allocation */ - dynamic := omit, - single := { - alpha_present := ?, - alpha := *, - gamma := ?, - padding := '01'B, - tbf_starting_time := ? - } - }; - - template IaRestOctets tr_IaRestOctets_ULAss(template PacketUlAssign ul_ass) := { - presence := '11'B, /* HH */ - ll := omit, lh := omit, hl := omit, - hh := { - pa_disc := '0'B, /* Packet Assignment (0) */ - pa := { - uldl := { - ass_disc := '0'B, /* Uplink Assignment (0) */ - ass := { ul := ul_ass } - } - } - } - }; - - template EgprsUlAss tr_EgprsUlAssDynamic(template (present) BIT5 ext_ra := ?, - template EgprsUlAssignDyn dyn_ass := ?) := { - ext_ra := ext_ra, - ats_present := ?, - ats := *, - presence := '1'B, - dynamic := dyn_ass, - multiblock := omit - }; - template EgprsUlAss tr_EgprsUlAssMultiblock(template (present) BIT5 ext_ra := ?, - template EgprsUlAssignMultiblock mb_ass := ?) := { - ext_ra := ext_ra, - ats_present := ?, - ats := *, - presence := '0'B, - dynamic := omit, - multiblock := mb_ass - }; - - template IaRestOctets tr_IaRestOctets_EGPRSULAss(template EgprsUlAss ul_ass) := { - presence := '01'B, /* LH */ - ll := omit, - lh := { - presence := '00'B, - egprs_ul := ul_ass, - multiblock_dl_ass := omit - }, - hl := omit, - hh := omit - }; - template (value) GsmRrMessage ts_IMM_ASS(uint8_t ra, GsmFrameNumber fn, TimingAdvance ta, ChannelDescription ch_desc, MobileAllocationLV ma) := { header := ts_RrHeader(IMMEDIATE_ASSIGNMENT, 0), @@ -1033,7 +807,8 @@ module GSM_RR_Types { template GsmRrMessage tr_IMM_ASS(template uint8_t ra := ?, template GsmFrameNumber fn := ?, template TimingAdvance ta := ?, template ChannelDescription ch_desc := ?, - template MobileAllocationLV ma := ?) := { + template MobileAllocationLV ma := ?, + template PageMode page_mode := PAGE_MODE_NORMAL) := { header := t_RrHeader(IMMEDIATE_ASSIGNMENT, ?), payload := { imm_ass := { @@ -1043,7 +818,7 @@ module GSM_RR_Types { downlink := false, tbf := false }, - page_mode := PAGE_MODE_NORMAL, + page_mode := page_mode, chan_desc := ch_desc, pkt_chan_desc := omit, req_ref := tr_compute_ReqRef(ra, fn), @@ -1099,9 +874,33 @@ module GSM_RR_Types { } }; - template (value) GsmRrL3Message ts_MEAS_REP(boolean valid, uint6_t rxl_f, uint6_t rxl_s, - uint3_t rxq_f, uint3_t rxq_s, - template (omit) NcellReports reps) := { + template (value) MeasurementResults + ts_MeasurementResults(template (value) uint6_t rxl_f := 63, + template (value) uint6_t rxl_s := 63, + template (value) uint3_t rxq_f := 0, + template (value) uint3_t rxq_s := 0, + boolean dtx_used := false, + boolean valid := true, + template (omit) NcellReports reps := omit) := { + ba_used := '0'B, + dtx_used := bool2bit(dtx_used), + rxlev_full_srv_cell := rxl_f, + threeg_ba_used := '0'B, + meas_valid := bool2bit(not valid), + rxlev_sub_srv_cell := rxl_s, + si23_ba_used := '0'B, + rxqual_full_srv_cell := rxq_f, + rxqual_sub_srv_cell := rxq_s, + no_ncell_m := 0, + ncell_reports := reps + }; + + template (value) GsmRrL3Message ts_MEAS_REP(boolean valid, + template (value) uint6_t rxl_f, + template (value) uint6_t rxl_s, + template (value) uint3_t rxq_f := 0, + template (value) uint3_t rxq_s := 0, + template (omit) NcellReports reps := omit) := { header := t_RrL3Header(MEASUREMENT_REPORT), payload := { meas_rep := { @@ -1142,18 +941,6 @@ module GSM_RR_Types { wait_ind := wi }; - template IARRestOctets tr_IARRestOctets(template ExtRAList ext_ra_list := ?, - template uint3_t rcc := ?) := { - ext_ra_list := ext_ra_list, - rel13_ind := ?, - rcc := rcc ifpresent - }; - - template ExtRAOpt tr_ExtRAOpt(template BIT5 ext_ra := ?) := { - presence := '1'B, // L/H - ext_ra := ext_ra - }; - template (value) ChannelDescription ts_ChanDescH0(template (value) RslChannelNr chan_nr, template (value) uint12_t arfcn, template (value) uint3_t tsc := 7) := { |