From e4890cc3c35bcec3d9538983f4c22393f1f3e25e Mon Sep 17 00:00:00 2001 From: Daniel Willmann Date: Tue, 28 Feb 2017 18:00:50 +0100 Subject: osmo-bsc_nat: Add infrastructure for multiple MSC connections Add some common defines and structs Change-Id: I9cdfc5b32f2500f47be8caaa281bcca3231db5ea Ticket: SYS#3208 Sponsored-by: On-Waves ehf. --- openbsc/include/openbsc/bsc_nat.h | 11 +++++++++++ openbsc/include/openbsc/vty.h | 1 + openbsc/src/libcommon/common_vty.c | 7 +++++++ openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 6 ++++++ 4 files changed, 25 insertions(+) diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index 94ab0e5ff..0425d84fd 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -23,6 +23,7 @@ #include "mgcp.h" #include "bsc_msg_filter.h" +#include "bsc_msc.h" #include @@ -228,6 +229,16 @@ struct bsc_nat_statistics { } ussd; }; +struct msc_config { + struct llist_head entry; + struct llist_head dests; + struct bsc_msc_dest *main_dest; + struct bsc_msc_connection *msc_con; + char *token; + int nr; + struct bsc_nat *nat; +}; + /** * the structure of the "nat" network */ diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index 60b7d2d76..9e34eda7c 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -38,6 +38,7 @@ enum bsc_vty_node { SMPP_NODE, SMPP_ESME_NODE, GTPHUB_NODE, + NAT_MSC_NODE }; extern int bsc_vty_is_config_node(struct vty *vty, int node); diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index 6e1c10b00..4d34a265d 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -108,6 +108,13 @@ int bsc_vty_go_parent(struct vty *vty) vty->node = SMPP_NODE; vty->index = NULL; break; + case NAT_MSC_NODE: + vty->node = NAT_NODE; + { + struct msc_config *msc_config = vty->index; + vty->index = msc_config->nat; + } + break; case SMPP_NODE: case MGCP_NODE: case GBPROXY_NODE: diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index d4cef5dbe..dfca04779 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -55,6 +55,12 @@ static struct cmd_node nat_node = { 1, }; +static struct cmd_node msc_node = { + NAT_MSC_NODE, + "%s(config-nat-msc)# ", + 1, +}; + static struct cmd_node bsc_node = { NAT_BSC_NODE, "%s(config-nat-bsc)# ", -- cgit v1.2.3