21 Commits
0.2.1 ... 0.3.0

Author SHA1 Message Date
Pau Espin Pedrol
61f2f7123c Bump version: 0.2.3.13-aeea-dirty → 0.3.0
Change-Id: I3cbf26467dd90c3fc56dae76324f5eb9cdd0f4ef
2022-06-29 12:00:03 +02:00
Pau Espin Pedrol
aeea8b1145 .gitignore: add configure~
Change-Id: I2b4327fd78914b63040fb3e7d5e00b92bdb5e1c1
2022-06-23 14:09:14 +02:00
Pau Espin Pedrol
5b25874c2b cbsp_server: Reorder logged message
log macro needs to be changed since it uses cbsp_cbc_client_name() which
accesses client->conn which is NULL in there.

Change-Id: Ic444c749476bb1626df5494c00021c5e1a9f24b9
2022-06-21 12:11:49 +02:00
Pau Espin Pedrol
b3ee9ca764 Rework cbsp_cbc_create() params
There's no need to pass the specific params. Let's simply get whatever
need from the global config in the function.
This makes it easier to extend it to more params if needed.
Also, when we add SBc-AP support, the params that have to be passed to
the counter part function are different, so let's simplify param
passing here.

While at it, rename also the callback function to contain "cbsp" on it,
since it is cbsp specific.

Change-Id: Ia2362757275e7cbce82b64c7c2a0798276d964c3
2022-06-21 12:11:49 +02:00
Pau Espin Pedrol
6c7d06a50a cbsp_server.h: Move function to the proper section
Change-Id: I47f694c2ffa1df50394ff01977ddb85768657062
2022-06-21 09:39:21 +00:00
Harald Welte
9514e3e4ba update git URLs (git -> https; gitea)
Change-Id: Ife8212bcd6db51f5d4533c7bd8a52f9a21a8d144
2022-06-18 11:41:07 +02:00
Pau Espin Pedrol
fb6f123daf src/Makefile: Reformat files one per line
Change-Id: I666d6cd1461117397e05ac573c834a82abb2807d
2022-06-16 16:10:14 +02:00
Pau Espin Pedrol
2029fbaf6a vty. Fix several typos and missing param descriptions
Change-Id: I798ba4663247018a61d6f392961af11871c6152b
2022-06-16 16:08:29 +02:00
Harald Welte
8b12076f97 cbc: Don't crash if peer->remote_host is NULL
As the peer->remote_host is initially NULL when creating a CBC peer,
the code should tolerate this.  The situation arises in two cases:

* if a peer is created by VTY but without any subequent 'remote-ip'
  statement
* if a peer is auto-created by 'unknown-peers accept'

Closes: OS#5506
Change-Id: I455e61f379f042680cdd2600a08d57a1ea22897c
2022-05-06 10:44:26 +02:00
Harald Welte
4db977919c CBSP: Append/store results in KILL COMPLETE + KILL FAIL
When the BSC returns a KILL COMPLETE or KILL FAIL, append the contained
lists (number of broadcasts completed list, fail list, ...) to update
the state of the CBC.

Change-Id: Iabe5b4e6a238597455294bf91759d4dc6e90d660
2022-04-29 13:34:50 +02:00
Harald Welte
a7a5270814 CBSP: Set Channel Indication IE in KILL for CBS
The channel Indicator IE shall be present if the KILL relates to a
CBS message.  Its absence indicates KILL for ETWS/PWS.

Change-Id: I11bfac3236d7cf1e30ae5bae0abcbd72531ab5cd
Related: SYS#5906, OS#5540, OS#5541
2022-04-29 13:16:03 +02:00
Vadim Yanitskiy
f492acf37f VTY: fix incomplete 'remote-ip' command description
Change-Id: I2f98285bda4a482ac1af04f71eafa19daee5137f
2022-03-30 23:11:50 +03:00
Vadim Yanitskiy
6e3f0abd89 VTY: cosmetic: use VTY_IPV46_CMD in the command string
Change-Id: I3088aed936b936d36a550f766031328143481064
2022-03-30 23:08:56 +03:00
Vadim Yanitskiy
cfb35a8c5b doc/examples: make osmo-cbc.cfg file more informative
This example is not any better than just using '-c /dev/null'.
Add some default parameters taken from 'show running-config'.

