2016-05-20 19:59:55 +00:00
|
|
|
/* MSC interface to quagga VTY */
|
|
|
|
/* (C) 2016 by sysmocom s.m.f.c. GmbH <info@sysmocom.de>
|
|
|
|
* Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c)
|
2017-12-23 18:30:32 +00:00
|
|
|
* (C) 2009-2017 by Harald Welte <laforge@gnumonks.org>
|
2016-05-20 19:59:55 +00:00
|
|
|
* (C) 2009-2011 by Holger Hans Peter Freyther
|
|
|
|
* All Rights Reserved
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* NOTE: I would have liked to call this the MSC_NODE instead of the MSC_NODE,
|
|
|
|
* but MSC_NODE already exists to configure a remote MSC for osmo-bsc. */
|
|
|
|
|
2017-07-05 13:19:52 +00:00
|
|
|
#include "../../bscconfig.h"
|
|
|
|
|
2016-05-20 19:59:55 +00:00
|
|
|
#include <inttypes.h>
|
|
|
|
|
|
|
|
#include <osmocom/vty/command.h>
|
2017-07-05 13:19:52 +00:00
|
|
|
#ifdef BUILD_IU
|
|
|
|
#include <osmocom/ranap/iu_client.h>
|
|
|
|
#endif
|
2016-05-20 19:59:55 +00:00
|
|
|
|
2017-09-04 13:04:35 +00:00
|
|
|
#include <osmocom/msc/vty.h>
|
|
|
|
#include <osmocom/msc/gsm_data.h>
|
|
|
|
#include <osmocom/msc/gsm_subscriber.h>
|
|
|
|
#include <osmocom/msc/vlr.h>
|
2016-05-20 19:59:55 +00:00
|
|
|
|
|
|
|
static struct cmd_node msc_node = {
|
|
|
|
MSC_NODE,
|
|
|
|
"%s(config-msc)# ",
|
|
|
|
1,
|
|
|
|
};
|
|
|
|
|
|
|
|
DEFUN(cfg_msc, cfg_msc_cmd,
|
|
|
|
"msc", "Configure MSC options")
|
|
|
|
{
|
|
|
|
vty->node = MSC_NODE;
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(cfg_msc_assign_tmsi, cfg_msc_assign_tmsi_cmd,
|
|
|
|
"assign-tmsi",
|
|
|
|
"Assign TMSI during Location Updating.\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->vlr->cfg.assign_tmsi = true;
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(cfg_msc_no_assign_tmsi, cfg_msc_no_assign_tmsi_cmd,
|
|
|
|
"no assign-tmsi",
|
|
|
|
NO_STR "Assign TMSI during Location Updating.\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->vlr->cfg.assign_tmsi = false;
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2017-04-09 10:32:51 +00:00
|
|
|
DEFUN(cfg_msc_cs7_instance_a,
|
|
|
|
cfg_msc_cs7_instance_a_cmd,
|
|
|
|
"cs7-instance-a <0-15>",
|
|
|
|
"Set SS7 to be used by the A-Interface.\n" "SS7 instance reference number\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->a.cs7_instance = atoi(argv[0]);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(cfg_msc_cs7_instance_iu,
|
|
|
|
cfg_msc_cs7_instance_iu_cmd,
|
|
|
|
"cs7-instance-iu <0-15>",
|
|
|
|
"Set SS7 to be used by the Iu-Interface.\n" "SS7 instance reference number\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->iu.cs7_instance = atoi(argv[0]);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2017-10-29 01:10:38 +00:00
|
|
|
DEFUN(cfg_msc_auth_tuple_max_reuse_count, cfg_msc_auth_tuple_max_reuse_count_cmd,
|
|
|
|
"auth-tuple-max-reuse-count <-1-2147483647>",
|
|
|
|
"Configure authentication tuple re-use\n"
|
|
|
|
"0 to use each auth tuple at most once (default), >0 to limit re-use, -1 to re-use infinitely (vulnerable!).\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->vlr->cfg.auth_tuple_max_reuse_count = atoi(argv[0]);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFUN(cfg_msc_auth_tuple_reuse_on_error, cfg_msc_auth_tuple_reuse_on_error_cmd,
|
|
|
|
"auth-tuple-reuse-on-error (0|1)",
|
|
|
|
"Configure authentication tuple re-use when HLR is not responsive\n"
|
|
|
|
"0 = never re-use auth tuples beyond auth-tuple-max-reuse-count (default)\n"
|
|
|
|
"1 = if the HLR does not deliver new tuples, do re-use already available old ones.\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
gsmnet->vlr->cfg.auth_reuse_old_sets_on_error = atoi(argv[0]) ? true : false;
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
fix paging: add timeout to discard unsuccessful paging
Currently, if there is no reply from the BSS / RNC, a subscriber will remain as
"already paged" forever, and is never going to be paged again. Even on IMSI
Detach, the pending request will keep a ref count on the vlr_subscr.
Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the
'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' /
'T3113' in OsmoBSC, but to not confuse the two, give this a different name.)
Add test_ms_timeout_paging() test to verify the timeout works.
I hit this while testing Paging across multiple hNodeB, when a UE lost
connection to the hNodeB. I noticed that no matter how long I wait, no Paging
is sent out anymore, and found this embarrassing issue. Good grief...
The choice of 10 seconds is taken from https://osmocom.org/issues/2756
Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
2017-12-15 02:02:27 +00:00
|
|
|
DEFUN(cfg_msc_paging_response_timer, cfg_msc_paging_response_timer_cmd,
|
|
|
|
"paging response-timer (default|<1-65535>)",
|
|
|
|
"Configure Paging\n"
|
|
|
|
"Set Paging timeout, the minimum time to pass between (unsuccessful) Pagings sent towards"
|
|
|
|
" BSS or RNC\n"
|
|
|
|
"Set to default timeout (" OSMO_STRINGIFY_VAL(MSC_PAGING_RESPONSE_TIMER_DEFAULT) " seconds)\n"
|
|
|
|
"Set paging timeout in seconds\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
if (!strcmp(argv[1], "default"))
|
|
|
|
gsmnet->paging_response_timer = MSC_PAGING_RESPONSE_TIMER_DEFAULT;
|
|
|
|
else
|
|
|
|
gsmnet->paging_response_timer = atoi(argv[0]);
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2018-02-09 19:41:14 +00:00
|
|
|
DEFUN(cfg_msc_emergency_msisdn, cfg_msc_emergency_msisdn_cmd,
|
|
|
|
"emergency-call route-to-msisdn MSISDN",
|
|
|
|
"Configure Emergency Call Behaviour\n"
|
|
|
|
"MSISDN to which Emergency Calls are Dispatched\n"
|
|
|
|
"MSISDN (E.164 Phone Number)\n")
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
|
|
|
|
osmo_talloc_replace_string(gsmnet, &gsmnet->emergency.route_to_msisdn, argv[0]);
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-05-20 19:59:55 +00:00
|
|
|
static int config_write_msc(struct vty *vty)
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
|
|
|
|
|
|
|
vty_out(vty, "msc%s", VTY_NEWLINE);
|
|
|
|
vty_out(vty, " %sassign-tmsi%s",
|
|
|
|
gsmnet->vlr->cfg.assign_tmsi? "" : "no ", VTY_NEWLINE);
|
|
|
|
|
2017-04-09 10:32:51 +00:00
|
|
|
vty_out(vty, " cs7-instance-a %u%s", gsmnet->a.cs7_instance,
|
|
|
|
VTY_NEWLINE);
|
|
|
|
vty_out(vty, " cs7-instance-iu %u%s", gsmnet->iu.cs7_instance,
|
|
|
|
VTY_NEWLINE);
|
|
|
|
|
2017-10-29 01:10:38 +00:00
|
|
|
if (gsmnet->vlr->cfg.auth_tuple_max_reuse_count)
|
|
|
|
vty_out(vty, " auth-tuple-max-reuse-count %d%s",
|
|
|
|
OSMO_MAX(-1, gsmnet->vlr->cfg.auth_tuple_max_reuse_count),
|
|
|
|
VTY_NEWLINE);
|
|
|
|
if (gsmnet->vlr->cfg.auth_reuse_old_sets_on_error)
|
|
|
|
vty_out(vty, " auth-tuple-reuse-on-error 1%s",
|
|
|
|
VTY_NEWLINE);
|
|
|
|
|
fix paging: add timeout to discard unsuccessful paging
Currently, if there is no reply from the BSS / RNC, a subscriber will remain as
"already paged" forever, and is never going to be paged again. Even on IMSI
Detach, the pending request will keep a ref count on the vlr_subscr.
Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the
'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' /
'T3113' in OsmoBSC, but to not confuse the two, give this a different name.)
Add test_ms_timeout_paging() test to verify the timeout works.
I hit this while testing Paging across multiple hNodeB, when a UE lost
connection to the hNodeB. I noticed that no matter how long I wait, no Paging
is sent out anymore, and found this embarrassing issue. Good grief...
The choice of 10 seconds is taken from https://osmocom.org/issues/2756
Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
2017-12-15 02:02:27 +00:00
|
|
|
if (gsmnet->paging_response_timer != MSC_PAGING_RESPONSE_TIMER_DEFAULT)
|
|
|
|
vty_out(vty, " paging response-timer %u%s", gsmnet->paging_response_timer, VTY_NEWLINE);
|
|
|
|
|
2018-02-09 19:41:14 +00:00
|
|
|
if (gsmnet->emergency.route_to_msisdn) {
|
|
|
|
vty_out(vty, " emergency-call route-to-msisdn %s%s",
|
|
|
|
gsmnet->emergency.route_to_msisdn, VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
|
2017-09-03 23:03:58 +00:00
|
|
|
mgcp_client_config_write(vty, " ");
|
2016-05-20 19:59:55 +00:00
|
|
|
#ifdef BUILD_IU
|
2017-07-05 13:19:52 +00:00
|
|
|
ranap_iu_vty_config_write(vty, " ");
|
2016-05-20 19:59:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int config_write_net(struct vty *vty)
|
|
|
|
{
|
|
|
|
struct gsm_network *gsmnet = gsmnet_from_vty(vty);
|
2017-12-23 18:30:32 +00:00
|
|
|
int i;
|
2016-05-20 19:59:55 +00:00
|
|
|
|
|
|
|
vty_out(vty, "network%s", VTY_NEWLINE);
|
|
|
|
vty_out(vty, " network country code %u%s", gsmnet->country_code, VTY_NEWLINE);
|
|
|
|
vty_out(vty, " mobile network code %u%s", gsmnet->network_code, VTY_NEWLINE);
|
|
|
|
vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
|
|
|
|
vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
|
2017-12-23 18:30:32 +00:00
|
|
|
vty_out(vty, " encryption a5");
|
|
|
|
for (i = 0; i < 8; i++) {
|
|
|
|
if (gsmnet->a5_encryption_mask & (1 << i))
|
|
|
|
vty_out(vty, " %u", i);
|
|
|
|
}
|
|
|
|
vty_out(vty, "%s", VTY_NEWLINE);
|
2017-12-13 23:51:44 +00:00
|
|
|
vty_out(vty, " authentication %s%s",
|
|
|
|
gsmnet->authentication_required ? "required" : "optional", VTY_NEWLINE);
|
2016-05-20 19:59:55 +00:00
|
|
|
vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode),
|
|
|
|
VTY_NEWLINE);
|
|
|
|
vty_out(vty, " mm info %u%s", gsmnet->send_mm_info, VTY_NEWLINE);
|
|
|
|
if (gsmnet->tz.override != 0) {
|
|
|
|
if (gsmnet->tz.dst)
|
|
|
|
vty_out(vty, " timezone %d %d %d%s",
|
|
|
|
gsmnet->tz.hr, gsmnet->tz.mn, gsmnet->tz.dst,
|
|
|
|
VTY_NEWLINE);
|
|
|
|
else
|
|
|
|
vty_out(vty, " timezone %d %d%s",
|
|
|
|
gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
if (gsmnet->t3212 == 0)
|
|
|
|
vty_out(vty, " no periodic location update%s", VTY_NEWLINE);
|
|
|
|
else
|
|
|
|
vty_out(vty, " periodic location update %u%s",
|
|
|
|
gsmnet->t3212 * 6, VTY_NEWLINE);
|
|
|
|
|
2018-02-09 19:41:14 +00:00
|
|
|
if (gsmnet->emergency.route_to_msisdn) {
|
|
|
|
vty_out(vty, " emergency-call route-to-msisdn %s%s",
|
|
|
|
gsmnet->emergency.route_to_msisdn, VTY_NEWLINE);
|
|
|
|
}
|
|
|
|
|
2016-05-20 19:59:55 +00:00
|
|
|
return CMD_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
void msc_vty_init(struct gsm_network *msc_network)
|
|
|
|
{
|
|
|
|
common_cs_vty_init(msc_network, config_write_net);
|
|
|
|
|
|
|
|
install_element(CONFIG_NODE, &cfg_msc_cmd);
|
|
|
|
install_node(&msc_node, config_write_msc);
|
|
|
|
install_element(MSC_NODE, &cfg_msc_assign_tmsi_cmd);
|
|
|
|
install_element(MSC_NODE, &cfg_msc_no_assign_tmsi_cmd);
|
2017-10-29 01:10:38 +00:00
|
|
|
install_element(MSC_NODE, &cfg_msc_auth_tuple_max_reuse_count_cmd);
|
|
|
|
install_element(MSC_NODE, &cfg_msc_auth_tuple_reuse_on_error_cmd);
|
2017-04-09 10:32:51 +00:00
|
|
|
install_element(MSC_NODE, &cfg_msc_cs7_instance_a_cmd);
|
|
|
|
install_element(MSC_NODE, &cfg_msc_cs7_instance_iu_cmd);
|
fix paging: add timeout to discard unsuccessful paging
Currently, if there is no reply from the BSS / RNC, a subscriber will remain as
"already paged" forever, and is never going to be paged again. Even on IMSI
Detach, the pending request will keep a ref count on the vlr_subscr.
Add a paging timeout, as gsm_network->paging_timeout and in the VTY on the
'msc' node as 'paging timeout (default|<1-65535>'. (There is a 'network' /
'T3113' in OsmoBSC, but to not confuse the two, give this a different name.)
Add test_ms_timeout_paging() test to verify the timeout works.
I hit this while testing Paging across multiple hNodeB, when a UE lost
connection to the hNodeB. I noticed that no matter how long I wait, no Paging
is sent out anymore, and found this embarrassing issue. Good grief...
The choice of 10 seconds is taken from https://osmocom.org/issues/2756
Change-Id: I2db6f1e2ad341cf9c2cc7a21ec2fca0bae5b2db5
2017-12-15 02:02:27 +00:00
|
|
|
install_element(MSC_NODE, &cfg_msc_paging_response_timer_cmd);
|
2018-02-09 19:41:14 +00:00
|
|
|
install_element(MSC_NODE, &cfg_msc_emergency_msisdn_cmd);
|
2017-04-09 10:32:51 +00:00
|
|
|
|
2017-09-03 23:03:58 +00:00
|
|
|
mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf);
|
2016-05-20 19:59:55 +00:00
|
|
|
#ifdef BUILD_IU
|
2018-01-22 12:49:53 +00:00
|
|
|
ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)&msc_network->iu.rab_assign_addr_enc);
|
2016-05-20 19:59:55 +00:00
|
|
|
#endif
|
|
|
|
}
|