<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/6/include/osmocom/bsc/handover_cfg.h">File include/osmocom/bsc/handover_cfg.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-bsc/+/24600/6/include/osmocom/bsc/handover_cfg.h@73">Patch Set #6, Line 73:</a> <code style="font-family:monospace,monospace">must end with a "\0",</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">see neels' comment below, every string constant gets a \0 appended to it. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/6/include/osmocom/bsc/handover_cfg.h@264">Patch Set #6, Line 264:</a> <code style="font-family:monospace,monospace">                "handover2 min-free-slots tch-h\0") \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I guess this is a typo and he meant '\n'</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c">File src/osmo-bsc/handover_ctrl.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-bsc/+/24600/1/src/osmo-bsc/handover_ctrl.c@33">Patch Set #1, Line 33:</a> <code style="font-family:monospace,monospace">bool verify_vty_cmd_arg(void *ctx, const char *range, const char *value)</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">yes, for a reason</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Its has the "vty" in the name because the function uses the same range descriptions like the VTY but feel free to suggest a different name for that function.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/6/src/osmo-bsc/handover_ctrl.c">File src/osmo-bsc/handover_ctrl.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-bsc/+/24600/6/src/osmo-bsc/handover_ctrl.c@32">Patch Set #6, Line 32:</a> <code style="font-family:monospace,monospace">/* Verify a VTY command argument against its value specification, the value</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Here we could add: […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/6/src/osmo-bsc/handover_ctrl.c@73">Patch Set #6, Line 73:</a> <code style="font-family:monospace,monospace">CTRL_CMD_DEFINE(NAME, CTRL_CMD VTY_CMD_PREFIX VTY_CMD); \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Hm, I don't understand how this works. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">When CTRL_CMD it is used the constant will be defined like "handover2 min-free-slots tch-h\0", VTY_CMD_PREFIX and VTY_CMD will still hold strings, but they are cut short by the \0 in that constant.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Unfortunately there is no way to get around this using #if in some way. The only way to get rid of this would be to use VTY_CMD only and repeat every VTY_CMD_PREFIX VTY_CMD in CTRL_CMD for all functions. At the moment VTY_CMD is an optional parameter that is only used when the string contains illegal characters so that a new string is needed to be defined.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I have found a better solution now. The command name string is filtered before the command is installed. That also means we can get rid of the CTRL_CMD parameter again.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600/6/src/osmo-bsc/handover_ctrl.c@114">Patch Set #6, Line 114:</a> <code style="font-family:monospace,monospace">          cmd->reply = talloc_asprintf(cmd, "%s", #DEFAULT_VAL); \</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">(we would usually also put { } around the else-scope)</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Done</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/24600">change 24600</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-bsc/+/24600"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I12f143906818fd6b16e8783157cbb1eb51e49ffc </div>
<div style="display:none"> Gerrit-Change-Number: 24600 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Assignee: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 06 Jul 2021 12:50:46 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>