Change in libosmocore[master]: vty: make function cmd_range_match() public

laforge gerrit-no-reply at
Fri Jun 18 12:31:01 UTC 2021

laforge has submitted this change. ( )

Change subject: vty: make function cmd_range_match() public

vty: make function cmd_range_match() public

Certain control interface commands also may require to verfy a range in
their verify function. cmd_range_match() from the VTY does exactly that
and the range can be specified as string, the same way as we would
specify it in the VTY.

Change-Id: I53fc207677f52b1dc748b01d58424839cdba807c
related: SYS#5369
M include/osmocom/vty/command.h
M src/vty/command.c
2 files changed, 6 insertions(+), 4 deletions(-)

  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index 81333b4..7f1ae5a 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -483,4 +483,6 @@
 int vty_dump_xml_ref_mode(FILE *stream, enum vty_ref_gen_mode mode);
 int vty_dump_xml_ref(FILE *stream) OSMO_DEPRECATED("Use vty_dump_xml_ref_mode() instead");
+int vty_cmd_range_match(const char *range, const char *str);
 /*! @} */
diff --git a/src/vty/command.c b/src/vty/command.c
index 6d63d84..de89337 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -1477,7 +1477,7 @@
 #error "LONG_MAX not defined!"
-static int cmd_range_match(const char *range, const char *str)
+int vty_cmd_range_match(const char *range, const char *str)
 	char *p;
@@ -1600,7 +1600,7 @@
 		return VARARG_MATCH;
 	else if (CMD_RANGE(str))
-		if (cmd_range_match(str, command))
+		if (vty_cmd_range_match(str, command))
 			return RANGE_MATCH;
 #ifdef HAVE_IPV6
@@ -1797,7 +1797,7 @@
 			case RANGE_MATCH:
-				if (cmd_range_match
+				if (vty_cmd_range_match
 				    (str, command)) {
 					if (matched
 					    && strcmp(matched,
@@ -1890,7 +1890,7 @@
 		return dst;
 	if (CMD_RANGE(dst)) {
-		if (cmd_range_match(dst, src))
+		if (vty_cmd_range_match(dst, src))
 			return dst;
 			return NULL;

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I53fc207677f52b1dc748b01d58424839cdba807c
Gerrit-Change-Number: 24691
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list