pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29808 )
Change subject: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
......................................................................
mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
That command was already deprecated when the new commands without the
"mgw" prefix were dropped, so there was no need to create a new command
for it (since it shouldn't be used and it's currently implemented as a
NOOP).
However, the recent patch moved the install line out of the common
function, which meant the command was not available anymore on the old
node, and as a result old config files using it would fail to be parsed.
This commit moves the command back to the common function so that it is
still available for config files using the old node.
Related: SYS#5987
Fixes: 8c138fe89cc070f860eca641481a092225b1247e
Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29
---
M src/libosmo-mgcp-client/mgcp_client_vty.c
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 6580710..390bacb 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -148,7 +148,7 @@
MGW_STR "remote port to reach the MGW at\n"
"remote port\n")
-DEFUN_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd,
+DEFUN_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgw_mgw_endpoint_range_cmd,
"mgw endpoint-range <1-65534> <1-65534>",
MGW_STR "DEPRECATED: the endpoint range cannot be defined by the client\n"
"-\n" "-\n")
@@ -158,7 +158,7 @@
VTY_NEWLINE);
return CMD_SUCCESS;
}
-ALIAS_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd,
+ALIAS_DEPRECATED(cfg_mgw_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"
@@ -340,6 +340,7 @@
install_lib_element(node, &cfg_mgw_mgw_local_port_cmd);
install_lib_element(node, &cfg_mgw_mgw_remote_ip_cmd);
install_lib_element(node, &cfg_mgw_mgw_remote_port_cmd);
+ install_lib_element(node, &cfg_mgw_mgw_endpoint_range_cmd);
install_lib_element(node, &cfg_mgw_mgw_endpoint_domain_name_cmd);
install_lib_element(node, &cfg_mgw_mgw_reset_ep_name_cmd);
install_lib_element(node, &cfg_mgw_mgw_no_reset_ep_name_cmd);
@@ -593,7 +594,6 @@
install_lib_element(mgw_node, &cfg_mgw_local_port_cmd);
install_lib_element(mgw_node, &cfg_mgw_remote_ip_cmd);
install_lib_element(mgw_node, &cfg_mgw_remote_port_cmd);
- install_lib_element(mgw_node, &cfg_mgw_endpoint_range_cmd);
install_lib_element(mgw_node, &cfg_mgw_rtp_bts_base_port_cmd);
install_lib_element(mgw_node, &cfg_mgw_endpoint_domain_name_cmd);
install_lib_element(mgw_node, &cfg_mgw_reset_ep_name_cmd);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29808
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29
Gerrit-Change-Number: 29808
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29808 )
Change subject: mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
......................................................................
mgcp-client: Fix 'mgw endpoint-range' command dropped from old VTY node
That command was already deprecated when the new commands without the
"mgw" prefix were dropped, so there was no need to create a new command
for it (since it shouldn't be used and it's currently implemented as a
NOOP).
However, the recent patch moved the install line out of the common
function, which meant the command was not available anymore on the old
node, and as a result old config files using it would fail to be parsed.
This commit moves the command back to the common function so that it is
still available for config files using the old node.
Related: SYS#5987
Fixes: 8c138fe89cc070f860eca641481a092225b1247e
Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29
---
M src/libosmo-mgcp-client/mgcp_client_vty.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/29808/1
diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 6580710..390bacb 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -148,7 +148,7 @@
MGW_STR "remote port to reach the MGW at\n"
"remote port\n")
-DEFUN_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgw_endpoint_range_cmd,
+DEFUN_DEPRECATED(cfg_mgw_mgw_endpoint_range, cfg_mgw_mgw_endpoint_range_cmd,
"mgw endpoint-range <1-65534> <1-65534>",
MGW_STR "DEPRECATED: the endpoint range cannot be defined by the client\n"
"-\n" "-\n")
@@ -158,7 +158,7 @@
VTY_NEWLINE);
return CMD_SUCCESS;
}
-ALIAS_DEPRECATED(cfg_mgw_endpoint_range, cfg_mgcpgw_endpoint_range_cmd,
+ALIAS_DEPRECATED(cfg_mgw_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"
@@ -340,6 +340,7 @@
install_lib_element(node, &cfg_mgw_mgw_local_port_cmd);
install_lib_element(node, &cfg_mgw_mgw_remote_ip_cmd);
install_lib_element(node, &cfg_mgw_mgw_remote_port_cmd);
+ install_lib_element(node, &cfg_mgw_mgw_endpoint_range_cmd);
install_lib_element(node, &cfg_mgw_mgw_endpoint_domain_name_cmd);
install_lib_element(node, &cfg_mgw_mgw_reset_ep_name_cmd);
install_lib_element(node, &cfg_mgw_mgw_no_reset_ep_name_cmd);
@@ -593,7 +594,6 @@
install_lib_element(mgw_node, &cfg_mgw_local_port_cmd);
install_lib_element(mgw_node, &cfg_mgw_remote_ip_cmd);
install_lib_element(mgw_node, &cfg_mgw_remote_port_cmd);
- install_lib_element(mgw_node, &cfg_mgw_endpoint_range_cmd);
install_lib_element(mgw_node, &cfg_mgw_rtp_bts_base_port_cmd);
install_lib_element(mgw_node, &cfg_mgw_endpoint_domain_name_cmd);
install_lib_element(mgw_node, &cfg_mgw_reset_ep_name_cmd);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29808
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I800abcc9869ed097a9d28715269c42552f5aaf29
Gerrit-Change-Number: 29808
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806
to look at the new patch set (#2).
Change subject: Introduce support for libosmo-mgcp-client MGW pooling
......................................................................
Introduce support for libosmo-mgcp-client MGW pooling
Large RAN installations may benefit from distributing the RTP voice
stream load over multiple media gateways.
libosmo-mgcp-client supports MGW pooling since version 1.8.0 (more than
one year ago). OsmoBSC has already been making use of it since then (see
osmo-bsc.git 8d22e6870637ed6d392a8a77aeaebc51b23a8a50); lets use this
feature in osmo-hngw too.
This commit is also part of a series of patches cleaning up
libosmo-mgcp-client and slowly getting rid of the old non-mgw-pooled VTY
configuration, in order to keep only 1 way to configure
libosmo-mgcp-client through VTY.
Related: SYS#5091
Related: SYS#5987
Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61
---
M doc/examples/osmo-hnbgw/osmo-hnbgw-pfcp.cfg
M doc/examples/osmo-hnbgw/osmo-hnbgw.cfg
M doc/manuals/chapters/running.adoc
M include/osmocom/hnbgw/hnbgw.h
M include/osmocom/hnbgw/vty.h
M src/osmo-hnbgw/hnbgw.c
M src/osmo-hnbgw/hnbgw_vty.c
M src/osmo-hnbgw/mgw_fsm.c
M tests/ranap_rab_ass/Makefile.am
9 files changed, 82 insertions(+), 37 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/06/29806/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/29806
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I371dc773b58788ee21037dc25d77f556c89c6b61
Gerrit-Change-Number: 29806
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-msc/+/29803
to look at the new patch set (#3).
Change subject: Use new mgcp-client VTY commands under mgw node
......................................................................
Use new mgcp-client VTY commands under mgw node
New VTY commands have been added recently to the "mgw" node which drop
the redundant "mgw" prefix on each fo them.
Change-Id: I8ac11388e9493416b644812638e1374251725584
Depends: osmo-mgw.git Change-Id: Id55af13d2ecde49d968b9dca6a2f8108a17ec484
Related: SYS#5987
---
M doc/examples/osmo-msc/osmo-msc.cfg
M doc/examples/osmo-msc/osmo-msc_custom-sccp.cfg
M doc/examples/osmo-msc/osmo-msc_multi-cs7.cfg
M doc/manuals/chapters/running.adoc
M tests/test_nodes.vty
5 files changed, 15 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/29803/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/29803
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I8ac11388e9493416b644812638e1374251725584
Gerrit-Change-Number: 29803
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29795 )
Change subject: mgcp-client: Introduce API mgcp_client_pool_config_write
......................................................................
mgcp-client: Introduce API mgcp_client_pool_config_write
It is not a good idea to use a personal write_config function for the
MGW node, since it's not meant to be a 1st level (top) node.
During write-config the node function will be called at an
implementation specific time (based on the order defined by the app in
the node type enum), so there's no real way to control that the output
of the MGW node will end up under the parent configured in
mgcp_client_pool_vty_init(). As mentioned the order can be tweaked based
on how the node enums are configured, installed, etc. but that's really
a nightmare, so let's better not rely on that.
Therefore, this patch introduces a new API which the users (apps such as
OsmoBSc and OsmoMSC) can use to write the config at the required time
(when writing its own parent node).
A hack is introduced internally to detect older versions of the users
which didn't call this function to still print stuff (up to to the app
if the order is correct).
Related: SYS#5987
Change-Id: I7a620cf47886d8ecab30ce369cf123d98ab842c5
---
M TODO-RELEASE
M include/osmocom/mgcp_client/mgcp_client_pool.h
M src/libosmo-mgcp-client/mgcp_client_vty.c
3 files changed, 47 insertions(+), 13 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 5fe3d53..3e10bf9 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -26,4 +26,4 @@
#library what description / commit summary line
libosmo-netif >1.2.0 OSMUX_DEFAULT_PORT, osmux_xfrm_output_*, osmux_xfrm_input_*
libosmocore >1.7.0 osmo_sockaddr_is_any()
-libmgcp-client NEW APIs mgcp_client_pool_member_...()
\ No newline at end of file
+libmgcp-client NEW APIs mgcp_client_pool_member_...(), mgcp_client_pool_config_write()
\ No newline at end of file
diff --git a/include/osmocom/mgcp_client/mgcp_client_pool.h b/include/osmocom/mgcp_client/mgcp_client_pool.h
index b547b78..46d7e90 100644
--- a/include/osmocom/mgcp_client/mgcp_client_pool.h
+++ b/include/osmocom/mgcp_client/mgcp_client_pool.h
@@ -9,6 +9,7 @@
struct mgcp_client_pool *mgcp_client_pool_alloc(void *talloc_ctx);
void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool);
+int mgcp_client_pool_config_write(struct vty *vty, const char *indent);
unsigned int mgcp_client_pool_connect(struct mgcp_client_pool *pool);
void mgcp_client_pool_register_single(struct mgcp_client_pool *pool, struct mgcp_client *mgcp_client);
diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c
index 1672f97..b571fa0 100644
--- a/src/libosmo-mgcp-client/mgcp_client_vty.c
+++ b/src/libosmo-mgcp-client/mgcp_client_vty.c
@@ -330,18 +330,46 @@
vty_init_common(talloc_ctx, node);
}
+/* Deprecated, used for backward compatibility with older users which didn't call
+ * mgcp_client_pool_config_write(): */
+static bool mgcp_client_pool_config_write_called = false;
static int config_write_pool(struct vty *vty)
{
+ int rc;
+ if (mgcp_client_pool_config_write_called)
+ return CMD_SUCCESS;
+
+ rc = mgcp_client_pool_config_write(vty, NULL);
+ /* mgcp_client_pool_config_write sets this to true, let's reset it */
+ mgcp_client_pool_config_write_called = false;
+ return rc;
+}
+
+/*! Write out MGCP client config to VTY.
+ * \param[in] vty VTY to which we should print.
+ * \param[in] indent string used for indentation (e.g. " ").
+ If NULL, indentation passed during mgcp_client_pool_vty_init() will be used.
+ * \returns CMD_SUCCESS on success, CMD_WARNING on error */
+int mgcp_client_pool_config_write(struct vty *vty, const char *indent)
+{
struct mgcp_client_pool *pool = global_mgcp_client_pool;
struct mgcp_client_pool_member *pool_member;
- unsigned int indent_buf_len = strlen(pool->vty_indent) + 1 + 1;
- char *indent = talloc_zero_size(vty, indent_buf_len);
+ unsigned int subindent_buf_len;
+ char *subindent;
- snprintf(indent, indent_buf_len, "%s ", pool->vty_indent);
+ /* Tell internal node write function that the user supports calling proper API: */
+ mgcp_client_pool_config_write_called = true;
+
+ if (!indent)
+ indent = pool->vty_indent ? : "";
+ subindent_buf_len = strlen(indent) + 1 + 1;
+ subindent = talloc_zero_size(vty, subindent_buf_len);
+
+ snprintf(subindent, subindent_buf_len, "%s ", indent);
llist_for_each_entry(pool_member, &pool->member_list, list) {
- vty_out(vty, "%smgw %u%s", pool->vty_indent, pool_member->nr, VTY_NEWLINE);
- config_write(vty, indent, &pool_member->conf);
+ vty_out(vty, "%smgw %u%s", indent, pool_member->nr, VTY_NEWLINE);
+ config_write(vty, subindent, &pool_member->conf);
}
/* MGW pool API is supported by user (global_mgcp_client_pool is set
@@ -350,11 +378,11 @@
* replacing it, then output the single MGW converted to the new MGW
* pool VTY. */
if (llist_empty(&pool->member_list) && pool->mgcp_client_single) {
- vty_out(vty, "%smgw 0%s", pool->vty_indent, VTY_NEWLINE);
- config_write(vty, indent, global_mgcp_client_conf);
+ vty_out(vty, "%smgw 0%s", indent, VTY_NEWLINE);
+ config_write(vty, subindent, global_mgcp_client_conf);
}
- talloc_free(indent);
+ talloc_free(subindent);
return CMD_SUCCESS;
}
@@ -495,7 +523,8 @@
* (called once at startup by the application process).
* \param[in] parent_node identifier of the parent node on which the mgw node appears.
* \param[in] mgw_node identifier that should be used with the newly installed MGW node.
- * \param[in] indent indentation string to match the indentation in the VTY config
+ * \param[in] indent indentation string to match the indentation in the VTY config.
+ If NULL, it must be passed explicitly each time mgcp_client_pool_config_write() is called.
* \param[in] pool user provided memory to store the configured MGCP client (MGW) pool. */
void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool)
{
@@ -503,11 +532,12 @@
OSMO_ASSERT(pool);
/* Never allow this function to be called twice on the same pool */
- OSMO_ASSERT(!pool->vty_indent);
OSMO_ASSERT(!pool->vty_node);
- pool->vty_indent = talloc_strdup(pool, indent);
- OSMO_ASSERT(pool->vty_indent);
+ if (indent) {
+ pool->vty_indent = talloc_strdup(pool, indent);
+ OSMO_ASSERT(pool->vty_indent);
+ }
pool->vty_node = talloc_zero(pool, struct cmd_node);
OSMO_ASSERT(pool->vty_node);
pool->vty_node->node = mgw_node;
@@ -517,6 +547,9 @@
install_lib_element(parent_node, &cfg_mgw_cmd);
install_lib_element(parent_node, &cfg_no_mgw_cmd);
+ /* Note: config_write_pool is deprecated and user is expected to
+ * manually call mgcp_client_pool_config_write() when printing the VTY
+ * config */
install_node(pool->vty_node, config_write_pool);
vty_init_common(pool, mgw_node);
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29795
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I7a620cf47886d8ecab30ce369cf123d98ab842c5
Gerrit-Change-Number: 29795
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged