aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 03:23:30 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 03:23:30 +0200
commit5307472ba2a3e1bbb1df314541e5d7ef670fb82f (patch)
treee951beb03c018ebedcd0def80ef35927b01ad9e4
parent2739d28ac8884c0e0085f357b578f8ed8e9443c0 (diff)
apply
-rw-r--r--include/openbsc/vty.h2
-rw-r--r--src/gprs/gb_proxy_main.c1
-rw-r--r--src/gprs/gprs_llc.c3
-rw-r--r--src/gprs/gprs_llc_vty.c1
-rw-r--r--src/gprs/gprs_sndcp_vty.c1
-rw-r--r--src/gprs/sgsn_ares.c2
-rw-r--r--src/gprs/sgsn_ctrl.c1
-rw-r--r--src/gprs/sgsn_main.c38
-rw-r--r--src/gprs/sgsn_vty.c2
9 files changed, 39 insertions, 12 deletions
diff --git a/include/openbsc/vty.h b/include/openbsc/vty.h
index f0495b84..d2e3d9a7 100644
--- a/include/openbsc/vty.h
+++ b/include/openbsc/vty.h
@@ -1,5 +1,7 @@
#pragma once
+#include <osmocom/vty/command.h>
+
enum bsc_vty_node {
GBPROXY_NODE = _LAST_OSMOVTY_NODE + 1,
SGSN_NODE,
diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c
index 70f6c7db..f4b05fae 100644
--- a/src/gprs/gb_proxy_main.c
+++ b/src/gprs/gb_proxy_main.c
@@ -205,7 +205,6 @@ int gbproxy_vty_go_parent(struct vty *vty)
{
switch (vty->node) {
case GBPROXY_NODE:
- case SGSN_NODE:
default:
if (gbproxy_vty_is_config_node(vty, vty->node))
vty->node = CONFIG_NODE;
diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c
index 2be663f9..904ec7e0 100644
--- a/src/gprs/gprs_llc.c
+++ b/src/gprs/gprs_llc.c
@@ -31,15 +31,14 @@
#include <osmocom/core/talloc.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/gprs/gprs_bssgp.h>
+#include <osmocom/gsm/gsm_utils.h>
-#include <openbsc/gsm_data.h>
#include <openbsc/debug.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/gprs_gmm.h>
#include <openbsc/gprs_llc.h>
#include <openbsc/crc24.h>
#include <openbsc/sgsn.h>
-#include <openbsc/gsm_subscriber.h>
#include <openbsc/gprs_llc_xid.h>
#include <openbsc/gprs_sndcp_comp.h>
#include <openbsc/gprs_sndcp.h>
diff --git a/src/gprs/gprs_llc_vty.c b/src/gprs/gprs_llc_vty.c
index bf34e978..626d6ef1 100644
--- a/src/gprs/gprs_llc_vty.c
+++ b/src/gprs/gprs_llc_vty.c
@@ -27,7 +27,6 @@
#include <arpa/inet.h>
-#include <openbsc/gsm_data.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
diff --git a/src/gprs/gprs_sndcp_vty.c b/src/gprs/gprs_sndcp_vty.c
index 430881fc..4bad8b04 100644
--- a/src/gprs/gprs_sndcp_vty.c
+++ b/src/gprs/gprs_sndcp_vty.c
@@ -26,7 +26,6 @@
#include <arpa/inet.h>
-#include <openbsc/gsm_data.h>
#include <osmocom/core/msgb.h>
#include <osmocom/gsm/tlv.h>
#include <osmocom/core/talloc.h>
diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c
index d94d184a..62380991 100644
--- a/src/gprs/sgsn_ares.c
+++ b/src/gprs/sgsn_ares.c
@@ -24,6 +24,8 @@
#include <netdb.h>
+extern void *tall_bsc_ctx;
+
struct cares_event_fd {
struct llist_head head;
struct osmo_fd fd;
diff --git a/src/gprs/sgsn_ctrl.c b/src/gprs/sgsn_ctrl.c
index 31ac74f1..f7b1180b 100644
--- a/src/gprs/sgsn_ctrl.c
+++ b/src/gprs/sgsn_ctrl.c
@@ -21,7 +21,6 @@
#include <osmocom/ctrl/control_if.h>
#include <osmocom/ctrl/control_cmd.h>
-#include <openbsc/gsm_data.h>
#include <openbsc/gprs_sgsn.h>
#include <openbsc/sgsn.h>
#include <openbsc/debug.h>
diff --git a/src/gprs/sgsn_main.c b/src/gprs/sgsn_main.c
index 5af23321..a543ae21 100644
--- a/src/gprs/sgsn_main.c
+++ b/src/gprs/sgsn_main.c
@@ -167,13 +167,40 @@ static void signal_handler(int signal)
/* NSI that BSSGP uses when transmitting on NS */
extern struct gprs_ns_inst *bssgp_nsi;
-extern int bsc_vty_go_parent(struct vty *vty);
+int sgsn_vty_is_config_node(struct vty *vty, int node)
+{
+ switch (node) {
+ /* add items that are not config */
+ case CONFIG_NODE:
+ return 0;
+
+ default:
+ return 1;
+ }
+}
+
+int sgsn_vty_go_parent(struct vty *vty)
+{
+ switch (vty->node) {
+ case SGSN_NODE:
+ default:
+ if (sgsn_vty_is_config_node(vty, vty->node))
+ vty->node = CONFIG_NODE;
+ else
+ vty->node = ENABLE_NODE;
+
+ vty->index = NULL;
+ }
+
+ return vty->node;
+}
+
static struct vty_app_info vty_info = {
.name = "OsmoSGSN",
.version = PACKAGE_VERSION,
- .go_parent_cb = bsc_vty_go_parent,
- .is_config_node = bsc_vty_is_config_node,
+ .go_parent_cb = sgsn_vty_go_parent,
+ .is_config_node = sgsn_vty_is_config_node,
};
static void print_help(void)
@@ -319,12 +346,11 @@ static const struct log_info gprs_log_info = {
.num_cat = ARRAY_SIZE(gprs_categories),
};
-int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
+int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
int main(int argc, char **argv)
{
struct ctrl_handle *ctrl;
- struct gsm_network dummy_network;
struct osmo_sccp_instance *sccp;
int rc;
@@ -382,7 +408,7 @@ int main(int argc, char **argv)
}
/* start telnet after reading config for vty_get_bind_addr() */
- rc = telnet_init_dynif(tall_bsc_ctx, &dummy_network,
+ rc = telnet_init_dynif(tall_bsc_ctx, NULL,
vty_get_bind_addr(), OSMO_VTY_PORT_SGSN);
if (rc < 0)
exit(1);
diff --git a/src/gprs/sgsn_vty.c b/src/gprs/sgsn_vty.c
index 77eb32bb..a0c7b27f 100644
--- a/src/gprs/sgsn_vty.c
+++ b/src/gprs/sgsn_vty.c
@@ -50,6 +50,8 @@
#include <osmocom/ranap/iu_client.h>
#endif
+extern void *tall_bsc_ctx;
+
static struct sgsn_config *g_cfg = NULL;
const struct value_string sgsn_auth_pol_strs[] = {