aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/vty_interface.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-02-07 11:43:27 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-02-07 11:45:55 +0100
commit4d95ab2231d451826130f1774d26ebf9c29bb56b (patch)
tree849d787d6280572f76b6a034514e4e87ba0cc076 /openbsc/src/vty_interface.c
parent17944f72859ea53852870ceda49d4a2cb4ec8968 (diff)
[vty] Add a config for a simple OpenBSC BSC token
We will use this token to identify us at the MSC for now. This assumes that something like OpenVPN is already used to secure the networking. In the future we will explore using TLS for the communication and certificates for the authentication.
Diffstat (limited to 'openbsc/src/vty_interface.c')
-rw-r--r--openbsc/src/vty_interface.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/vty_interface.c b/openbsc/src/vty_interface.c
index ef8f6b2d1..5197ec36b 100644
--- a/openbsc/src/vty_interface.c
+++ b/openbsc/src/vty_interface.c
@@ -353,6 +353,9 @@ static int config_write_net(struct vty *vty)
vty_out(vty, "%s", VTY_NEWLINE);
}
+ if (gsmnet->bsc_token)
+ vty_out(vty, " bsc_token %s%s", gsmnet->bsc_token, VTY_NEWLINE);
+
return CMD_SUCCESS;
}
@@ -1110,6 +1113,18 @@ DEFUN(cfg_net_rtp_base_port,
return CMD_SUCCESS;
}
+DEFUN(cfg_net_bsc_token,
+ cfg_net_bsc_token_cmd,
+ "bsc_token TOKEN",
+ "A token for the BSC to be sent to the MSC")
+{
+ if (gsmnet->bsc_token)
+ talloc_free(gsmnet->bsc_token);
+ gsmnet->bsc_token = talloc_strdup(gsmnet, argv[0]);
+
+ return CMD_SUCCESS;
+}
+
#define DECLARE_TIMER(number) \
DEFUN(cfg_net_T##number, \
cfg_net_T##number##_cmd, \
@@ -1641,6 +1656,7 @@ int bsc_vty_init(struct gsm_network *net)
install_element(GSMNET_NODE, &cfg_net_T3117_cmd);
install_element(GSMNET_NODE, &cfg_net_T3119_cmd);
install_element(GSMNET_NODE, &cfg_net_T3141_cmd);
+ install_element(GSMNET_NODE, &cfg_net_bsc_token_cmd);
install_element(GSMNET_NODE, &cfg_bts_cmd);
install_node(&bts_node, config_write_bts);