From 2b6d39c9e0b741b124739064983470bc717826c8 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 13 Jul 2017 02:41:37 +0200 Subject: add specific code bits Change-Id: I42c3f261bbee8eb73dd6b0096de72c11704cd0a2 --- include/openbsc/gprs_sgsn.h | 10 ++++++++-- src/gprs/gb_proxy.c | 2 ++ src/gprs/gb_proxy_main.c | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h index 52fba66d5..bf61c26c8 100644 --- a/include/openbsc/gprs_sgsn.h +++ b/include/openbsc/gprs_sgsn.h @@ -10,8 +10,7 @@ #include #include - -#include +#include #define GSM_EXTENSION_LENGTH 15 #define GSM_APN_LENGTH 102 @@ -119,6 +118,13 @@ struct service_info { struct ranap_ue_conn_ctx; +struct gsm_auth_tuple { + int use_count; + int key_seq; + struct osmo_auth_vector vec; +}; +#define GSM_KEY_SEQ_INVAL 7 /* GSM 04.08 - 10.5.1.2 */ + /* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */ /* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */ struct sgsn_mm_ctx { diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index d95139f8d..bfbbf8df6 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -53,6 +53,8 @@ #include +extern void *tall_bsc_ctx; + static const struct rate_ctr_desc global_ctr_description[] = { { "inv-bvci", "Invalid BVC Identifier " }, { "inv-lai", "Invalid Location Area Identifier" }, diff --git a/src/gprs/gb_proxy_main.c b/src/gprs/gb_proxy_main.c index 69a93b6f7..27aae6ae3 100644 --- a/src/gprs/gb_proxy_main.c +++ b/src/gprs/gb_proxy_main.c @@ -189,13 +189,40 @@ static void handle_options(int argc, char **argv) } } -extern int bsc_vty_go_parent(struct vty *vty); +int gbproxy_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 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; + else + vty->node = ENABLE_NODE; + + vty->index = NULL; + } + + return vty->node; +} static struct vty_app_info vty_info = { .name = "OsmoGbProxy", .version = PACKAGE_VERSION, - .go_parent_cb = bsc_vty_go_parent, - .is_config_node = bsc_vty_is_config_node, + .go_parent_cb = gbproxy_vty_go_parent, + .is_config_node = gbproxy_vty_is_config_node, }; /* default categories */ -- cgit v1.2.3