net-snmp 3.10.2 → 3.10.3

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
@@ -3351,6 +3351,10 @@ Example programs are included under the module's `example` directory.
3351
3351
 
3352
3352
  * Add MIB parsing support for OID values with intermediate entries in list
3353
3353
 
3354
+ ## Version 3.10.3 - 05/02/2024
3355
+
3356
+ * Add MIB parsing support for final member of OID value list containing identifier/descriptor pair
3357
+
3354
3358
  # License
3355
3359
 
3356
3360
  Copyright (c) 2020 Mark Abrahams <mark@abrahams.co.nz>
package/example/test.js CHANGED
@@ -42,21 +42,26 @@ store.loadFromFile (mibDir + "HOST-RESOURCES-MIB.MIB");
42
42
  store.loadFromFile (mibDir + "IANA-PRINTER-MIB.mib");
43
43
  store.loadFromFile (mibDir + "IANA-CHARSET-MIB.mib");
44
44
  store.loadFromFile (mibDir + "PRINTER-MIBv1.mib");
45
- store.loadFromFile (mibDir + "JOB-MONITORING-MIB.mib");
45
+ store.loadFromFile (mibDir + "JOB-MONITORING-MIB-RFC.mib");
46
46
 
47
47
  // const mibModuleOid = store.translate('1.3.6.1.4.1', snmp.OidFormat.module);
48
48
  // console.log('mibModuleOid: ', mibModuleOid);
49
49
  // const mibOid = store.translate('Job-Monitoring-MIB::jmJobTable', snmp.OidFormat.oid);
50
50
  // console.log('mibOid: ', mibOid);
51
51
  console.log(store.translate('Job-Monitoring-MIB::jmJobTable', snmp.OidFormat.oid));
52
+ console.log(store.translate('Job-Monitoring-MIB::jmJobTable', snmp.OidFormat.path));
53
+ console.log(store.translate('1.3.6.1.4.1.2699.1.1.1.3.1', snmp.OidFormat.path));
54
+ console.log(store.translate('1.3.6.1.4.1.2699.1.1.1.3.1', snmp.OidFormat.module));
55
+ console.log(store.translate('iso.org.dod.internet.private.enterprises.pwg.mibs.jobmonMIB.jobmonMIBObjects.jmJob.jmJobTable', snmp.OidFormat.oid));
56
+ console.log(store.translate('iso.org.dod.internet.private.enterprises.pwg.mibs.jobmonMIB.jobmonMIBObjects.jmJob.jmJobTable', snmp.OidFormat.module));
52
57
 
53
58
  // ifNumber
54
59
  // Scalar type - setScalarValue() and getScalarValue() are the entire API for these
55
60
 
56
61
  // console.log("All modules: ", JSON.stringify(modules, '', 2));
57
- const jobModule = store.getModule('Job-Monitoring-MIB');
58
- console.log('jobModule: ', JSON.stringify(jobModule, null, 2));
62
+ // const jobModule = store.getModule('Job-Monitoring-MIB');
63
+ // console.log('jobModule: ', JSON.stringify(jobModule, null, 2));
59
64
 
60
65
  // print IF-MIB
61
- // const ifModule = store.getModule('IF-MIB');
62
- // console.log('ifModule: ', JSON.stringify(ifModule, null, 2));
66
+ const ifModule = store.getModule('IF-MIB');
67
+ console.log('ifModule: ', JSON.stringify(ifModule, null, 2));
package/lib/mib.js CHANGED
@@ -736,6 +736,10 @@ var MIB = function (dir) {
736
736
  let members = OBJECT_IDENTIFIER.split(/\s+/);
737
737
  let parent = members.shift();
738
738
  let oid = members.pop();
739
+ if ( oid.includes('(') ) {
740
+ let oidSplit = oid.match(/(.*)\((.+)\)$/);
741
+ oid = oidSplit[2];
742
+ }
739
743
  if (parent == 'iso') {
740
744
  let midID = ['1'];
741
745
  let midOD = ['iso'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "net-snmp",
3
- "version": "3.10.2",
3
+ "version": "3.10.3",
4
4
  "description": "JavaScript implementation of the Simple Network Management Protocol (SNMP)",
5
5
  "main": "index.js",
6
6
  "directories": {