net-snmp 3.14.1 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/index.js +9 -6
- package/lib/mib.js +0 -2
- package/package.json +1 -1
package/README.md
CHANGED
@@ -3412,6 +3412,14 @@ Example programs are included under the module's `example` directory.
|
|
3412
3412
|
|
3413
3413
|
* Add RFC-1215 to base MIB modules to provide TRAP-TYPE macro
|
3414
3414
|
|
3415
|
+
## Version 3.15.0 - 14/09/2024
|
3416
|
+
|
3417
|
+
* Change return of undefined or null MIB values to NoSuchInstance
|
3418
|
+
|
3419
|
+
## Version 3.15.1 - 12/10/2024
|
3420
|
+
|
3421
|
+
* Fix bundler failure due to unnecessary string length assignment
|
3422
|
+
|
3415
3423
|
# License
|
3416
3424
|
|
3417
3425
|
Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
|
package/index.js
CHANGED
@@ -3771,17 +3771,16 @@ MibNode.prototype.getNextInstanceNode = function () {
|
|
3771
3771
|
var childrenAddresses;
|
3772
3772
|
|
3773
3773
|
var node = this;
|
3774
|
-
|
3775
|
-
|
3776
|
-
node = this;
|
3774
|
+
// If we start on a leaf node, we need next (right) sibling or upwards traversal first
|
3775
|
+
if ( ! node.children || Object.keys (node.children).length === 0 ) {
|
3777
3776
|
while ( node ) {
|
3778
3777
|
siblingIndex = node.address.slice(-1)[0];
|
3779
3778
|
node = node.parent;
|
3780
3779
|
if ( ! node ) {
|
3781
|
-
//
|
3780
|
+
// End of MIB
|
3782
3781
|
return null;
|
3783
3782
|
} else {
|
3784
|
-
// Move to next sibling
|
3783
|
+
// Move to next sibling if we are not last child
|
3785
3784
|
childrenAddresses = Object.keys (node.children).sort ( (a, b) => a - b);
|
3786
3785
|
var siblingPosition = childrenAddresses.indexOf(siblingIndex.toString());
|
3787
3786
|
if ( siblingPosition + 1 < childrenAddresses.length ) {
|
@@ -3792,7 +3791,8 @@ MibNode.prototype.getNextInstanceNode = function () {
|
|
3792
3791
|
}
|
3793
3792
|
}
|
3794
3793
|
while ( node ) {
|
3795
|
-
|
3794
|
+
// Return if at leaf
|
3795
|
+
if ( ! node.children || Object.keys (node.children).length === 0 ) {
|
3796
3796
|
return node;
|
3797
3797
|
}
|
3798
3798
|
// Descend to first child if not at leaf
|
@@ -5215,6 +5215,9 @@ Agent.prototype.request = function (socket, requestMessage, rinfo) {
|
|
5215
5215
|
responseVarbind.type = mibRequests[savedIndex].instanceNode.valueType;
|
5216
5216
|
}
|
5217
5217
|
responseVarbind.value = mibRequests[savedIndex].instanceNode.value;
|
5218
|
+
if ( responseVarbind.value === undefined || responseVarbind.value === null ) {
|
5219
|
+
responseVarbind.type = ObjectType.NoSuchInstance;
|
5220
|
+
}
|
5218
5221
|
}
|
5219
5222
|
if ( providerNode && providerNode.provider && providerNode.provider.name ) {
|
5220
5223
|
responseVarbind.providerName = providerNode.provider.name;
|
package/lib/mib.js
CHANGED
@@ -48,14 +48,12 @@ var MIB = function (dir) {
|
|
48
48
|
column = (column - this.builder.length);
|
49
49
|
var symbol = this.builder.toString().trim();
|
50
50
|
this.builder = "";
|
51
|
-
this.builder.length = 0;
|
52
51
|
if (!this.Table[FileName]) {
|
53
52
|
this.Table[FileName] = [];
|
54
53
|
} else if (this.PreviousRow < row) {
|
55
54
|
this.RowIndex++;
|
56
55
|
this.ColumnIndex = 0;
|
57
56
|
this.PreviousRow = row;
|
58
|
-
|
59
57
|
}
|
60
58
|
var R = this.RowIndex;
|
61
59
|
var C = this.ColumnIndex;
|