diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2017-07-13 02:03:50 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-08-30 14:14:58 +0200 |
commit | ee6cfdc0d9710e3a69c8e1939eb21c8f2b759885 (patch) | |
tree | ed5aeb0979a1838778649078847a1ed6caa6b1a4 /src/gprs/gtphub_main.c | |
parent | 6c809185ee86d318d10205756bb6d91914d11fdf (diff) |
split off osmo-sgsn: remove files, apply build1.1.0
Change-Id: I5d27ff93e56cd13e0e70edd15e2080201e35e91f
Diffstat (limited to 'src/gprs/gtphub_main.c')
-rw-r--r-- | src/gprs/gtphub_main.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/src/gprs/gtphub_main.c b/src/gprs/gtphub_main.c index 2b87d19ef..d7b3ba74b 100644 --- a/src/gprs/gtphub_main.c +++ b/src/gprs/gtphub_main.c @@ -39,6 +39,8 @@ #include <osmocom/vty/telnet_interface.h> #include <osmocom/vty/ports.h> +#include <osmocom/sigtran/osmo_ss7.h> + #include <openbsc/debug.h> #include <openbsc/gtphub.h> #include <openbsc/vty.h> @@ -46,7 +48,7 @@ #include "../../bscconfig.h" extern void *osmo_gtphub_ctx; - +void *tall_bsc_ctx; const char *gtphub_copyright = "Copyright (C) 2015 sysmocom s.f.m.c GmbH <info@sysmocom.de>\r\n" @@ -113,13 +115,38 @@ static void signal_handler(int signal) } } -extern int bsc_vty_go_parent(struct vty *vty); +int gtphub_vty_go_parent(struct vty *vty) +{ + switch (vty->node) { + default: + osmo_ss7_vty_go_parent(vty); + } + + return vty->node; +} + +int gtphub_vty_is_config_node(struct vty *vty, int node) +{ + /* Check if libosmo-sccp declares the node in + * question as config node */ + if (osmo_ss7_is_config_node(vty, node)) + return 1; + + switch (node) { + /* add items that are not config */ + case CONFIG_NODE: + return 0; + + default: + return 1; + } +} static struct vty_app_info vty_info = { .name = "OsmoGTPhub", .version = PACKAGE_VERSION, - .go_parent_cb = bsc_vty_go_parent, - .is_config_node = bsc_vty_is_config_node, + .go_parent_cb = gtphub_vty_go_parent, + .is_config_node = gtphub_vty_is_config_node, }; struct cmdline_cfg { |