Add enumerated for RR Message Type
diff --git a/sysinfo/GSM_SystemInformation.ttcn b/sysinfo/GSM_SystemInformation.ttcn
index 552463f..8413ee3 100644
--- a/sysinfo/GSM_SystemInformation.ttcn
+++ b/sysinfo/GSM_SystemInformation.ttcn
@@ -6,6 +6,7 @@
module GSM_SystemInformation {
import from General_Types all;
+ import from GSM_Types all;
import from Osmocom_Types all;
type record L2PseudoLength {
@@ -32,10 +33,10 @@
L2PseudoLength l2_plen,
uint4_t skip_indicator,
uint4_t rr_protocol_discriminator,
- OCT1 message_type
+ RrMessageType message_type
} with { variant "" };
- template SystemInformationHeader t_SiHeader(OCT1 msg_type, uint6_t len) := {
+ template SystemInformationHeader t_SiHeader(RrMessageType msg_type, uint6_t len) := {
l2_plen := t_L2Pseudolength(len),
rr_protocol_discriminator := 6,
message_type := msg_type
@@ -234,16 +235,16 @@
SystemInformationType5bis si5bis,
SystemInformationType5ter si5ter,
SystemInformationType6 si6
- } with { variant "TAG(si1, header.message_type = '19'O;
- si2, header.message_type = '1A'O;
- si2bis, header.message_type = '02'O;
- si2ter, header.message_type = '03'O;
- si3, header.message_type = '1B'O;
- si4, header.message_type = '1C'O;
- si5, header.message_type = '1D'O;
- si5bis, header.message_type = '05'O;
- si5ter, header.message_type = '06'O;
- si6, header.message_type = '1E'O;
+ } with { variant "TAG(si1, header.message_type = SYSTEM_INFORMATION_TYPE_1;
+ si2, header.message_type = SYSTEM_INFORMATION_TYPE_2;
+ si2bis, header.message_type = SYSTEM_INFORMATION_TYPE_2bis;
+ si2ter, header.message_type = SYSTEM_INFORMATION_TYPE_2ter;
+ si3, header.message_type = SYSTEM_INFORMATION_TYPE_3;
+ si4, header.message_type = SYSTEM_INFORMATION_TYPE_4;
+ si5, header.message_type = SYSTEM_INFORMATION_TYPE_5;
+ si5bis, header.message_type = SYSTEM_INFORMATION_TYPE_5bis;
+ si5ter, header.message_type = SYSTEM_INFORMATION_TYPE_5ter;
+ si6, header.message_type = SYSTEM_INFORMATION_TYPE_6;
)" };
external function enc_SystemInformation(in SystemInformation si) return octetstring
diff --git a/sysinfo/GSM_Types.ttcn b/sysinfo/GSM_Types.ttcn
new file mode 100644
index 0000000..70051bd
--- /dev/null
+++ b/sysinfo/GSM_Types.ttcn
@@ -0,0 +1,106 @@
+/* Encoding/Decoding routines for GSM System Information messages
+ * according to 3GPP TS 44.018 Version 12.3.0 Release 12 */
+
+/* (C) 2017 by Harald Welte <laforge@gnumonks.org> */
+
+module GSM_Types {
+
+ import from General_Types all;
+ import from Osmocom_Types all;
+
+ /* Table 10.4.1 of Section 10.4 / 3GPP TS 44.018 */
+ type enumerated RrMessageType {
+ ADDITIONAL_ASSIGNMENT ('00111011'B),
+ IMMEDIATE_ASSIGNMENT ('00111111'B),
+ IMMEDIATE_ASSIGNMENT_EXTENDED ('00111001'B),
+ IMMEDIATE_ASSIGNMENT_REJECT ('00111010'B),
+ IMMEDIATE_PACKET_ASSIGNMENT ('01101001'B),
+
+ CIPHERING_MODE_COMMAND ('00110101'B),
+ CIPHERING_MODE_COMPLETE ('00110010'B),
+
+ CONFIGURATION_CHANGE_COMMAND ('00110000'B),
+ CONFIGURATION_CHANGE_ACK ('00110001'B),
+ CONFIGURATION_CHANGE_REJECT ('00110011'B),
+
+ ASSIGNMENT_COMMAND ('00101110'B),
+ ASSIGNMENT_COMPLETE ('00101001'B),
+ ASSIGNMENT_FAILURE ('00101111'B),
+ HANDOVER_COMMAND ('00101011'B),
+ HANDOVER_COMPLETE ('00101100'B),
+ HANDOVER_FAILURE ('00101000'B),
+ PHYSICAL_INFORMATION ('00101101'B),
+
+ CHANNEL_RELEASE ('00001101'B),
+ PARTIAL_RELEASE ('00001010'B),
+ PARTIAL_RELEASE_COMPLETE ('00001111'B),
+
+ PAGING_REQUEST_TYPE_1 ('00100001'B),
+ PAGING_REQUEST_TYPE_2 ('00100010'B),
+ PAGING_REQUEST_TYPE_3 ('00100100'B),
+ PAGING_RESPONSE ('00100111'B),
+ NOTIFICATION_NCH ('00100000'B),
+ NOTIFICATION_RESPOSNE ('00100110'B),
+
+ SYSTEM_INFORMATION_TYPE_8 ('00011000'B),
+ SYSTEM_INFORMATION_TYPE_1 ('00011001'B),
+ SYSTEM_INFORMATION_TYPE_2 ('00011010'B),
+ SYSTEM_INFORMATION_TYPE_3 ('00011011'B),
+ SYSTEM_INFORMATION_TYPE_4 ('00011100'B),
+ SYSTEM_INFORMATION_TYPE_5 ('00011101'B),
+ SYSTEM_INFORMATION_TYPE_6 ('00011110'B),
+ SYSTEM_INFORMATION_TYPE_7 ('00011111'B),
+ SYSTEM_INFORMATION_TYPE_2bis ('00000010'B),
+ SYSTEM_INFORMATION_TYPE_2ter ('00000011'B),
+ SYSTEM_INFORMATION_TYPE_2quater ('00000111'B),
+ SYSTEM_INFORMATION_TYPE_5bis ('00000101'B),
+ SYSTEM_INFORMATION_TYPE_5ter ('00000110'B),
+ SYSTEM_INFORMATION_TYPE_9 ('00000100'B),
+ SYSTEM_INFORMATION_TYPE_13 ('00000000'B),
+
+ SYSTEM_INFORMATION_TYPE_16 ('00111101'B),
+ SYSTEM_INFORMATION_TYPE_17 ('00111110'B),
+
+ CHANNEL_MODE_MODIFY ('00010000'B),
+ RR_STATUS ('00010010'B),
+ CHANNEL_MODE_MODIFY_ACKNOWLEDGE ('00010111'B),
+ FREQUENCY_REDEFINITION ('00010100'B),
+ MEASUREMENT_REPORT ('00010101'B),
+ CLASSMARK_CHANGE ('00010110'B),
+ CLASSMARK_ENQUIRY ('00010011'B),
+ 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?
+
+ APPLICATION_INFORMATION ('00111000'B),
+
+ SYSTEM_INFORMATION_TYPE_14 ('00000001'B),
+ SYSTEM_INFORMATION_TYPE_15 ('01000011'B),
+ SYSTEM_INFORMATION_TYPE_18 ('01000000'B),
+ SYSTEM_INFORMATION_TYPE_19 ('01000001'B),
+ SYSTEM_INFORMATION_TYPE_20 ('01000010'B),
+ SYSTEM_INFORMATION_TYPE_13alt ('01000100'B),
+ SYSTEM_INFORMATION_TYPE_2n ('01000101'B),
+ SYSTEM_INFORMATION_TYPE_21 ('01000110'B),
+ SYSTEM_INFORMATION_TYPE_22 ('01000111'B),
+ SYSTEM_INFORMATION_TYPE_23 ('01001111'B),
+
+ DTM_ASSIGNMENT_FAILURE ('01001000'B),
+ DTM_REJECT ('01001001'B),
+ DTM_REQUEST ('01001010'B),
+ PACKET_ASSIGNMENT ('01001011'B),
+ DTM_ASSIGNMENT_COMMAND ('01001100'B),
+ DTM_INFORMATION ('01001101'B),
+ PACKET_INFORMATION ('01001110'B),
+
+ UTRAN_CLASSMARK_CHANGE ('01100000'B),
+ 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)
+ } with { variant "FIELDLENGTH(8)" };
+
+} with { encode "RAW"; variant "FIELDORDER(msb)" }
diff --git a/sysinfo/Test.ttcn b/sysinfo/Test.ttcn
index 5fa89fa..c2ffa4d 100644
--- a/sysinfo/Test.ttcn
+++ b/sysinfo/Test.ttcn
@@ -16,12 +16,6 @@
};
testcase TC_si1() runs on dummy_CT {
- var SystemInformationHeader hdr := {
- l2_plen := valueof(t_L2Pseudolength(21)),
- skip_indicator := 0,
- rr_protocol_discriminator := 6,
- message_type := '19'O
- };
log("SI: ", dec_SystemInformation(si1));
log("SI: ", dec_SystemInformation(si2));
log("SI: ", dec_SystemInformation(si3));