Neels Hofmeyr | 17518fe | 2017-06-20 04:35:06 +0200 | [diff] [blame] | 1 | /*! \file gsm_08_18.h */ |
| 2 | |
Sylvain Munaut | 12ba778 | 2014-06-16 10:13:40 +0200 | [diff] [blame] | 3 | #pragma once |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 4 | |
| 5 | #include <stdint.h> |
| 6 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 7 | /*! Fixed BVCI definitions (Section 5.4.1) */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 8 | #define BVCI_SIGNALLING 0x0000 |
| 9 | #define BVCI_PTM 0x0001 |
| 10 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 11 | /*! BSSGP PDU types (Section 11.3.26 / Table 11.27) */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 12 | enum bssgp_pdu_type { |
| 13 | /* PDUs between RL and BSSGP SAPs */ |
| 14 | BSSGP_PDUT_DL_UNITDATA = 0x00, |
| 15 | BSSGP_PDUT_UL_UNITDATA = 0x01, |
| 16 | BSSGP_PDUT_RA_CAPABILITY = 0x02, |
| 17 | BSSGP_PDUT_PTM_UNITDATA = 0x03, |
| 18 | /* PDUs between GMM SAPs */ |
| 19 | BSSGP_PDUT_PAGING_PS = 0x06, |
| 20 | BSSGP_PDUT_PAGING_CS = 0x07, |
| 21 | BSSGP_PDUT_RA_CAPA_UDPATE = 0x08, |
| 22 | BSSGP_PDUT_RA_CAPA_UPDATE_ACK = 0x09, |
| 23 | BSSGP_PDUT_RADIO_STATUS = 0x0a, |
| 24 | BSSGP_PDUT_SUSPEND = 0x0b, |
| 25 | BSSGP_PDUT_SUSPEND_ACK = 0x0c, |
| 26 | BSSGP_PDUT_SUSPEND_NACK = 0x0d, |
| 27 | BSSGP_PDUT_RESUME = 0x0e, |
| 28 | BSSGP_PDUT_RESUME_ACK = 0x0f, |
| 29 | BSSGP_PDUT_RESUME_NACK = 0x10, |
| 30 | /* PDus between NM SAPs */ |
| 31 | BSSGP_PDUT_BVC_BLOCK = 0x20, |
| 32 | BSSGP_PDUT_BVC_BLOCK_ACK = 0x21, |
| 33 | BSSGP_PDUT_BVC_RESET = 0x22, |
| 34 | BSSGP_PDUT_BVC_RESET_ACK = 0x23, |
| 35 | BSSGP_PDUT_BVC_UNBLOCK = 0x24, |
| 36 | BSSGP_PDUT_BVC_UNBLOCK_ACK = 0x25, |
| 37 | BSSGP_PDUT_FLOW_CONTROL_BVC = 0x26, |
| 38 | BSSGP_PDUT_FLOW_CONTROL_BVC_ACK = 0x27, |
| 39 | BSSGP_PDUT_FLOW_CONTROL_MS = 0x28, |
| 40 | BSSGP_PDUT_FLOW_CONTROL_MS_ACK = 0x29, |
| 41 | BSSGP_PDUT_FLUSH_LL = 0x2a, |
| 42 | BSSGP_PDUT_FLUSH_LL_ACK = 0x2b, |
| 43 | BSSGP_PDUT_LLC_DISCARD = 0x2c, |
| 44 | BSSGP_PDUT_SGSN_INVOKE_TRACE = 0x40, |
| 45 | BSSGP_PDUT_STATUS = 0x41, |
| 46 | /* PDUs between PFM SAP's */ |
| 47 | BSSGP_PDUT_DOWNLOAD_BSS_PFC = 0x50, |
| 48 | BSSGP_PDUT_CREATE_BSS_PFC = 0x51, |
| 49 | BSSGP_PDUT_CREATE_BSS_PFC_ACK = 0x52, |
| 50 | BSSGP_PDUT_CREATE_BSS_PFC_NACK = 0x53, |
| 51 | BSSGP_PDUT_MODIFY_BSS_PFC = 0x54, |
| 52 | BSSGP_PDUT_MODIFY_BSS_PFC_ACK = 0x55, |
| 53 | BSSGP_PDUT_DELETE_BSS_PFC = 0x56, |
| 54 | BSSGP_PDUT_DELETE_BSS_PFC_ACK = 0x57, |
| 55 | }; |
| 56 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 57 | /*! BSSGP User-Data header (Section 10.2.1 and 10.2.2) */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 58 | struct bssgp_ud_hdr { |
| 59 | uint8_t pdu_type; /*!< BSSGP PDU type */ |
| 60 | uint32_t tlli; /*!< Temporary Link-Local Identifier */ |
| 61 | uint8_t qos_profile[3]; /*!< QoS profile */ |
| 62 | uint8_t data[0]; /* optional/conditional IEs as TLVs */ |
| 63 | } __attribute__((packed)); |
| 64 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 65 | /*! BSSGP normal header */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 66 | struct bssgp_normal_hdr { |
| 67 | uint8_t pdu_type; /*!< BSSGP PDU type */ |
| 68 | uint8_t data[0]; /*!< optional/conditional IEs as TLVs */ |
| 69 | }; |
| 70 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 71 | /*! BSSGP Information Element Identifiers */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 72 | enum bssgp_iei_type { |
| 73 | BSSGP_IE_ALIGNMENT = 0x00, |
| 74 | BSSGP_IE_BMAX_DEFAULT_MS = 0x01, |
| 75 | BSSGP_IE_BSS_AREA_ID = 0x02, |
| 76 | BSSGP_IE_BUCKET_LEAK_RATE = 0x03, |
| 77 | BSSGP_IE_BVCI = 0x04, |
| 78 | BSSGP_IE_BVC_BUCKET_SIZE = 0x05, |
| 79 | BSSGP_IE_BVC_MEASUREMENT = 0x06, |
| 80 | BSSGP_IE_CAUSE = 0x07, |
| 81 | BSSGP_IE_CELL_ID = 0x08, |
| 82 | BSSGP_IE_CHAN_NEEDED = 0x09, |
| 83 | BSSGP_IE_DRX_PARAMS = 0x0a, |
| 84 | BSSGP_IE_EMLPP_PRIO = 0x0b, |
| 85 | BSSGP_IE_FLUSH_ACTION = 0x0c, |
| 86 | BSSGP_IE_IMSI = 0x0d, |
| 87 | BSSGP_IE_LLC_PDU = 0x0e, |
| 88 | BSSGP_IE_LLC_FRAMES_DISCARDED = 0x0f, |
| 89 | BSSGP_IE_LOCATION_AREA = 0x10, |
| 90 | BSSGP_IE_MOBILE_ID = 0x11, |
| 91 | BSSGP_IE_MS_BUCKET_SIZE = 0x12, |
| 92 | BSSGP_IE_MS_RADIO_ACCESS_CAP = 0x13, |
| 93 | BSSGP_IE_OMC_ID = 0x14, |
| 94 | BSSGP_IE_PDU_IN_ERROR = 0x15, |
| 95 | BSSGP_IE_PDU_LIFETIME = 0x16, |
| 96 | BSSGP_IE_PRIORITY = 0x17, |
| 97 | BSSGP_IE_QOS_PROFILE = 0x18, |
| 98 | BSSGP_IE_RADIO_CAUSE = 0x19, |
| 99 | BSSGP_IE_RA_CAP_UPD_CAUSE = 0x1a, |
| 100 | BSSGP_IE_ROUTEING_AREA = 0x1b, |
| 101 | BSSGP_IE_R_DEFAULT_MS = 0x1c, |
| 102 | BSSGP_IE_SUSPEND_REF_NR = 0x1d, |
| 103 | BSSGP_IE_TAG = 0x1e, |
| 104 | BSSGP_IE_TLLI = 0x1f, |
| 105 | BSSGP_IE_TMSI = 0x20, |
| 106 | BSSGP_IE_TRACE_REFERENC = 0x21, |
| 107 | BSSGP_IE_TRACE_TYPE = 0x22, |
| 108 | BSSGP_IE_TRANSACTION_ID = 0x23, |
| 109 | BSSGP_IE_TRIGGER_ID = 0x24, |
| 110 | BSSGP_IE_NUM_OCT_AFF = 0x25, |
| 111 | BSSGP_IE_LSA_ID_LIST = 0x26, |
| 112 | BSSGP_IE_LSA_INFORMATION = 0x27, |
| 113 | BSSGP_IE_PACKET_FLOW_ID = 0x28, |
| 114 | BSSGP_IE_PACKET_FLOW_TIMER = 0x29, |
| 115 | BSSGP_IE_AGG_BSS_QOS_PROFILE = 0x3a, |
| 116 | BSSGP_IE_FEATURE_BITMAP = 0x3b, |
| 117 | BSSGP_IE_BUCKET_FULL_RATIO = 0x3c, |
| 118 | BSSGP_IE_SERVICE_UTRAN_CCO = 0x3d, |
| 119 | }; |
| 120 | |
Neels Hofmeyr | 87e4550 | 2017-06-20 00:17:59 +0200 | [diff] [blame] | 121 | /*! Cause coding (Section 11.3.8 / Table 11.10) */ |
Harald Welte | 8648e49 | 2012-06-17 13:12:51 +0800 | [diff] [blame] | 122 | enum gprs_bssgp_cause { |
| 123 | BSSGP_CAUSE_PROC_OVERLOAD = 0x00, |
| 124 | BSSGP_CAUSE_EQUIP_FAIL = 0x01, |
| 125 | BSSGP_CAUSE_TRASIT_NET_FAIL = 0x02, |
| 126 | BSSGP_CAUSE_CAPA_GREATER_0KPBS = 0x03, |
| 127 | BSSGP_CAUSE_UNKNOWN_MS = 0x04, |
| 128 | BSSGP_CAUSE_UNKNOWN_BVCI = 0x05, |
| 129 | BSSGP_CAUSE_CELL_TRAF_CONG = 0x06, |
| 130 | BSSGP_CAUSE_SGSN_CONG = 0x07, |
| 131 | BSSGP_CAUSE_OML_INTERV = 0x08, |
| 132 | BSSGP_CAUSE_BVCI_BLOCKED = 0x09, |
| 133 | BSSGP_CAUSE_PFC_CREATE_FAIL = 0x0a, |
| 134 | BSSGP_CAUSE_SEM_INCORR_PDU = 0x20, |
| 135 | BSSGP_CAUSE_INV_MAND_INF = 0x21, |
| 136 | BSSGP_CAUSE_MISSING_MAND_IE = 0x22, |
| 137 | BSSGP_CAUSE_MISSING_COND_IE = 0x23, |
| 138 | BSSGP_CAUSE_UNEXP_COND_IE = 0x24, |
| 139 | BSSGP_CAUSE_COND_IE_ERR = 0x25, |
| 140 | BSSGP_CAUSE_PDU_INCOMP_STATE = 0x26, |
| 141 | BSSGP_CAUSE_PROTO_ERR_UNSPEC = 0x27, |
| 142 | BSSGP_CAUSE_PDU_INCOMP_FEAT = 0x28, |
| 143 | }; |