Loading...
Searching...
No Matches
gsm_25_415.h
Go to the documentation of this file.
#pragma once
/* Iu User Plane (IuUP) Definitions as per 3GPP TS 25.415 */
/* (C) 2017 by Harald Welte <laforge@gnumonks.org>
* All Rights Reserved.
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <stdint.h>
#include <osmocom/core/endian.h>
/* 3GPP TS 25.415 Section 6.6.2.1 */
struct iuup_pdutype0_hdr {
#if OSMO_IS_LITTLE_ENDIAN
/* control part */
uint8_t frame_nr:4,
pdu_type:4;
uint8_t rfci:6,
fqc:2;
/* checksum part */
uint8_t payload_crc_hi:2, header_crc:6;
uint8_t payload_crc_lo;
/* payload part */
uint8_t payload[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t pdu_type:4, frame_nr:4;
uint8_t fqc:2, rfci:6;
uint8_t header_crc:6, payload_crc_hi:2;
uint8_t payload_crc_lo;
uint8_t payload[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.2 */
struct iuup_pdutype1_hdr {
#if OSMO_IS_LITTLE_ENDIAN
/* control part */
uint8_t frame_nr:4,
pdu_type:4;
uint8_t rfci:6,
fqc:2;
/* checksum part */
uint8_t spare:2,
header_crc:6;
/* payload part */
uint8_t payload[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t pdu_type:4, frame_nr:4;
uint8_t fqc:2, rfci:6;
uint8_t header_crc:6, spare:2;
uint8_t payload[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.3 */
struct iuup_pdutype14_hdr {
#if OSMO_IS_LITTLE_ENDIAN
/* control part */
uint8_t frame_nr:2,
ack_nack:2,
pdu_type:4;
uint8_t proc_ind:4,
mode_version:4;
/* checksum part */
uint8_t payload_crc_hi:2, header_crc:6;
uint8_t payload_crc_lo;
/* payload part */
uint8_t payload[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t pdu_type:4, ack_nack:2, frame_nr:2;
uint8_t mode_version:4, proc_ind:4;
uint8_t header_crc:6, payload_crc_hi:2;
uint8_t payload_crc_lo;
uint8_t payload[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.3.4.1 */
struct iuup_ctrl_init_rfci_hdr {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t rfci:6,
li:1,
lri:1;
uint8_t subflow_length[0]; /* 1 or 2 bytes depending on li */
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t lri:1, li:1, rfci:6;
uint8_t subflow_length[0];
#endif
} __attribute__((packed));
struct iuup_ctrl_init_hdr {
#if OSMO_IS_LITTLE_ENDIAN
uint8_t chain_ind:1,
num_subflows_per_rfci:3,
ti:1,
spare:3;
uint8_t rfci_data[0]; /* struct iuup_ctrl_init_rfci_hdr* */
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint8_t spare:3, ti:1, num_subflows_per_rfci:3, chain_ind:1;
uint8_t rfci_data[0]; /* struct iuup_ctrl_init_rfci_hdr* */
;
#endif
} __attribute__((packed));
struct iuup_ctrl_init_tail {
#if OSMO_IS_LITTLE_ENDIAN
uint16_t versions_supported;
uint8_t spare:4,
data_pdu_type:4;
uint8_t spare_extension[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
uint16_t versions_supported;
uint8_t data_pdu_type:4, spare:4;
uint8_t spare_extension[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.3.4.4 */
struct iuup_ctrl_error_event {
#if OSMO_IS_LITTLE_ENDIAN
struct iuup_pdutype14_hdr hdr;
uint8_t error_cause:6,
error_distance:2;
uint8_t spare_extension[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct iuup_pdutype14_hdr hdr;
uint8_t error_distance:2, error_cause:6;
uint8_t spare_extension[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.3.2 */
struct iuup_ctrl_ack {
struct iuup_pdutype14_hdr hdr;
uint8_t spare_extension[0];
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2.3.3 */
struct iuup_ctrl_nack {
#if OSMO_IS_LITTLE_ENDIAN
struct iuup_pdutype14_hdr hdr;
uint8_t spare:2,
error_cause:6;
uint8_t spare_extension[0];
#elif OSMO_IS_BIG_ENDIAN
/* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */
struct iuup_pdutype14_hdr hdr;
uint8_t error_cause:6, spare:2;
uint8_t spare_extension[0];
#endif
} __attribute__((packed));
/* 3GPP TS 25.415 Section 6.6.2 + 6.6.3.1 */
enum iuup_pdu_type {
IUUP_PDU_T_DATA_CRC = 0,
IUUP_PDU_T_DATA_NOCRC = 1,
IUUP_PDU_T_CONTROL = 14,
};
/* 3GPP TS 25.415 Section 6.6.3.2 */
enum iuup_ack_nack {
IUUP_AN_PROCEDURE = 0,
IUUP_AN_ACK = 1,
IUUP_AN_NACK = 2,
};
/* 3GPP TS 25.415 Section 6.6.3.5 */
enum iuup_fqc {
IUUP_FQC_FRAME_GOOD = 0,
IUUP_FQC_FRAME_BAD = 1,
IUUP_FQC_FRAME_BAD_RADIO = 2,
};
/* 3GPP TS 25.415 Section 6.6.3.7 */
enum iuup_procedure {
IUUP_PROC_INIT = 0,
IUUP_PROC_RATE_CTRL = 1,
IUUP_PROC_TIME_ALIGN = 2,
IUUP_PROC_ERR_EVENT = 3,
};
/* 3GPP TS 25.415 Section 6.6.3.15 */
enum iuup_error_distance {
IUUP_ERR_DIST_LOCAL = 0,
IUUP_ERR_DIST_FIRST_FWD = 1,
IUUP_ERR_DIST_SECOND_FWD = 2,
IUUP_ERR_DIST_RESERVED = 3,
};
/* 3GPP TS 25.415 Section 6.6.3.16 */
enum iuup_error_cause {
IUUP_ERR_CAUSE_CRC_ERR_HDR = 0,
IUUP_ERR_CAUSE_CRC_ERR_DATA = 1,
IUUP_ERR_CAUSE_UNEXPECTED_FN = 2,
IUUP_ERR_CAUSE_FRAME_LOSS = 3,
IUUP_ERR_CAUSE_UNKNOWN_PDUTYPE = 4,
IUUP_ERR_CAUSE_UNKNOWN_PROC = 5,
IUUP_ERR_CAUSE_UNKNNOWN_RES_VAL = 6,
IUUP_ERR_CAUSE_UNKNNOWN_FIELD = 7,
IUUP_ERR_CAUSE_FRAME_TOO_SHORT = 8,
IUUP_ERR_CAUSE_MISSING_FIELDS = 9,
IUUP_ERR_CAUSE_UNEXPECTED_PDU_T = 16,
IUUP_ERR_CAUSE_UNEXPECTED_PROC = 18,
IUUP_ERR_CAUSE_UNEXPECTED_RFCI = 19,
IUUP_ERR_CAUSE_UNEXPECTED_VALUE = 20,
IUUP_ERR_CAUSE_INIT_FAILURE = 42,
IUUP_ERR_CAUSE_INIT_FAILURE_NET_TMR = 43,
IUUP_ERR_CAUSE_INIT_FAILURE_REP_NACK = 44,
IUUP_ERR_CAUSE_RATE_CTRL_FAILURE = 45,
IUUP_ERR_CAUSE_ERR_EVENT_FAIL = 46,
IUUP_ERR_CAUSE_TIME_ALIGN_NOTSUPP = 47,
IUUP_ERR_CAUSE_REQ_TIME_ALIGN_NOTPOSS = 48,
IUUP_ERR_CAUSE_MODE_VERSION_NOT_SUPPORTED = 49,
};
endian.h
pdu_type
uint8_t pdu_type
hdr
struct iuup_pdutype14_hdr hdr
Definition gsm_25_415.h:0
iuup_pdu_type
iuup_pdu_type
Definition gsm_25_415.h:160
IUUP_PDU_T_DATA_CRC
@ IUUP_PDU_T_DATA_CRC
Definition gsm_25_415.h:161
IUUP_PDU_T_DATA_NOCRC
@ IUUP_PDU_T_DATA_NOCRC
Definition gsm_25_415.h:162
IUUP_PDU_T_CONTROL
@ IUUP_PDU_T_CONTROL
Definition gsm_25_415.h:163
__attribute__
enum iuup_pdu_type __attribute__
iuup_error_distance
iuup_error_distance
Definition gsm_25_415.h:190
IUUP_ERR_DIST_SECOND_FWD
@ IUUP_ERR_DIST_SECOND_FWD
Definition gsm_25_415.h:193
IUUP_ERR_DIST_RESERVED
@ IUUP_ERR_DIST_RESERVED
Definition gsm_25_415.h:194
IUUP_ERR_DIST_LOCAL
@ IUUP_ERR_DIST_LOCAL
Definition gsm_25_415.h:191
IUUP_ERR_DIST_FIRST_FWD
@ IUUP_ERR_DIST_FIRST_FWD
Definition gsm_25_415.h:192
iuup_error_cause
iuup_error_cause
Definition gsm_25_415.h:199
IUUP_ERR_CAUSE_UNKNOWN_PROC
@ IUUP_ERR_CAUSE_UNKNOWN_PROC
Definition gsm_25_415.h:205
IUUP_ERR_CAUSE_REQ_TIME_ALIGN_NOTPOSS
@ IUUP_ERR_CAUSE_REQ_TIME_ALIGN_NOTPOSS
Definition gsm_25_415.h:220
IUUP_ERR_CAUSE_ERR_EVENT_FAIL
@ IUUP_ERR_CAUSE_ERR_EVENT_FAIL
Definition gsm_25_415.h:218
IUUP_ERR_CAUSE_INIT_FAILURE_REP_NACK
@ IUUP_ERR_CAUSE_INIT_FAILURE_REP_NACK
Definition gsm_25_415.h:216
IUUP_ERR_CAUSE_UNKNNOWN_RES_VAL
@ IUUP_ERR_CAUSE_UNKNNOWN_RES_VAL
Definition gsm_25_415.h:206
IUUP_ERR_CAUSE_UNEXPECTED_PDU_T
@ IUUP_ERR_CAUSE_UNEXPECTED_PDU_T
Definition gsm_25_415.h:210
IUUP_ERR_CAUSE_UNEXPECTED_FN
@ IUUP_ERR_CAUSE_UNEXPECTED_FN
Definition gsm_25_415.h:202
IUUP_ERR_CAUSE_MODE_VERSION_NOT_SUPPORTED
@ IUUP_ERR_CAUSE_MODE_VERSION_NOT_SUPPORTED
Definition gsm_25_415.h:221
IUUP_ERR_CAUSE_FRAME_LOSS
@ IUUP_ERR_CAUSE_FRAME_LOSS
Definition gsm_25_415.h:203
IUUP_ERR_CAUSE_UNEXPECTED_RFCI
@ IUUP_ERR_CAUSE_UNEXPECTED_RFCI
Definition gsm_25_415.h:212
IUUP_ERR_CAUSE_RATE_CTRL_FAILURE
@ IUUP_ERR_CAUSE_RATE_CTRL_FAILURE
Definition gsm_25_415.h:217
IUUP_ERR_CAUSE_UNEXPECTED_VALUE
@ IUUP_ERR_CAUSE_UNEXPECTED_VALUE
Definition gsm_25_415.h:213
IUUP_ERR_CAUSE_MISSING_FIELDS
@ IUUP_ERR_CAUSE_MISSING_FIELDS
Definition gsm_25_415.h:209
IUUP_ERR_CAUSE_TIME_ALIGN_NOTSUPP
@ IUUP_ERR_CAUSE_TIME_ALIGN_NOTSUPP
Definition gsm_25_415.h:219
IUUP_ERR_CAUSE_UNKNOWN_PDUTYPE
@ IUUP_ERR_CAUSE_UNKNOWN_PDUTYPE
Definition gsm_25_415.h:204
IUUP_ERR_CAUSE_CRC_ERR_HDR
@ IUUP_ERR_CAUSE_CRC_ERR_HDR
Definition gsm_25_415.h:200
IUUP_ERR_CAUSE_UNEXPECTED_PROC
@ IUUP_ERR_CAUSE_UNEXPECTED_PROC
Definition gsm_25_415.h:211
IUUP_ERR_CAUSE_INIT_FAILURE
@ IUUP_ERR_CAUSE_INIT_FAILURE
Definition gsm_25_415.h:214
IUUP_ERR_CAUSE_UNKNNOWN_FIELD
@ IUUP_ERR_CAUSE_UNKNNOWN_FIELD
Definition gsm_25_415.h:207
IUUP_ERR_CAUSE_FRAME_TOO_SHORT
@ IUUP_ERR_CAUSE_FRAME_TOO_SHORT
Definition gsm_25_415.h:208
IUUP_ERR_CAUSE_INIT_FAILURE_NET_TMR
@ IUUP_ERR_CAUSE_INIT_FAILURE_NET_TMR
Definition gsm_25_415.h:215
IUUP_ERR_CAUSE_CRC_ERR_DATA
@ IUUP_ERR_CAUSE_CRC_ERR_DATA
Definition gsm_25_415.h:201
iuup_procedure
iuup_procedure
Definition gsm_25_415.h:181
IUUP_PROC_INIT
@ IUUP_PROC_INIT
Definition gsm_25_415.h:182
IUUP_PROC_RATE_CTRL
@ IUUP_PROC_RATE_CTRL
Definition gsm_25_415.h:183
IUUP_PROC_ERR_EVENT
@ IUUP_PROC_ERR_EVENT
Definition gsm_25_415.h:185
IUUP_PROC_TIME_ALIGN
@ IUUP_PROC_TIME_ALIGN
Definition gsm_25_415.h:184
iuup_fqc
iuup_fqc
Definition gsm_25_415.h:174
IUUP_FQC_FRAME_BAD
@ IUUP_FQC_FRAME_BAD
Definition gsm_25_415.h:176
IUUP_FQC_FRAME_GOOD
@ IUUP_FQC_FRAME_GOOD
Definition gsm_25_415.h:175
IUUP_FQC_FRAME_BAD_RADIO
@ IUUP_FQC_FRAME_BAD_RADIO
Definition gsm_25_415.h:177
spare_extension
uint8_t spare_extension[0]
Definition gsm_25_415.h:1
iuup_ack_nack
iuup_ack_nack
Definition gsm_25_415.h:167
IUUP_AN_NACK
@ IUUP_AN_NACK
Definition gsm_25_415.h:170
IUUP_AN_PROCEDURE
@ IUUP_AN_PROCEDURE
Definition gsm_25_415.h:168
IUUP_AN_ACK
@ IUUP_AN_ACK
Definition gsm_25_415.h:169
iuup_ctrl_ack
Definition gsm_25_415.h:139
iuup_ctrl_ack::spare_extension
uint8_t spare_extension[0]
Definition gsm_25_415.h:141
iuup_ctrl_ack::hdr
struct iuup_pdutype14_hdr hdr
Definition gsm_25_415.h:140
iuup_ctrl_error_event
Definition gsm_25_415.h:124
iuup_ctrl_init_hdr
Definition gsm_25_415.h:95
iuup_ctrl_init_rfci_hdr
Definition gsm_25_415.h:83
iuup_ctrl_init_tail
Definition gsm_25_415.h:109
iuup_ctrl_nack
Definition gsm_25_415.h:145
iuup_pdutype0_hdr
Definition gsm_25_415.h:13
iuup_pdutype14_hdr
Definition gsm_25_415.h:59
iuup_pdutype1_hdr
Definition gsm_25_415.h:37