Change-Id: I6dca38a2220c32fad96237d7522a300f12b4469e
2022-03-30 23:04:04 +03:00
Pau Espin Pedrol
78f4cc85a4 Bump version: 0.2.2.1-cf3c → 0.2.3
Change-Id: I145e8f4292f582b2656a66832e522e6010998828
2021-11-16 18:05:21 +01:00
Harald Welte
cf3c47d6bc varaible for atoi() result shouild be signed integer
... otherwise we won't detect < 0 cases.

Fixes: CID#240731
Change-Id: I650fce5bd64752823ee57d8b528d2b371fada857
2021-10-25 08:09:16 +02:00
Harald Welte
35b230f2bf Bump version: 0.2.1.4-88b5 → 0.2.2
Change-Id: If4919093a0569b81bfd95f76763f8b4b2fddaada
2021-02-23 20:40:44 +01:00
Harald Welte
88b5f3bb04 Update dependencies to current libosmocore & co
So far we couldn't depend on proper versions as they had not been
released yet.  Now they do, so we can add the respective dependencies

Change-Id: I0573a151f55488599a01ea9dfdcfa02396cd6c35
2021-02-23 20:36:25 +01:00
Harald Welte
3ae1a77bbc fix encoding of CBSP cell identifiers
We need to use the matching enum values if we actually want to
match correctly.  Before this patch, the Cell List Items in CBSP
were encoded wrongly.

Change-Id: Iea3e2a28573baaead308eb9c8475c6b8093d0b48
2021-02-20 20:04:21 +01:00
Harald Welte
1c3cfd2ccc bring JSON schema in sync with reality
Change-Id: I80f394e76d8c57f367f0049ee52df02d943ad105
2021-02-20 18:07:37 +01:00
Harald Welte
13385443a3 rest_api.c: Add missing \n in log line after error message
Change-Id: If2e9134d827891468df7ae35b89d6dfb798eb0dc
2021-02-20 17:34:30 +01:00
18 changed files with 141 additions and 61 deletions

1
.gitignore vendored
View File

@@ -20,6 +20,7 @@ depcomp
install-sh
missing
stamp-h1
configure~
# libtool
ltmain.sh

View File

@@ -28,9 +28,9 @@ GIT Repository
You can clone from the official osmo-cbc.git repository using
git clone https://git.osmocom.org/osmo-cbc.git
git clone https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc
There is a cgit interface at https://git.osmocom.org/osmo-cbc/
There is a web interface at <https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc>
Documentation
-------------

View File

@@ -42,7 +42,7 @@
"num_of_bcast": { "$ref": "#/definitions/number_of_broadcasts" },
"scope": { "$ref": "#/definitions/scope" },
"warning_period_sec": { "$ref": "#/definitions/warning_period_sec" },
"smscb": { "$ref": "smscb.schema.json#definitions/smscb_message" }
"smscb_message": { "$ref": "smscb.schema.json#definitions/smscb_message" }
},
"required": [ "scope", "smscb" }
}

View File

@@ -31,10 +31,10 @@ if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
fi
PKG_PROG_PKG_CONFIG([0.20])
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.0.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.0.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.0.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.4.0)
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.7.0)
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.2.0)
PKG_CHECK_MODULES(ULFIUS, libulfius)
PKG_CHECK_MODULES(JANSSON, jansson)
PKG_CHECK_MODULES(ORCANIA, liborcania)
@@ -157,7 +157,7 @@ if test "x$enable_ext_tests" = "xyes" ; then
AM_PATH_PYTHON
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])

View File

@@ -30,16 +30,10 @@ BuildRequires: pkgconfig >= 0.20
%if 0%{?suse_version}
BuildRequires: systemd-rpm-macros
%endif
BuildRequires: pkgconfig(libcrypto) >= 0.9.5
BuildRequires: pkgconfig(libosmo-netif) >= 0.6.0
BuildRequires: pkgconfig(libosmo-sccp) >= 0.10.0
BuildRequires: pkgconfig(libosmo-sigtran) >= 0.10.0
BuildRequires: pkgconfig(libosmoabis) >= 0.6.0
BuildRequires: pkgconfig(libosmocore) >= 1.2.0
BuildRequires: pkgconfig(libosmoctrl) >= 1.2.0
BuildRequires: pkgconfig(libosmogb)
BuildRequires: pkgconfig(libosmogsm) >= 1.2.0
BuildRequires: pkgconfig(libosmovty) >= 1.2.0
BuildRequires: pkgconfig(libosmocore) >= 1.7.0
BuildRequires: pkgconfig(libosmogsm) >= 1.7.0
BuildRequires: pkgconfig(libosmovty) >= 1.7.0
BuildRequires: pkgconfig(libosmo-netif) >= 1.2.0
BuildRequires: pkgconfig(talloc)
BuildRequires: pkgconfig(libulfius)
%{?systemd_requires}

