Add header file with definitions for GSM TS 04.14 / 3GPP TS 44.014

Change-Id: I1f4fc2761b55a4f83544c1c3793ab67fec9fc120
This commit is contained in:
Harald Welte 2017-05-29 15:58:43 +02:00
parent dee7172689
commit 2956737681
5 changed files with 125 additions and 1 deletions

View File

@ -99,6 +99,7 @@ nobase_include_HEADERS = \
osmocom/gsm/protocol/gsm_04_08_gprs.h \
osmocom/gsm/protocol/gsm_04_11.h \
osmocom/gsm/protocol/gsm_04_12.h \
osmocom/gsm/protocol/gsm_04_14.h \
osmocom/gsm/protocol/gsm_04_80.h \
osmocom/gsm/protocol/gsm_08_08.h \
osmocom/gsm/protocol/gsm_08_58.h \

View File

@ -0,0 +1,101 @@
#pragma once
#include <stdint.h>
#include <osmocom/core/endian.h>
#include <osmocom/core/utils.h>
/* According to 3GPP TS 44.014 / GSM TS 04.14 */
#define GSM414_MT_CLOSE_TCH_LOOP_CMD 0x00 /* 8.1 */
enum gsm414_tch_loop_mode {
GSM414_LOOP_A = 0x00,
GSM414_LOOP_B = 0x01,
GSM414_LOOP_C = 0x02,
GSM414_LOOP_D = 0x04,
GSM414_LOOP_E = 0x08,
GSM414_LOOP_F = 0x0c,
GSM414_LOOP_I = 0x1c,
};
#define GSM414_MT_CLOSE_TCH_LOOP_ACK 0x01 /* 8.2 */
#define GSM414_MT_OPEN_LOOP_CMD 0x02 /* 8.3 */
#define GSM414_OPEN_LOOP_ACK_IE 0x81
#define GSM414_MT_CLOSE_MSLOT_LOOP_CMD 0x20 /* 8.4 */
struct gsm414_close_mslot_loop_cmd {
#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t chc:2,
loop_mech:3,
tn:3;
#else
uint8_t tn:3,
loop_mech:3,
chc:2;
#endif
} __attribute__((packed));
#define GSM414_MT_CLOSE_MSLOT_LOOP_ACK 0x21 /* 8.5 */
struct gsm414_close_mslot_loop_ack {
#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t err_ind:1,
loop_mech:3,
chc:2,
spare:2;
#else
uint8_t spare:2,
chc:2,
loop_mech:3,
err_ind:1;
#endif
} __attribute__((packed));
#define GSM414_MT_OPEN_MSLOT_LOOP_CMD 0x22 /* 8.6 */
#define GSM414_MT_OPEN_MSLOT_LOOP_ACK 0x23 /* 8.7 */
#define GSM414_MT_ACT_EMMI_CMD 0x0c /* 8.8 */
#define GSM414_MT_ACT_EMMI_ACK 0x0d /* 8.9 */
#define GSM414_MT_DEACT_EMMI_CMD 0x80 /* 8.10 */
#define GSM414_MT_TEST_INTERFACE 0x84 /* 8.11 */
/* 8.12 Timers (milli-seconds) */
#define GSM414_TT01_MS 2500
#define GSM414_TT02_MS 2500
#define GSM414_TT03_MS 50
#define GSM414_MT_GPRS_TEST_MODE_CMD 0x24 /* 8.13 */
struct gsm414_gprs_test_mode_cmd {
#if OSMO_IS_LITTLE_ENDIAN == 1
uint16_t d:12,
spare:3,
l:1;
uint8_t m:1,
dl_tx_offset:3,
_spare:4;
#else
uint16_t l:1,
spare:3,
d:12;
uint8_t _spare:4,
dl_tx_offset:3,
m:1;
#endif
} __attribute__((packed));
#define GSM414_MT_EGPRS_ST_RB_LOOP_CMD 0x25 /* 8.14 */
struct gsm414_egprs_st_sb_loop_cmd {
#if OSMO_IS_LITTLE_ENDIAN == 1
uint8_t _spare:4,
dl_tx_offset:3,
m:1;
#else
uint8_t m:1,
dl_tx_offset:3,
_spare:4;
#endif
} __attribute__((packed));
#define GSM414_MT_RESET_MS_POS_STORED 0x26 /* 8.15 */
#define GSM414_MS_POS_TECH_AGPS 0x00
#define GSM414_MS_POS_TECH_AGNSS 0x01
extern const struct value_string gsm414_msgt_names[];

View File

@ -23,7 +23,7 @@ BUILT_SOURCES = gsm0503_conv.c
libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm0808.c sysinfo.c \
gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c gsm0502.c \
gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c \
gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \
lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \
auth_core.c auth_comp128v1.c auth_comp128v23.c \
auth_milenage.c milenage/aes-encblock.c gea.c \

20
src/gsm/gsm0414.c Normal file
View File

@ -0,0 +1,20 @@
#include <osmocom/gsm/protocol/gsm_04_14.h>
#include <osmocom/core/utils.h>
const struct value_string gsm414_msgt_names[] = {
{ GSM414_MT_CLOSE_TCH_LOOP_CMD, "CLOSE_TCH_LOOP_CMD" },
{ GSM414_MT_CLOSE_TCH_LOOP_ACK, "CLOSE_TCH_LOOP_ACK" },
{ GSM414_MT_OPEN_LOOP_CMD, "OPEN_LOOP_CMD" },
{ GSM414_MT_CLOSE_MSLOT_LOOP_CMD, "CLOSE_MSLOT_LOOP_CMD" },
{ GSM414_MT_CLOSE_MSLOT_LOOP_ACK, "CLOSE_MSLOT_LOOP_ACK" },
{ GSM414_MT_OPEN_MSLOT_LOOP_CMD, "OPEN_MSLOT_LOOP_CMD" },
{ GSM414_MT_OPEN_MSLOT_LOOP_ACK, "OPEN_MSLOT_LOOP_ACK" },
{ GSM414_MT_ACT_EMMI_CMD, "ACT_EMMI_CMD" },
{ GSM414_MT_ACT_EMMI_ACK, "ACT_EMMI_ACK" },
{ GSM414_MT_DEACT_EMMI_CMD, "DEACT_EMMI_CMD" },
{ GSM414_MT_TEST_INTERFACE, "TEST_INTERFACE" },
{ GSM414_MT_GPRS_TEST_MODE_CMD, "GPRS_TEST_MODE_CMD" },
{ GSM414_MT_EGPRS_ST_RB_LOOP_CMD, "EGPRS_START_RB_LOOP_CMD" },
{ GSM414_MT_RESET_MS_POS_STORED, "RESET_MS_POS_STORED" },
{ 0, NULL }
};

View File

@ -188,6 +188,8 @@ gsm411_unbcdify;
gsm411_cp_cause_strs;
gsm411_rp_cause_strs;
gsm414_msgt_names;
gsm48_att_tlvdef;
gsm48_cc_msg_name;
gsm48_rr_msg_name;