aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 02:41:37 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-07-13 02:41:37 +0200
commit2b6d39c9e0b741b124739064983470bc717826c8 (patch)
treeebb171f4124c4c3a5da53b2f994a830198767d7e
parent63c09b18f3bca32548260af11a42b2fb03ffb376 (diff)
add specific code bits
-rw-r--r--include/openbsc/gprs_sgsn.h10
-rw-r--r--src/gprs/gb_proxy.c2
-rw-r--r--src/gprs/gb_proxy_main.c33
3 files changed, 40 insertions, 5 deletions
diff --git a/include/openbsc/gprs_sgsn.h b/include/openbsc/gprs_sgsn.h
index 52fba66d..bf61c26c 100644
--- a/include/openbsc/gprs_sgsn.h
+++ b/include/openbsc/gprs_sgsn.h
@@ -10,8 +10,7 @@
#include <osmocom/crypt/gprs_cipher.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
-
-#include <openbsc/gsm_data.h>
+#include <osmocom/crypt/auth.h>
#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 d95139f8..bfbbf8df 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -53,6 +53,8 @@
#include <openssl/rand.h>
+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 69a93b6f..27aae6ae 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 */