39
debian/changelog vendored
View File

@@ -1,3 +1,42 @@
osmo-cbc (0.3.0) unstable; urgency=medium
[ Vadim Yanitskiy ]
* doc/examples: make osmo-cbc.cfg file more informative
* VTY: cosmetic: use VTY_IPV46_CMD in the command string
* VTY: fix incomplete 'remote-ip' command description
[ Harald Welte ]
* CBSP: Set Channel Indication IE in KILL for CBS
* CBSP: Append/store results in KILL COMPLETE + KILL FAIL
* cbc: Don't crash if peer->remote_host is NULL
* update git URLs (git -> https; gitea)
[ Pau Espin Pedrol ]
* vty. Fix several typos and missing param descriptions
* src/Makefile: Reformat files one per line
* cbsp_server.h: Move function to the proper section
* Rework cbsp_cbc_create() params
* cbsp_server: Reorder logged message
* .gitignore: add configure~
-- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 29 Jun 2022 12:00:03 +0200
osmo-cbc (0.2.3) unstable; urgency=medium
[ Harald Welte ]
* varaible for atoi() result shouild be signed integer
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 16 Nov 2021 18:05:21 +0100
osmo-cbc (0.2.2) unstable; urgency=medium
* rest_api.c: Add missing \n in log line after error message
* bring JSON schema in sync with reality
* fix encoding of CBSP cell identifiers
* Update dependencies to current libosmocore & co
-- Harald Welte <laforge@osmocom.org> Tue, 23 Feb 2021 20:40:44 +0100
osmo-cbc (0.2.1) unstable; urgency=medium
[ Harald Welte ]

8
debian/control vendored
View File

@@ -11,14 +11,14 @@ Build-Depends: debhelper (>=9),
pkg-config,
python3-minimal,
libtalloc-dev,
libosmocore-dev,
libosmo-netif-dev,
libosmocore-dev (>= 1.7.0),
libosmo-netif-dev (>= 1.2.0),
libulfius-dev,
libjansson-dev,
osmo-gsm-manuals-dev
Standards-Version: 3.9.8
Vcs-Git: git://git.osmocom.org/osmo-cbc.git
Vcs-Browser: https://git.osmocom.org/osmo-cbc/
Vcs-Git: https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc
Vcs-Browser: https://gitea.osmocom.org/cellular-infrastructure/osmo-cbc
Homepage: https://projects.osmocom.org/projects/osmo-cbc
Package: osmo-cbc

View File

@@ -1,3 +1,11 @@
log stderr
logging level cbsp debug
cbc
unknown-peers reject
cbsp
local-ip 127.0.0.1
local-port 48049
ecbe
local-ip 127.0.0.1
local-port 12345

View File

@@ -67,7 +67,7 @@
"dcs_class": { "$ref": "#/definitions/dcs_class" },
"data_utf8": { "type": "string" }
},
"required": [ "data" ]
"required": [ "data_utf8" ]
},
"page": {
"type": "string"

View File

@@ -5,14 +5,30 @@ AM_CFLAGS=-Wall -g $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAG
$(COVERAGE_CFLAGS)
AM_LDFLAGS=$(COVERAGE_LDFLAGS)
EXTRA_DIST = cbc_data.h cbsp_server.h charset.h internal.h rest_it_op.h
EXTRA_DIST = \
cbc_data.h \
cbsp_server.h \
charset.h \
internal.h \
rest_it_op.h \
$(NULL)
bin_PROGRAMS = osmo-cbc
osmo_cbc_SOURCES = cbc_main.c cbc_data.c cbc_vty.c cbsp_server.c cbsp_server_fsm.c \
rest_api.c charset.c message_handling.c rest_it_op.c \
smscb_peer_fsm.c smscb_message_fsm.c
osmo_cbc_SOURCES = \
cbc_main.c \
cbc_data.c \
cbc_vty.c \
cbsp_server.c \
cbsp_server_fsm.c \
rest_api.c \
charset.c \
message_handling.c \
rest_it_op.c \
smscb_peer_fsm.c \
smscb_message_fsm.c \
$(NULL)
osmo_cbc_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) \
$(LIBOSMONETIF_LIBS) \
$(ULFIUS_LIBS) $(JANSSON_LIBS) $(ORCANIA_LIBS)

