mirror of https://gerrit.osmocom.org/libosmocore
CBSP (Cell Broadcast Service Protocol; 3GPP TS 48.049) support
This introduces definitions as well as a parser+encoder for the Cell Broadcast Service Protocol (CBSP) as specified in 3GPP TS 48.049. CBSP is used on the interface between CBC and BSC. Related: OS#3537 Change-Id: I5b7ae08f67e415967b60ac4b824db9e22ca00935
This commit is contained in:
parent
00a55ae7fe
commit
07958e44ec
|
@ -72,6 +72,7 @@ nobase_include_HEADERS = \
|
|||
osmocom/gsm/abis_nm.h \
|
||||
osmocom/gsm/apn.h \
|
||||
osmocom/gsm/bts_features.h \
|
||||
osmocom/gsm/cbsp.h \
|
||||
osmocom/gsm/comp128.h \
|
||||
osmocom/gsm/comp128v23.h \
|
||||
osmocom/gsm/bitvec_gsm.h \
|
||||
|
@ -124,6 +125,7 @@ nobase_include_HEADERS = \
|
|||
osmocom/gsm/protocol/gsm_23_003.h \
|
||||
osmocom/gsm/protocol/gsm_29_118.h \
|
||||
osmocom/gsm/protocol/gsm_44_318.h \
|
||||
osmocom/gsm/protocol/gsm_48_049.h \
|
||||
osmocom/gsm/protocol/ipaccess.h \
|
||||
osmocom/gsm/protocol/smpp34_osmocom.h \
|
||||
osmocom/gsm/rsl.h \
|
||||
|
|
|
@ -0,0 +1,292 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/linuxlist.h>
|
||||
#include <osmocom/gsm/protocol/gsm_48_049.h>
|
||||
#include <osmocom/gsm/gsm0808_utils.h>
|
||||
|
||||
/* Definitions for parsed / abstract representation of messages in the
|
||||
* CBSP (Cell Broadcast Service Protocol). Data here is *not* formatted
|
||||
* like the * on-the-wire format. Any similarities are coincidetial ;) */
|
||||
|
||||
/* Copyright (C) 2019 Harald Welte <laforge@gnumonks.org>
|
||||
*
|
||||
* All Rights Reserved
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
/* Decoded 8.2.3 Message Content */
|
||||
struct osmo_cbsp_content {
|
||||
struct llist_head list;
|
||||
uint8_t user_len;
|
||||
uint8_t data[82];
|
||||
};
|
||||
|
||||
/* Decoded Entry in a 8.2.6 Cell List */
|
||||
struct osmo_cbsp_cell_ent {
|
||||
struct llist_head list; /* entry in osmo_cbsp_cell_list.list */
|
||||
union gsm0808_cell_id_u cell_id;
|
||||
};
|
||||
struct osmo_cbsp_cell_list {
|
||||
enum CELL_IDENT id_discr;
|
||||
struct llist_head list; /* list of osmo_cbsp_cell_ent */
|
||||
};
|
||||
|
||||
/* Decoded Entry in a 8.2.10 Completed List */
|
||||
struct osmo_cbsp_num_compl_ent {
|
||||
struct llist_head list; /* entry in osmo_cbsp_num_compl_list.list */
|
||||
union gsm0808_cell_id_u cell_id;
|
||||
uint16_t num_compl;
|
||||
uint8_t num_bcast_info;
|
||||
};
|
||||
struct osmo_cbsp_num_compl_list {
|
||||
enum CELL_IDENT id_discr;
|
||||
struct llist_head list; /* list of osmo_cbsp_num_compl_ent */
|
||||
};
|
||||
|
||||
/* Decoded Entry in a 8.2.12 Radio Resource Loading List */
|
||||
struct osmo_cbsp_loading_ent {
|
||||
struct llist_head list; /* entry in osmo_cbsp_loading_list */
|
||||
union gsm0808_cell_id_u cell_id;
|
||||
uint8_t load[2];
|
||||
};
|
||||
struct osmo_cbsp_loading_list {
|
||||
enum CELL_IDENT id_discr;
|
||||
struct llist_head list; /* list of osmo_cbsp_loading_ent */
|
||||
};
|
||||
|
||||
/* Decoded Entry in a 8.2.11 Failure List */
|
||||
struct osmo_cbsp_fail_ent {
|
||||
struct llist_head list; /* entry in a fail_list below */
|
||||
enum CELL_IDENT id_discr;
|
||||
union gsm0808_cell_id_u cell_id;
|
||||
uint8_t cause;
|
||||
};
|
||||
|
||||
|
||||
/* 8.1.3.1 */
|
||||
struct osmo_cbsp_write_replace {
|
||||
uint16_t msg_id; /* 8.2.16 M */
|
||||
uint16_t new_serial_nr; /* 8.2.5 M */
|
||||
uint16_t *old_serial_nr; /* 8.2.4 */
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
|
||||
bool is_cbs;
|
||||
union {
|
||||
struct {
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
enum cbsp_category category;
|
||||
uint16_t rep_period;
|
||||
uint16_t num_bcast_req;
|
||||
/* num_of_pages implicit as llist_count(msg_content) */
|
||||
uint8_t dcs;
|
||||
struct llist_head msg_content;
|
||||
} cbs;
|
||||
struct {
|
||||
uint8_t indicator;
|
||||
uint16_t warning_type;
|
||||
uint8_t warning_sec_info[50];
|
||||
uint32_t warning_period; /* in seconds; 0xffffffff = unlimited */
|
||||
} emergency;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* 8.1.3.2 */
|
||||
struct osmo_cbsp_write_replace_complete {
|
||||
uint16_t msg_id;
|
||||
uint16_t new_serial_nr;
|
||||
uint16_t *old_serial_nr;
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.3 */
|
||||
struct osmo_cbsp_write_replace_failure {
|
||||
uint16_t msg_id;
|
||||
uint16_t new_serial_nr;
|
||||
uint16_t *old_serial_nr;
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.4 */
|
||||
struct osmo_cbsp_kill {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.5 */
|
||||
struct osmo_cbsp_kill_complete {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.6 */
|
||||
struct osmo_cbsp_kill_failure {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.7 */
|
||||
struct osmo_cbsp_load_query {
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.8 */
|
||||
struct osmo_cbsp_load_query_complete {
|
||||
struct osmo_cbsp_loading_list loading_list;
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.9 */
|
||||
struct osmo_cbsp_load_query_failure {
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
struct osmo_cbsp_loading_list loading_list;
|
||||
};
|
||||
|
||||
/* 8.1.3.10 */
|
||||
struct osmo_cbsp_msg_status_query {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.11 */
|
||||
struct osmo_cbsp_msg_status_query_complete {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.12 */
|
||||
struct osmo_cbsp_msg_status_query_failure {
|
||||
uint16_t msg_id;
|
||||
uint16_t old_serial_nr;
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
enum cbsp_channel_ind channel_ind;
|
||||
struct osmo_cbsp_num_compl_list num_compl_list;
|
||||
};
|
||||
|
||||
/* 8.1.3.16 */
|
||||
struct osmo_cbsp_reset {
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
};
|
||||
|
||||
/* 8.1.3.17 */
|
||||
struct osmo_cbsp_reset_complete {
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
};
|
||||
|
||||
/* 8.1.3.18 */
|
||||
struct osmo_cbsp_reset_failure {
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
};
|
||||
|
||||
/* 8.1.3.18a */
|
||||
struct osmo_cbsp_keep_alive {
|
||||
uint8_t repetition_period;
|
||||
};
|
||||
|
||||
/* 8.1.3.18b */
|
||||
struct osmo_cbsp_keep_alive_complete {
|
||||
};
|
||||
|
||||
/* 8.1.3.19 */
|
||||
struct osmo_cbsp_restart {
|
||||
struct osmo_cbsp_cell_list cell_list;
|
||||
uint8_t bcast_msg_type;
|
||||
uint8_t recovery_ind;
|
||||
};
|
||||
|
||||
/* 8.1.3.20 */
|
||||
struct osmo_cbsp_failure {
|
||||
struct llist_head fail_list; /* list of osmo_cbsp_fail_ent */
|
||||
uint8_t bcast_msg_type;
|
||||
};
|
||||
|
||||
/* 8.1.3.21 */
|
||||
struct osmo_cbsp_error_ind {
|
||||
enum cbsp_cell_id_cause cause;
|
||||
uint16_t *msg_id;
|
||||
uint16_t *new_serial_nr;
|
||||
uint16_t *old_serial_nr;
|
||||
enum cbsp_channel_ind *channel_ind;
|
||||
};
|
||||
|
||||
|
||||
/* decoded CBSP message */
|
||||
struct osmo_cbsp_decoded {
|
||||
enum cbsp_msg_type msg_type;
|
||||
union {
|
||||
struct osmo_cbsp_write_replace write_replace;
|
||||
struct osmo_cbsp_write_replace_complete write_replace_compl;
|
||||
struct osmo_cbsp_write_replace_failure write_replace_fail;
|
||||
|
||||
struct osmo_cbsp_kill kill;
|
||||
struct osmo_cbsp_kill_complete kill_compl;
|
||||
struct osmo_cbsp_kill_failure kill_fail;
|
||||
|
||||
struct osmo_cbsp_load_query load_query;
|
||||
struct osmo_cbsp_load_query_complete load_query_compl;
|
||||
struct osmo_cbsp_load_query_failure load_query_fail;
|
||||
|
||||
struct osmo_cbsp_msg_status_query msg_status_query;
|
||||
struct osmo_cbsp_msg_status_query_complete msg_status_query_compl;
|
||||
struct osmo_cbsp_msg_status_query_failure msg_status_query_fail;
|
||||
|
||||
/* TODO: set DRX */
|
||||
|
||||
struct osmo_cbsp_reset reset;
|
||||
struct osmo_cbsp_reset_complete reset_compl;
|
||||
struct osmo_cbsp_reset_failure reset_fail;
|
||||
|
||||
struct osmo_cbsp_restart restart;
|
||||
|
||||
struct osmo_cbsp_failure failure;
|
||||
|
||||
struct osmo_cbsp_error_ind error_ind;
|
||||
|
||||
struct osmo_cbsp_keep_alive keep_alive;
|
||||
struct osmo_cbsp_keep_alive_complete keep_alive_compl;
|
||||
} u;
|
||||
};
|
||||
|
||||
struct msgb *osmo_cbsp_msgb_alloc(void *ctx, const char *name);
|
||||
struct msgb *osmo_cbsp_encode(void *ctx, const struct osmo_cbsp_decoded *in);
|
||||
struct osmo_cbsp_decoded *osmo_cbsp_decode(void *ctx, struct msgb *in);
|
||||
void osmo_cbsp_init_struct(struct osmo_cbsp_decoded *cbsp, enum cbsp_msg_type msg_type);
|
||||
struct osmo_cbsp_decoded *osmo_cbsp_decoded_alloc(void *ctx, enum cbsp_msg_type msg_type);
|
||||
|
||||
int osmo_cbsp_recv_buffered(void *ctx, int fd, struct msgb **rmsg, struct msgb **tmp_msg);
|
|
@ -0,0 +1,128 @@
|
|||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <osmocom/core/utils.h>
|
||||
|
||||
/* CBSP is an ETSI/3GPP standard protocol used between CBC (Cell
|
||||
* Brodadcast Centre) and BSC (Base Station Controller) in 2G/GSM/GERAN
|
||||
* networks. It is specified in 3GPP TS 48.049.
|
||||
*
|
||||
* (C) 2019 by Harald Welte <laforge@gnumonks.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* Released under the terms of the GNU General Public License, Version 2 or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
/* 5.2 TCP/IP */
|
||||
#define CBSP_TCP_PORT 48049
|
||||
|
||||
/* 8.2.1 Information Element Identifiers */
|
||||
enum cbsp_iei {
|
||||
CBSP_IEI_MSG_CONTENT = 0x01,
|
||||
CBSP_IEI_OLD_SERIAL_NR = 0x02,
|
||||
CBSP_IEI_NEW_SERIAL_NR = 0x03,
|
||||
CBSP_IEI_CELL_LIST = 0x04,
|
||||
CBSP_IEI_CATEGORY = 0x05,
|
||||
CBSP_IEI_REP_PERIOD = 0x06,
|
||||
CBSP_IEI_NUM_BCAST_REQ = 0x07,
|
||||
CBSP_IEI_NUM_BCAST_COMPL_LIST = 0x08,
|
||||
CBSP_IEI_FAILURE_LIST = 0x09,
|
||||
CBSP_IEI_RR_LOADING_LIST = 0x0a,
|
||||
CBSP_IEI_CAUSE = 0x0b,
|
||||
CBSP_IEI_DCS = 0x0c,
|
||||
CBSP_IEI_RECOVERY_IND = 0x0d,
|
||||
CBSP_IEI_MSG_ID = 0x0e,
|
||||
CBSP_IEI_EMERG_IND = 0x0f,
|
||||
CBSP_IEI_WARN_TYPE = 0x10,
|
||||
CBSP_IEI_WARN_SEC_INFO = 0x11,
|
||||
CBSP_IEI_CHANNEL_IND = 0x12,
|
||||
CBSP_IEI_NUM_OF_PAGES = 0x13,
|
||||
CBSP_IEI_SCHEDULE_PERIOD = 0x14,
|
||||
CBSP_IEI_NUM_OF_RES_SLOTS = 0x15,
|
||||
CBSP_IEI_BCAST_MSG_TYPE = 0x16,
|
||||
CBSP_IEI_WARNING_PERIOD = 0x17,
|
||||
CBSP_IEI_KEEP_ALIVE_REP_PERIOD = 0x18,
|
||||
};
|
||||
|
||||
/* 8.2.2 Message Type */
|
||||
enum cbsp_msg_type {
|
||||
CBSP_MSGT_WRITE_REPLACE = 0x01,
|
||||
CBSP_MSGT_WRITE_REPLACE_COMPL = 0x02,
|
||||
CBSP_MSGT_WRITE_REPLACE_FAIL = 0x03,
|
||||
CBSP_MSGT_KILL = 0x04,
|
||||
CBSP_MSGT_KILL_COMPL = 0x05,
|
||||
CBSP_MSGT_KILL_FAIL = 0x06,
|
||||
CBSP_MSGT_LOAD_QUERY = 0x07,
|
||||
CBSP_MSGT_LOAD_QUERY_COMPL = 0x08,
|
||||
CBSP_MSGT_LOAD_QUERY_FAIL = 0x09,
|
||||
CBSP_MSGT_MSG_STATUS_QUERY = 0x0a,
|
||||
CBSP_MSGT_MSG_STATUS_QUERY_COMPL= 0x0b,
|
||||
CBSP_MSGT_MSG_STATUS_QUERY_FAIL = 0x0c,
|
||||
CBSP_MSGT_SET_DRX = 0x0d,
|
||||
CBSP_MSGT_SET_DRX_COMPL = 0x0e,
|
||||
CBSP_MSGT_SET_DRX_FAIL = 0x0f,
|
||||
CBSP_MSGT_RESET = 0x10,
|
||||
CBSP_MSGT_RESET_COMPL = 0x11,
|
||||
CBSP_MSGT_RESET_FAIL = 0x12,
|
||||
CBSP_MSGT_RESTART = 0x13,
|
||||
CBSP_MSGT_FAILURE = 0x14,
|
||||
CBSP_MSGT_ERROR_IND = 0x15,
|
||||
CBSP_MSGT_KEEP_ALIVE = 0x16,
|
||||
CBSP_MSGT_KEEP_ALIVE_COMPL = 0x17,
|
||||
};
|
||||
|
||||
/* 8.2.7 Category */
|
||||
enum cbsp_category {
|
||||
CBSP_CATEG_HIGH_PRIO = 0x00,
|
||||
CBSP_CATEG_BACKGROUND = 0x01,
|
||||
CBSP_CATEG_NORMAL = 0x02,
|
||||
};
|
||||
|
||||
/* Cell ID Discriminator (8.2.11, ...) */
|
||||
enum cbsp_cell_id_disc {
|
||||
CBSP_CIDD_WHOLE_CGI = 0x0,
|
||||
CBSP_CIDD_LAC_CI = 0x1,
|
||||
CBSP_CIDD_CI = 0x2,
|
||||
CBSP_CIDD_LAI = 0x4,
|
||||
CBSP_CIDD_LAC = 0x5,
|
||||
CBSP_CIDD_ALL_IN_BSC = 0x6,
|
||||
};
|
||||
|
||||
/* 8.2.13 Cause */
|
||||
enum cbsp_cell_id_cause {
|
||||
CBSP_CAUSE_PARAM_NOT_RECOGNISED = 0x00,
|
||||
CBSP_CAUSE_PARAM_VAL_INVALID = 0x01,
|
||||
CBSP_CAUSE_MSG_REF_NOT_IDENTIFIED = 0x02,
|
||||
CBSP_CAUSE_CELL_ID_NOT_VALID = 0x03,
|
||||
CBSP_CAUSE_UNRECOGNISED_MSG = 0x04,
|
||||
CBSP_CAUSE_MISSING_MAND_IE = 0x05,
|
||||
CBSP_CAUSE_BSC_CAPACITY_EXCEEDED = 0x06,
|
||||
CBSP_CAUSE_CELL_MEMORY_EXCEEDED = 0x07,
|
||||
CBSP_CAUSE_BSC_MEMORY_EXCEEDED = 0x08,
|
||||
CBSP_CAUSE_CB_NOT_SUPPORTED = 0x09,
|
||||
CBSP_CAUSE_CB_NOT_OPERATIONAL = 0x0a,
|
||||
CBSP_CAUSE_INCOMPATIBLE_DRX_PARAM = 0x0b,
|
||||
CBSP_CAUSE_EXT_CHAN_NOT_SUPPORTED = 0x0c,
|
||||
CBSP_CAUSE_MSG_REF_ALREADY_USED = 0x0d,
|
||||
CBSP_CAUSE_UNSPECIFIED_ERROR = 0x0e,
|
||||
CBSP_CAUSE_LAI_OR_LAC_NPT_VALID = 0x0f,
|
||||
};
|
||||
|
||||
/* 8.2.20 Chanel Indicator */
|
||||
enum cbsp_channel_ind {
|
||||
CBSP_CHAN_IND_BASIC = 0,
|
||||
CBSP_CHAN_IND_EXTENDED = 1,
|
||||
};
|
||||
|
||||
/* not explicitly specified, but every message starts with those mandatory elements */
|
||||
struct cbsp_header {
|
||||
uint8_t msg_type;
|
||||
uint8_t len[3]; /* excluding the header */
|
||||
} __attribute__((packed));
|
||||
|
||||
extern const struct value_string cbsp_msg_type_names[];
|
||||
extern const struct value_string cbsp_iei_names[];
|
||||
extern const struct value_string cbsp_category_names[];
|
||||
extern const struct tlv_definition cbsp_att_tlvdef;
|
|
@ -32,7 +32,7 @@ libgsmint_la_SOURCES = a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
|
|||
milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \
|
||||
gsup.c gsup_sms.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \
|
||||
gsm23003.c mncc.c bts_features.c oap_client.c \
|
||||
gsm29118.c gsm48_rest_octets.c
|
||||
gsm29118.c gsm48_rest_octets.c cbsp.c gsm48049.c
|
||||
libgsmint_la_LDFLAGS = -no-undefined
|
||||
libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,111 @@
|
|||
/* CBSP is an ETSI/3GPP standard protocol used between CBC (Cell Brodadcast Centre)
|
||||
* and BSC (Base Station Controller0 in 2G/GSM/GERAN networks. It is specified
|
||||
* in 3GPP TS 48.049
|
||||
*
|
||||
* (C) 2019 by Harald Welte <laforge@gnumonks.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*
|
||||
* Released under the terms of the GNU General Public License, Version 2 or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <osmocom/gsm/tlv.h>
|
||||
#include <osmocom/gsm/protocol/gsm_48_049.h>
|
||||
|
||||
/***********************************************************************
|
||||
* Protocol Definitions
|
||||
***********************************************************************/
|
||||
|
||||
const struct value_string cbsp_msg_type_names[] = {
|
||||
{ CBSP_MSGT_WRITE_REPLACE, "WRITE-REPLACE" },
|
||||
{ CBSP_MSGT_WRITE_REPLACE_COMPL, "WRITE-REPLACE COMPLETE" },
|
||||
{ CBSP_MSGT_WRITE_REPLACE_FAIL, "WRITE-REPLACE FAILURE" },
|
||||
{ CBSP_MSGT_KILL, "KILL" },
|
||||
{ CBSP_MSGT_KILL_COMPL, "KILL COMPLETE" },
|
||||
{ CBSP_MSGT_KILL_FAIL, "KILL FAILURE" },
|
||||
{ CBSP_MSGT_LOAD_QUERY, "LOAD QUERY" },
|
||||
{ CBSP_MSGT_LOAD_QUERY_COMPL, "LOAD QUERY COMPLETE" },
|
||||
{ CBSP_MSGT_LOAD_QUERY_FAIL, "LOAD QUERY FAILURE" },
|
||||
{ CBSP_MSGT_MSG_STATUS_QUERY, "MESSAGE STATUS QUERY" },
|
||||
{ CBSP_MSGT_MSG_STATUS_QUERY_COMPL, "MESSAGE STATUS QUERY COMPLETE" },
|
||||
{ CBSP_MSGT_MSG_STATUS_QUERY_FAIL, "MESSAGE STATUS QUERY FAILURE" },
|
||||
{ CBSP_MSGT_SET_DRX, "SET-DRX" },
|
||||
{ CBSP_MSGT_SET_DRX_COMPL, "SET-DRX COMPLETE" },
|
||||
{ CBSP_MSGT_SET_DRX_FAIL, "SET-DRX FAILURE" },
|
||||
{ CBSP_MSGT_RESET, "RESET" },
|
||||
{ CBSP_MSGT_RESET_COMPL, "RESET COMPLETE" },
|
||||
{ CBSP_MSGT_RESET_FAIL, "RESET FAILURE" },
|
||||
{ CBSP_MSGT_RESTART, "RESTART" },
|
||||
{ CBSP_MSGT_FAILURE, "FAILURE" },
|
||||
{ CBSP_MSGT_ERROR_IND, "ERROR INDICATION" },
|
||||
{ CBSP_MSGT_KEEP_ALIVE, "KEEP-ALIVE" },
|
||||
{ CBSP_MSGT_KEEP_ALIVE_COMPL, "KEEP-ALIVE COMPLETE" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
const struct value_string cbsp_iei_names[] = {
|
||||
{ CBSP_IEI_MSG_CONTENT, "Message Content" },
|
||||
{ CBSP_IEI_OLD_SERIAL_NR, "Old Serial Number" },
|
||||
{ CBSP_IEI_NEW_SERIAL_NR, "New Serial Number" },
|
||||
{ CBSP_IEI_CELL_LIST, "Cell List" },
|
||||
{ CBSP_IEI_CATEGORY, "Category" },
|
||||
{ CBSP_IEI_REP_PERIOD, "Repetition Period" },
|
||||
{ CBSP_IEI_NUM_BCAST_REQ, "Number of Broadcasts Requested" },
|
||||
{ CBSP_IEI_NUM_BCAST_COMPL_LIST,"Number of Broadcasts Completed List" },
|
||||
{ CBSP_IEI_FAILURE_LIST, "Failure List" },
|
||||
{ CBSP_IEI_RR_LOADING_LIST, "Radio Resource Loading List" },
|
||||
{ CBSP_IEI_CAUSE, "Cause" },
|
||||
{ CBSP_IEI_DCS, "Data Coding Scheme" },
|
||||
{ CBSP_IEI_RECOVERY_IND, "Recovery Indication" },
|
||||
{ CBSP_IEI_MSG_ID, "Message Identifier" },
|
||||
{ CBSP_IEI_EMERG_IND, "Emergency Indicator" },
|
||||
{ CBSP_IEI_WARN_TYPE, "Warning Type" },
|
||||
{ CBSP_IEI_WARN_SEC_INFO, "warning Security Information" },
|
||||
{ CBSP_IEI_CHANNEL_IND, "Channel Indicator" },
|
||||
{ CBSP_IEI_NUM_OF_PAGES, "Number of Pages" },
|
||||
{ CBSP_IEI_SCHEDULE_PERIOD, "Schedule Period" },
|
||||
{ CBSP_IEI_NUM_OF_RES_SLOTS, "Number of Reserved Slots" },
|
||||
{ CBSP_IEI_BCAST_MSG_TYPE, "Broadcast Message Type" },
|
||||
{ CBSP_IEI_WARNING_PERIOD, "Waring Period" },
|
||||
{ CBSP_IEI_KEEP_ALIVE_REP_PERIOD, "Keep Alive Repetition Period" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
const struct value_string cbsp_category_names[] = {
|
||||
{ CBSP_CATEG_HIGH_PRIO, "High Priority" },
|
||||
{ CBSP_CATEG_BACKGROUND, "Background" },
|
||||
{ CBSP_CATEG_NORMAL, "Normal" },
|
||||
{ 0, NULL }
|
||||
};
|
||||
|
||||
const struct tlv_definition cbsp_att_tlvdef = {
|
||||
.def = {
|
||||
[CBSP_IEI_MSG_CONTENT] = { TLV_TYPE_FIXED, 83 },
|
||||
[CBSP_IEI_OLD_SERIAL_NR] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_NEW_SERIAL_NR] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_CELL_LIST] = { TLV_TYPE_TL16V },
|
||||
[CBSP_IEI_CATEGORY] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_REP_PERIOD] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_NUM_BCAST_REQ] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_NUM_BCAST_COMPL_LIST] = { TLV_TYPE_TL16V },
|
||||
[CBSP_IEI_FAILURE_LIST] = { TLV_TYPE_TL16V },
|
||||
[CBSP_IEI_RR_LOADING_LIST] = { TLV_TYPE_TL16V },
|
||||
[CBSP_IEI_CAUSE] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_DCS] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_RECOVERY_IND] { TLV_TYPE_TV },
|
||||
[CBSP_IEI_MSG_ID] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_EMERG_IND] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_WARN_TYPE] = { TLV_TYPE_FIXED, 2 },
|
||||
[CBSP_IEI_WARN_SEC_INFO] = { TLV_TYPE_FIXED, 50 },
|
||||
[CBSP_IEI_CHANNEL_IND] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_NUM_OF_PAGES] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_SCHEDULE_PERIOD] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_NUM_OF_RES_SLOTS] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_BCAST_MSG_TYPE] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_WARNING_PERIOD] = { TLV_TYPE_TV },
|
||||
[CBSP_IEI_KEEP_ALIVE_REP_PERIOD] = { TLV_TYPE_TV },
|
||||
},
|
||||
};
|
|
@ -646,5 +646,16 @@ osmo_gsm48_classmark_a5_name_buf;
|
|||
osmo_gsm48_classmark_a5_name_c;
|
||||
osmo_gsm48_classmark_update;
|
||||
|
||||
cbsp_msg_type_names;
|
||||
cbsp_iei_names;
|
||||
cbsp_category_names;
|
||||
cbsp_att_tlvdef;
|
||||
osmo_cbsp_msgb_alloc;
|
||||
osmo_cbsp_decoded_alloc;
|
||||
osmo_cbsp_init_struct;
|
||||
osmo_cbsp_encode;
|
||||
osmo_cbsp_decode;
|
||||
osmo_cbsp_recv_buffered;
|
||||
|
||||
local: *;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue