Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/homebridge-camera-ui/node_modules/ping/lib/parser/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
var util = require('util');
var base = require('./base');
var MacParser = require('./mac');
/**
* @constructor
*
* @param {string} addr - Hostname or ip addres
* @param {PingConfig} config - Config object in probe()
*/
function LinuxParser(addr, config) {
base.call(this, addr, config);
}
util.inherits(LinuxParser, base);
/**
* Process output's body
* @param {string} line - A line from system ping
*/
LinuxParser.prototype._processHeader = function (line) {
// Get host and numeric_host
var tokens = line.split(' ');
var isProbablyIPv4 = tokens[1].indexOf('(') === -1;
if (isProbablyIPv4) {
this._response.host = tokens[1];
this._response.numeric_host = tokens[2].slice(1, -1);
} else {
// Normalise into either a 2 or 3 element array
var foundAddresses = tokens.slice(1, -3).join('').match(/([^\s()]+)/g);
this._response.host = foundAddresses.shift();
this._response.numeric_host = foundAddresses.pop();
}
this._changeState(this.STATES.BODY);
};
/**
* Process output's body
* @param {string} line - A line from system ping
*/
LinuxParser.prototype._processBody = function (line) {
// Reuse mac parser implementation
MacParser.prototype._processBody.call(this, line);
};
/**
* Process output's footer
* @param {string} line - A line from system ping
*/
LinuxParser.prototype._processFooter = function (line) {
// Reuse mac parser implementation
MacParser.prototype._processFooter.call(this, line);
};
module.exports = LinuxParser;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |