aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/sgsn_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gprs/sgsn_main.c')
-rw-r--r--src/gprs/sgsn_main.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index c59265fb..bfa2e52c 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -28,18 +28,19 @@
#include <signal.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <osmocore/talloc.h>
-#include <osmocore/select.h>
-#include <osmocore/rate_ctr.h>
-#include <osmocore/logging.h>
-#include <osmocore/process.h>
+#include <osmocom/core/application.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/select.h>
+#include <osmocom/core/rate_ctr.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/process.h>
#include <osmocom/vty/telnet_interface.h>
+#include <osmocom/vty/logging.h>
#include <openbsc/signal.h>
#include <openbsc/debug.h>
@@ -62,7 +63,6 @@ void subscr_put() { abort(); }
void *tall_bsc_ctx;
struct gprs_ns_inst *sgsn_nsi;
-static struct log_target *stderr_target;
static int daemonize = 0;
const char *openbsc_copyright =
"Copyright (C) 2010 Harald Welte and On-Waves\r\n"
@@ -80,7 +80,7 @@ struct sgsn_instance *sgsn = &sgsn_inst;
/* call-back function for the NS protocol */
static int sgsn_ns_cb(enum gprs_ns_evt event, struct gprs_nsvc *nsvc,
- struct msgb *msg, u_int16_t bvci)
+ struct msgb *msg, uint16_t bvci)
{
int rc = 0;
@@ -105,7 +105,7 @@ static void signal_handler(int signal)
switch (signal) {
case SIGINT:
- dispatch_signal(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
+ osmo_signal_dispatch(SS_GLOBAL, S_GLOBAL_SHUTDOWN, NULL);
sleep(1);
exit(0);
break;
@@ -174,10 +174,10 @@ static void handle_options(int argc, char **argv)
print_help();
exit(0);
case 's':
- log_set_use_color(stderr_target, 0);
+ log_set_use_color(osmo_stderr_target, 0);
break;
case 'd':
- log_parse_category_mask(stderr_target, optarg);
+ log_parse_category_mask(osmo_stderr_target, optarg);
break;
case 'D':
daemonize = 1;
@@ -186,10 +186,10 @@ static void handle_options(int argc, char **argv)
sgsn_inst.config_file = strdup(optarg);
break;
case 'T':
- log_set_print_timestamp(stderr_target, 1);
+ log_set_print_timestamp(osmo_stderr_target, 1);
break;
case 'e':
- log_set_log_level(stderr_target, atoi(optarg));
+ log_set_log_level(osmo_stderr_target, atoi(optarg));
break;
default:
/* ignore */
@@ -211,16 +211,13 @@ int main(int argc, char **argv)
signal(SIGABRT, &signal_handler);
signal(SIGUSR1, &signal_handler);
signal(SIGUSR2, &signal_handler);
- signal(SIGPIPE, SIG_IGN);
- log_init(&log_info);
- stderr_target = log_target_create_stderr();
- log_add_target(stderr_target);
- log_set_all_filter(stderr_target, 1);
+ osmo_init_ignore_signals();
+ osmo_init_logging(&log_info);
vty_info.copyright = openbsc_copyright;
vty_init(&vty_info);
- logging_vty_add_cmds();
+ logging_vty_add_cmds(&log_info);
sgsn_vty_init();
handle_options(argc, argv);
@@ -279,7 +276,7 @@ int main(int argc, char **argv)
}
while (1) {
- rc = bsc_select_main(0);
+ rc = osmo_select_main(0);
if (rc < 0)
exit(3);
}