<p>fixeria has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/17017">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">tdef_vty: do not enforce enum 'node_type' in osmo_tdef_vty_groups_init()<br><br>Some osmo-* applications may need to use their own VTY node as a<br>parent for the timer configuration commands. Therefore it makes<br>more sense to use 'int' instead of 'enum node_type'.<br><br>Let's also clarify that osmo_tdef_vty_groups_init() accepts parent<br>node for configuration commands only: 'parent_node' -> 'cfg_node'.<br><br>Change-Id: Ifb4c406c85d76a25fc53fc235484599aa87dc77c<br>---<br>M include/osmocom/vty/tdef_vty.h<br>M src/vty/tdef_vty.c<br>2 files changed, 4 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/17/17017/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/osmocom/vty/tdef_vty.h b/include/osmocom/vty/tdef_vty.h</span><br><span>index 6334d5b..c054e22 100644</span><br><span>--- a/include/osmocom/vty/tdef_vty.h</span><br><span>+++ b/include/osmocom/vty/tdef_vty.h</span><br><span>@@ -68,7 +68,7 @@</span><br><span> struct osmo_tdef *osmo_tdef_vty_parse_T_arg(struct vty *vty, struct osmo_tdef *tdefs, const char *osmo_tdef_str);</span><br><span> unsigned long osmo_tdef_vty_parse_val_arg(const char *val_arg, unsigned long default_val);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-void osmo_tdef_vty_groups_init(enum node_type parent_node, struct osmo_tdef_group *groups);</span><br><span style="color: hsl(120, 100%, 40%);">+void osmo_tdef_vty_groups_init(int cfg_node, struct osmo_tdef_group *groups);</span><br><span> void osmo_tdef_vty_groups_write(struct vty *vty, const char *indent);</span><br><span> </span><br><span> /*! @} */</span><br><span>diff --git a/src/vty/tdef_vty.c b/src/vty/tdef_vty.c</span><br><span>index 4549a61..1f661b7 100644</span><br><span>--- a/src/vty/tdef_vty.c</span><br><span>+++ b/src/vty/tdef_vty.c</span><br><span>@@ -361,10 +361,10 @@</span><br><span>  * The given timer definitions group is stored in a global pointer, so this can be done only once per main() scope.</span><br><span>  * It would also be possible to have distinct timer groups on separate VTY subnodes, with a "manual" implementation, but</span><br><span>  * not with this API.</span><br><span style="color: hsl(0, 100%, 40%);">- * \param[in] parent_node  VTY node id at which to add the timer group commands, e.g. CONFIG_NODE.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \param[in] cfg_node  VTY node at which to add the timer configuration commands, e.g. CONFIG_NODE.</span><br><span>  * \param[in] groups  Global timer groups definition.</span><br><span>  */</span><br><span style="color: hsl(0, 100%, 40%);">-void osmo_tdef_vty_groups_init(enum node_type parent_node, struct osmo_tdef_group *groups)</span><br><span style="color: hsl(120, 100%, 40%);">+void osmo_tdef_vty_groups_init(int cfg_node, struct osmo_tdef_group *groups)</span><br><span> {</span><br><span>     struct osmo_tdef_group *g;</span><br><span>   OSMO_ASSERT(!global_tdef_groups);</span><br><span>@@ -380,7 +380,7 @@</span><br><span>      cfg_timer_cmd.doc = timer_doc_string("Configure or show timers\n", OSMO_TDEF_VTY_DOC_SET);</span><br><span> </span><br><span>     install_element_ve(&show_timer_cmd);</span><br><span style="color: hsl(0, 100%, 40%);">-        install_element(parent_node, &cfg_timer_cmd);</span><br><span style="color: hsl(120, 100%, 40%);">+     install_element(cfg_node, &cfg_timer_cmd);</span><br><span> }</span><br><span> </span><br><span> /*! Write the global osmo_tdef_group configuration to VTY, as previously passed to osmo_tdef_vty_groups_init().</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/17017">change 17017</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/libosmocore/+/17017"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ifb4c406c85d76a25fc53fc235484599aa87dc77c </div>
<div style="display:none"> Gerrit-Change-Number: 17017 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: fixeria <axilirator@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>