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 <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>
Gerrit-HasComments: No