[MERGED] libosmo-sccp[master]: ss7_vty: don't re-define xUA dialect strings

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
Sat Apr 15 21:04:24 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: ss7_vty: don't re-define xUA dialect strings
......................................................................


ss7_vty: don't re-define xUA dialect strings

If we add more xUA variants/protocols, we want to avoid having to touch
too many parts of the code with copy+pasted strings.

Change-Id: I085b884d98fb4c45ac15910a8ebf82b91e861fd4
---
M src/osmo_ss7_vty.c
1 file changed, 15 insertions(+), 12 deletions(-)

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



diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index c2ad25c..a05d74f 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -37,6 +37,13 @@
 
 #include "xua_internal.h"
 
+#define XUA_VAR_STR	"(sua|m3ua)"
+
+#define XUA_VAR_HELP_STR		\
+	"SCCP User Adaptation\n"	 \
+	"MTP3 User Adaptation\n"
+
+
 /***********************************************************************
  * Core CS7 Configuration
  ***********************************************************************/
@@ -380,12 +387,10 @@
 	1,
 };
 
-#define XUA_STR	"SCCP User Adaptation\n" "MTP3 User Adaptation\n"
-
 DEFUN(cs7_xua, cs7_xua_cmd,
-	"listen (sua|m3ua) <0-65534>",
+	"listen " XUA_VAR_STR " <0-65534>",
 	"Configure/Enable xUA Listener\n"
-	XUA_STR "SCTP Port number\n")
+	XUA_VAR_HELP_STR "SCTP Port number\n")
 {
 	struct osmo_ss7_instance *inst = vty->index;
 	struct osmo_xua_server *xs;
@@ -405,9 +410,9 @@
 }
 
 DEFUN(no_cs7_xua, no_cs7_xua_cmd,
-	"no listen (sua|m3ua) <0-65534>",
+	"no listen " XUA_VAR_STR " <0-65534>",
 	NO_STR "Disable xUA Listener on given SCTP Port\n"
-	XUA_STR "SCTP Port number\n")
+	XUA_VAR_HELP_STR "SCTP Port number\n")
 {
 	struct osmo_ss7_instance *inst = vty->index;
 	struct osmo_xua_server *xs;
@@ -472,13 +477,12 @@
 };
 
 DEFUN(cs7_asp, cs7_asp_cmd,
-	"asp NAME <0-65535> <0-65535> (m3ua|sua)",
+	"asp NAME <0-65535> <0-65535> " XUA_VAR_STR,
 	"Configure Application Server Process\n"
 	"Name of ASP\n"
 	"Remote SCTP port number\n"
 	"Local SCTP port number\n"
-	"M3UA Protocol\n"
-	"SUA Protocol\n")
+	XUA_VAR_HELP_STR)
 {
 	struct osmo_ss7_instance *inst = vty->index;
 	const char *name = argv[0];
@@ -617,11 +621,10 @@
 };
 
 DEFUN(cs7_as, cs7_as_cmd,
-	"as NAME (m3ua|sua)",
+	"as NAME " XUA_VAR_STR,
 	"Configure an Application Server\n"
 	"Name of the Application Server\n"
-	"M3UA Application Server\n"
-	"SUA Application Server\n")
+	XUA_VAR_HELP_STR)
 {
 	struct osmo_ss7_instance *inst = vty->index;
 	struct osmo_ss7_as *as;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I085b884d98fb4c45ac15910a8ebf82b91e861fd4
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list