6 #include <osmocom/core/utils.h>
7 #include <osmocom/core/endian.h>
19 } __attribute__ ((packed));
43 } __attribute__ ((packed));
46 #if OSMO_IS_LITTLE_ENDIAN == 1
79 } __attribute__ ((packed));
113 } __attribute__ ((packed));
117 #if OSMO_IS_LITTLE_ENDIAN == 1
119 uint8_t orig_arfcn_hi:1,
121 uint8_t orig_arfcn_mid;
150 } __attribute__ ((packed));
155 uint8_t orig_arfcn_mid;
156 uint8_t orig_arfcn_lo:1,
184 } __attribute__ ((packed));
188 #if OSMO_IS_LITTLE_ENDIAN == 1
190 uint8_t orig_arfcn_hi:1,
192 uint8_t orig_arfcn_mid;
227 } __attribute__ ((packed));
232 uint8_t orig_arfcn_mid;
233 uint8_t orig_arfcn_lo:1,
267 } __attribute__ ((packed));
271 #if OSMO_IS_LITTLE_ENDIAN == 1
273 uint8_t orig_arfcn_hi:1,
275 uint8_t orig_arfcn_mid;
312 } __attribute__ ((packed));
317 uint8_t orig_arfcn_mid;
318 uint8_t orig_arfcn_lo:1,
354 } __attribute__ ((packed));
359 uint8_t orig_arfcn_hi:1,
361 uint8_t orig_arfcn_mid;
364 uint8_t rrfcn8_111[13];
365 } __attribute__ ((packed));
377 } __attribute__ ((packed)) h1;
379 uint8_t arfcn_high:2,
384 } __attribute__ ((packed)) h0;
385 } __attribute__ ((packed));
386 } __attribute__ ((packed));
390 uint8_t rxlev_full:6,
396 uint8_t no_nc_n_hi:1,
402 uint8_t bsic_nc1_hi:3,
404 uint8_t rxlev_nc2_hi:5,
406 uint8_t bsic_nc2_hi:2,
409 uint8_t rxlev_nc3_hi:4,
411 uint8_t bsic_nc3_hi:1,
414 uint8_t rxlev_nc4_hi:3,
416 uint8_t bcch_f_nc4:5,
418 uint8_t rxlev_nc5_hi:2,
420 uint8_t bcch_f_nc5_hi:4,
422 uint8_t rxlev_nc6_hi:1,
425 uint8_t bcch_f_nc6_hi:3,
429 } __attribute__ ((packed));
446 } __attribute__((packed));
450 uint8_t power_level:5,
453 } __attribute__((packed));
463 } __attribute__ ((packed));
473 } __attribute__ ((packed));
481 } __attribute__ ((packed));
489 } __attribute__((packed));
499 } __attribute__ ((packed));
501 enum gsm48_chan_mode {
502 GSM48_CMODE_SIGN = 0x00,
503 GSM48_CMODE_SPEECH_V1 = 0x01,
504 GSM48_CMODE_SPEECH_EFR = 0x21,
505 GSM48_CMODE_SPEECH_AMR = 0x41,
506 GSM48_CMODE_DATA_14k5 = 0x0f,
507 GSM48_CMODE_DATA_12k0 = 0x03,
508 GSM48_CMODE_DATA_6k0 = 0x0b,
509 GSM48_CMODE_DATA_3k6 = 0x13,
512 extern const struct value_string gsm48_chan_mode_names[];
518 uint8_t power_command;
520 } __attribute__((packed));
526 uint8_t mob_alloc_len;
527 uint8_t mob_alloc[0];
528 } __attribute__((packed));
536 } __attribute__((packed));
543 uint8_t power_command;
545 } __attribute__((packed));
555 uint8_t timing_advance;
556 uint8_t mob_alloc_len;
557 uint8_t mob_alloc[0];
558 } __attribute__ ((packed));
567 } __attribute__ ((packed));
573 } __attribute__ ((packed));
580 } __attribute__ ((packed));
585 } __attribute__ ((packed));
595 } __attribute__ ((packed));
602 } __attribute__ ((packed));
607 uint8_t rr_protocol_discriminator :4,
609 uint8_t system_information;
610 } __attribute__ ((packed));
614 uint8_t ms_txpwr_max_ccch:5,
616 uint8_t rxlev_acc_min:6,
619 } __attribute__ ((packed));
623 uint8_t ccch_conf :3,
627 uint8_t bs_pa_mfrms : 3,
630 } __attribute__ ((packed));
632 enum gsm48_dtx_mode {
633 GSM48_DTX_MAY_BE_USED,
634 GSM48_DTX_SHALL_BE_USED,
635 GSM48_DTX_SHALL_NOT_BE_USED
641 uint8_t radio_link_timeout:4,
646 } __attribute__ ((packed));
650 uint8_t cm_service_type : 4,
657 } __attribute__ ((packed));
662 uint8_t cell_channel_description[16];
664 uint8_t rest_octets[0];
665 } __attribute__ ((packed));
670 uint8_t bcch_frequency_list[16];
671 uint8_t ncc_permitted;
673 } __attribute__ ((packed));
678 uint8_t bcch_frequency_list[16];
680 uint8_t rest_octets[0];
681 } __attribute__ ((packed));
686 uint8_t ext_bcch_frequency_list[16];
687 uint8_t rest_octets[0];
688 } __attribute__ ((packed));
693 uint8_t rest_octets[0];
694 } __attribute__ ((packed));
699 uint16_t cell_identity;
705 uint8_t rest_octets[0];
706 } __attribute__ ((packed));
718 } __attribute__ ((packed));
722 uint8_t rr_protocol_discriminator :4,
724 uint8_t system_information;
725 uint8_t bcch_frequency_list[16];
726 } __attribute__ ((packed));
730 uint8_t rr_protocol_discriminator :4,
732 uint8_t system_information;
733 uint8_t bcch_frequency_list[16];
734 } __attribute__ ((packed));
738 uint8_t rr_protocol_discriminator :4,
740 uint8_t system_information;
741 uint8_t bcch_frequency_list[16];
742 } __attribute__ ((packed));
746 uint8_t rr_protocol_discriminator :4,
748 uint8_t system_information;
749 uint16_t cell_identity;
752 uint8_t ncc_permitted;
753 uint8_t rest_octets[0];
754 } __attribute__ ((packed));
759 uint8_t rest_octets[0];
760 } __attribute__ ((packed));
767 } __attribute__ ((packed));
774 } __attribute__((packed));
779 } __attribute__((packed));
784 } __attribute__((packed));
790 } __attribute__((packed));
795 } __attribute__((packed));
801 } __attribute__((packed));
809 } __attribute__((packed));
816 } __attribute__((packed));
826 uint8_t timing_advance1;
829 uint8_t timing_advance2;
830 uint8_t mob_alloc_len;
831 uint8_t mob_alloc[0];
832 } __attribute__ ((packed));
849 } __attribute__ ((packed));
861 } __attribute__((packed));
875 } __attribute__((packed));
894 } __attribute__((packed));
903 } __attribute__((packed));
908 } __attribute__((packed));
911 #define GSM48_PDISC_GROUP_CC 0x00
912 #define GSM48_PDISC_BCAST_CC 0x01
913 #define GSM48_PDISC_PDSS1 0x02
914 #define GSM48_PDISC_CC 0x03
915 #define GSM48_PDISC_PDSS2 0x04
916 #define GSM48_PDISC_MM 0x05
917 #define GSM48_PDISC_RR 0x06
918 #define GSM48_PDISC_MM_GPRS 0x08
919 #define GSM48_PDISC_SMS 0x09
920 #define GSM48_PDISC_SM_GPRS 0x0a
921 #define GSM48_PDISC_NC_SS 0x0b
922 #define GSM48_PDISC_LOC 0x0c
923 #define GSM48_PDISC_EXTEND 0x0e
924 #define GSM48_PDISC_MASK 0x0f
925 #define GSM48_PDISC_USSD 0x11
927 bool gsm48_hdr_gmm_cipherable(
const struct gsm48_hdr *hdr);
929 static inline uint8_t gsm48_hdr_pdisc(
const struct gsm48_hdr *hdr)
935 uint8_t pdisc = hdr->proto_discr & GSM48_PDISC_MASK;
936 if (pdisc == GSM48_PDISC_EXTEND)
937 return hdr->proto_discr;
941 static inline uint8_t gsm48_hdr_trans_id(
const struct gsm48_hdr *hdr)
947 return (hdr->proto_discr & 0xf0) >> 4;
950 #define GSM48_TA_INVALID 220
957 static inline bool gsm48_ta_is_valid(uint8_t ta)
962 static inline uint8_t gsm48_hdr_trans_id_flip_ti(
const struct gsm48_hdr *hdr)
964 return gsm48_hdr_trans_id(hdr) ^ 0x08;
967 static inline uint8_t gsm48_hdr_trans_id_no_ti(
const struct gsm48_hdr *hdr)
969 return gsm48_hdr_trans_id(hdr) & 0x07;
972 static inline uint8_t gsm48_hdr_msg_type_r98(
const struct gsm48_hdr *hdr)
979 switch (gsm48_hdr_pdisc(hdr)) {
982 case GSM48_PDISC_NC_SS:
983 case GSM48_PDISC_GROUP_CC:
984 case GSM48_PDISC_BCAST_CC:
985 case GSM48_PDISC_LOC:
986 return hdr->msg_type & 0xbf;
988 return hdr->msg_type;
992 static inline uint8_t gsm48_hdr_msg_type_r99(
const struct gsm48_hdr *hdr)
999 switch (gsm48_hdr_pdisc(hdr)) {
1000 case GSM48_PDISC_MM:
1001 case GSM48_PDISC_CC:
1002 return hdr->msg_type & 0x3f;
1003 case GSM48_PDISC_NC_SS:
1004 case GSM48_PDISC_GROUP_CC:
1005 case GSM48_PDISC_BCAST_CC:
1006 case GSM48_PDISC_LOC:
1007 return hdr->msg_type & 0xbf;
1009 return hdr->msg_type;
1014 enum gsm48_dtx_mode half,
bool is_bcch);
1016 #define gsm48_hdr_msg_type gsm48_hdr_msg_type_r99
1019 #define GSM48_MT_RR_INIT_REQ 0x3c
1020 #define GSM48_MT_RR_ADD_ASS 0x3b
1021 #define GSM48_MT_RR_IMM_ASS 0x3f
1022 #define GSM48_MT_RR_IMM_ASS_EXT 0x39
1023 #define GSM48_MT_RR_IMM_ASS_REJ 0x3a
1024 #define GSM48_MT_RR_DTM_ASS_FAIL 0x48
1025 #define GSM48_MT_RR_DTM_REJECT 0x49
1026 #define GSM48_MT_RR_DTM_REQUEST 0x4A
1027 #define GSM48_MT_RR_PACKET_ASS 0x4B
1029 #define GSM48_MT_RR_CIPH_M_CMD 0x35
1030 #define GSM48_MT_RR_CIPH_M_COMPL 0x32
1032 #define GSM48_MT_RR_CFG_CHG_CMD 0x30
1033 #define GSM48_MT_RR_CFG_CHG_ACK 0x31
1034 #define GSM48_MT_RR_CFG_CHG_REJ 0x33
1036 #define GSM48_MT_RR_ASS_CMD 0x2e
1037 #define GSM48_MT_RR_ASS_COMPL 0x29
1038 #define GSM48_MT_RR_ASS_FAIL 0x2f
1039 #define GSM48_MT_RR_HANDO_CMD 0x2b
1040 #define GSM48_MT_RR_HANDO_COMPL 0x2c
1041 #define GSM48_MT_RR_HANDO_FAIL 0x28
1042 #define GSM48_MT_RR_HANDO_INFO 0x2d
1043 #define GSM48_MT_RR_HANDO_INFO 0x2d
1044 #define GSM48_MT_RR_DTM_ASS_CMD 0x4c
1046 #define GSM48_MT_RR_CELL_CHG_ORDER 0x08
1047 #define GSM48_MT_RR_PDCH_ASS_CMD 0x23
1049 #define GSM48_MT_RR_CHAN_REL 0x0d
1050 #define GSM48_MT_RR_PART_REL 0x0a
1051 #define GSM48_MT_RR_PART_REL_COMP 0x0f
1053 #define GSM48_MT_RR_PAG_REQ_1 0x21
1054 #define GSM48_MT_RR_PAG_REQ_2 0x22
1055 #define GSM48_MT_RR_PAG_REQ_3 0x24
1056 #define GSM48_MT_RR_PAG_RESP 0x27
1057 #define GSM48_MT_RR_NOTIF_NCH 0x20
1058 #define GSM48_MT_RR_NOTIF_FACCH 0x25
1059 #define GSM48_MT_RR_NOTIF_RESP 0x26
1060 #define GSM48_MT_RR_PACKET_NOTIF 0x4e
1061 #define GSM48_MT_RR_UTRAN_CLSM_CHG 0x60
1062 #define GSM48_MT_RR_CDMA2K_CLSM_CHG 0x62
1063 #define GSM48_MT_RR_IS_TO_UTRAN_HANDO 0x63
1064 #define GSM48_MT_RR_IS_TO_CDMA2K_HANDO 0x64
1066 #define GSM48_MT_RR_SYSINFO_8 0x18
1067 #define GSM48_MT_RR_SYSINFO_1 0x19
1068 #define GSM48_MT_RR_SYSINFO_2 0x1a
1069 #define GSM48_MT_RR_SYSINFO_3 0x1b
1070 #define GSM48_MT_RR_SYSINFO_4 0x1c
1071 #define GSM48_MT_RR_SYSINFO_5 0x1d
1072 #define GSM48_MT_RR_SYSINFO_6 0x1e
1073 #define GSM48_MT_RR_SYSINFO_7 0x1f
1075 #define GSM48_MT_RR_SYSINFO_2bis 0x02
1076 #define GSM48_MT_RR_SYSINFO_2ter 0x03
1077 #define GSM48_MT_RR_SYSINFO_2quater 0x07
1078 #define GSM48_MT_RR_SYSINFO_5bis 0x05
1079 #define GSM48_MT_RR_SYSINFO_5ter 0x06
1080 #define GSM48_MT_RR_SYSINFO_9 0x04
1081 #define GSM48_MT_RR_SYSINFO_13 0x00
1083 #define GSM48_MT_RR_SYSINFO_16 0x3d
1084 #define GSM48_MT_RR_SYSINFO_17 0x3e
1086 #define GSM48_MT_RR_SYSINFO_18 0x40
1087 #define GSM48_MT_RR_SYSINFO_19 0x41
1088 #define GSM48_MT_RR_SYSINFO_20 0x42
1090 #define GSM48_MT_RR_CHAN_MODE_MODIF 0x10
1091 #define GSM48_MT_RR_STATUS 0x12
1092 #define GSM48_MT_RR_CHAN_MODE_MODIF_ACK 0x17
1093 #define GSM48_MT_RR_FREQ_REDEF 0x14
1094 #define GSM48_MT_RR_MEAS_REP 0x15
1095 #define GSM48_MT_RR_CLSM_CHG 0x16
1096 #define GSM48_MT_RR_CLSM_ENQ 0x13
1097 #define GSM48_MT_RR_EXT_MEAS_REP 0x36
1098 #define GSM48_MT_RR_EXT_MEAS_REP_ORD 0x37
1099 #define GSM48_MT_RR_GPRS_SUSP_REQ 0x34
1100 #define GSM48_MT_RR_DTM_INFO 0x4d
1102 #define GSM48_MT_RR_VGCS_UPL_GRANT 0x09
1103 #define GSM48_MT_RR_UPLINK_RELEASE 0x0e
1104 #define GSM48_MT_RR_UPLINK_FREE 0x0c
1105 #define GSM48_MT_RR_UPLINK_BUSY 0x2a
1106 #define GSM48_MT_RR_TALKER_IND 0x11
1108 #define GSM48_MT_RR_APP_INFO 0x38
1111 #define GSM48_MT_MM_IMSI_DETACH_IND 0x01
1112 #define GSM48_MT_MM_LOC_UPD_ACCEPT 0x02
1113 #define GSM48_MT_MM_LOC_UPD_REJECT 0x04
1114 #define GSM48_MT_MM_LOC_UPD_REQUEST 0x08
1116 #define GSM48_MT_MM_AUTH_REJ 0x11
1117 #define GSM48_MT_MM_AUTH_REQ 0x12
1118 #define GSM48_MT_MM_AUTH_RESP 0x14
1119 #define GSM48_MT_MM_AUTH_FAIL 0x1c
1120 #define GSM48_MT_MM_ID_REQ 0x18
1121 #define GSM48_MT_MM_ID_RESP 0x19
1122 #define GSM48_MT_MM_TMSI_REALL_CMD 0x1a
1123 #define GSM48_MT_MM_TMSI_REALL_COMPL 0x1b
1125 #define GSM48_MT_MM_CM_SERV_ACC 0x21
1126 #define GSM48_MT_MM_CM_SERV_REJ 0x22
1127 #define GSM48_MT_MM_CM_SERV_ABORT 0x23
1128 #define GSM48_MT_MM_CM_SERV_REQ 0x24
1129 #define GSM48_MT_MM_CM_SERV_PROMPT 0x25
1130 #define GSM48_MT_MM_CM_REEST_REQ 0x28
1131 #define GSM48_MT_MM_ABORT 0x29
1133 #define GSM48_MT_MM_NULL 0x30
1134 #define GSM48_MT_MM_STATUS 0x31
1135 #define GSM48_MT_MM_INFO 0x32
1138 #define GSM48_MT_CC_ALERTING 0x01
1139 #define GSM48_MT_CC_CALL_CONF 0x08
1140 #define GSM48_MT_CC_CALL_PROC 0x02
1141 #define GSM48_MT_CC_CONNECT 0x07
1142 #define GSM48_MT_CC_CONNECT_ACK 0x0f
1143 #define GSM48_MT_CC_EMERG_SETUP 0x0e
1144 #define GSM48_MT_CC_PROGRESS 0x03
1145 #define GSM48_MT_CC_ESTAB 0x04
1146 #define GSM48_MT_CC_ESTAB_CONF 0x06
1147 #define GSM48_MT_CC_RECALL 0x0b
1148 #define GSM48_MT_CC_START_CC 0x09
1149 #define GSM48_MT_CC_SETUP 0x05
1151 #define GSM48_MT_CC_MODIFY 0x17
1152 #define GSM48_MT_CC_MODIFY_COMPL 0x1f
1153 #define GSM48_MT_CC_MODIFY_REJECT 0x13
1154 #define GSM48_MT_CC_USER_INFO 0x10
1155 #define GSM48_MT_CC_HOLD 0x18
1156 #define GSM48_MT_CC_HOLD_ACK 0x19
1157 #define GSM48_MT_CC_HOLD_REJ 0x1a
1158 #define GSM48_MT_CC_RETR 0x1c
1159 #define GSM48_MT_CC_RETR_ACK 0x1d
1160 #define GSM48_MT_CC_RETR_REJ 0x1e
1162 #define GSM48_MT_CC_DISCONNECT 0x25
1163 #define GSM48_MT_CC_RELEASE 0x2d
1164 #define GSM48_MT_CC_RELEASE_COMPL 0x2a
1166 #define GSM48_MT_CC_CONG_CTRL 0x39
1167 #define GSM48_MT_CC_NOTIFY 0x3e
1168 #define GSM48_MT_CC_STATUS 0x3d
1169 #define GSM48_MT_CC_STATUS_ENQ 0x34
1170 #define GSM48_MT_CC_START_DTMF 0x35
1171 #define GSM48_MT_CC_STOP_DTMF 0x31
1172 #define GSM48_MT_CC_STOP_DTMF_ACK 0x32
1173 #define GSM48_MT_CC_START_DTMF_ACK 0x36
1174 #define GSM48_MT_CC_START_DTMF_REJ 0x37
1175 #define GSM48_MT_CC_FACILITY 0x3a
1180 #define GSM48_CMSERV_MO_CALL_PACKET 1
1181 #define GSM48_CMSERV_EMERGENCY 2
1182 #define GSM48_CMSERV_SMS 4
1183 #define GSM48_CMSERV_SUP_SERV 8
1184 #define GSM48_CMSERV_VGCS 9
1185 #define GSM48_CMSERV_VBS 10
1186 #define GSM48_CMSERV_LOC_SERV 11
1189 #define GSM48_PM_MASK 0x03
1190 #define GSM48_PM_NORMAL 0x00
1191 #define GSM48_PM_EXTENDED 0x01
1192 #define GSM48_PM_REORG 0x02
1193 #define GSM48_PM_SAME 0x03
1196 #define GSM48_LUPD_NORMAL 0x0
1197 #define GSM48_LUPD_PERIODIC 0x1
1198 #define GSM48_LUPD_IMSI_ATT 0x2
1199 #define GSM48_LUPD_RESERVED 0x3
1202 #define GSM_MI_TYPE_MASK 0x07
1203 #define GSM_MI_TYPE_NONE 0x00
1204 #define GSM_MI_TYPE_IMSI 0x01
1205 #define GSM_MI_TYPE_IMEI 0x02
1206 #define GSM_MI_TYPE_IMEISV 0x03
1207 #define GSM_MI_TYPE_TMSI 0x04
1208 #define GSM_MI_ODD 0x08
1210 #define GSM48_IE_MOBILE_ID 0x17
1211 #define GSM48_IE_NAME_LONG 0x43
1212 #define GSM48_IE_NAME_SHORT 0x45
1213 #define GSM48_IE_UTC 0x46
1214 #define GSM48_IE_NET_TIME_TZ 0x47
1215 #define GSM48_IE_LSA_IDENT 0x48
1216 #define GSM48_IE_NET_DST 0x49
1218 #define GSM48_IE_BEARER_CAP 0x04
1219 #define GSM48_IE_CAUSE 0x08
1220 #define GSM48_IE_CC_CAP 0x15
1221 #define GSM48_IE_ALERT 0x19
1222 #define GSM48_IE_FACILITY 0x1c
1223 #define GSM48_IE_PROGR_IND 0x1e
1224 #define GSM48_IE_AUX_STATUS 0x24
1225 #define GSM48_IE_NOTIFY 0x27
1226 #define GSM48_IE_KPD_FACILITY 0x2c
1227 #define GSM48_IE_SIGNAL 0x34
1228 #define GSM48_IE_CONN_BCD 0x4c
1229 #define GSM48_IE_CONN_SUB 0x4d
1230 #define GSM48_IE_CALLING_BCD 0x5c
1231 #define GSM48_IE_CALLING_SUB 0x5d
1232 #define GSM48_IE_CALLED_BCD 0x5e
1233 #define GSM48_IE_CALLED_SUB 0x6d
1234 #define GSM48_IE_REDIR_BCD 0x74
1235 #define GSM48_IE_REDIR_SUB 0x75
1236 #define GSM48_IE_LOWL_COMPAT 0x7c
1237 #define GSM48_IE_HIGHL_COMPAT 0x7d
1238 #define GSM48_IE_USER_USER 0x7e
1239 #define GSM48_IE_SS_VERS 0x7f
1240 #define GSM48_IE_MORE_DATA 0xa0
1241 #define GSM48_IE_CLIR_SUPP 0xa1
1242 #define GSM48_IE_CLIR_INVOC 0xa2
1243 #define GSM48_IE_REV_C_SETUP 0xa3
1244 #define GSM48_IE_REPEAT_CIR 0xd1
1245 #define GSM48_IE_REPEAT_SEQ 0xd3
1248 #define GSM48_CAUSE_CS_GSM 0x60
1252 #define GSM48_IE_VGCS_TARGET 0x01
1254 #define GSM48_IE_FRQSHORT_AFTER 0x02
1255 #define GSM48_IE_MUL_RATE_CFG 0x03
1256 #define GSM48_IE_FREQ_L_AFTER 0x05
1257 #define GSM48_IE_MSLOT_DESC 0x10
1258 #define GSM48_IE_CHANMODE_2 0x11
1259 #define GSM48_IE_FRQSHORT_BEFORE 0x12
1261 #define GSM48_IE_CHANMODE_3 0x13
1262 #define GSM48_IE_CHANMODE_4 0x14
1263 #define GSM48_IE_CHANMODE_5 0x15
1264 #define GSM48_IE_CHANMODE_6 0x16
1265 #define GSM48_IE_CHANMODE_7 0x17
1266 #define GSM48_IE_CHANMODE_8 0x18
1267 #define GSM48_IE_CHANDESC_2 0x64
1268 #define GSM48_IE_MA_AFTER 0x72
1269 #define GSM48_IE_START_TIME 0x7c
1270 #define GSM48_IE_FREQ_L_BEFORE 0x19
1272 #define GSM48_IE_CH_DESC_1_BEFORE 0x1c
1274 #define GSM48_IE_CH_DESC_2_BEFORE 0x1d
1276 #define GSM48_IE_F_CH_SEQ_BEFORE 0x1e
1278 #define GSM48_IE_CLASSMARK3 0x20
1279 #define GSM48_IE_MA_BEFORE 0x21
1280 #define GSM48_IE_RR_PACKET_UL 0x22
1281 #define GSM48_IE_RR_PACKET_DL 0x23
1282 #define GSM48_IE_CELL_CH_DESC 0x62
1283 #define GSM48_IE_CHANMODE_1 0x63
1284 #define GSM48_IE_CHDES_2_AFTER 0x64
1285 #define GSM48_IE_MODE_SEC_CH 0x66
1286 #define GSM48_IE_F_CH_SEQ_AFTER 0x69
1287 #define GSM48_IE_MA_AFTER 0x72
1288 #define GSM48_IE_BA_RANGE 0x73
1289 #define GSM48_IE_GROUP_CHDES 0x74
1290 #define GSM48_IE_BA_LIST_PREF 0x75
1291 #define GSM48_IE_MOB_OVSERV_DIF 0x77
1292 #define GSM48_IE_REALTIME_DIFF 0x7b
1293 #define GSM48_IE_START_TIME 0x7c
1294 #define GSM48_IE_TIMING_ADVANCE 0x7d
1295 #define GSM48_IE_GROUP_CIP_SEQ 0x80
1296 #define GSM48_IE_CIP_MODE_SET 0x90
1297 #define GSM48_IE_GPRS_RESUMPT 0xc0
1298 #define GSM48_IE_SYNC_IND 0xd0
1300 #define GSM48_IE_CBCH_CHAN_DESC 0x64
1301 #define GSM48_IE_CBCH_MOB_AL 0x72
1304 #define GSM48_IE_LOCATION_AREA 0x13
1305 #define GSM48_IE_AUTN 0x20
1306 #define GSM48_IE_AUTH_RES_EXT 0x21
1307 #define GSM48_IE_AUTS 0x22
1308 #define GSM48_IE_PRIORITY_LEV 0x80
1309 #define GSM48_IE_FOLLOW_ON_PROC 0xa1
1310 #define GSM48_IE_CTS_PERMISSION 0xa2
1313 enum gsm48_signal_val {
1314 GSM48_SIGNAL_DIALTONE = 0x00,
1315 GSM48_SIGNAL_RINGBACK = 0x01,
1316 GSM48_SIGNAL_INTERCEPT = 0x02,
1317 GSM48_SIGNAL_NET_CONG = 0x03,
1318 GSM48_SIGNAL_BUSY = 0x04,
1319 GSM48_SIGNAL_CONFIRM = 0x05,
1320 GSM48_SIGNAL_ANSWER = 0x06,
1321 GSM48_SIGNAL_CALL_WAIT = 0x07,
1322 GSM48_SIGNAL_OFF_HOOK = 0x08,
1323 GSM48_SIGNAL_OFF = 0x3f,
1324 GSM48_SIGNAL_ALERT_OFF = 0x4f,
1327 enum gsm48_cause_loc {
1328 GSM48_CAUSE_LOC_USER = 0x00,
1329 GSM48_CAUSE_LOC_PRN_S_LU = 0x01,
1330 GSM48_CAUSE_LOC_PUN_S_LU = 0x02,
1331 GSM48_CAUSE_LOC_TRANS_NET = 0x03,
1332 GSM48_CAUSE_LOC_PUN_S_RU = 0x04,
1333 GSM48_CAUSE_LOC_PRN_S_RU = 0x05,
1335 GSM48_CAUSE_LOC_INN_NET = 0x07,
1336 GSM48_CAUSE_LOC_NET_BEYOND = 0x0a,
1340 enum gsm48_rr_cause {
1341 GSM48_RR_CAUSE_NORMAL = 0x00,
1342 GSM48_RR_CAUSE_ABNORMAL_UNSPEC = 0x01,
1343 GSM48_RR_CAUSE_ABNORMAL_UNACCT = 0x02,
1344 GSM48_RR_CAUSE_ABNORMAL_TIMER = 0x03,
1345 GSM48_RR_CAUSE_ABNORMAL_NOACT = 0x04,
1346 GSM48_RR_CAUSE_PREMPTIVE_REL = 0x05,
1347 GSM48_RR_CAUSE_HNDOVER_IMP = 0x08,
1348 GSM48_RR_CAUSE_CHAN_MODE_UNACCT = 0x09,
1349 GSM48_RR_CAUSE_FREQ_NOT_IMPL = 0x0a,
1350 GSM48_RR_CAUSE_CALL_CLEARED = 0x41,
1351 GSM48_RR_CAUSE_SEMANT_INCORR = 0x5f,
1352 GSM48_RR_CAUSE_INVALID_MAND_INF = 0x60,
1353 GSM48_RR_CAUSE_MSG_TYPE_N = 0x61,
1354 GSM48_RR_CAUSE_MSG_TYPE_N_COMPAT= 0x62,
1355 GSM48_RR_CAUSE_COND_IE_ERROR = 0x64,
1356 GSM48_RR_CAUSE_NO_CELL_ALLOC_A = 0x65,
1357 GSM48_RR_CAUSE_PROT_ERROR_UNSPC = 0x6f,
1361 enum gsm48_cc_cause {
1362 GSM48_CC_CAUSE_UNASSIGNED_NR = 1,
1363 GSM48_CC_CAUSE_NO_ROUTE = 3,
1364 GSM48_CC_CAUSE_CHAN_UNACCEPT = 6,
1365 GSM48_CC_CAUSE_OP_DET_BARRING = 8,
1366 GSM48_CC_CAUSE_NORM_CALL_CLEAR = 16,
1367 GSM48_CC_CAUSE_USER_BUSY = 17,
1368 GSM48_CC_CAUSE_USER_NOTRESPOND = 18,
1369 GSM48_CC_CAUSE_USER_ALERTING_NA = 19,
1370 GSM48_CC_CAUSE_CALL_REJECTED = 21,
1371 GSM48_CC_CAUSE_NUMBER_CHANGED = 22,
1372 GSM48_CC_CAUSE_PRE_EMPTION = 25,
1373 GSM48_CC_CAUSE_NONSE_USER_CLR = 26,
1374 GSM48_CC_CAUSE_DEST_OOO = 27,
1375 GSM48_CC_CAUSE_INV_NR_FORMAT = 28,
1376 GSM48_CC_CAUSE_FACILITY_REJ = 29,
1377 GSM48_CC_CAUSE_RESP_STATUS_INQ = 30,
1378 GSM48_CC_CAUSE_NORMAL_UNSPEC = 31,
1379 GSM48_CC_CAUSE_NO_CIRCUIT_CHAN = 34,
1380 GSM48_CC_CAUSE_NETWORK_OOO = 38,
1381 GSM48_CC_CAUSE_TEMP_FAILURE = 41,
1382 GSM48_CC_CAUSE_SWITCH_CONG = 42,
1383 GSM48_CC_CAUSE_ACC_INF_DISCARD = 43,
1384 GSM48_CC_CAUSE_REQ_CHAN_UNAVAIL = 44,
1385 GSM48_CC_CAUSE_RESOURCE_UNAVAIL = 47,
1386 GSM48_CC_CAUSE_QOS_UNAVAIL = 49,
1387 GSM48_CC_CAUSE_REQ_FAC_NOT_SUBSC= 50,
1388 GSM48_CC_CAUSE_INC_BARRED_CUG = 55,
1389 GSM48_CC_CAUSE_BEARER_CAP_UNAUTH= 57,
1390 GSM48_CC_CAUSE_BEARER_CA_UNAVAIL= 58,
1391 GSM48_CC_CAUSE_SERV_OPT_UNAVAIL = 63,
1392 GSM48_CC_CAUSE_BEARERSERV_UNIMPL= 65,
1393 GSM48_CC_CAUSE_ACM_GE_ACM_MAX = 68,
1394 GSM48_CC_CAUSE_REQ_FAC_NOTIMPL = 69,
1395 GSM48_CC_CAUSE_RESTR_BCAP_AVAIL = 70,
1396 GSM48_CC_CAUSE_SERV_OPT_UNIMPL = 79,
1397 GSM48_CC_CAUSE_INVAL_TRANS_ID = 81,
1398 GSM48_CC_CAUSE_USER_NOT_IN_CUG = 87,
1399 GSM48_CC_CAUSE_INCOMPAT_DEST = 88,
1400 GSM48_CC_CAUSE_INVAL_TRANS_NET = 91,
1401 GSM48_CC_CAUSE_SEMANTIC_INCORR = 95,
1402 GSM48_CC_CAUSE_INVAL_MAND_INF = 96,
1403 GSM48_CC_CAUSE_MSGTYPE_NOTEXIST = 97,
1404 GSM48_CC_CAUSE_MSGTYPE_INCOMPAT = 98,
1405 GSM48_CC_CAUSE_IE_NOTEXIST = 99,
1406 GSM48_CC_CAUSE_COND_IE_ERR = 100,
1407 GSM48_CC_CAUSE_MSG_INCOMP_STATE = 101,
1408 GSM48_CC_CAUSE_RECOVERY_TIMER = 102,
1409 GSM48_CC_CAUSE_PROTO_ERR = 111,
1410 GSM48_CC_CAUSE_INTERWORKING = 127,
1414 enum gsm48_reject_value {
1415 GSM48_REJECT_IMSI_UNKNOWN_IN_HLR = 2,
1416 GSM48_REJECT_ILLEGAL_MS = 3,
1417 GSM48_REJECT_IMSI_UNKNOWN_IN_VLR = 4,
1418 GSM48_REJECT_IMEI_NOT_ACCEPTED = 5,
1419 GSM48_REJECT_ILLEGAL_ME = 6,
1420 GSM48_REJECT_PLMN_NOT_ALLOWED = 11,
1421 GSM48_REJECT_LOC_NOT_ALLOWED = 12,
1422 GSM48_REJECT_ROAMING_NOT_ALLOWED = 13,
1423 GSM48_REJECT_NETWORK_FAILURE = 17,
1424 GSM48_REJECT_SYNCH_FAILURE = 21,
1425 GSM48_REJECT_CONGESTION = 22,
1426 GSM48_REJECT_SRV_OPT_NOT_SUPPORTED = 32,
1427 GSM48_REJECT_RQD_SRV_OPT_NOT_SUPPORTED = 33,
1428 GSM48_REJECT_SRV_OPT_TMP_OUT_OF_ORDER = 34,
1429 GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED = 38,
1430 GSM48_REJECT_INCORRECT_MESSAGE = 95,
1431 GSM48_REJECT_INVALID_MANDANTORY_INF = 96,
1432 GSM48_REJECT_MSG_TYPE_NOT_IMPLEMENTED = 97,
1433 GSM48_REJECT_MSG_TYPE_NOT_COMPATIBLE = 98,
1434 GSM48_REJECT_INF_ELEME_NOT_IMPLEMENTED = 99,
1435 GSM48_REJECT_CONDTIONAL_IE_ERROR = 100,
1436 GSM48_REJECT_MSG_NOT_COMPATIBLE = 101,
1437 GSM48_REJECT_PROTOCOL_ERROR = 111,
1440 GSM48_REJECT_GPRS_NOT_ALLOWED = 7,
1441 GSM48_REJECT_SERVICES_NOT_ALLOWED = 8,
1442 GSM48_REJECT_MS_IDENTITY_NOT_DERVIVABLE = 9,
1443 GSM48_REJECT_IMPLICITLY_DETACHED = 10,
1444 GSM48_REJECT_GPRS_NOT_ALLOWED_IN_PLMN = 14,
1445 GSM48_REJECT_MSC_TMP_NOT_REACHABLE = 16,
1450 CHREQ_T_CALL_REEST_TCH_F,
1451 CHREQ_T_CALL_REEST_TCH_H,
1452 CHREQ_T_CALL_REEST_TCH_H_DBL,
1455 CHREQ_T_VOICE_CALL_TCH_H,
1456 CHREQ_T_DATA_CALL_TCH_H,
1457 CHREQ_T_LOCATION_UPD,
1458 CHREQ_T_PAG_R_ANY_NECI0,
1459 CHREQ_T_PAG_R_ANY_NECI1,
1460 CHREQ_T_PAG_R_TCH_F,
1461 CHREQ_T_PAG_R_TCH_FH,
1463 CHREQ_T_RESERVED_SDCCH,
1464 CHREQ_T_RESERVED_IGNORE,
1468 #define GSM48_T301 180, 0
1469 #define GSM48_T303 30, 0
1470 #define GSM48_T305 30, 0
1471 #define GSM48_T306 30, 0
1472 #define GSM48_T308 10, 0
1473 #define GSM48_T310 180, 0
1474 #define GSM48_T313 30, 0
1475 #define GSM48_T323 30, 0
1476 #define GSM48_T331 30, 0
1477 #define GSM48_T333 30, 0
1478 #define GSM48_T334 25, 0
1479 #define GSM48_T338 30, 0
1480 #define GSM48_T303_MS 30, 0
1481 #define GSM48_T305_MS 30, 0
1482 #define GSM48_T308_MS 30, 0
1483 #define GSM48_T310_MS 30, 0
1484 #define GSM48_T313_MS 30, 0
1485 #define GSM48_T323_MS 30, 0
1486 #define GSM48_T332_MS 30, 0
1487 #define GSM48_T335_MS 30, 0
1490 #define GSM_CSTATE_NULL 0
1491 #define GSM_CSTATE_INITIATED 1
1492 #define GSM_CSTATE_MM_CONNECTION_PEND 2
1493 #define GSM_CSTATE_MO_CALL_PROC 3
1494 #define GSM_CSTATE_CALL_DELIVERED 4
1495 #define GSM_CSTATE_CALL_PRESENT 6
1496 #define GSM_CSTATE_CALL_RECEIVED 7
1497 #define GSM_CSTATE_CONNECT_REQUEST 8
1498 #define GSM_CSTATE_MO_TERM_CALL_CONF 9
1499 #define GSM_CSTATE_ACTIVE 10
1500 #define GSM_CSTATE_DISCONNECT_REQ 12
1501 #define GSM_CSTATE_DISCONNECT_IND 12
1502 #define GSM_CSTATE_RELEASE_REQ 19
1503 #define GSM_CSTATE_MO_ORIG_MODIFY 26
1504 #define GSM_CSTATE_MO_TERM_MODIFY 27
1505 #define GSM_CSTATE_CONNECT_IND 28
1507 #define SBIT(a) (1 << a)
1508 #define ALL_STATES 0xffffffff
1511 #define GSM_LAC_RESERVED_DETACHED 0x0
1512 #define GSM_LAC_RESERVED_ALL_BTS 0xfffe
1515 enum gsm48_bcap_itcap {
1516 GSM48_BCAP_ITCAP_SPEECH = 0,
1517 GSM48_BCAP_ITCAP_UNR_DIG_INF = 1,
1518 GSM48_BCAP_ITCAP_3k1_AUDIO = 2,
1519 GSM48_BCAP_ITCAP_FAX_G3 = 3,
1520 GSM48_BCAP_ITCAP_OTHER = 5,
1521 GSM48_BCAP_ITCAP_RESERVED = 7,
1525 enum gsm48_bcap_tmod {
1526 GSM48_BCAP_TMOD_CIRCUIT = 0,
1527 GSM48_BCAP_TMOD_PACKET = 1,
1531 enum gsm48_bcap_coding {
1532 GSM48_BCAP_CODING_GSM_STD = 0,
1536 enum gsm48_bcap_rrq {
1537 GSM48_BCAP_RRQ_FR_ONLY = 1,
1538 GSM48_BCAP_RRQ_DUAL_HR = 2,
1539 GSM48_BCAP_RRQ_DUAL_FR = 3,
1543 enum gsm48_bcap_ra {
1544 GSM48_BCAP_RA_NONE = 0,
1545 GSM48_BCAP_RA_V110_X30 = 1,
1546 GSM48_BCAP_RA_X31 = 2,
1547 GSM48_BCAP_RA_OTHER = 3,
1551 enum gsm48_bcap_sig_access {
1552 GSM48_BCAP_SA_I440_I450 = 1,
1553 GSM48_BCAP_SA_X21 = 2,
1554 GSM48_BCAP_SA_X28_DP_IN = 3,
1555 GSM48_BCAP_SA_X28_DP_UN = 4,
1556 GSM48_BCAP_SA_X28_NDP = 5,
1557 GSM48_BCAP_SA_X32 = 6,
1561 enum gsm48_bcap_user_rate {
1562 GSM48_BCAP_UR_300 = 1,
1563 GSM48_BCAP_UR_1200 = 2,
1564 GSM48_BCAP_UR_2400 = 3,
1565 GSM48_BCAP_UR_4800 = 4,
1566 GSM48_BCAP_UR_9600 = 5,
1567 GSM48_BCAP_UR_12000 = 6,
1568 GSM48_BCAP_UR_1200_75 = 7,
1572 enum gsm48_bcap_parity {
1573 GSM48_BCAP_PAR_ODD = 0,
1574 GSM48_BCAP_PAR_EVEN = 2,
1575 GSM48_BCAP_PAR_NONE = 3,
1576 GSM48_BCAP_PAR_ZERO = 4,
1577 GSM48_BCAP_PAR_ONE = 5,
1581 enum gsm48_bcap_interm_rate {
1582 GSM48_BCAP_IR_8k = 2,
1583 GSM48_BCAP_IR_16k = 3,
1587 enum gsm48_bcap_transp {
1588 GSM48_BCAP_TR_TRANSP = 0,
1589 GSM48_BCAP_TR_RLP = 1,
1590 GSM48_BCAP_TR_TR_PREF = 2,
1591 GSM48_BCAP_TR_RLP_PREF = 3,
1595 enum gsm48_bcap_modem_type {
1596 GSM48_BCAP_MT_NONE = 0,
1597 GSM48_BCAP_MT_V21 = 1,
1598 GSM48_BCAP_MT_V22 = 2,
1599 GSM48_BCAP_MT_V22bis = 3,
1600 GSM48_BCAP_MT_V23 = 4,
1601 GSM48_BCAP_MT_V26ter = 5,
1602 GSM48_BCAP_MT_V32 = 6,
1603 GSM48_BCAP_MT_UNDEF = 7,
1604 GSM48_BCAP_MT_AUTO_1 = 8,
1608 enum gsm48_bcap_speech_ver {
1609 GSM48_BCAP_SV_FR = 0,
1610 GSM48_BCAP_SV_HR = 1,
1611 GSM48_BCAP_SV_EFR = 2,
1612 GSM48_BCAP_SV_AMR_F = 4,
1613 GSM48_BCAP_SV_AMR_H = 5,
1616 #define GSM48_TMSI_LEN 5
1617 #define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2)
1618 #define GSM48_MI_SIZE 32
1625 } __attribute__ ((packed));
1627 #define GSM48_CELL_CHAN_DESC_SIZE 16
1629 #define GSM_MACBLOCK_LEN 23
1630 #define GSM_MACBLOCK_PADDING 0x2b
uint8_t data[0]
actual payload data
Definition: gsm_08_58.h:2
Definition: gsm_04_08.h:770
Definition: gsm_04_08.h:515
Definition: gsm_04_08.h:777
Definition: gsm_04_08.h:782
Definition: gsm_04_08.h:576
Definition: gsm_04_08.h:583
Definition: gsm_04_08.h:531
Definition: gsm_04_08.h:640
Definition: gsm_04_08.h:613
Definition: gsm_04_08.h:368
Definition: gsm_04_08.h:496
Definition: gsm_04_08.h:798
Definition: gsm_04_08.h:804
Definition: gsm_04_08.h:13
Definition: gsm_04_08.h:22
Definition: gsm_04_08.h:812
Definition: gsm_04_08.h:622
Definition: gsm_04_08.h:523
Definition: gsm_04_08.h:598
Definition: gsm_04_08.h:539
Definition: gsm_04_08.h:787
Definition: gsm_04_08.h:793
Definition: gsm_04_08.h:819
Definition: gsm_04_08.h:835
Definition: gsm_04_08.h:548
Definition: gsm_04_08.h:763
Definition: gsm_04_08.h:570
Definition: gsm_04_08.h:588
Definition: gsm_04_08.h:389
Definition: gsm_04_08.h:432
Definition: gsm_04_08.h:561
Definition: gsm_04_08.h:897
Definition: gsm_04_08.h:852
Definition: gsm_04_08.h:864
Definition: gsm_04_08.h:878
Definition: gsm_04_08.h:449
Definition: gsm_04_08.h:1621
Definition: gsm_04_08.h:456
Definition: gsm_04_08.h:81
Definition: gsm_04_08.h:314
Definition: gsm_04_08.h:229
Definition: gsm_04_08.h:152
Definition: gsm_04_08.h:467
Definition: gsm_04_08.h:906
Definition: gsm_04_08.h:649
Definition: gsm_04_08.h:476
Definition: gsm_04_08.h:484
Definition: gsm_04_08.h:358