aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/main.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-25 13:42:13 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-25 13:48:33 +0200
commit0e2b6244184a1c030252667765a0587073575d23 (patch)
tree3e9a850e6ea4ac59f1e10c7694d280a5fd3811ba /src/osmo-bts-sysmo/main.c
parent7996134d2afb8098eb750433b20185bde21e0023 (diff)
sysmobts: Revert all sysmobts-mgr related changes
Harald is right and that the code is generally not ready for inclusion. I fell victim of trying to finish it while the code is not ready at all. It is better to re-introduce the patches in a smaller and more tested way. The right way would have been a branch were ready things are split-off the main/wip commit until everything is ready. Revert "sysmobts: Have a common prefix for the enum" This reverts commit 44980347f308fe5bbe48a933dbc81b82b53d310a. Revert "utils: Used the enum manuf_type_id in the parameter of add_manufacturer_id_label" This reverts commit 7d36e5ed46b630203167fc9d5d28e0087fdbd394. Revert "utils: Classify the OML message using the return type" This reverts commit afee0b7929a00500f9c204f3bc7e12f72451e832. Revert "sysmobts: Do not access out of bound string" This reverts commit f5f41e805195c8c3294a9e6a68b10f975fbabbbd. Revert "sysmobts: Separate IPA and OML check into two methods" This reverts commit 13a224063dfcee0be529fba1c8fb9be9c1fb261e. Revert "screenrc: osmobts-mgr now needs a config file" This reverts commit 0a1699ff8a5462c167c24e8b28186abb26331698. Revert "make sure osmobts-mgr.cfg file is included in tarballs" This reverts commit 14c60b425f8146f6a392d2d3de2979c817cd975e. Revert "sysmobts-mgr: Add VTY support for configuring it" This reverts commit c5fedd24c96a4ef6d7a0c0ed3c70d6ef0abd5c17. Revert "sysmobts: Add beginnings of an OML router and create Failure Messages in the sysmobts-manager" This reverts commit c6ab90b27006ff2d1fdfb0b1d7fc01e1dd4a696d.
Diffstat (limited to 'src/osmo-bts-sysmo/main.c')
-rw-r--r--src/osmo-bts-sysmo/main.c104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c
index 81f6474c..bd11472b 100644
--- a/src/osmo-bts-sysmo/main.c
+++ b/src/osmo-bts-sysmo/main.c
@@ -35,10 +35,8 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/application.h>
-#include <osmocom/core/socket.h>
#include <osmocom/vty/telnet_interface.h>
#include <osmocom/vty/logging.h>
-#include <osmocom/gsm/protocol/ipaccess.h>
#include <osmo-bts/gsm_data.h>
#include <osmo-bts/logging.h>
@@ -47,9 +45,6 @@
#include <osmo-bts/vty.h>
#include <osmo-bts/bts_model.h>
#include <osmo-bts/pcu_if.h>
-#include <osmo-bts/oml.h>
-
-#include "misc/sysmobts_mgr.h"
#define SYSMOBTS_RF_LOCK_PATH "/var/lock/bts_rf_lock"
@@ -263,7 +258,6 @@ static void signal_handler(int signal)
case SIGINT:
//osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
bts_shutdown(bts, "SIGINT");
- unlink(SOCKET_PATH);
break;
case SIGABRT:
case SIGUSR1:
@@ -294,97 +288,6 @@ static int write_pid_file(char *procname)
return 0;
}
-static int read_sock(struct osmo_fd *fd, unsigned int what)
-{
- struct msgb *msg;
- struct gsm_abis_mo *mo;
- int rc;
-
- msg = oml_msgb_alloc();
- if (msg == NULL) {
- LOGP(DL1C, LOGL_ERROR,
- "Failed to allocate oml msgb.\n");
- return -1;
- }
-
- rc = recv(fd->fd, msg->tail, msg->data_len, 0);
- if (rc <= 0) {
- close(fd->fd);
- osmo_fd_unregister(fd);
- fd->fd = -1;
- goto err;
- }
-
- msgb_put(msg, rc);
-
- rc = check_ipa_header(msg);
- if (rc < 0) {
- LOGP(DL1C, LOGL_ERROR, "Malformed receive message: Ipa hdr\n");
- goto err;
- }
-
- msgb_pull(msg, sizeof(struct ipaccess_head));
-
- rc = check_oml_msg(msg);
- if (rc < 0) {
- LOGP(DL1C, LOGL_ERROR, "Malformed receive message\n");
- goto err;
- }
-
- mo = &bts->mo;
- msg->trx = mo->bts->c0;
-
- return abis_oml_sendmsg(msg);
-
-err:
- msgb_free(msg);
- return -1;
-}
-
-static int accept_unix_sock(struct osmo_fd *fd, unsigned int what)
-{
- int sfd = fd->fd, cl;
- struct osmo_fd *read_fd = (struct osmo_fd *)fd->data;
-
- if (read_fd->fd > -1) {
- close(read_fd->fd);
- osmo_fd_unregister(read_fd);
- read_fd->fd = -1;
- }
-
- cl = accept(sfd, NULL, NULL);
- if (cl < 0) {
- LOGP(DL1C, LOGL_ERROR, "Failed to accept. errno: %s.\n",
- strerror(errno));
- return -1;
- }
-
- read_fd->fd = cl;
- if (osmo_fd_register(read_fd) != 0) {
- LOGP(DL1C, LOGL_ERROR, "Register the read file desc.\n");
- close(cl);
- read_fd->fd = -1;
- return -1;
- }
-
- return 0;
-}
-
-static int oml_sock_unix_init(struct osmo_fd *accept, struct osmo_fd *read)
-{
- int rc;
-
- accept->cb = accept_unix_sock;
- read->cb = read_sock;
- read->when = BSC_FD_READ;
- read->fd = -1;
- accept->data = read;
-
- rc = osmo_sock_unix_init_ofd(accept, SOCK_SEQPACKET, 0, SOCKET_PATH,
- OSMO_SOCK_F_BIND | OSMO_SOCK_F_NONBLOCK);
- return rc;
-}
-
int main(int argc, char **argv)
{
struct stat st;
@@ -392,7 +295,6 @@ int main(int argc, char **argv)
struct gsm_bts_role_bts *btsb;
struct e1inp_line *line;
void *tall_msgb_ctx;
- struct osmo_fd accept_fd, read_fd;
int rc;
tall_bts_ctx = talloc_named_const(NULL, 1, "OsmoBTS context");
@@ -471,12 +373,6 @@ int main(int argc, char **argv)
exit(1);
}
- rc = oml_sock_unix_init(&accept_fd, &read_fd);
- if (rc < 0) {
- perror("Error creating socket domain creation");
- exit(1);
- }
-
if (daemonize) {
rc = osmo_daemonize();
if (rc < 0) {