aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-virtual/virtualbts_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/osmo-bts-virtual/virtualbts_vty.c')
-rw-r--r--src/osmo-bts-virtual/virtualbts_vty.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/osmo-bts-virtual/virtualbts_vty.c b/src/osmo-bts-virtual/virtualbts_vty.c
index 323222b4..3933bd27 100644
--- a/src/osmo-bts-virtual/virtualbts_vty.c
+++ b/src/osmo-bts-virtual/virtualbts_vty.c
@@ -50,25 +50,26 @@
SHOW_STR \
TRX_STR
-static struct gsm_bts *vty_bts;
-
-void bts_model_config_write_bts(struct vty *vty, struct gsm_bts *bts)
+void bts_model_config_write_bts(struct vty *vty, const struct gsm_bts *bts)
{
}
-void bts_model_config_write_trx(struct vty *vty, struct gsm_bts_trx *trx)
+void bts_model_config_write_trx(struct vty *vty, const struct gsm_bts_trx *trx)
{
}
-void bts_model_config_write_phy_inst(struct vty *vty, struct phy_instance *pinst)
+void bts_model_config_write_phy_inst(struct vty *vty, const struct phy_instance *pinst)
{
}
-void bts_model_config_write_phy(struct vty *vty, struct phy_link *plink)
+void bts_model_config_write_phy(struct vty *vty, const struct phy_link *plink)
{
if (plink->u.virt.mcast_dev)
vty_out(vty, " virtual-um net-device %s%s",
plink->u.virt.mcast_dev, VTY_NEWLINE);
+ if (plink->u.virt.ttl != -1)
+ vty_out(vty, " virtual-um ttl %d%s",
+ plink->u.virt.ttl, VTY_NEWLINE);
if (strcmp(plink->u.virt.ms_mcast_group, DEFAULT_BTS_MCAST_GROUP))
vty_out(vty, " virtual-um ms-multicast-group %s%s",
plink->u.virt.ms_mcast_group, VTY_NEWLINE);
@@ -171,15 +172,31 @@ DEFUN(cfg_phy_mcast_dev, cfg_phy_mcast_dev_cmd,
return CMD_SUCCESS;
}
-int bts_model_vty_init(struct gsm_bts *bts)
+DEFUN(cfg_phy_mcast_ttl, cfg_phy_mcast_ttl_cmd,
+ "virtual-um ttl <0-255>",
+ VUM_STR "Configure the TTL for transmitted multicast GSMTAP packets\n")
{
- vty_bts = bts;
+ struct phy_link *plink = vty->index;
+ if (plink->state != PHY_LINK_SHUTDOWN) {
+ vty_out(vty, "Can only reconfigure a PHY link that is down%s",
+ VTY_NEWLINE);
+ return CMD_WARNING;
+ }
+
+ plink->u.virt.ttl = atoi(argv[0]);
+
+ return CMD_SUCCESS;
+}
+
+int bts_model_vty_init(void *ctx)
+{
install_element(PHY_NODE, &cfg_phy_ms_mcast_group_cmd);
install_element(PHY_NODE, &cfg_phy_ms_mcast_port_cmd);
install_element(PHY_NODE, &cfg_phy_bts_mcast_group_cmd);
install_element(PHY_NODE, &cfg_phy_bts_mcast_port_cmd);
install_element(PHY_NODE, &cfg_phy_mcast_dev_cmd);
+ install_element(PHY_NODE, &cfg_phy_mcast_ttl_cmd);
return 0;
}