Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add snmp_getnext_multi() function #8052
Added snmp_getnext_multi() function using syntax of existing snmp_get_multi() function.
This replicates the snmp_get_multi() function but calls snmpgetnext instead, returning an array like so;
This replicates the output of snmp_get_multi() - we won't know the index in advance, but consistency of outputs seems worth doing.
See #8005 for further details :)
DO NOT DELETE THIS TEXT
If you would like to test this pull request then please run:
referenced this pull request
Jan 9, 2018
Because this is getnext, perhaps omitting the index seems appropriate. Otherwise, how will you find the data in the result array?
For example we get firstOid and secondOid, but first oid is at index 32 and the second index is at index 43
Now we have an array like this:
array( 32 => array('firstOid' => 'value'), 43 => array('secondOid' => 'value), )
You'd have to iterate through the array and search for the right oid.
I think this makes more sense:
array( 'firstOid' => 'value', 'secondOid' => 'value', )
I was looking to preserve the index number without having to account for it being a part of the key, since it's something that isn't known at the time of calling the function (and might be different for each returned result). We could return this;
But now our calling routine won't know what it should be looking for as a key. Maybe a bit of both?
Then it's as simple as $data['firstOid']['value'] but the index isn't lost along the way - If we don't mind losing the index entirely then I'm totally happy to strip it, though.