summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-04-20 17:11:43 +0200
committerHarald Welte <laforge@gnumonks.org>2016-04-29 13:10:37 +0200
commit53373bca8f9fe79ca981f9fc1ef644586bd5c3b2 (patch)
treef3a6886fb869070b1982e8ad3aa396c87cbb2046
parent121e9a4164e65dfb68b2bf09297a8537a2f659c5 (diff)
move gsm_04_08_gprs.h to libosmocore
This requres the corresponding commit in libosmocore.
-rw-r--r--openbsc/include/openbsc/Makefile.am2
-rw-r--r--openbsc/include/openbsc/gprs_gsup_messages.h3
-rw-r--r--openbsc/include/openbsc/gsm_04_08_gprs.h397
-rw-r--r--openbsc/include/openbsc/oap_messages.h2
-rw-r--r--openbsc/src/gprs/Makefile.am2
-rw-r--r--openbsc/src/gprs/gb_proxy.c2
-rw-r--r--openbsc/src/gprs/gb_proxy_patch.c1
-rw-r--r--openbsc/src/gprs/gb_proxy_peer.c1
-rw-r--r--openbsc/src/gprs/gprs_gb_parse.c2
-rw-r--r--openbsc/src/gprs/gprs_gmm.c2
-rw-r--r--openbsc/src/gprs/gprs_sgsn.c2
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c1
-rw-r--r--openbsc/src/gprs/gprs_utils.c2
-rw-r--r--openbsc/src/gprs/gsm_04_08_gprs.c141
-rw-r--r--openbsc/src/gprs/sgsn_auth.c2
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c2
-rw-r--r--openbsc/src/gprs/sgsn_vty.c2
-rw-r--r--openbsc/tests/gbproxy/gbproxy_test.c2
-rw-r--r--openbsc/tests/oap/Makefile.am1
-rw-r--r--openbsc/tests/sgsn/Makefile.am1
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c1
21 files changed, 14 insertions, 557 deletions
diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am
index d42f775d9..631a74e5e 100644
--- a/openbsc/include/openbsc/Makefile.am
+++ b/openbsc/include/openbsc/Makefile.am
@@ -8,7 +8,7 @@ noinst_HEADERS = abis_nm.h abis_rsl.h db.h gsm_04_08.h gsm_data.h \
vty.h socket.h e1_config.h trau_upqueue.h token_auth.h \
handover_decision.h rrlp.h \
crc24.h gprs_llc.h gprs_gmm.h \
- gb_proxy.h gprs_sgsn.h gsm_04_08_gprs.h sgsn.h \
+ gb_proxy.h gprs_sgsn.h sgsn.h \
auth.h osmo_msc.h bsc_msc.h bsc_nat.h \
osmo_bsc_rf.h osmo_bsc.h network_listen.h bsc_nat_sccp.h \
osmo_msc_data.h osmo_bsc_grace.h sms_queue.h abis_om2000.h \
diff --git a/openbsc/include/openbsc/gprs_gsup_messages.h b/openbsc/include/openbsc/gprs_gsup_messages.h
index 66a75a801..c4e97570c 100644
--- a/openbsc/include/openbsc/gprs_gsup_messages.h
+++ b/openbsc/include/openbsc/gprs_gsup_messages.h
@@ -22,8 +22,7 @@
#pragma once
#include <stdint.h>
-#include <openbsc/gsm_04_08_gprs.h>
-#include <openbsc/gsm_data.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
/* Needed for GSM_IMSI_LENGTH: */
#include <openbsc/gsm_subscriber.h>
diff --git a/openbsc/include/openbsc/gsm_04_08_gprs.h b/openbsc/include/openbsc/gsm_04_08_gprs.h
deleted file mode 100644
index f35d11b60..000000000
--- a/openbsc/include/openbsc/gsm_04_08_gprs.h
+++ /dev/null
@@ -1,397 +0,0 @@
-#ifndef _GSM48_GPRS_H
-#define _GSM48_GPRS_H
-
-#include <stdint.h>
-#include <osmocom/gsm/protocol/gsm_04_08.h>
-
-/* Table 10.4 / 10.4a, GPRS Mobility Management (GMM) */
-#define GSM48_MT_GMM_ATTACH_REQ 0x01
-#define GSM48_MT_GMM_ATTACH_ACK 0x02
-#define GSM48_MT_GMM_ATTACH_COMPL 0x03
-#define GSM48_MT_GMM_ATTACH_REJ 0x04
-#define GSM48_MT_GMM_DETACH_REQ 0x05
-#define GSM48_MT_GMM_DETACH_ACK 0x06
-
-#define GSM48_MT_GMM_RA_UPD_REQ 0x08
-#define GSM48_MT_GMM_RA_UPD_ACK 0x09
-#define GSM48_MT_GMM_RA_UPD_COMPL 0x0a
-#define GSM48_MT_GMM_RA_UPD_REJ 0x0b
-
-#define GSM48_MT_GMM_PTMSI_REALL_CMD 0x10
-#define GSM48_MT_GMM_PTMSI_REALL_COMPL 0x11
-#define GSM48_MT_GMM_AUTH_CIPH_REQ 0x12
-#define GSM48_MT_GMM_AUTH_CIPH_RESP 0x13
-#define GSM48_MT_GMM_AUTH_CIPH_REJ 0x14
-#define GSM48_MT_GMM_ID_REQ 0x15
-#define GSM48_MT_GMM_ID_RESP 0x16
-#define GSM48_MT_GMM_STATUS 0x20
-#define GSM48_MT_GMM_INFO 0x21
-
-/* Table 10.4a, GPRS Session Management (GSM) */
-#define GSM48_MT_GSM_ACT_PDP_REQ 0x41
-#define GSM48_MT_GSM_ACT_PDP_ACK 0x42
-#define GSM48_MT_GSM_ACT_PDP_REJ 0x43
-#define GSM48_MT_GSM_REQ_PDP_ACT 0x44
-#define GSM48_MT_GSM_REQ_PDP_ACT_REJ 0x45
-#define GSM48_MT_GSM_DEACT_PDP_REQ 0x46
-#define GSM48_MT_GSM_DEACT_PDP_ACK 0x47
-#define GSM48_MT_GSM_ACT_AA_PDP_REQ 0x50
-#define GSM48_MT_GSM_ACT_AA_PDP_ACK 0x51
-#define GSM48_MT_GSM_ACT_AA_PDP_REJ 0x52
-#define GSM48_MT_GSM_DEACT_AA_PDP_REQ 0x53
-#define GSM48_MT_GSM_DEACT_AA_PDP_ACK 0x54
-#define GSM48_MT_GSM_STATUS 0x55
-
-/* Chapter 10.5.5.2 / Table 10.5.135 */
-#define GPRS_ATT_T_ATTACH 1
-#define GPRS_ATT_T_ATT_WHILE_IMSI 2
-#define GPRS_ATT_T_COMBINED 3
-
-extern const struct value_string *gprs_att_t_strs;
-
-/* Chapter 10.5.5.5 / Table 10.5.138 */
-#define GPRS_DET_T_MO_GPRS 1
-#define GPRS_DET_T_MO_IMSI 2
-#define GPRS_DET_T_MO_COMBINED 3
-/* Network to MS direction */
-#define GPRS_DET_T_MT_REATT_REQ 1
-#define GPRS_DET_T_MT_REATT_NOTREQ 2
-#define GPRS_DET_T_MT_IMSI 3
-
-extern const struct value_string *gprs_det_t_mo_strs;
-extern const struct value_string *gprs_det_t_mt_strs;
-
-/* Chapter 10.5.5.18 / Table 105.150 */
-#define GPRS_UPD_T_RA 0
-#define GPRS_UPD_T_RA_LA 1
-#define GPRS_UPD_T_RA_LA_IMSI_ATT 2
-#define GPRS_UPD_T_PERIODIC 3
-
-extern const struct value_string *gprs_upd_t_strs;
-
-enum gsm48_gprs_ie_mm {
- GSM48_IE_GMM_CIPH_CKSN = 0x08, /* 10.5.1.2 */
- GSM48_IE_GMM_TIMER_READY = 0x17, /* 10.5.7.3 */
- GSM48_IE_GMM_ALLOC_PTMSI = 0x18, /* 10.5.1.4 */
- GSM48_IE_GMM_PTMSI_SIG = 0x19, /* 10.5.5.8 */
- GSM48_IE_GMM_AUTH_RAND = 0x21, /* 10.5.3.1 */
- GSM48_IE_GMM_AUTH_SRES = 0x22, /* 10.5.3.2 */
- GSM48_IE_GMM_IMEISV = 0x23, /* 10.5.1.4 */
- GSM48_IE_GMM_CAUSE = 0x25, /* 10.5.5.14 */
- GSM48_IE_GMM_DRX_PARAM = 0x27, /* 10.5.5.6 */
- GSM48_IE_GMM_MS_NET_CAPA = 0x31, /* 10.5.5.12 */
- GSM48_IE_GMM_PDP_CTX_STATUS = 0x32, /* 10.5.7.1 */
- GSM48_IE_GMM_PS_LCS_CAPA = 0x33, /* 10.5.5.22 */
- GSM48_IE_GMM_GMM_MBMS_CTX_ST = 0x35, /* 10.5.7.6 */
-};
-
-enum gsm48_gprs_ie_sm {
- GSM48_IE_GSM_APN = 0x28, /* 10.5.6.1 */
- GSM48_IE_GSM_PROTO_CONF_OPT = 0x27, /* 10.5.6.3 */
- GSM48_IE_GSM_PDP_ADDR = 0x2b, /* 10.5.6.4 */
- GSM48_IE_GSM_AA_TMR = 0x29, /* 10.5.7.3 */
- GSM48_IE_GSM_NAME_FULL = 0x43, /* 10.5.3.5a */
- GSM48_IE_GSM_NAME_SHORT = 0x45, /* 10.5.3.5a */
- GSM48_IE_GSM_TIMEZONE = 0x46, /* 10.5.3.8 */
- GSM48_IE_GSM_UTC_AND_TZ = 0x47, /* 10.5.3.9 */
- GSM48_IE_GSM_LSA_ID = 0x48, /* 10.5.3.11 */
-
- /* Fake IEs that are not present on the Layer3 air interface,
- * but which we use to simplify internal APIs */
- OSMO_IE_GSM_REQ_QOS = 0xfd,
- OSMO_IE_GSM_REQ_PDP_ADDR = 0xfe,
- OSMO_IE_GSM_SUB_QOS = 0xff,
-};
-
-/* Chapter 9.4.15 / Table 9.4.15 */
-struct gsm48_ra_upd_ack {
- uint8_t force_stby:4, /* 10.5.5.7 */
- upd_result:4; /* 10.5.5.17 */
- uint8_t ra_upd_timer; /* 10.5.7.3 */
- struct gsm48_ra_id ra_id; /* 10.5.5.15 */
- uint8_t data[0];
-} __attribute__((packed));
-
-/* Chapter 10.5.7.3 */
-enum gsm48_gprs_tmr_unit {
- GPRS_TMR_2SECONDS = 0 << 5,
- GPRS_TMR_MINUTE = 1 << 5,
- GPRS_TMR_6MINUTE = 2 << 5,
- GPRS_TMR_DEACTIVATED = 7 << 5,
-};
-
-#define GPRS_TMR_UNIT_MASK (7 << 5)
-#define GPRS_TMR_FACT_MASK ((1 << 5)-1)
-
-/* Chapter 9.4.2 / Table 9.4.2 */
-struct gsm48_attach_ack {
- uint8_t att_result:4, /* 10.5.5.7 */
- force_stby:4; /* 10.5.5.1 */
- uint8_t ra_upd_timer; /* 10.5.7.3 */
- uint8_t radio_prio; /* 10.5.7.2 */
- struct gsm48_ra_id ra_id; /* 10.5.5.15 */
- uint8_t data[0];
-} __attribute__((packed));
-
-/* Chapter 9.4.9 / Table 9.4.9 */
-struct gsm48_auth_ciph_req {
- uint8_t ciph_alg:4, /* 10.5.5.3 */
- imeisv_req:4; /* 10.5.5.10 */
- uint8_t force_stby:4, /* 10.5.5.7 */
- ac_ref_nr:4; /* 10.5.5.19 */
- uint8_t data[0];
-} __attribute__((packed));
-/* optional: TV RAND, TV CKSN */
-
-struct gsm48_auth_ciph_resp {
- uint8_t ac_ref_nr:4,
- spare:4;
- uint8_t data[0];
-} __attribute__((packed));
-
-/* Chapter 9.5.1 / Table 9.5.1 */
-struct gsm48_act_pdp_ctx_req {
- uint8_t req_nsapi;
- uint8_t req_llc_sapi;
- uint8_t data[0];
-} __attribute__((packed));
-
-/* Chapter 10.5.5.14 / Table 10.5.147 */
-enum gsm48_gmm_cause {
- GMM_CAUSE_IMSI_UNKNOWN = 0x02,
- GMM_CAUSE_ILLEGAL_MS = 0x03,
- GMM_CAUSE_ILLEGAL_ME = 0x06,
- GMM_CAUSE_GPRS_NOTALLOWED = 0x07,
- GMM_CAUSE_GPRS_OTHER_NOTALLOWED = 0x08,
- GMM_CAUSE_MS_ID_NOT_DERIVED = 0x09,
- GMM_CAUSE_IMPL_DETACHED = 0x0a,
- GMM_CAUSE_PLMN_NOTALLOWED = 0x0b,
- GMM_CAUSE_LA_NOTALLOWED = 0x0c,
- GMM_CAUSE_ROAMING_NOTALLOWED = 0x0d,
- GMM_CAUSE_NO_GPRS_PLMN = 0x0e,
- GMM_CAUSE_MSC_TEMP_NOTREACH = 0x10,
- GMM_CAUSE_NET_FAIL = 0x11,
- GMM_CAUSE_CONGESTION = 0x16,
- GMM_CAUSE_SEM_INCORR_MSG = 0x5f,
- GMM_CAUSE_INV_MAND_INFO = 0x60,
- GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL = 0x61,
- GMM_CAUSE_MSGT_INCOMP_P_STATE = 0x62,
- GMM_CAUSE_IE_NOTEXIST_NOTIMPL = 0x63,
- GMM_CAUSE_COND_IE_ERR = 0x64,
- GMM_CAUSE_MSG_INCOMP_P_STATE = 0x65,
- GMM_CAUSE_PROTO_ERR_UNSPEC = 0x6f,
-};
-
-extern const struct value_string *gsm48_gmm_cause_names;
-
-/* Chapter 10.4.6.6 / Table 10.5.157 */
-enum gsm48_gsm_cause {
- GSM_CAUSE_INSUFF_RSRC = 0x1a,
- GSM_CAUSE_MISSING_APN = 0x1b,
- GSM_CAUSE_UNKNOWN_PDP = 0x1c,
- GSM_CAUSE_AUTH_FAILED = 0x1d,
- GSM_CAUSE_ACT_REJ_GGSN = 0x1e,
- GSM_CAUSE_ACT_REJ_UNSPEC = 0x1f,
- GSM_CAUSE_SERV_OPT_NOTSUPP = 0x20,
- GSM_CAUSE_REQ_SERV_OPT_NOTSUB = 0x21,
- GSM_CAUSE_SERV_OPT_TEMP_OOO = 0x22,
- GSM_CAUSE_NSAPI_IN_USE = 0x23,
- GSM_CAUSE_DEACT_REGULAR = 0x24,
- GSM_CAUSE_QOS_NOT_ACCEPTED = 0x25,
- GSM_CAUSE_NET_FAIL = 0x26,
- GSM_CAUSE_REACT_RQD = 0x27,
- GSM_CAUSE_FEATURE_NOTSUPP = 0x28,
- GSM_CAUSE_INVALID_TRANS_ID = 0x51,
- GSM_CAUSE_SEM_INCORR_MSG = 0x5f,
- GSM_CAUSE_INV_MAND_INFO = 0x60,
- GSM_CAUSE_MSGT_NOTEXIST_NOTIMPL = 0x61,
- GSM_CAUSE_MSGT_INCOMP_P_STATE = 0x62,
- GSM_CAUSE_IE_NOTEXIST_NOTIMPL = 0x63,
- GSM_CAUSE_COND_IE_ERR = 0x64,
- GSM_CAUSE_MSG_INCOMP_P_STATE = 0x65,
- GSM_CAUSE_PROTO_ERR_UNSPEC = 0x6f,
-};
-
-extern const struct value_string *gsm48_gsm_cause_names;
-
-/* Section 6.1.2.2: Session management states on the network side */
-enum gsm48_pdp_state {
- PDP_S_INACTIVE,
- PDP_S_ACTIVE_PENDING,
- PDP_S_ACTIVE,
- PDP_S_INACTIVE_PENDING,
- PDP_S_MODIFY_PENDING,
-};
-
-/* Table 10.5.155/3GPP TS 24.008 */
-enum gsm48_pdp_type_org {
- PDP_TYPE_ORG_ETSI = 0x00,
- PDP_TYPE_ORG_IETF = 0x01,
-};
-enum gsm48_pdp_type_nr {
- PDP_TYPE_N_ETSI_RESERVED = 0x00,
- PDP_TYPE_N_ETSI_PPP = 0x01,
- PDP_TYPE_N_IETF_IPv4 = 0x21,
- PDP_TYPE_N_IETF_IPv6 = 0x57,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_reliab_class {
- GSM48_QOS_RC_LLC_ACK_RLC_ACK_DATA_PROT = 2,
- GSM48_QOS_RC_LLC_UN_RLC_ACK_DATA_PROT = 3,
- GSM48_QOS_RC_LLC_UN_RLC_UN_PROT_DATA = 4,
- GSM48_QOS_RC_LLC_UN_RLC_UN_DATA_UN = 5,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_preced_class {
- GSM48_QOS_PC_HIGH = 1,
- GSM48_QOS_PC_NORMAL = 2,
- GSM48_QOS_PC_LOW = 3,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_peak_tput {
- GSM48_QOS_PEAK_TPUT_1000bps = 1,
- GSM48_QOS_PEAK_TPUT_2000bps = 2,
- GSM48_QOS_PEAK_TPUT_4000bps = 3,
- GSM48_QOS_PEAK_TPUT_8000bps = 4,
- GSM48_QOS_PEAK_TPUT_16000bps = 5,
- GSM48_QOS_PEAK_TPUT_32000bps = 6,
- GSM48_QOS_PEAK_TPUT_64000bps = 7,
- GSM48_QOS_PEAK_TPUT_128000bps = 8,
- GSM48_QOS_PEAK_TPUT_256000bps = 9,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_mean_tput {
- GSM48_QOS_MEAN_TPUT_100bph = 1,
- GSM48_QOS_MEAN_TPUT_200bph = 2,
- GSM48_QOS_MEAN_TPUT_500bph = 3,
- GSM48_QOS_MEAN_TPUT_1000bph = 4,
- GSM48_QOS_MEAN_TPUT_2000bph = 5,
- GSM48_QOS_MEAN_TPUT_5000bph = 6,
- GSM48_QOS_MEAN_TPUT_10000bph = 7,
- GSM48_QOS_MEAN_TPUT_20000bph = 8,
- GSM48_QOS_MEAN_TPUT_50000bph = 9,
- GSM48_QOS_MEAN_TPUT_100kbph = 10,
- GSM48_QOS_MEAN_TPUT_200kbph = 11,
- GSM48_QOS_MEAN_TPUT_500kbph = 0xc,
- GSM48_QOS_MEAN_TPUT_1Mbph = 0xd,
- GSM48_QOS_MEAN_TPUT_2Mbph = 0xe,
- GSM48_QOS_MEAN_TPUT_5Mbph = 0xf,
- GSM48_QOS_MEAN_TPUT_10Mbph = 0x10,
- GSM48_QOS_MEAN_TPUT_20Mbph = 0x11,
- GSM48_QOS_MEAN_TPUT_50Mbph = 0x12,
- GSM48_QOS_MEAN_TPUT_BEST_EFFORT = 0x1f,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_err_sdu {
- GSM48_QOS_ERRSDU_NODETECT = 1,
- GSM48_QOS_ERRSDU_YES = 2,
- GSM48_QOS_ERRSDU_NO = 3,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_deliv_order {
- GSM48_QOS_DO_ORDERED = 1,
- GSM48_QOS_DO_UNORDERED = 2,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_traf_class {
- GSM48_QOS_TC_CONVERSATIONAL = 1,
- GSM48_QOS_TC_STREAMING = 2,
- GSM48_QOS_TC_INTERACTIVE = 3,
- GSM48_QOS_TC_BACKGROUND = 4,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_max_sdu_size {
- /* values below in 10 octet granularity */
- GSM48_QOS_MAXSDU_1502 = 0x97,
- GSM48_QOS_MAXSDU_1510 = 0x98,
- GSM48_QOS_MAXSDU_1520 = 0x99,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_max_bitrate {
- GSM48_QOS_MBRATE_1k = 0x01,
- GSM48_QOS_MBRATE_63k = 0x3f,
- GSM48_QOS_MBRATE_64k = 0x40,
- GSM48_QOS_MBRATE_568k = 0x7f,
- GSM48_QOS_MBRATE_576k = 0x80,
- GSM48_QOS_MBRATE_8640k = 0xfe,
- GSM48_QOS_MBRATE_0k = 0xff,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_resid_ber {
- GSM48_QOS_RBER_5e_2 = 0x01,
- GSM48_QOS_RBER_1e_2 = 0x02,
- GSM48_QOS_RBER_5e_3 = 0x03,
- GSM48_QOS_RBER_4e_3 = 0x04,
- GSM48_QOS_RBER_1e_3 = 0x05,
- GSM48_QOS_RBER_1e_4 = 0x06,
- GSM48_QOS_RBER_1e_5 = 0x07,
- GSM48_QOS_RBER_1e_6 = 0x08,
- GSM48_QOS_RBER_6e_8 = 0x09,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-enum gsm48_qos_sdu_err {
- GSM48_QOS_SERR_1e_2 = 0x01,
- GSM48_QOS_SERR_7e_2 = 0x02,
- GSM48_QOS_SERR_1e_3 = 0x03,
- GSM48_QOS_SERR_1e_4 = 0x04,
- GSM48_QOS_SERR_1e_5 = 0x05,
- GSM48_QOS_SERR_1e_6 = 0x06,
- GSM48_QOS_SERR_1e_1 = 0x07,
-};
-
-/* Figure 10.5.138/24.008 / Chapter 10.5.6.5 */
-struct gsm48_qos {
- /* octet 3 */
- uint8_t reliab_class:3;
- uint8_t delay_class:3;
- uint8_t spare:2;
- /* octet 4 */
- uint8_t preced_class:3;
- uint8_t spare2:1;
- uint8_t peak_tput:4;
- /* octet 5 */
- uint8_t mean_tput:5;
- uint8_t spare3:3;
- /* octet 6 */
- uint8_t deliv_err_sdu:3;
- uint8_t deliv_order:2;
- uint8_t traf_class:3;
- /* octet 7 */
- uint8_t max_sdu_size;
- /* octet 8 */
- uint8_t max_bitrate_up;
- /* octet 9 */
- uint8_t max_bitrate_down;
- /* octet 10 */
- uint8_t sdu_err_ratio:4;
- uint8_t resid_ber:4;
- /* octet 11 */
- uint8_t handling_prio:2;
- uint8_t xfer_delay:6;
- /* octet 12 */
- uint8_t guar_bitrate_up;
- /* octet 13 */
- uint8_t guar_bitrate_down;
- /* octet 14 */
- uint8_t src_stats_desc:4;
- uint8_t sig_ind:1;
- uint8_t spare5:3;
- /* octet 15 */
- uint8_t max_bitrate_down_ext;
- /* octet 16 */
- uint8_t guar_bitrate_down_ext;
-};
-
-
-#endif /* _GSM48_GPRS_H */
diff --git a/openbsc/include/openbsc/oap_messages.h b/openbsc/include/openbsc/oap_messages.h
index a7a254c2e..b7f4ccada 100644
--- a/openbsc/include/openbsc/oap_messages.h
+++ b/openbsc/include/openbsc/oap_messages.h
@@ -22,7 +22,7 @@
#pragma once
#include <stdint.h>
-#include <openbsc/gsm_04_08_gprs.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/gsm_data.h>
/* Some numbers are out of sequence because (so far) they match gprs_gsup_iei.
diff --git a/openbsc/src/gprs/Makefile.am b/openbsc/src/gprs/Makefile.am
index f406dd795..104bd296b 100644
--- a/openbsc/src/gprs/Makefile.am
+++ b/openbsc/src/gprs/Makefile.am
@@ -27,7 +27,7 @@ osmo_sgsn_SOURCES = gprs_gmm.c gprs_sgsn.c gprs_sndcp.c gprs_sndcp_vty.c \
gprs_llc.c gprs_llc_parse.c gprs_llc_vty.c crc24.c \
sgsn_ctrl.c sgsn_auth.c gprs_subscriber.c \
gprs_gsup_messages.c gprs_utils.c gprs_gsup_client.c \
- gsm_04_08_gprs.c sgsn_cdr.c sgsn_ares.c \
+ sgsn_cdr.c sgsn_ares.c \
oap.c oap_messages.c
osmo_sgsn_LDADD = \
$(top_builddir)/src/libcommon/libcommon.a \
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index 6e6b03b86..111f05208 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -48,7 +48,7 @@
#include <openbsc/gprs_llc.h>
#include <openbsc/gsm_04_08.h>
-#include <openbsc/gsm_04_08_gprs.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/gprs_utils.h>
#include <openssl/rand.h>
diff --git a/openbsc/src/gprs/gb_proxy_patch.c b/openbsc/src/gprs/gb_proxy_patch.c
index c1d2497db..7bddc4494 100644
--- a/openbsc/src/gprs/gb_proxy_patch.c
+++ b/openbsc/src/gprs/gb_proxy_patch.c
@@ -23,7 +23,6 @@
#include <openbsc/gprs_utils.h>
#include <openbsc/gprs_gb_parse.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c
index c2cdd0e67..5365ff0fa 100644
--- a/openbsc/src/gprs/gb_proxy_peer.c
+++ b/openbsc/src/gprs/gb_proxy_peer.c
@@ -24,7 +24,6 @@
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_data_shared.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/debug.h>
#include <osmocom/gprs/protocol/gsm_08_18.h>
diff --git a/openbsc/src/gprs/gprs_gb_parse.c b/openbsc/src/gprs/gprs_gb_parse.c
index 63ac9028d..5ec3cf6ea 100644
--- a/openbsc/src/gprs/gprs_gb_parse.c
+++ b/openbsc/src/gprs/gprs_gb_parse.c
@@ -19,12 +19,12 @@
*/
#include <osmocom/gsm/gsm48.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/gprs_gb_parse.h>
#include <openbsc/gprs_utils.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/debug.h>
#include <osmocom/gprs/gprs_bssgp.h>
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index 6b6e741fa..2bbc5ff34 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -39,6 +39,7 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gsm/apn.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gprs/gprs_bssgp.h>
@@ -46,7 +47,6 @@
#include <openbsc/gsm_data.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/gsm_04_08.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/paging.h>
#include <openbsc/transaction.h>
#include <openbsc/gprs_llc.h>
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index b7bda49ba..65f789d6d 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -29,12 +29,12 @@
#include <osmocom/core/backtrace.h>
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/debug.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/sgsn.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/gprs_gmm.h>
#include <openbsc/gprs_utils.h>
#include <openbsc/signal.h>
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index 678c1de6a..5b0bf398c 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -20,6 +20,7 @@
*
*/
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/gsm_subscriber.h>
#include <openbsc/gprs_gsup_client.h>
diff --git a/openbsc/src/gprs/gprs_utils.c b/openbsc/src/gprs/gprs_utils.c
index 895a03384..64bfd743d 100644
--- a/openbsc/src/gprs/gprs_utils.c
+++ b/openbsc/src/gprs/gprs_utils.c
@@ -20,11 +20,11 @@
*
*/
#include <openbsc/gprs_utils.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gprs/gprs_ns.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gsm/protocol/gsm_04_08.h>
#include <osmocom/gsm/gsm48.h>
diff --git a/openbsc/src/gprs/gsm_04_08_gprs.c b/openbsc/src/gprs/gsm_04_08_gprs.c
deleted file mode 100644
index 3ae50e26c..000000000
--- a/openbsc/src/gprs/gsm_04_08_gprs.c
+++ /dev/null
@@ -1,141 +0,0 @@
-/* (C) 2009-2010 by Harald Welte <laforge@gnumonks.org>
- * (C) 2010 by On-Waves
- * (C) 2014-2015 by Sysmocom s.f.m.c. GmbH
- *
- * All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-
-#include <openbsc/gsm_04_08_gprs.h>
-
-#include <osmocom/core/utils.h>
-
-/* Protocol related stuff, should go into libosmocore */
-
-/* 10.5.5.14 GPRS MM Cause / Table 10.5.147 */
-const struct value_string gsm48_gmm_cause_names_[] = {
- { GMM_CAUSE_IMSI_UNKNOWN, "IMSI unknown in HLR" },
- { GMM_CAUSE_ILLEGAL_MS, "Illegal MS" },
- { GMM_CAUSE_ILLEGAL_ME, "Illegal ME" },
- { GMM_CAUSE_GPRS_NOTALLOWED, "GPRS services not allowed" },
- { GMM_CAUSE_GPRS_OTHER_NOTALLOWED,
- "GPRS services and non-GPRS services not allowed" },
- { GMM_CAUSE_MS_ID_NOT_DERIVED,
- "MS identity cannot be derived by the network" },
- { GMM_CAUSE_IMPL_DETACHED, "Implicitly detached" },
- { GMM_CAUSE_PLMN_NOTALLOWED, "PLMN not allowed" },
- { GMM_CAUSE_LA_NOTALLOWED, "Location Area not allowed" },
- { GMM_CAUSE_ROAMING_NOTALLOWED,
- "Roaming not allowed in this location area" },
- { GMM_CAUSE_NO_GPRS_PLMN,
- "GPRS services not allowed in this PLMN" },
- { GMM_CAUSE_MSC_TEMP_NOTREACH, "MSC temporarily not reachable" },
- { GMM_CAUSE_NET_FAIL, "Network failure" },
- { GMM_CAUSE_CONGESTION, "Congestion" },
- { GMM_CAUSE_SEM_INCORR_MSG, "Semantically incorrect message" },
- { GMM_CAUSE_INV_MAND_INFO, "Invalid mandatory information" },
- { GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL,
- "Message type non-existant or not implemented" },
- { GMM_CAUSE_MSGT_INCOMP_P_STATE,
- "Message type not compatible with protocol state" },
- { GMM_CAUSE_IE_NOTEXIST_NOTIMPL,
- "Information element non-existent or not implemented" },
- { GMM_CAUSE_COND_IE_ERR, "Conditional IE error" },
- { GMM_CAUSE_MSG_INCOMP_P_STATE,
- "Message not compatible with protocol state " },
- { GMM_CAUSE_PROTO_ERR_UNSPEC, "Protocol error, unspecified" },
- { 0, NULL }
-};
-
-const struct value_string *gsm48_gmm_cause_names = gsm48_gmm_cause_names_;
-
-/* 10.5.6.6 SM Cause / Table 10.5.157 */
-const struct value_string gsm48_gsm_cause_names_[] = {
- { GSM_CAUSE_INSUFF_RSRC, "Insufficient resources" },
- { GSM_CAUSE_MISSING_APN, "Missing or unknown APN" },
- { GSM_CAUSE_UNKNOWN_PDP, "Unknown PDP address or PDP type" },
- { GSM_CAUSE_AUTH_FAILED, "User Authentication failed" },
- { GSM_CAUSE_ACT_REJ_GGSN, "Activation rejected by GGSN" },
- { GSM_CAUSE_ACT_REJ_UNSPEC, "Activation rejected, unspecified" },
- { GSM_CAUSE_SERV_OPT_NOTSUPP, "Service option not supported" },
- { GSM_CAUSE_REQ_SERV_OPT_NOTSUB,
- "Requested service option not subscribed" },
- { GSM_CAUSE_SERV_OPT_TEMP_OOO,
- "Service option temporarily out of order" },
- { GSM_CAUSE_NSAPI_IN_USE, "NSAPI already used" },
- { GSM_CAUSE_DEACT_REGULAR, "Regular deactivation" },
- { GSM_CAUSE_QOS_NOT_ACCEPTED, "QoS not accepted" },
- { GSM_CAUSE_NET_FAIL, "Network Failure" },
- { GSM_CAUSE_REACT_RQD, "Reactivation required" },
- { GSM_CAUSE_FEATURE_NOTSUPP, "Feature not supported " },
- { GSM_CAUSE_INVALID_TRANS_ID, "Invalid transaction identifier" },
- { GSM_CAUSE_SEM_INCORR_MSG, "Semantically incorrect message" },
- { GSM_CAUSE_INV_MAND_INFO, "Invalid mandatory information" },
- { GSM_CAUSE_MSGT_NOTEXIST_NOTIMPL,
- "Message type non-existant or not implemented" },
- { GSM_CAUSE_MSGT_INCOMP_P_STATE,
- "Message type not compatible with protocol state" },
- { GSM_CAUSE_IE_NOTEXIST_NOTIMPL,
- "Information element non-existent or not implemented" },
- { GSM_CAUSE_COND_IE_ERR, "Conditional IE error" },
- { GSM_CAUSE_MSG_INCOMP_P_STATE,
- "Message not compatible with protocol state " },
- { GSM_CAUSE_PROTO_ERR_UNSPEC, "Protocol error, unspecified" },
- { 0, NULL }
-};
-
-const struct value_string *gsm48_gsm_cause_names = gsm48_gsm_cause_names_;
-
-/* 10.5.5.2 */
-const struct value_string gprs_att_t_strs_[] = {
- { GPRS_ATT_T_ATTACH, "GPRS attach" },
- { GPRS_ATT_T_ATT_WHILE_IMSI, "GPRS attach while IMSI attached" },
- { GPRS_ATT_T_COMBINED, "Combined GPRS/IMSI attach" },
- { 0, NULL }
-};
-
-const struct value_string *gprs_att_t_strs = gprs_att_t_strs_;
-
-const struct value_string gprs_upd_t_strs_[] = {
- { GPRS_UPD_T_RA, "RA updating" },
- { GPRS_UPD_T_RA_LA, "combined RA/LA updating" },
- { GPRS_UPD_T_RA_LA_IMSI_ATT, "combined RA/LA updating + IMSI attach" },
- { GPRS_UPD_T_PERIODIC, "periodic updating" },
- { 0, NULL }
-};
-
-const struct value_string *gprs_upd_t_strs = gprs_upd_t_strs_;
-
-/* 10.5.5.5 */
-const struct value_string gprs_det_t_mo_strs_[] = {
- { GPRS_DET_T_MO_GPRS, "GPRS detach" },
- { GPRS_DET_T_MO_IMSI, "IMSI detach" },
- { GPRS_DET_T_MO_COMBINED, "Combined GPRS/IMSI detach" },
- { 0, NULL }
-};
-
-const struct value_string *gprs_det_t_mo_strs = gprs_det_t_mo_strs_;
-
-const struct value_string gprs_det_t_mt_strs_[] = {
- { GPRS_DET_T_MT_REATT_REQ, "re-attach required" },
- { GPRS_DET_T_MT_REATT_NOTREQ, "re-attach not required" },
- { GPRS_DET_T_MT_IMSI, "IMSI detach (after VLR failure)" },
- { 0, NULL }
-};
-
-const struct value_string *gprs_det_t_mt_strs = gprs_det_t_mt_strs_;
-
diff --git a/openbsc/src/gprs/sgsn_auth.c b/openbsc/src/gprs/sgsn_auth.c
index b83294d30..f0c4316c0 100644
--- a/openbsc/src/gprs/sgsn_auth.c
+++ b/openbsc/src/gprs/sgsn_auth.c
@@ -19,11 +19,11 @@
*
*/
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/sgsn.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/gprs_gmm.h>
#include <openbsc/gsm_subscriber.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/debug.h>
const struct value_string auth_state_names[] = {
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index aff2f91a1..aaf7e7aa7 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -38,8 +38,8 @@
#include <osmocom/core/select.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>
#include <openbsc/sgsn.h>
diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c
index 50f0e8f6e..f16c95ad4 100644
--- a/openbsc/src/gprs/sgsn_vty.c
+++ b/openbsc/src/gprs/sgsn_vty.c
@@ -27,13 +27,13 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/rate_ctr.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <openbsc/debug.h>
#include <openbsc/sgsn.h>
#include <osmocom/gprs/gprs_ns.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/vty.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/gprs_gsup_client.h>
#include <osmocom/vty/command.h>
diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c
index 96a68b0e5..a2ff95b1d 100644
--- a/openbsc/tests/gbproxy/gbproxy_test.c
+++ b/openbsc/tests/gbproxy/gbproxy_test.c
@@ -26,6 +26,7 @@
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/gsm/gsm_utils.h>
+#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/gprs/gprs_msgb.h>
#include <osmocom/gprs/gprs_ns.h>
#include <osmocom/gprs/gprs_bssgp.h>
@@ -34,7 +35,6 @@
#include <openbsc/gprs_utils.h>
#include <openbsc/gprs_llc.h>
#include <openbsc/gprs_gb_parse.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <openbsc/debug.h>
#include <openssl/rand.h>
diff --git a/openbsc/tests/oap/Makefile.am b/openbsc/tests/oap/Makefile.am
index 3a76b11ad..538e1787e 100644
--- a/openbsc/tests/oap/Makefile.am
+++ b/openbsc/tests/oap/Makefile.am
@@ -15,7 +15,6 @@ oap_test_LDADD = \
$(top_builddir)/src/gprs/oap.o \
$(top_builddir)/src/gprs/oap_messages.o \
$(top_builddir)/src/gprs/gprs_utils.o \
- $(top_builddir)/src/gprs/gsm_04_08_gprs.o \
$(top_builddir)/src/libcommon/libcommon.a \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
diff --git a/openbsc/tests/sgsn/Makefile.am b/openbsc/tests/sgsn/Makefile.am
index d432fb139..aebcf0105 100644
--- a/openbsc/tests/sgsn/Makefile.am
+++ b/openbsc/tests/sgsn/Makefile.am
@@ -27,7 +27,6 @@ sgsn_test_LDADD = \
$(top_builddir)/src/gprs/gprs_gsup_client.o \
$(top_builddir)/src/gprs/gprs_utils.o \
$(top_builddir)/src/gprs/gprs_subscriber.o \
- $(top_builddir)/src/gprs/gsm_04_08_gprs.o \
$(top_builddir)/src/gprs/gprs_gb_parse.o \
$(top_builddir)/src/gprs/oap.o \
$(top_builddir)/src/gprs/oap_messages.o \
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index fe41e759b..94c277f55 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -32,7 +32,6 @@
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gsm/gsm_utils.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <osmocom/core/application.h>
#include <osmocom/core/msgb.h>