Review at  https://gerrit.osmocom.org/6245

cosmetic: rename mgcp_release_endp to mgcp_endp_release

In order to allow clean prefixes for future endpoint related
functions the "rlease" should be moved to the end of the
function name.

- rename mgcp_release_endp to mgcp_endp_release

Change-Id: I22e938e702f57ad76d38c9f4a1370b110ac1ba11
---
M include/osmocom/mgcp/mgcp_ep.h
M src/libosmo-mgcp/mgcp_ep.c
M src/libosmo-mgcp/mgcp_protocol.c
M src/libosmo-mgcp/mgcp_vty.c
M src/osmo-mgw/mgw_main.c
M tests/mgcp/mgcp_test.c
6 files changed, 13 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/45/6245/1

diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h
index 2b7a5d6..c0fd9ff 100644
--- a/include/osmocom/mgcp/mgcp_ep.h
+++ b/include/osmocom/mgcp/mgcp_ep.h
@@ -95,4 +95,5 @@
 /*! Extract endpoint number for a given endpoint */
 #define ENDPOINT_NUMBER(endp) abs((int)(endp - endp->tcfg->endpoints))
 
-void mgcp_release_endp(struct mgcp_endpoint *endp);
+void mgcp_endp_release(struct mgcp_endpoint *endp);
+
diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c
index c2bf78e..efa15a0 100644
--- a/src/libosmo-mgcp/mgcp_ep.c
+++ b/src/libosmo-mgcp/mgcp_ep.c
@@ -34,7 +34,7 @@
 
 /*! release endpoint, all open connections are closed.
  *  \param[in] endp endpoint to release */
-void mgcp_release_endp(struct mgcp_endpoint *endp)
+void mgcp_endp_release(struct mgcp_endpoint *endp)
 {
        LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n",
             ENDPOINT_NUMBER(endp));
diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c
index 9fe30f8..c6beaa4 100644
--- a/src/libosmo-mgcp/mgcp_protocol.c
+++ b/src/libosmo-mgcp/mgcp_protocol.c
@@ -583,7 +583,7 @@
                if (tcfg->force_realloc)
                        /* This is not our call, toss everything by releasing
                         * the entire endpoint. (rude!) */
-                       mgcp_release_endp(endp);
+                       mgcp_endp_release(endp);
                else {
                        /* This is not our call, leave everything as it is and
                         * return with an error. */
@@ -673,7 +673,7 @@
                        LOGP(DLMGCP, LOGL_NOTICE,
                             "CRCX: endpoint:0x%x CRCX rejected by policy\n",
                             ENDPOINT_NUMBER(endp));
-                       mgcp_release_endp(endp);
+                       mgcp_endp_release(endp);
                        return create_err_response(endp, 400, "CRCX", p->trans);
                        break;
                case MGCP_POLICY_DEFER:
@@ -703,7 +703,7 @@
             ENDPOINT_NUMBER(endp));
        return create_response_with_sdp(endp, conn, "CRCX", p->trans, true);
 error2:
-       mgcp_release_endp(endp);
+       mgcp_endp_release(endp);
        LOGP(DLMGCP, LOGL_NOTICE,
             "CRCX: endpoint:0x%x unable to create connection resource error\n",
             ENDPOINT_NUMBER(endp));
@@ -954,7 +954,7 @@
                     "DLCX: endpoint:0x%x missing ci (connectionIdentifier), 
will remove all connections at once\n",
                     ENDPOINT_NUMBER(endp));
 
-               mgcp_release_endp(endp);
+               mgcp_endp_release(endp);
 
                /* Note: In this case we do not return any statistics,
                 * as we assume that the client is not interested in
@@ -981,7 +981,7 @@
        /* When all connections are closed, the endpoint will be released
         * in order to be ready to be used by another call. */
        if (llist_count(&endp->conns) <= 0) {
-               mgcp_release_endp(endp);
+               mgcp_endp_release(endp);
                LOGP(DLMGCP, LOGL_DEBUG,
                     "DLCX: endpoint:0x%x endpoint released\n",
                     ENDPOINT_NUMBER(endp));
diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c
index 99780c8..5378931 100644
--- a/src/libosmo-mgcp/mgcp_vty.c
+++ b/src/libosmo-mgcp/mgcp_vty.c
@@ -1048,7 +1048,7 @@
        }
 
        endp = &trunk->endpoints[endp_no];
-       mgcp_release_endp(endp);
+       mgcp_endp_release(endp);
        return CMD_SUCCESS;
 }
 
diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c
index 8e956e4..4452ae3 100644
--- a/src/osmo-mgw/mgw_main.c
+++ b/src/osmo-mgw/mgw_main.c
@@ -190,7 +190,7 @@
                /* Walk over all endpoints and trigger a release, this will 
release all
                 * endpoints, possible open connections are forcefully dropped 
*/
                for (i = 1; i < reset_trunk->number_endpoints; ++i)
-                       mgcp_release_endp(&reset_trunk->endpoints[i]);
+                       mgcp_endp_release(&reset_trunk->endpoints[i]);
        }
 
        return 0;
diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c
index 1790444..4d39bda 100644
--- a/tests/mgcp/mgcp_test.c
+++ b/tests/mgcp/mgcp_test.c
@@ -1324,7 +1324,7 @@
 
        /* Free the previous endpoint and the data and
         * check if the connection really vanished... */
-       mgcp_release_endp(endp);
+       mgcp_endp_release(endp);
        talloc_free(endp->last_response);
        talloc_free(endp->last_trans);
        endp->last_response = endp->last_trans = NULL;
@@ -1395,7 +1395,7 @@
        OSMO_ASSERT(conn->state.stats.cycles == UINT16_MAX + 1);
        OSMO_ASSERT(conn->state.stats.max_seq == 0);
 
-       mgcp_release_endp(endp);
+       mgcp_endp_release(endp);
        talloc_free(cfg);
 }
 
@@ -1426,7 +1426,7 @@
        msgb_free(inp);
        msgb_free(msg);
 
-       mgcp_release_endp(&cfg->trunk.endpoints[1]);
+       mgcp_endp_release(&cfg->trunk.endpoints[1]);
        talloc_free(cfg);
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I22e938e702f57ad76d38c9f4a1370b110ac1ba11
Gerrit-PatchSet: 1
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Owner: dexter <pma...@sysmocom.de>

Reply via email to