diff options
Diffstat (limited to 'openbsc/src/osmo-bsc')
-rw-r--r-- | openbsc/src/osmo-bsc/Makefile.am | 6 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_main.c | 4 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 17 | ||||
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_rf.c | 28 |
4 files changed, 29 insertions, 26 deletions
diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index f32705c01..b59ea16bf 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -1,6 +1,6 @@ INCLUDES = $(all_includes) -I$(top_srcdir)/include -I$(top_builddir) -AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) -AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS) +AM_CFLAGS=-Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOSCCP_CFLAGS) $(COVERAGE_CFLAGS) $(LIBOSMOABIS_CFLAGS) +AM_LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(COVERAGE_LDFLAGS) $(LIBOSMOABIS_LIBS) bin_PROGRAMS = osmo-bsc @@ -12,8 +12,8 @@ osmo_bsc_SOURCES = osmo_bsc_main.c osmo_bsc_rf.c osmo_bsc_vty.c osmo_bsc_api.c \ osmo_bsc_LDADD = $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libabis/libabis.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libctrl/libctrl.a \ + $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOSCCP_LIBS) diff --git a/openbsc/src/osmo-bsc/osmo_bsc_main.c b/openbsc/src/osmo-bsc/osmo_bsc_main.c index 7d376ef0e..d8950dac1 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_main.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_main.c @@ -146,7 +146,7 @@ static void signal_handler(int signal) switch (signal) { case SIGINT: bsc_shutdown_net(bsc_gsmnet); - osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL); + osmo_signal_dispatch(SS_L_GLOBAL, S_L_GLOBAL_SHUTDOWN, NULL); sleep(3); exit(0); break; @@ -396,7 +396,7 @@ int main(int argc, char **argv) osmo_init_logging(&log_info); bts_init(); - e1inp_init(); + libosmo_abis_init(tall_bsc_ctx); /* enable filters */ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index f4d6cf2eb..04cfb997d 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -34,6 +34,8 @@ #include <osmocom/sccp/sccp.h> +#include <osmocom/abis/ipa.h> + #include <sys/socket.h> #include <netinet/tcp.h> #include <unistd.h> @@ -183,7 +185,7 @@ static int msc_alink_do_write(struct osmo_fd *fd, struct msgb *msg) int ret; LOGP(DMSC, LOGL_DEBUG, "Sending SCCP to MSC: %u\n", msgb_l2len(msg)); - LOGP(DMI, LOGL_DEBUG, "MSC TX %s\n", osmo_hexdump(msg->data, msg->len)); + LOGP(DLMI, LOGL_DEBUG, "MSC TX %s\n", osmo_hexdump(msg->data, msg->len)); ret = write(fd->fd, msg->data, msg->len); if (ret < msg->len) @@ -244,23 +246,24 @@ static void osmo_ext_handle(struct osmo_msc_data *msc, struct msgb *msg) static int ipaccess_a_fd_cb(struct osmo_fd *bfd) { - int error; - struct msgb *msg = ipaccess_read_msg(bfd, &error); + struct msgb *msg; struct ipaccess_head *hh; struct osmo_msc_data *data = (struct osmo_msc_data *) bfd->data; + int ret; - if (!msg) { - if (error == 0) { + ret = ipa_msg_recv(bfd->fd, &msg); + if (ret <= 0) { + if (ret == 0) { LOGP(DMSC, LOGL_ERROR, "The connection to the MSC was lost.\n"); bsc_msc_lost(data->msc_con); return -1; } - LOGP(DMSC, LOGL_ERROR, "Failed to parse ip access message: %d\n", error); + LOGP(DMSC, LOGL_ERROR, "Failed to parse ip access message: %d\n", ret); return -1; } - LOGP(DMI, LOGL_DEBUG, "From MSC: %s proto: %d\n", osmo_hexdump(msg->data, msg->len), msg->l2h[0]); + LOGP(DLMI, LOGL_DEBUG, "From MSC: %s proto: %d\n", osmo_hexdump(msg->data, msg->len), msg->l2h[0]); /* handle base message handling */ hh = (struct ipaccess_head *) msg->data; diff --git a/openbsc/src/osmo-bsc/osmo_bsc_rf.c b/openbsc/src/osmo-bsc/osmo_bsc_rf.c index 6e9e027d9..6288fbf9f 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_rf.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_rf.c @@ -62,7 +62,7 @@ static void send_resp(struct osmo_bsc_rf_conn *conn, char send) msg = msgb_alloc(10, "RF Query"); if (!msg) { - LOGP(DINP, LOGL_ERROR, "Failed to allocate response msg.\n"); + LOGP(DLINP, LOGL_ERROR, "Failed to allocate response msg.\n"); return; } @@ -70,7 +70,7 @@ static void send_resp(struct osmo_bsc_rf_conn *conn, char send) msg->l2h[0] = send; if (osmo_wqueue_enqueue(&conn->queue, msg) != 0) { - LOGP(DINP, LOGL_ERROR, "Failed to enqueue the answer.\n"); + LOGP(DLINP, LOGL_ERROR, "Failed to enqueue the answer.\n"); msgb_free(msg); return; } @@ -152,7 +152,7 @@ static void grace_timeout(void *_data) { struct osmo_bsc_rf *rf = (struct osmo_bsc_rf *) _data; - LOGP(DINP, LOGL_NOTICE, "Grace timeout. Disabling the TRX.\n"); + LOGP(DLINP, LOGL_NOTICE, "Grace timeout. Disabling the TRX.\n"); switch_rf_off(rf); } @@ -161,7 +161,7 @@ static int enter_grace(struct osmo_bsc_rf *rf) rf->grace_timeout.cb = grace_timeout; rf->grace_timeout.data = rf; osmo_timer_schedule(&rf->grace_timeout, rf->gsm_network->msc_data->mid_call_timeout, 0); - LOGP(DINP, LOGL_NOTICE, "Going to switch RF off in %d seconds.\n", + LOGP(DLINP, LOGL_NOTICE, "Going to switch RF off in %d seconds.\n", rf->gsm_network->msc_data->mid_call_timeout); send_signal(rf, S_RF_GRACE); @@ -202,7 +202,7 @@ static int rf_read_cmd(struct osmo_fd *fd) rc = read(fd->fd, buf, sizeof(buf)); if (rc != sizeof(buf)) { - LOGP(DINP, LOGL_ERROR, "Short read %d/%s\n", errno, strerror(errno)); + LOGP(DLINP, LOGL_ERROR, "Short read %d/%s\n", errno, strerror(errno)); osmo_fd_unregister(fd); close(fd->fd); osmo_wqueue_clear(&conn->queue); @@ -223,7 +223,7 @@ static int rf_read_cmd(struct osmo_fd *fd) break; default: conn->rf->last_state_command = "Unknown command"; - LOGP(DINP, LOGL_ERROR, "Unknown command %d\n", buf[0]); + LOGP(DLINP, LOGL_ERROR, "Unknown command %d\n", buf[0]); break; } @@ -236,7 +236,7 @@ static int rf_write_cmd(struct osmo_fd *fd, struct msgb *msg) rc = write(fd->fd, msg->data, msg->len); if (rc != msg->len) { - LOGP(DINP, LOGL_ERROR, "Short write %d/%s\n", errno, strerror(errno)); + LOGP(DLINP, LOGL_ERROR, "Short write %d/%s\n", errno, strerror(errno)); return -1; } @@ -253,14 +253,14 @@ static int rf_ctrl_accept(struct osmo_fd *bfd, unsigned int what) fd = accept(bfd->fd, (struct sockaddr *) &addr, &len); if (fd < 0) { - LOGP(DINP, LOGL_ERROR, "Failed to accept. errno: %d/%s\n", + LOGP(DLINP, LOGL_ERROR, "Failed to accept. errno: %d/%s\n", errno, strerror(errno)); return -1; } conn = talloc_zero(rf, struct osmo_bsc_rf_conn); if (!conn) { - LOGP(DINP, LOGL_ERROR, "Failed to allocate mem.\n"); + LOGP(DLINP, LOGL_ERROR, "Failed to allocate mem.\n"); close(fd); return -1; } @@ -292,14 +292,14 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net rf = talloc_zero(NULL, struct osmo_bsc_rf); if (!rf) { - LOGP(DINP, LOGL_ERROR, "Failed to create osmo_bsc_rf.\n"); + LOGP(DLINP, LOGL_ERROR, "Failed to create osmo_bsc_rf.\n"); return NULL; } bfd = &rf->listen; bfd->fd = socket(AF_UNIX, SOCK_STREAM, 0); if (bfd->fd < 0) { - LOGP(DINP, LOGL_ERROR, "Can not create socket. %d/%s\n", + LOGP(DLINP, LOGL_ERROR, "Can not create socket. %d/%s\n", errno, strerror(errno)); return NULL; } @@ -323,7 +323,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net rc = bind(bfd->fd, (struct sockaddr *) &local, namelen); if (rc != 0) { - LOGP(DINP, LOGL_ERROR, "Failed to bind '%s' errno: %d/%s\n", + LOGP(DLINP, LOGL_ERROR, "Failed to bind '%s' errno: %d/%s\n", local.sun_path, errno, strerror(errno)); close(bfd->fd); talloc_free(rf); @@ -331,7 +331,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net } if (listen(bfd->fd, 0) != 0) { - LOGP(DINP, LOGL_ERROR, "Failed to listen: %d/%s\n", errno, strerror(errno)); + LOGP(DLINP, LOGL_ERROR, "Failed to listen: %d/%s\n", errno, strerror(errno)); close(bfd->fd); talloc_free(rf); return NULL; @@ -342,7 +342,7 @@ struct osmo_bsc_rf *osmo_bsc_rf_create(const char *path, struct gsm_network *net bfd->data = rf; if (osmo_fd_register(bfd) != 0) { - LOGP(DINP, LOGL_ERROR, "Failed to register bfd.\n"); + LOGP(DLINP, LOGL_ERROR, "Failed to register bfd.\n"); close(bfd->fd); talloc_free(rf); return NULL; |