[PATCH] osmo-mgw[master]: mgcp-client vty: use name 'mgw' instead of 'mgcpgw'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Sat Nov 4 13:33:58 UTC 2017


Hello Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/4597

to look at the new patch set (#2).

mgcp-client vty: use name 'mgw' instead of 'mgcpgw'

'mgcpgw' was a working title for the osmo-mgw. Before this takes hold out
there, let's rename the VTY commands to 'mgw'. I'd rather have some local
fallout in our testing environments now than drag the stupid name along.

Keep deprecated 'mgcpgw' commands for backwards compat.

Change-Id: I1d43d42929dc9162e57640499526fb7cadbcfbe6
---
M src/libosmo-mgcp-client/mgcp_client_vty.c
1 file changed, 54 insertions(+), 25 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/97/4597/2

diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index c52803f..0a30436 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -1,4 +1,4 @@
-/* MGCPGW client interface to quagga VTY */
+/* MGCP client interface to quagga VTY */
 /* (C) 2016 by sysmocom s.m.f.c. GmbH <info at sysmocom.de>
  * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c)
  * (C) 2009 by Harald Welte <laforge at gnumonks.org>
@@ -29,14 +29,14 @@
 
 #include <osmocom/mgcp_client/mgcp_client.h>
 
-#define MGCPGW_STR "MGCP gateway configuration for RTP streams\n"
+#define MGW_STR "MGCP gateway configuration for RTP streams\n"
 
 void *global_mgcp_client_ctx = NULL;
 struct mgcp_client_conf *global_mgcp_client_conf = NULL;
 
-DEFUN(cfg_mgcpgw_local_ip, cfg_mgcpgw_local_ip_cmd,
-      "mgcpgw local-ip A.B.C.D",
-      MGCPGW_STR "local bind to connect to MGCP gateway with\n"
+DEFUN(cfg_mgw_local_ip, cfg_mgw_local_ip_cmd,
+      "mgw local-ip A.B.C.D",
+      MGW_STR "local bind to connect to MGCP gateway with\n"
       "local bind IP address\n")
 {
 	if (!global_mgcp_client_conf)
@@ -46,10 +46,14 @@
 		talloc_strdup(global_mgcp_client_ctx, argv[0]);
 	return CMD_SUCCESS;
 }
+ALIAS_DEPRECATED(cfg_mgw_local_ip, cfg_mgcpgw_local_ip_cmd,
+		 "mgcpgw local-ip A.B.C.D",
+		 MGW_STR "local bind to connect to MGCP gateway with\n"
+		 "local bind IP address\n")
 
-DEFUN(cfg_mgcpgw_local_port, cfg_mgcpgw_local_port_cmd,
-      "mgcpgw local-port <0-65535>",
-      MGCPGW_STR "local bind to connect to MGCP gateway with\n"
+DEFUN(cfg_mgw_local_port, cfg_mgw_local_port_cmd,
+      "mgw local-port <0-65535>",
+      MGW_STR "local bind to connect to MGCP gateway with\n"
       "local bind port\n")
 {
 	if (!global_mgcp_client_conf)
@@ -57,10 +61,14 @@
 	global_mgcp_client_conf->local_port = atoi(argv[0]);
 	return CMD_SUCCESS;
 }
+ALIAS_DEPRECATED(cfg_mgw_local_port, cfg_mgcpgw_local_port_cmd,
+		 "mgcpgw local-port <0-65535>",
+		 MGW_STR "local bind to connect to MGCP gateway with\n"
+		 "local bind port\n")
 
-DEFUN(cfg_mgcpgw_remote_ip, cfg_mgcpgw_remote_ip_cmd,
-      "mgcpgw remote-ip A.B.C.D",
-      MGCPGW_STR "remote bind to connect to MGCP gateway with\n"
+DEFUN(cfg_mgw_remote_ip, cfg_mgw_remote_ip_cmd,
+      "mgw remote-ip A.B.C.D",
+      MGW_STR "remote bind to connect to MGCP gateway with\n"
       "remote bind IP address\n")
 {
 	if (!global_mgcp_client_conf)
@@ -70,10 +78,14 @@
 		talloc_strdup(global_mgcp_client_ctx, argv[0]);
 	return CMD_SUCCESS;
 }
+ALIAS_DEPRECATED(cfg_mgw_remote_ip, cfg_mgcpgw_remote_ip_cmd,
+		 "mgcpgw remote-ip A.B.C.D",
+		 MGW_STR "remote bind to connect to MGCP gateway with\n"
+		 "remote bind IP address\n")
 
-DEFUN(cfg_mgcpgw_remote_port, cfg_mgcpgw_remote_port_cmd,
-      "mgcpgw remote-port <0-65535>",
-      MGCPGW_STR "remote bind to connect to MGCP gateway with\n"
+DEFUN(cfg_mgw_remote_port, cfg_mgw_remote_port_cmd,
+      "mgw remote-port <0-65535>",
+      MGW_STR "remote bind to connect to MGCP gateway with\n"
       "remote bind port\n")
 {
 	if (!global_mgcp_client_conf)
@@ -81,10 +93,14 @@
 	global_mgcp_client_conf->remote_port = atoi(argv[0]);
 	return CMD_SUCCESS;
 }
+ALIAS_DEPRECATED(cfg_mgw_remote_port, cfg_mgcpgw_remote_port_cmd,
+		 "mgcpgw remote-port <0-65535>",
+		 MGW_STR "remote bind to connect to MGCP gateway with\n"
+		 "remote bind port\n")
 
-DEFUN(cfg_mgcpgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd,
-      "mgcpgw endpoint-range <1-65534> <1-65534>",
-      MGCPGW_STR "usable range of endpoint identifiers\n"
+DEFUN(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd,
+      "mgw endpoint-range <1-65534> <1-65534>",
+      MGW_STR "usable range of endpoint identifiers\n"
       "set first useable endpoint identifier\n"
       "set the last useable endpoint identifier\n")
 {
@@ -101,13 +117,18 @@
 	global_mgcp_client_conf->last_endpoint = last_endpoint;
 	return CMD_SUCCESS;
 }
+ALIAS_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd,
+      "mgcpgw endpoint-range <1-65534> <1-65534>",
+      MGW_STR "usable range of endpoint identifiers\n"
+      "set first useable endpoint identifier\n"
+      "set the last useable endpoint identifier\n")
 
 #define BTS_START_STR "First UDP port allocated for the BTS side\n"
 #define UDP_PORT_STR "UDP Port number\n"
 DEFUN(cfg_mgcp_rtp_bts_base_port,
       cfg_mgcp_rtp_bts_base_port_cmd,
-      "mgcpgw bts-base <0-65534>",
-      MGCPGW_STR
+      "mgw bts-base <0-65534>",
+      MGW_STR
       BTS_START_STR
       UDP_PORT_STR)
 {
@@ -125,32 +146,32 @@
 
 	addr = global_mgcp_client_conf->local_addr;
 	if (addr)
-		vty_out(vty, "%smgcpgw local-ip %s%s", indent, addr,
+		vty_out(vty, "%smgw local-ip %s%s", indent, addr,
 			VTY_NEWLINE);
 	port = global_mgcp_client_conf->local_port;
 	if (port >= 0)
-		vty_out(vty, "%smgcpgw local-port %u%s", indent,
+		vty_out(vty, "%smgw local-port %u%s", indent,
 			(uint16_t)port, VTY_NEWLINE);
 
 	addr = global_mgcp_client_conf->remote_addr;
 	if (addr)
-		vty_out(vty, "%smgcpgw remote-ip %s%s", indent, addr,
+		vty_out(vty, "%smgw remote-ip %s%s", indent, addr,
 			VTY_NEWLINE);
 	port = global_mgcp_client_conf->remote_port;
 	if (port >= 0)
-		vty_out(vty, "%smgcpgw remote-port %u%s", indent,
+		vty_out(vty, "%smgw remote-port %u%s", indent,
 			(uint16_t)port, VTY_NEWLINE);
 
 	first_endpoint = global_mgcp_client_conf->first_endpoint;
 	last_endpoint = global_mgcp_client_conf->last_endpoint;
 	if (last_endpoint != 0) {
-		vty_out(vty, "%smgcpgw endpoint-range %u %u%s", indent,
+		vty_out(vty, "%smgw endpoint-range %u %u%s", indent,
 			first_endpoint, last_endpoint, VTY_NEWLINE);
 	}
 
 	bts_base = global_mgcp_client_conf->bts_base;
 	if (bts_base) {
-		vty_out(vty, "%smgcpgw bts-base %u%s", indent,
+		vty_out(vty, "%smgw bts-base %u%s", indent,
 			bts_base, VTY_NEWLINE);
 	}
 
@@ -162,10 +183,18 @@
 	global_mgcp_client_ctx = talloc_ctx;
 	global_mgcp_client_conf = conf;
 
+	install_element(node, &cfg_mgw_local_ip_cmd);
+	install_element(node, &cfg_mgw_local_port_cmd);
+	install_element(node, &cfg_mgw_remote_ip_cmd);
+	install_element(node, &cfg_mgw_remote_port_cmd);
+	install_element(node, &cfg_mgw_endpoint_range_cmd);
+
+	/* deprecated 'mgcpgw' commands */
 	install_element(node, &cfg_mgcpgw_local_ip_cmd);
 	install_element(node, &cfg_mgcpgw_local_port_cmd);
 	install_element(node, &cfg_mgcpgw_remote_ip_cmd);
 	install_element(node, &cfg_mgcpgw_remote_port_cmd);
 	install_element(node, &cfg_mgcpgw_endpoint_range_cmd);
+
 	install_element(node, &cfg_mgcp_rtp_bts_base_port_cmd);
 }

-- 
To view, visit https://gerrit.osmocom.org/4597
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I1d43d42929dc9162e57640499526fb7cadbcfbe6
Gerrit-PatchSet: 2
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list