Change in osmo-mgw[master]: rename strip_epname and find_specific_endpoint and make them available

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

laforge gerrit-no-reply at lists.osmocom.org
Wed Nov 3 15:19:13 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/25429 )

Change subject: rename strip_epname and find_specific_endpoint and make them available
......................................................................

rename strip_epname and find_specific_endpoint and make them available

Change-Id: I4f76676640a308ab84da3848e1c1ec22bd5d9566
---
M include/osmocom/mgcp/mgcp_endp.h
M src/libosmo-mgcp/mgcp_endp.c
2 files changed, 20 insertions(+), 10 deletions(-)

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



diff --git a/include/osmocom/mgcp/mgcp_endp.h b/include/osmocom/mgcp/mgcp_endp.h
index b8796c1..91c4551 100644
--- a/include/osmocom/mgcp/mgcp_endp.h
+++ b/include/osmocom/mgcp/mgcp_endp.h
@@ -136,3 +136,7 @@
 bool mgcp_endp_avail(struct mgcp_endpoint *endp);
 void mgcp_endp_add_conn(struct mgcp_endpoint *endp, struct mgcp_conn *conn);
 void mgcp_endp_remove_conn(struct mgcp_endpoint *endp, struct mgcp_conn *conn);
+void mgcp_endp_strip_name(char *epname_stripped, const char *epname,
+			 const struct mgcp_trunk *trunk);
+struct mgcp_endpoint *mgcp_endp_find_specific(const char *epname,
+			const struct mgcp_trunk *trunk);
diff --git a/src/libosmo-mgcp/mgcp_endp.c b/src/libosmo-mgcp/mgcp_endp.c
index 19446ce..247baac 100644
--- a/src/libosmo-mgcp/mgcp_endp.c
+++ b/src/libosmo-mgcp/mgcp_endp.c
@@ -187,12 +187,16 @@
 	}
 }
 
-/* Convert all characters in epname to lowercase and strip trunk prefix and
+
+ /*! Convert all characters in epname to lowercase and strip trunk prefix and
  * endpoint name suffix (domain name) from epname. The result is written to
  * to the memory pointed at by epname_stripped. The expected size of the
  * result is either equal or lower then the length of the input string
- * (epname) */
-static void strip_epname(char *epname_stripped, const char *epname,
+ * (epname)
+ *  \param[out] epname_stripped pointer to store the stripped ep name.
+ *  \param[in] epname endpoint name to lookup.
+ *  \param[in] trunk where the endpoint is located. */
+void mgcp_endp_strip_name(char *epname_stripped, const char *epname,
 			 const struct mgcp_trunk *trunk)
 {
 	osmo_str_tolower_buf(epname_stripped, MGCP_ENDPOINT_MAXLEN, epname);
@@ -219,9 +223,11 @@
 	return NULL;
 }
 
-/* Find an endpoint specified by its name. If the endpoint can not be found,
- * return NULL */
-static struct mgcp_endpoint *find_specific_endpoint(const char *epname,
+/*! Find an endpoint of a trunk specified by its name.
+ *  \param[in] epname endpoint name to check
+ *  \param[in] trunk mgcp_trunk that might have this endpoint
+ *  \returns NULL if no ep found, else endpoint */
+struct mgcp_endpoint *mgcp_endp_find_specific(const char *epname,
 						    const struct mgcp_trunk *trunk)
 {
 	char epname_stripped[MGCP_ENDPOINT_MAXLEN];
@@ -230,11 +236,11 @@
 	unsigned int i;
 
 	/* Strip irrelevant information from the endpoint name */
-	strip_epname(epname_stripped, epname, trunk);
+	mgcp_endp_strip_name(epname_stripped, epname, trunk);
 
 	for (i = 0; i < trunk->number_endpoints; i++) {
 		endp = trunk->endpoints[i];
-		strip_epname(epname_stripped_endp, endp->name, trunk);
+		mgcp_endp_strip_name(epname_stripped_endp, endp->name, trunk);
 		if (strcmp(epname_stripped_endp, epname_stripped) == 0)
 			return endp;
 	}
@@ -289,7 +295,7 @@
 
 	/* Find an endpoint by its name (if wildcarded request is not
 	 * applicable) */
-	endp = find_specific_endpoint(epname, trunk);
+	endp = mgcp_endp_find_specific(epname, trunk);
 	if (endp) {
 		LOGPENDP(endp, DLMGCP, LOGL_DEBUG,
 			 "(trunk:%d) found endpoint: %s\n",
@@ -540,7 +546,7 @@
 		epname_check = gen_e1_epname(endp, endp->trunk->cfg->domain,
 					     endp->trunk->trunk_nr, ts_nr,
 					     interlock[i]);
-		endp_check = find_specific_endpoint(epname_check, endp->trunk);
+		endp_check = mgcp_endp_find_specific(epname_check, endp->trunk);
 		if (!endp_check) {
 			LOGPENDP(endp, DLMGCP, LOGL_ERROR,
 				 "cannot check endpoint availability, overlapping endpoint:%s not found!\n",

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/25429
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I4f76676640a308ab84da3848e1c1ec22bd5d9566
Gerrit-Change-Number: 25429
Gerrit-PatchSet: 18
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211103/791a22f9/attachment.htm>


More information about the gerrit-log mailing list