net-snmp 3.9.3 → 3.9.5

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 CHANGED
@@ -3289,6 +3289,14 @@ Example programs are included under the module's `example` directory.
3289
3289
 
3290
3290
  * Add AgentX subagent "error" and "close" events
3291
3291
 
3292
+ ## Version 3.9.4 - 26/05/2023
3293
+
3294
+ * Fix syntax constraints tokenization and fix applying of size constraints
3295
+
3296
+ ## Version 3.9.5 - 30/05/2023
3297
+
3298
+ * Normalize whitespace parsing for OBJECT IDENTIFIER value
3299
+
3292
3300
  # License
3293
3301
 
3294
3302
  Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
package/index.js CHANGED
@@ -3392,7 +3392,7 @@ ModuleStore.getConstraintsFromSyntax = function (syntax) {
3392
3392
  syntax = Object.keys(syntax)[0];
3393
3393
  } else if ( firstSyntaxKey.sizes ) {
3394
3394
  constraints = {
3395
- size: firstSyntaxKey.sizes
3395
+ sizes: firstSyntaxKey.sizes
3396
3396
  };
3397
3397
  syntax = Object.keys(syntax)[0];
3398
3398
  } else {
@@ -3553,7 +3553,7 @@ MibNode.prototype.setValue = function (newValue) {
3553
3553
  }
3554
3554
  } else if ( constraints.sizes ) {
3555
3555
  // if size is constrained, value must have a length property
3556
- if ( ! ( "length" in newValue ) ) {
3556
+ if ( newValue.length === undefined ) {
3557
3557
  return false;
3558
3558
  }
3559
3559
  len = newValue.length;
package/lib/mib.js CHANGED
@@ -167,14 +167,15 @@ var MIB = function (dir) {
167
167
  case '(':
168
168
  if ( ! this.CharBuffer.isComment && ! this.CharBuffer.isString ) {
169
169
  this.CharBuffer.nested++;
170
- if ( char == '(') {
170
+ if (char == '(' || char == '{') {
171
+ // Emit the previous token if this is the start of an outer group
172
+ if (this.CharBuffer.nested === 1) {
173
+ this.CharBuffer.Fill(FileName, row, column);
174
+ }
171
175
  this.CharBuffer.inGroup++;
172
176
  }
173
177
  }
174
- if (this.CharBuffer.builder == 'INTEGER') {
175
- this.CharBuffer.Fill(FileName, row, column);
176
- this.CharBuffer.Append(char);
177
- } else if (this.CharBuffer.isComment || ((this.CharBuffer.isOID || this.CharBuffer.nested > 0) && (!this.CharBuffer.isList || this.CharBuffer.inGroup > 0))) {
178
+ if (this.CharBuffer.isComment || ((this.CharBuffer.isOID || this.CharBuffer.nested > 0) && (!this.CharBuffer.isList || this.CharBuffer.inGroup > 0))) {
178
179
  this.CharBuffer.Append(char);
179
180
  } else {
180
181
  this.CharBuffer.Fill(FileName, row, column);
@@ -363,7 +364,7 @@ var MIB = function (dir) {
363
364
  Object[Symbols[i - 2]] = {};
364
365
  Object[Symbols[i - 2]]['ObjectName'] = Symbols[i - 2];
365
366
  Object[Symbols[i - 2]]['ModuleName'] = ModuleName;
366
- Object[Symbols[i - 2]]['OBJECT IDENTIFIER'] = Symbols[i + 1].replace("{", "").replace("}", "").trim();
367
+ Object[Symbols[i - 2]]['OBJECT IDENTIFIER'] = Symbols[i + 1].replace("{", "").replace("}", "").trim().replace(/\s+/, " ");
367
368
  if (Object[Symbols[i - 2]]['OBJECT IDENTIFIER'] == '0 0') {
368
369
  Object[Symbols[i - 2]]['OID'] = '0.0';
369
370
  Object[Symbols[i - 2]]['NameSpace'] = 'null';
@@ -523,7 +524,7 @@ var MIB = function (dir) {
523
524
  }
524
525
  Object[Symbols[r - 1]]['ObjectName'] = Symbols[r - 1];
525
526
  Object[Symbols[r - 1]]['ModuleName'] = ModuleName;
526
- Object[Symbols[r - 1]]['OBJECT IDENTIFIER'] = Symbols[i + 1].replace("{", "").replace("}", "").trim();
527
+ Object[Symbols[r - 1]]['OBJECT IDENTIFIER'] = Symbols[i + 1].replace("{", "").replace("}", "").trim().replace(/\s+/, " ");
527
528
 
528
529
  if (Object[Symbols[r - 1]]['OBJECT IDENTIFIER'] == '0 0') {
529
530
  Object[Symbols[r - 1]]['OID'] = '0.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.9.3",
3
+ "version": "3.9.5",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "main": "index.js",
6
6
  "directories": {