[MERGED] osmo-iuh[master]: hnbgw: parameterize iuh local port: add vty cmd

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Fri Oct 28 09:30:44 UTC 2016


Harald Welte has submitted this change and it was merged.

Change subject: hnbgw: parameterize iuh local port: add vty cmd
......................................................................


hnbgw: parameterize iuh local port: add vty cmd

For completeness' sake, add VTY command to set the local Iuh port, to go with
the command that sets the local IP.

Change-Id: I4b5e9fe9fcfa489069a0728d47899ef4a61f7ce5
---
M src/hnbgw_vty.c
1 file changed, 14 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/hnbgw_vty.c b/src/hnbgw_vty.c
index 93c1f9a..ff75aea 100644
--- a/src/hnbgw_vty.c
+++ b/src/hnbgw_vty.c
@@ -114,6 +114,14 @@
 	return CMD_SUCCESS;
 }
 
+DEFUN(cfg_hnbgw_iuh_local_port, cfg_hnbgw_iuh_local_port_cmd, "local-port <1-65535>",
+      "Accept Iuh connections on local port\n"
+      "Local interface port (default: 29169)")
+{
+	g_hnb_gw->config.iuh_local_port = atoi(argv[0]);
+	return CMD_SUCCESS;
+}
+
 DEFUN(cfg_hnbgw_iuh_hnbap_allow_tmsi, cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd,
       "hnbap-allow-tmsi (0|1)",
       "Allow HNBAP UE Register messages with TMSI or PTMSI identity\n"
@@ -133,12 +141,17 @@
 static int config_write_hnbgw_iuh(struct vty *vty)
 {
 	const char *addr;
+	uint16_t port;
 
 	vty_out(vty, " iuh%s", VTY_NEWLINE);
 
 	addr = g_hnb_gw->config.iuh_local_ip;
 	if (addr && (strcmp(addr, HNBGW_LOCAL_IP_DEFAULT) != 0))
 		vty_out(vty, "  local-ip %s%s", addr, VTY_NEWLINE);
+
+	port = g_hnb_gw->config.iuh_local_port;
+	if (port && port != IUH_DEFAULT_SCTP_PORT)
+		vty_out(vty, "  local-port %u%s", port, VTY_NEWLINE);
 
 	if (g_hnb_gw->config.hnbap_allow_tmsi)
 		vty_out(vty, "  hnbap-allow-tmsi 1%s", VTY_NEWLINE);
@@ -160,6 +173,7 @@
 	vty_install_default(IUH_NODE);
 
 	install_element(IUH_NODE, &cfg_hnbgw_iuh_local_ip_cmd);
+	install_element(IUH_NODE, &cfg_hnbgw_iuh_local_port_cmd);
 	install_element(IUH_NODE, &cfg_hnbgw_iuh_hnbap_allow_tmsi_cmd);
 
 	install_element_ve(&show_hnb_cmd);

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

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



More information about the gerrit-log mailing list