<p>Patch set 2:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372">View Change</a></p><p>17 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2//COMMIT_MSG">Commit Message:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2//COMMIT_MSG@10">Patch Set #2, Line 10:</a> <code style="font-family:monospace,monospace">implemented in various placed (mostly mgcp_protocol.c). Also we use</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">places</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2//COMMIT_MSG@14">Patch Set #2, Line 14:</a> <code style="font-family:monospace,monospace">The trunk and endpoint handling in osmo-mgw is still very complex and</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This paragraph is repeated.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2//COMMIT_MSG@25">Patch Set #2, Line 25:</a> <code style="font-family:monospace,monospace"> - rename struct mgcp_trunk_config to mgcp_trunk and "tcfg" to "trunk"</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Having an "mgcp_trunk" structure and a "trunk" one looks confusing to me.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/include/osmocom/mgcp/mgcp_endp.h">File include/osmocom/mgcp/mgcp_endp.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/include/osmocom/mgcp/mgcp_endp.h@81">Patch Set #2, Line 81:</a> <code style="font-family:monospace,monospace">     /*! Backpointer to the related trunk */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">"Backpointer to the trunk this endpoint belongs to" would probably be more clear for newcomers to understand relation between objects.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c">File src/libosmo-mgcp/mgcp_endp.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@101">Patch Set #2, Line 101:</a> <code style="font-family:monospace,monospace">                 (epname, MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK,</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">what if len(epname) < prefix_len? Is strncmp safe here?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@158">Patch Set #2, Line 158:</a> <code style="font-family:monospace,monospace">    * wildarded endpoint searches that picks the next free endpoint on</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">wildcarded</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@183">Patch Set #2, Line 183:</a> <code style="font-family:monospace,monospace">                endp = trunk->endpoints[i];</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(We should move to a hashtable with key=str and val=ptr at some point now that we use strings.)</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@188">Patch Set #2, Line 188:</a> <code style="font-family:monospace,monospace">                                 "(trunk:%i) found endpoint: %s\n",</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">%d</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@196">Patch Set #2, Line 196:</a> <code style="font-family:monospace,monospace">           "(trunk:%i) Not able to find specified endpoint: %s\n",</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">%d</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_endp.c@254">Patch Set #2, Line 254:</a> <code style="font-family:monospace,monospace">       if (trunk->trunk_type == MGCP_TRUNK_VIRTUAL) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">(At some point we should have function pointers to do type-specific stuff. Like in here trunk->check_domain_name().)</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_protocol.c">File src/libosmo-mgcp/mgcp_protocol.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_protocol.c@285">Patch Set #2, Line 285:</a> <code style="font-family:monospace,monospace">      /* FIXME: We hardcode to pick cfg->virt_trunkl, but </code></p><p style="white-space: pre-wrap; word-wrap: break-word;">trailing whitespace</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_protocol.c@288">Patch Set #2, Line 288:</a> <code style="font-family:monospace,monospace">       struct rate_ctr_group *rate_ctrs = trunk->mgcp_general_ctr_group;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">The rate_ctrs used below look general and not related to a trunk, so they should mbe moved to be under "mgcp_config cfg" instead of "cfg->virt_trunk".</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_protocol.c@996">Patch Set #2, Line 996:</a> <code style="font-family:monospace,monospace">        struct mgcp_endpoint *endp = p->endp;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Swap these two lines:<br>struct mgcp_endpoint *endp = p->endp;<br>struct mgcp_trunk *trunk = endp->trunk;</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_protocol.c@1220">Patch Set #2, Line 1220:</a> <code style="font-family:monospace,monospace">    struct mgcp_endpoint *endp = p->endp;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same, swap these two lines.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_sdp.c">File src/libosmo-mgcp/mgcp_sdp.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_sdp.c@386">Patch Set #2, Line 386:</a> <code style="font-family:monospace,monospace">                    LOGP(DLMGCP, LOGL_NOTICE, "endpoint:%s, failed to add codec\n", endp->name);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I see a lot of endpoint:%s logging, what about introducing LOGPENDP(endp, CAT, "...") at some point?</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_trunk.c">File src/libosmo-mgcp/mgcp_trunk.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/src/libosmo-mgcp/mgcp_trunk.c@30">Patch Set #2, Line 30:</a> <code style="font-family:monospace,monospace">static const struct rate_ctr_desc mgcp_general_ctr_desc[] = {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">As I said, to me lots of these counters are not per-trunk, but global, so they shouldn't be here.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/tests/mgcp/mgcp_test.c">File tests/mgcp/mgcp_test.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372/2/tests/mgcp/mgcp_test.c@74">Patch Set #2, Line 74:</a> <code style="font-family:monospace,monospace">#define AUEP1_RET "500 158663169 FAIL\r\n"</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">What about these changes in behavior? expected? I don't recall seeing any comment in commit deescription.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372">change 18372</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-mgw/+/18372"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ice8aaf03faa2fd99074f8665eea3a696d30c5eb3 </div>
<div style="display:none"> Gerrit-Change-Number: 18372 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 27 May 2020 07:40:36 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>