libosmocore[master]: ctrl: allow more nodes than those in enum ctrl_node_type

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Oct 23 12:28:16 UTC 2017


Patch Set 3:

> wouldn't it make more sense for the application simply to provide
 > the number of it's onw nodes?

API wise it appears more logical, but in practical terms that would actually be more complex. All the new node IDs have to be >= _LAST_CTRL_NODE anyway:

  enum my_nodes {
    MY_FIRST = _LAST_CTRL_NODE,
    MORE,
    _MY_LAST_CTRL_NODE
  }

Current patch:

  ctrl_interface_setup_dynip(_MY_LAST_CTRL_NODE)

Passing the number of additional nodes:

  ctrl_interface_setup_dynip(caller_nodes = _MY_LAST_CTRL_NODE - _LAST_CTRL_NODE)
  {
     alloc(_LAST_CTRL_NODE + caller_nodes)
  }

So we do two steps of math just to end up with the caller's last node again. Maybe the parameter shouldn't be called 'node_count', but 'last_node'?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1bd62ae0d4eefde7e1517db15a2155640a1bab58
Gerrit-PatchSet: 3
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: No



More information about the gerrit-log mailing list