View File

@@ -99,6 +99,8 @@ struct cbc_peer *cbc_peer_by_addr_proto(const char *remote_host, uint16_t remote
struct cbc_peer *peer;
llist_for_each_entry(peer, &g_cbc->peers, list) {
if (!peer->remote_host)
continue;
if (!strcasecmp(remote_host, peer->remote_host)) {
if (peer->remote_port == -1)
return peer;

View File

@@ -244,8 +244,7 @@ int main(int argc, char **argv)
exit(1);
}
if (cbsp_cbc_create(tall_cbc_ctx, g_cbc->config.cbsp.local_host, g_cbc->config.cbsp.local_port,
&cbc_client_rx_cb) == NULL) {
if (cbsp_cbc_create(tall_cbc_ctx) == NULL) {
perror("Error binidng CBSP port\n");
exit(1);
}

View File

@@ -48,7 +48,8 @@ static void dump_one_cbc_peer(struct vty *vty, const struct cbc_peer *peer)
}
vty_out(vty, "|%-20s| %-15s| %-5d| %-6s| %-20s|%s",
peer->name ? peer->name : "<unnamed>", peer->remote_host, peer->remote_port,
peer->name ? peer->name : "<unnamed>",
peer->remote_host ? peer->remote_host : "<unset>", peer->remote_port,
get_value_string(cbc_peer_proto_name, peer->proto), state, VTY_NEWLINE);
}
@@ -347,7 +348,7 @@ static int config_write_cbsp(struct vty *vty)
}
DEFUN(cfg_cbsp_local_ip, cfg_cbsp_local_ip_cmd,
"local-ip (A.B.C.D|X:X::X:X)",
"local-ip " VTY_IPV46_CMD,
"Local IP address for CBSP\n"
"Local IPv4 address for CBSP\n" "Local IPv6 address for CBSP\n")
{
@@ -383,7 +384,7 @@ static int config_write_ecbe(struct vty *vty)
}
DEFUN(cfg_ecbe_local_ip, cfg_ecbe_local_ip_cmd,
"local-ip (A.B.C.D|X:X::X:X)",
"local-ip " VTY_IPV46_CMD,
"Local IP address for CBSP\n"
"Local IPv4 address for ECBE REST Interface\n"
"Local IPv6 address for ECBE REST Interface\n")
@@ -394,8 +395,8 @@ DEFUN(cfg_ecbe_local_ip, cfg_ecbe_local_ip_cmd,
DEFUN(cfg_ecbe_local_port, cfg_ecbe_local_port_cmd,
"local-port <0-65535>",
"Local TCP port for ECBE RESET Interface\n"
"Local TCP port for ECBE RESET Interface\n")
"Local TCP port for ECBE REST Interface\n"
"Local TCP port for ECBE REST Interface\n")
{
g_cbc->config.ecbe.local_port = atoi(argv[0]);
return CMD_SUCCESS;
@@ -406,7 +407,8 @@ DEFUN(cfg_ecbe_local_port, cfg_ecbe_local_port_cmd,
DEFUN(cfg_cbc_peer, cfg_cbc_peer_cmd,
"peer NAME",
"Remote Peer\n")
"Remote Peer\n"
"Name identifying the peer\n")
{
struct cbc_peer *peer;
@@ -423,7 +425,8 @@ DEFUN(cfg_cbc_peer, cfg_cbc_peer_cmd,
DEFUN(cfg_cbc_no_peer, cfg_cbc_no_peer_cmd,
"no peer NAME",
NO_STR "Remote Peer\n")
NO_STR "Remote Peer\n"
"Name identifying the peer\n")
{
struct cbc_peer *peer;
@@ -469,9 +472,9 @@ DEFUN(cfg_peer_no_remote_port, cfg_peer_no_remote_port_cmd,
DEFUN(cfg_peer_remote_ip, cfg_peer_remote_ip_cmd,
"remote-ip (A.B.C.D|X:X::X:X)",
"remote-ip " VTY_IPV46_CMD,
"Configure remote IP of peer\n"
"Remote IP address of peer\n")
"IPv4 address of peer\n" "IPv6 address of peer\n")
{
struct cbc_peer *peer = (struct cbc_peer *) vty->index;
osmo_talloc_replace_string(peer, &peer->remote_host, argv[0]);
@@ -488,7 +491,8 @@ static void write_one_peer(struct vty *vty, struct cbc_peer *peer)
vty_out(vty, " no remote-port%s", VTY_NEWLINE);
else
vty_out(vty, " remote-port %d%s", peer->remote_port, VTY_NEWLINE);
vty_out(vty, " remote-ip %s%s", peer->remote_host, VTY_NEWLINE);
if (peer->remote_host)
vty_out(vty, " remote-ip %s%s", peer->remote_host, VTY_NEWLINE);
}
static int config_write_peer(struct vty *vty)

View File

@@ -126,6 +126,8 @@ static int cbsp_cbc_accept_cb(struct osmo_stream_srv_link *link, int fd)
osmo_sock_get_ip_and_port(fd, remote_ip, sizeof(remote_ip), portbuf, sizeof(portbuf), false);
remote_port = atoi(portbuf);
LOGP(DCBSP, LOGL_NOTICE, "New CBSP client connection from %s:%u\n", remote_ip, remote_port);
client->conn = osmo_stream_srv_create(link, link, fd, cbsp_cbc_read_cb, cbsp_cbc_closed_cb, client);
if (!client->conn) {
LOGP(DCBSP, LOGL_ERROR, "Unable to create stream server for %s:%d\n",
@@ -167,9 +169,7 @@ static int cbsp_cbc_accept_cb(struct osmo_stream_srv_link *link, int fd)
client->peer->client.cbsp = client;
}
LOGPCC(client, LOGL_NOTICE, "New CBSP client connection from %s:%u\n", remote_ip, remote_port);
osmo_fsm_inst_dispatch(client->fi, CBSP_SRV_E_CMD_RESET, NULL);
return 0;
}
@@ -206,18 +206,18 @@ void cbsp_cbc_client_close(struct osmo_cbsp_cbc_client *client)
}
/* initialize the CBC-side CBSP server */
struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx, const char *bind_ip, int bind_port,
int (*rx_cb)(struct osmo_cbsp_cbc_client *client,
struct osmo_cbsp_decoded *dec))
struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx)
{
struct osmo_cbsp_cbc *cbc = talloc_zero(ctx, struct osmo_cbsp_cbc);
int rc;
char *bind_ip = g_cbc->config.cbsp.local_host;
int bind_port = g_cbc->config.cbsp.local_port;
if (bind_port == -1)
bind_port = CBSP_TCP_PORT;
OSMO_ASSERT(cbc);
cbc->rx_cb = rx_cb;
cbc->rx_cb = cbsp_cbc_client_rx_cb;
INIT_LLIST_HEAD(&cbc->clients);
cbc->link = osmo_stream_srv_link_create(cbc);
osmo_stream_srv_link_set_data(cbc->link, cbc);

View File

@@ -23,6 +23,8 @@ struct osmo_cbsp_cbc {
int (*rx_cb)(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec);
};
struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx);
/* a single (remote) client connected to the (local) CBC server */
struct osmo_cbsp_cbc_client {
/* entry in osmo_cbsp_cbc.clients */
@@ -40,6 +42,4 @@ struct osmo_cbsp_cbc_client {
const char *cbsp_cbc_client_name(const struct osmo_cbsp_cbc_client *client);
void cbsp_cbc_client_tx(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *cbsp);
void cbsp_cbc_client_close(struct osmo_cbsp_cbc_client *client);
struct osmo_cbsp_cbc *cbsp_cbc_create(void *ctx, const char *bind_ip, int bind_port,
int (*rx_cb)(struct osmo_cbsp_cbc_client *client,
struct osmo_cbsp_decoded *dec));
int cbsp_cbc_client_rx_cb(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec);

View File

@@ -269,7 +269,7 @@ static int get_msg_id(const struct osmo_cbsp_decoded *dec)
}
/* message was received from remote CBSP peer (BSC) */
int cbc_client_rx_cb(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec)
int cbsp_cbc_client_rx_cb(struct osmo_cbsp_cbc_client *client, struct osmo_cbsp_decoded *dec)
{
struct cbc_message *smscb;
struct cbc_message_peer *mp;

View File

@@ -589,7 +589,7 @@ static int api_cb_message_post(const struct _u_request *req, struct _u_response
return U_CALLBACK_COMPLETE;
err:
jsonstr = json_dumps(json_req, 0);
LOGP(DREST, LOGL_ERROR, "ERROR: %s (%s)", errstr, jsonstr);
LOGP(DREST, LOGL_ERROR, "ERROR: %s (%s)\n", errstr, jsonstr);
free(jsonstr);
json_decref(json_req);
talloc_free(riop);
@@ -602,7 +602,7 @@ static int api_cb_message_del(const struct _u_request *req, struct _u_response *
{
const char *message_id_str = u_map_get(req->map_url, "message_id");
struct rest_it_op *riop = talloc_zero(g_cbc, struct rest_it_op);
uint16_t message_id;
int message_id;
int status = 404;
int rc;

View File

@@ -149,25 +149,28 @@ static void cci_from_cbsp(struct cbc_cell_id *cci, enum CELL_IDENT id_discr,
static void cbsp_from_cci(union gsm0808_cell_id_u *u, const struct cbc_cell_id *cci)
{
switch (cci->id_discr) {
case CELL_IDENT_NO_CELL:
case CBC_CELL_ID_NONE:
break;
case CELL_IDENT_WHOLE_GLOBAL:
case CBC_CELL_ID_CGI:
u->global = cci->u.cgi;
printf("u->gobal: %s\n", osmo_hexdump((uint8_t *) &u->global, sizeof(u->global)));
break;
case CELL_IDENT_LAC_AND_CI:
case CBC_CELL_ID_LAC_CI:
u->lac_and_ci = cci->u.lac_and_ci;
break;
case CELL_IDENT_CI:
case CBC_CELL_ID_CI:
u->ci = cci->u.ci;
break;
case CELL_IDENT_LAI:
case CBC_CELL_ID_LAI:
u->lai_and_lac = cci->u.lai;
break;
case CELL_IDENT_LAC:
case CBC_CELL_ID_LAC:
u->lac = cci->u.lac;
break;
case CELL_IDENT_BSS:
case CBC_CELL_ID_BSS:
break;
default:
OSMO_ASSERT(0);
}
}
@@ -408,16 +411,24 @@ static void smscb_p_fsm_wait_replace_ack(struct osmo_fsm_inst *fi, uint32_t even
static void smscb_p_fsm_wait_delete_ack(struct osmo_fsm_inst *fi, uint32_t event, void *data)
{
struct cbc_message_peer *mp = (struct cbc_message_peer *) fi->priv;
struct osmo_cbsp_decoded *dec = NULL;
switch (event) {
case SMSCB_E_CBSP_DELETE_ACK:
/* TODO: append results */
dec = data;
/* append results */
msg_peer_append_cbsp_compl(mp, &dec->u.kill_compl.num_compl_list);
msg_peer_append_cbsp_cell(mp, &dec->u.kill_compl.cell_list);
/* Signal parent fsm about completion */
osmo_fsm_inst_dispatch(fi->proc.parent, SMSCB_E_CBSP_DELETE_ACK, mp);
osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
break;
case SMSCB_E_CBSP_DELETE_NACK:
/* TODO: append results */
dec = data;
/* append results */
msg_peer_append_cbsp_compl(mp, &dec->u.kill_fail.num_compl_list);
msg_peer_append_cbsp_cell(mp, &dec->u.kill_fail.cell_list);
msg_peer_append_cbsp_fail(mp, &dec->u.kill_fail.fail_list);
/* Signal parent fsm about completion */
osmo_fsm_inst_dispatch(fi->proc.parent, SMSCB_E_CBSP_DELETE_NACK, mp);
osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
@@ -476,6 +487,12 @@ static void smscb_p_fsm_allstate(struct osmo_fsm_inst *fi, uint32_t event, void
cbsp->u.kill.old_serial_nr = mp->cbcmsg->msg.serial_nr;
/* TODO: we assume that the delete will always affect all original cells */
cbsp_append_cell_list(&cbsp->u.kill.cell_list, cbsp, mp);
if (!mp->cbcmsg->msg.is_etws) {
/* Channel Indication IE is only present in CBS, not in ETWS! */
cbsp->u.kill.channel_ind = talloc_zero(cbsp, enum cbsp_channel_ind);
OSMO_ASSERT(cbsp->u.kill.channel_ind);
*(cbsp->u.kill.channel_ind) = CBSP_CHAN_IND_BASIC;
}
cbsp_cbc_client_tx(mp->peer->client.cbsp, cbsp);
osmo_fsm_inst_state_chg(fi, SMSCB_S_WAIT_DELETE_ACK, 10, T_WAIT_DELETE_ACK);
break;