laforge has submitted this change. (
https://gerrit.osmocom.org/c/osmo-hlr/+/30699 )
Change subject: Vty: Fixup config shown/written from vty
......................................................................
Vty: Fixup config shown/written from vty
This commit fixes the following errors:
Missing timeout param for mslookup.
Fails to start reading a written config if an msc node
is configured in the mslookup server.
Places the individual msc node services in the
top-level wildcard node due to incorrect indentation.
* Add missing timeout param.
* Add missing "ipa-name" part to mslookup-server-msc section.
* Add one extra space indentation for msc services.
This commit also adds a DEFINE for the default timeout value.
Change-Id: Ibb60e74a0803f05f37ac13ca529d77b4cb736025
---
M include/osmocom/hlr/dgsm.h
M src/dgsm.c
M src/dgsm_vty.c
M tests/test_nodes.vty
4 files changed, 29 insertions(+), 24 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/include/osmocom/hlr/dgsm.h b/include/osmocom/hlr/dgsm.h
index cc8f3d2..1114fbe 100644
--- a/include/osmocom/hlr/dgsm.h
+++ b/include/osmocom/hlr/dgsm.h
@@ -25,6 +25,7 @@
#include <osmocom/gsupclient/cni_peer_id.h>
#include <osmocom/gsupclient/gsup_req.h>
+#define OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS 2000
#define LOG_DGSM(imsi, level, fmt, args...) \
LOGP(DDGSM, level, "(IMSI-%s) " fmt, imsi, ##args)
diff --git a/src/dgsm.c b/src/dgsm.c
index cdd82a2..f96bca6 100644
--- a/src/dgsm.c
+++ b/src/dgsm.c
@@ -170,7 +170,7 @@
g_hlr->mslookup.server.local_attach_max_age = 60 * 60;
- g_hlr->mslookup.client.result_timeout_milliseconds = 2000;
+ g_hlr->mslookup.client.result_timeout_milliseconds =
OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS;
g_hlr->gsup_unit_name.unit_name = "HLR";
g_hlr->gsup_unit_name.serno = "unnamed-HLR";
diff --git a/src/dgsm_vty.c b/src/dgsm_vty.c
index 00a60ea..925545e 100644
--- a/src/dgsm_vty.c
+++ b/src/dgsm_vty.c
@@ -447,8 +447,8 @@
llist_for_each_entry(msc, &g_hlr->mslookup.server.local_site_services, entry) {
if (!osmo_ipa_name_cmp(&mslookup_server_msc_wildcard, &msc->name))
continue;
- vty_out(vty, " msc %s%s", osmo_ipa_name_to_str(&msc->name),
VTY_NEWLINE);
- config_write_msc_services(vty, " ", msc);
+ vty_out(vty, " msc ipa-name %s%s", osmo_ipa_name_to_str(&msc->name),
VTY_NEWLINE);
+ config_write_msc_services(vty, " ", msc);
}
/* If the server is disabled, still output the above to not lose the service config.
*/
@@ -475,6 +475,10 @@
vty_out(vty, " mdns domain-suffix %s%s",
g_hlr->mslookup.client.mdns.domain_suffix,
VTY_NEWLINE);
+ if (g_hlr->mslookup.client.result_timeout_milliseconds !=
OSMO_DGSM_DEFAULT_RESULT_TIMEOUT_MS)
+ vty_out(vty, " timeout %u%s",
+ g_hlr->mslookup.client.result_timeout_milliseconds,
+ VTY_NEWLINE);
}
return CMD_SUCCESS;
diff --git a/tests/test_nodes.vty b/tests/test_nodes.vty
index bebe9a0..0f02f22 100644
--- a/tests/test_nodes.vty
+++ b/tests/test_nodes.vty
@@ -349,15 +349,15 @@
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service baz.bar at a:b:c::d 1819
- msc MSC-1
- msc msc-901-70-23
- service foo.bar at 76.54.32.10 1234
- service baz.bar at 12.11.10.98 7654
- service baz.bar at dd:cc:bb::a 3210
- msc msc-901-70-42
- service foo.bar at 1.1.1.1 1111
- service baz.bar at 2.2.2.2 2222
- service baz.bar at 2222:2222:2222::2 2222
+ msc ipa-name MSC-1
+ msc ipa-name msc-901-70-23
+ service foo.bar at 76.54.32.10 1234
+ service baz.bar at 12.11.10.98 7654
+ service baz.bar at dd:cc:bb::a 3210
+ msc ipa-name msc-901-70-42
+ service foo.bar at 1.1.1.1 1111
+ service baz.bar at 2.2.2.2 2222
+ service baz.bar at 2222:2222:2222::2 2222
client
gateway-proxy 1.2.3.4 4222
mdns bind 239.192.23.42 4266
@@ -404,12 +404,12 @@
mdns bind 239.192.23.42 4266
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
- msc MSC-1
- msc msc-901-70-23
- service foo.bar at 76.54.32.10 1234
- service baz.bar at 12.11.10.98 7654
- msc msc-901-70-42
- service foo.bar at 1.1.1.1 1111
+ msc ipa-name MSC-1
+ msc ipa-name msc-901-70-23
+ service foo.bar at 76.54.32.10 1234
+ service baz.bar at 12.11.10.98 7654
+ msc ipa-name msc-901-70-42
+ service foo.bar at 1.1.1.1 1111
client
mdns bind 239.192.23.42 4266
...
@@ -437,12 +437,12 @@
service foo.bar at 123.45.67.89 1011
service baz.bar at 121.31.41.5 1617
service gsup.hlr at 23.42.17.11 4223
- msc MSC-1
- msc msc-901-70-23
- service foo.bar at 76.54.32.10 1234
- service baz.bar at 12.11.10.98 7654
- msc msc-901-70-42
- service foo.bar at 1.1.1.1 1111
+ msc ipa-name MSC-1
+ msc ipa-name msc-901-70-23
+ service foo.bar at 76.54.32.10 1234
+ service baz.bar at 12.11.10.98 7654
+ msc ipa-name msc-901-70-42
+ service foo.bar at 1.1.1.1 1111
client
mdns bind 239.192.23.42 4266
...
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hlr/+/30699
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: Ibb60e74a0803f05f37ac13ca529d77b4cb736025
Gerrit-Change-Number: 30699
Gerrit-PatchSet: 5
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged