systeminformation 5.12.5 → 5.12.6

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.
Files changed (2) hide show
  1. package/lib/network.js +17 -4
  2. package/package.json +1 -1
package/lib/network.js CHANGED
@@ -1189,7 +1189,7 @@ function networkStatsSingle(iface) {
1189
1189
  if (sections[i].trim() !== '') {
1190
1190
  let lines = sections[i].trim().split('\r\n');
1191
1191
  perfData.push({
1192
- name: util.getValue(lines, 'Name', ':').replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase(),
1192
+ name: util.getValue(lines, 'Name', ':').replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase(),
1193
1193
  rx_bytes: parseInt(util.getValue(lines, 'BytesReceivedPersec', ':'), 10),
1194
1194
  rx_errors: parseInt(util.getValue(lines, 'PacketsReceivedErrors', ':'), 10),
1195
1195
  rx_dropped: parseInt(util.getValue(lines, 'PacketsReceivedDiscarded', ':'), 10),
@@ -1340,8 +1340,8 @@ function networkStatsSingle(iface) {
1340
1340
  det.mac.toLowerCase() === ifaceSanitized.toLowerCase() ||
1341
1341
  det.ip4.toLowerCase() === ifaceSanitized.toLowerCase() ||
1342
1342
  det.ip6.toLowerCase() === ifaceSanitized.toLowerCase() ||
1343
- det.ifaceName.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase() === ifaceSanitized.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase()) &&
1344
- (det.ifaceName.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase() === detail.name)) {
1343
+ det.ifaceName.replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase() === ifaceSanitized.replace(/[()[\] ]+/g, '').replace('#', '_').toLowerCase()) &&
1344
+ (det.ifaceName.replace(/[()[\] ]+/g, '').replace(/\#|\//g, '_').toLowerCase() === detail.name)) {
1345
1345
  ifaceName = det.iface;
1346
1346
  rx_bytes = detail.rx_bytes;
1347
1347
  rx_dropped = detail.rx_dropped;
@@ -1558,6 +1558,7 @@ function networkConnections(callback) {
1558
1558
  localaddress.pop();
1559
1559
  localip = localaddress.join(':');
1560
1560
  }
1561
+ localip = localip.replace(/\[/g, '').replace(/\]/g, '');
1561
1562
  let peerip = line[2];
1562
1563
  let peerport = '';
1563
1564
  let peeraddress = line[2].split(':');
@@ -1566,6 +1567,7 @@ function networkConnections(callback) {
1566
1567
  peeraddress.pop();
1567
1568
  peerip = peeraddress.join(':');
1568
1569
  }
1570
+ peerip = peerip.replace(/\[/g, '').replace(/\]/g, '');
1569
1571
  let pid = util.toInt(line[4]);
1570
1572
  let connstate = line[3];
1571
1573
  if (connstate === 'HERGESTELLT') { connstate = 'ESTABLISHED'; }
@@ -1578,7 +1580,7 @@ function networkConnections(callback) {
1578
1580
  if (connstate === 'SYN_RECEIVED') { connstate = 'SYN_RECV'; }
1579
1581
  if (connstate === 'FIN_WAIT_1') { connstate = 'FIN_WAIT1'; }
1580
1582
  if (connstate === 'FIN_WAIT_2') { connstate = 'FIN_WAIT2'; }
1581
- if (connstate) {
1583
+ if (line[0].toLowerCase() !== 'udp' && connstate) {
1582
1584
  result.push({
1583
1585
  protocol: line[0].toLowerCase(),
1584
1586
  localAddress: localip,
@@ -1589,6 +1591,17 @@ function networkConnections(callback) {
1589
1591
  pid,
1590
1592
  process: ''
1591
1593
  });
1594
+ } else if (line[0].toLowerCase() === 'udp') {
1595
+ result.push({
1596
+ protocol: line[0].toLowerCase(),
1597
+ localAddress: localip,
1598
+ localPort: localport,
1599
+ peerAddress: peerip,
1600
+ peerPort: peerport,
1601
+ state: '',
1602
+ pid: parseInt(line[3], 10),
1603
+ process: ''
1604
+ });
1592
1605
  }
1593
1606
  }
1594
1607
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.12.5",
3
+ "version": "5.12.6",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",