-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use SNMP + Node JS at client browser as javascript? #1148
Comments
please clarify / elaborate on your requirement. What are you trying to achieve? |
I am trying to run snmp get method on client browser using plain javascript without installing nodejs at client machine. And need that data at Java application server. On Console i am able to get this done but on html/javascript getting error that require method is undefine.
I have even tried to use browserify but there is one exception coming on generated javascript file for dgram.createSocket method.
Please help me how to utilize nodejs+snmp with existing web application and run snmp get method on client machine.
Thank you,
Mrityunjay Kumar
…________________________________
From: Gireesh Punathil <[email protected]>
Sent: Sunday, March 11, 2018 11:03:39 AM
To: nodejs/help
Cc: Mrityunjay Kumar; Author
Subject: Re: [nodejs/help] How to use SNMP + Node JS at client browser as javascript? (#1148)
please clarify / elaborate on your requirement. What are you trying to achieve?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnodejs%2Fhelp%2Fissues%2F1148%23issuecomment-372091018&data=02%7C01%7Cmrityunjay.k%40hcl.com%7C037b2f1b2e194bd20dd808d58711a6cb%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C0%7C636563432258728948&sdata=zoXQPbrO%2Bf17VvFhIuYvt%2BwkU5c0wXIRLYj7%2FvjVQF8%3D&reserved=0>, or mute the thread<https://apac01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAXzMzCIz-OktHAM0dJSjww09nh2FhIVpks5tdLczgaJpZM4SkNn3&data=02%7C01%7Cmrityunjay.k%40hcl.com%7C037b2f1b2e194bd20dd808d58711a6cb%7C189de737c93a4f5a8b686f4ca9941912%7C0%7C0%7C636563432258728948&sdata=Ny5iOeYS1LZ29T%2Fv5iSiUvQPrmujLcYihPS02aLtSng%3D&reserved=0>.
::DISCLAIMER::
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
can you please the code here? I wrote a sample program with |
test_2.js `var snmp = require ("net-snmp"); var oids = ["1.3.6.1.2.1.1.1.0", "1.3.6.1.2.1.1.5.0"]; session.get (oids, function (error, varbinds) {
}); session.trap (snmp.TrapType.LinkDown, function (error) { |
`(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ },{}],2:[function(require,module,exports){ // compare and isBuffer taken from https://github.com/feross/buffer/blob/680e9e5e488f22aac27599a57dc844a6315928dd/index.js /*!
var x = a.length; for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (x < y) { // based on node assert, original notice: // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 var util = require('util/'); var assert = module.exports = ok; // 2. The AssertionError is defined in assert. var regex = /\sfunction\s+([^\(\s])\s*/;
} // assert.AssertionError instanceof Error function truncate(s, n) { // At present only the three keys mentioned above are used and // 3. All of the following functions must throw an AssertionError function fail(actual, expected, message, operator, stackStartFunction) { // EXTENSION! allows for well behaved errors defined elsewhere. // 4. Pure assertion tests whether a value is truthy, as determined function ok(value, message) { // 5. The equality assertion tests shallow, coercive equality with assert.equal = function equal(actual, expected, message) { // 6. The non-equality assertion tests for whether two objects are not equal assert.notEqual = function notEqual(actual, expected, message) { // 7. The equivalence assertion tests a deep equality relation. assert.deepEqual = function deepEqual(actual, expected, message) { assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) { function _deepEqual(actual, expected, strict, memos) { // 7.2. If the expected value is a Date object, the actual value is // 7.3 If the expected value is a RegExp object, the actual value is // 7.4. Other pairs that do not both pass typeof value == 'object', // If both values are instances of typed arrays, wrap their underlying // 7.5 For all other Object pairs, including Array objects, equivalence is
} function isArguments(object) { function objEquiv(a, b, strict, actualVisitedObjects) { // 8. The non-equivalence assertion tests for any deep inequality. assert.notDeepEqual = function notDeepEqual(actual, expected, message) { assert.notDeepStrictEqual = notDeepStrictEqual; // 9. The strict equality assertion tests strict equality, as determined by ===. assert.strictEqual = function strictEqual(actual, expected, message) { // 10. The strict non-equality assertion tests for strict inequality, as assert.notStrictEqual = function notStrictEqual(actual, expected, message) { function expectedException(actual, expected) { if (Object.prototype.toString.call(expected) == '[object RegExp]') { try { if (Error.isPrototypeOf(expected)) { return expected.call({}, actual) === true; function _tryBlock(block) { function _throws(shouldThrow, block, expected, message) { if (typeof block !== 'function') { if (typeof expected === 'string') { actual = _tryBlock(block); message = (expected && expected.name ? ' (' + expected.name + ').' : '.') + if (shouldThrow && !actual) { var userProvidedMessage = typeof message === 'string'; if ((isUnwantedException && if ((shouldThrow && actual && expected && // 11. Expected to throw an error: assert.throws = function(block, /optional/error, /optional/message) { // EXTENSION! This is annoying to write outside this module. assert.ifError = function(err) { if (err) throw err; }; var objectKeys = Object.keys || function (obj) { }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) exports.byteLength = byteLength var lookup = [] var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' // Support decoding URL-safe base64 strings, as Node.js does. function placeHoldersCount (b64) { // the number of equal signs (place holders) function byteLength (b64) { function toByteArray (b64) { arr = new Arr((len * 3 / 4) - placeHolders) // if there are placeholders, only get up to the last complete 4 chars var L = 0 for (i = 0; i < l; i += 4) { if (placeHolders === 2) { return arr function tripletToBase64 (num) { function encodeChunk (uint8, start, end) { function fromByteArray (uint8) { // go through the array every three bytes, we'll deal with trailing stuff later // pad the end with zeros, but make sure to not forget the extra bytes parts.push(output) return parts.join('') },{}],4:[function(require,module,exports){
'use strict' var base64 = require('base64-js') exports.Buffer = Buffer var K_MAX_LENGTH = 0x7fffffff /**
if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && function typedArraySupport () { Object.defineProperty(Buffer.prototype, 'parent', { Object.defineProperty(Buffer.prototype, 'offset', { function createBuffer (length) { /**
function Buffer (arg, encodingOrOffset, length) { // Fix subarray() in ES2016. See: feross/buffer#97 Buffer.poolSize = 8192 // not used by this implementation function from (value, encodingOrOffset, length) { if (isArrayBuffer(value) || (value && isArrayBuffer(value.buffer))) { if (typeof value === 'string') { return fromObject(value) /**
// Note: Change prototype after Buffer.from is defined to workaround Chrome bug: function assertSize (size) { function alloc (size, fill, encoding) { /**
function allocUnsafe (size) { /**
function fromString (string, encoding) { if (!Buffer.isEncoding(encoding)) { var length = byteLength(string, encoding) | 0 var actual = buf.write(string, encoding) if (actual !== length) { return buf function fromArrayLike (array) { function fromArrayBuffer (array, byteOffset, length) { if (array.byteLength < byteOffset + (length || 0)) { var buf // Return an augmented function fromObject (obj) {
} if (obj) {
} throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.') function checked (length) { function SlowBuffer (length) { Buffer.isBuffer = function isBuffer (b) { Buffer.compare = function compare (a, b) { if (a === b) return 0 var x = a.length for (var i = 0, len = Math.min(x, y); i < len; ++i) { if (x < y) return -1 Buffer.isEncoding = function isEncoding (encoding) { Buffer.concat = function concat (list, length) { if (list.length === 0) { var i var buffer = Buffer.allocUnsafe(length) function byteLength (string, encoding) { var len = string.length // Use a for loop to avoid recursion function slowToString (encoding, start, end) { // No need to verify that "this.length <= MAX_UINT32" since it's a read-only // This behaves neither like String nor Uint8Array in that we set start/end if (end === undefined || end > this.length) { if (end <= 0) { // Force coersion to uint32. This will also coerce falsey/NaN values to 0. if (end <= start) { if (!encoding) encoding = 'utf8' while (true) {
} // This property is used by function swap (b, n, m) { Buffer.prototype.swap16 = function swap16 () { Buffer.prototype.swap32 = function swap32 () { Buffer.prototype.swap64 = function swap64 () { Buffer.prototype.toString = function toString () { Buffer.prototype.toLocaleString = Buffer.prototype.toString Buffer.prototype.equals = function equals (b) { Buffer.prototype.inspect = function inspect () { Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { if (start === undefined) { if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { if (thisStart >= thisEnd && start >= end) { start >>>= 0 if (this === target) return 0 var x = thisEnd - thisStart var thisCopy = this.slice(thisStart, thisEnd) for (var i = 0; i < len; ++i) { if (x < y) return -1 // Finds either the first index of // Normalize byteOffset // Normalize byteOffset: negative offsets start from the end of the buffer // Normalize val // Finally, search either indexOf (if dir is true) or lastIndexOf throw new TypeError('val must be string, number or Buffer') function arrayIndexOf (arr, val, byteOffset, encoding, dir) { if (encoding !== undefined) { function read (buf, i) { var i return -1 Buffer.prototype.includes = function includes (val, byteOffset, encoding) { Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { function hexWrite (buf, string, offset, length) { var strLen = string.length if (length > strLen / 2) { function utf8Write (buf, string, offset, length) { function asciiWrite (buf, string, offset, length) { function latin1Write (buf, string, offset, length) { function base64Write (buf, string, offset, length) { function ucs2Write (buf, string, offset, length) { Buffer.prototype.write = function write (string, offset, length, encoding) { var remaining = this.length - offset if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { if (!encoding) encoding = 'utf8' var loweredCase = false
} Buffer.prototype.toJSON = function toJSON () { function base64Slice (buf, start, end) { function utf8Slice (buf, start, end) { var i = start
} return decodeCodePointsArray(res) // Based on http://stackoverflow.com/a/22747272/680742, the browser with function decodeCodePointsArray (codePoints) { // Decode in chunks to avoid "call stack size exceeded". function asciiSlice (buf, start, end) { for (var i = start; i < end; ++i) { function latin1Slice (buf, start, end) { for (var i = start; i < end; ++i) { function hexSlice (buf, start, end) { if (!start || start < 0) start = 0 var out = '' function utf16leSlice (buf, start, end) { Buffer.prototype.slice = function slice (start, end) { if (start < 0) { if (end < 0) { if (end < start) end = start var newBuf = this.subarray(start, end) /*
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { var val = this[offset] return val Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { var val = this[offset + --byteLength] return val Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { return ((this[offset]) | Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { return (this[offset] * 0x1000000) + Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { var val = this[offset] if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { var i = byteLength if (val >= mul) val -= Math.pow(2, 8 * byteLength) return val Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { return (this[offset]) | Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { return (this[offset] << 24) | Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { function checkInt (buf, value, offset, ext, max, min) { Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { var mul = 1 return offset + byteLength Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { var i = byteLength - 1 return offset + byteLength Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
} var i = 0 return offset + byteLength Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
} var i = byteLength - 1 return offset + byteLength Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { function checkIEEE754 (buf, value, offset, ext, max, min) { function writeFloat (buf, value, offset, littleEndian, noAssert) { Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { function writeDouble (buf, value, offset, littleEndian, noAssert) { Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) // Copy 0 bytes; we're done // Fatal error conditions // Are we oob? var len = end - start if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { return len // Usage: // Invalid ranges are not set to a default, so can range check early. if (end <= start) { start = start >>> 0 if (!val) val = 0 var i return this // HELPER FUNCTIONS var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g function base64clean (str) { function toHex (n) { function utf8ToBytes (string, units) { for (var i = 0; i < length; ++i) {
} return bytes function asciiToBytes (str) { function utf16leToBytes (str, units) {
} return byteArray function base64ToBytes (str) { function blitBuffer (src, dst, offset, length) { // ArrayBuffers from another context (i.e. an iframe) do not pass the function numberIsNaN (obj) { },{"base64-js":3,"ieee754":6}],5:[function(require,module,exports){ var objectCreate = Object.create || objectCreatePolyfill function EventEmitter() { this._maxListeners = this._maxListeners || undefined; // Backwards-compat with node 0.10.x EventEmitter.prototype._events = undefined; // By default EventEmitters will print a warning if more than 10 listeners are var hasDefineProperty; // Obviously not all Emitters should be limited to 10. This function allows function $getMaxListeners(that) { EventEmitter.prototype.getMaxListeners = function getMaxListeners() { // These standalone emit* functions are used to optimize calling of event function emitMany(handler, isFn, self, args) { EventEmitter.prototype.emit = function emit(type) { events = this._events; // If there is no 'error' event listener then throw. handler = events[type]; if (!handler) var isFn = typeof handler === 'function'; return true; function _addListener(target, type, listener, prepend) { if (typeof listener !== 'function') events = target._events;
} if (!existing) {
} return target; EventEmitter.prototype.addListener = function addListener(type, listener) { EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.prependListener = function onceWrapper() { function _onceWrap(target, type, listener) { EventEmitter.prototype.once = function once(type, listener) { EventEmitter.prototype.prependOnceListener = // Emits a 'removeListener' event if and only if the listener was removed.
EventEmitter.prototype.removeAllListeners =
EventEmitter.prototype.listeners = function listeners(type) { if (!events) return ret; EventEmitter.listenerCount = function(emitter, type) { EventEmitter.prototype.listenerCount = listenerCount; if (events) {
} return 0; EventEmitter.prototype.eventNames = function eventNames() { // About 1.5x faster than the two-arg version of Array#splice(). function arrayClone(arr, n) { function unwrapListeners(arr) { function objectCreatePolyfill(proto) { },{}],6:[function(require,module,exports){ i += d e = s & ((1 << (-nBits)) - 1) m = e & ((1 << (-nBits)) - 1) if (e === 0) { exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { value = Math.abs(value) if (isNaN(value) || value === Infinity) {
} for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} e = (e << mLen) | m buffer[offset + i - d] |= s * 128 },{}],7:[function(require,module,exports){ // cached from whatever global is present so that test runners that stub it var cachedSetTimeout; function defaultSetTimout() { } } function cleanUpNextTick() { function drainQueue() {
} process.nextTick = function (fun) { // v8 likes predictible objects function noop() {} process.on = noop; process.listeners = function (name) { return [] } process.binding = function (name) { process.cwd = function () { return '/' }; },{}],8:[function(require,module,exports){ },{}],9:[function(require,module,exports){ var formatRegExp = /%[sdj%]/g; var i = 1; // Mark that a method should not be used. if (process.noDeprecation === true) { var warned = false; return deprecated; var debugs = {}; /**
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics // Don't use 'blue' not visible on cmd.exe function stylizeWithColor(str, styleType) { if (style) { function stylizeNoColor(str, styleType) { function arrayToHash(array) { array.forEach(function(val, idx) { return hash; function formatValue(ctx, value, recurseTimes) { // Primitive types cannot have properties // Look up the keys of the object. if (ctx.showHidden) { // IE doesn't make error fields non-enumerable // Some type of object without properties can be shortcutted. var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array // Make functions say that they are functions // Make RegExps say that they are RegExps // Make dates with properties first say the date // Make error with message first say the error if (keys.length === 0 && (!array || value.length == 0)) { if (recurseTimes < 0) { ctx.seen.push(value); var output; ctx.seen.pop(); return reduceToSingleString(output, base, braces); function formatPrimitive(ctx, value) { function formatError(value) { function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { return name + ': ' + str; function reduceToSingleString(output, base, braces) { if (length > 60) { return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; // NOTE: These type checking functions intentionally don't use function isBoolean(arg) { function isNull(arg) { function isNullOrUndefined(arg) { function isNumber(arg) { function isString(arg) { function isSymbol(arg) { function isUndefined(arg) { function isRegExp(re) { function isObject(arg) { function isDate(d) { function isError(e) { function isFunction(arg) { function isPrimitive(arg) { exports.isBuffer = require('./support/isBuffer'); function objectToString(o) { function pad(n) { var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', // 26 Feb 16:19:34 // log is just a thin wrapper to console.log that prepends a timestamp /**
exports._extend = function(origin, add) { var keys = Object.keys(add); function hasOwnProperty(obj, prop) { }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) var session = snmp.createSession ("13.61.10.146", "public"); var oid = "1.3.6.1.2.1.2.2"; function doneCb (error) { function feedCb (varbinds) { var maxRepetitions = 20; // The maxRepetitions argument is optional, and will be ignored unless using var Ber = require('./lib/ber/index') exports.Ber = Ber },{"./lib/ber/index":14}],13:[function(require,module,exports){ module.exports = { },{}],14:[function(require,module,exports){ var errors = require('./errors') var Reader = require('./reader') for (var t in types) for (var e in errors) exports.Reader = Reader },{"./errors":13,"./reader":15,"./types":16,"./writer":17}],15:[function(require,module,exports){ var assert = require('assert'); var ASN1 = require('./types'); ///--- Globals var InvalidAsn1Error = errors.InvalidAsn1Error; ///--- API function Reader(data) {
} Object.defineProperty(Reader.prototype, 'length', { Object.defineProperty(Reader.prototype, 'offset', { Object.defineProperty(Reader.prototype, 'remain', { Object.defineProperty(Reader.prototype, 'buffer', { /**
}; Reader.prototype.peek = function() { /**
}; /**
}; Reader.prototype.readInt = function(tag) {
}; Reader.prototype.readBoolean = function(tag) {
}; Reader.prototype.readEnumeration = function(tag) {
}; Reader.prototype.readString = function(tag, retbuf) {
}; Reader.prototype.readOID = function(tag) {
}; Reader.prototype._readTag = function(tag) {
}; ///--- Exported API module.exports = Reader; }).call(this,require("buffer").Buffer) module.exports = { },{}],17:[function(require,module,exports){ var assert = require('assert'); ///--- Globals var InvalidAsn1Error = errors.InvalidAsn1Error; var DEFAULT_OPTS = { ///--- Helpers function merge(from, to) {
} ///--- API function Writer(options) {
} Object.defineProperty(Writer.prototype, 'buffer', {
}); Writer.prototype.writeByte = function(b) {
}; Writer.prototype.writeInt = function(i, tag) {
}; Writer.prototype.writeNull = function() { Writer.prototype.writeEnumeration = function(i, tag) {
}; Writer.prototype.writeBoolean = function(b, tag) {
}; Writer.prototype.writeString = function(s, tag) {
}; Writer.prototype.writeBuffer = function(buf, tag) {
}; Writer.prototype.writeStringArray = function(strings, tag) {
}; // This is really to solve DER cases, but whatever for now
}; Writer.prototype.writeLength = function(len) {
}; Writer.prototype.startSequence = function(tag) {
}; Writer.prototype.endSequence = function() {
}; Writer.prototype._shift = function(start, len, shift) {
}; Writer.prototype._ensure = function(len) {
}; ///--- Exported API module.exports = Writer; }).call(this,require("buffer").Buffer) // Copyright 2013 Stephen Vickers [email protected] var ber = require ("asn1-ber").Ber; /***************************************************************************** function _expandConstantObject (object) { var ErrorStatus = { _expandConstantObject (ErrorStatus); var ObjectType = { _expandConstantObject (ObjectType); ObjectType.Integer32 = ObjectType.Integer; var PduType = { _expandConstantObject (PduType); var TrapType = { _expandConstantObject (TrapType); var Version1 = 0; /***************************************************************************** function ResponseInvalidError (message) { function RequestInvalidError (message) { function RequestFailedError (message, status) { function RequestTimedOutError (message) { /***************************************************************************** function isVarbindError (varbind) { function varbindError (varbind) { function oidFollowsOid (oidString, nextString) {
} function oidInSubtree (oidString, nextString) {
} /** function readInt (buffer) { function readUint (buffer, isSigned) {
} function readUint64 (buffer) {
} function readVarbinds (buffer, varbinds) {
} function writeUint (buffer, type, value) { function writeUint64 (buffer, value) { function writeVarbinds (buffer, varbinds) {
} /***************************************************************************** var SimplePdu = function (id, varbinds, options) { SimplePdu.prototype.toBuffer = function (buffer) {
}; var GetBulkRequestPdu = function () { util.inherits (GetBulkRequestPdu, SimplePdu); var GetNextRequestPdu = function () { util.inherits (GetNextRequestPdu, SimplePdu); var GetResponsePdu = function (buffer) {
}; var GetRequestPdu = function () { util.inherits (GetRequestPdu, SimplePdu); var InformRequestPdu = function () { util.inherits (InformRequestPdu, SimplePdu); var SetRequestPdu = function () { util.inherits (SetRequestPdu, SimplePdu); var TrapPdu = function (typeOrOid, varbinds, options) {
}; TrapPdu.prototype.toBuffer = function (buffer) {
}; var TrapV2Pdu = function () { util.inherits (TrapV2Pdu, SimplePdu); /***************************************************************************** var RequestMessage = function (version, community, pdu) { RequestMessage.prototype.toBuffer = function () {
}; var ResponseMessage = function (buffer) {
}; /***************************************************************************** var Session = function (target, community, options) {
}; util.inherits (Session, events.EventEmitter); Session.prototype.close = function () { Session.prototype.cancelRequests = function (error) { function _generateId (bitSize) { Session.prototype.get = function (oids, responseCb) {
}; Session.prototype.getBulk = function () {
}; Session.prototype.getNext = function (oids, responseCb) {
}; Session.prototype.inform = function () {
}; Session.prototype.onClose = function () { Session.prototype.onError = function (error) { Session.prototype.onMsg = function (buffer, remote) {
}; Session.prototype.onSimpleGetResponse = function (req, message) {
}; Session.prototype.registerRequest = function (req) { Session.prototype.send = function (req, noWait) {
}; Session.prototype.set = function (varbinds, responseCb) {
}; Session.prototype.simpleGet = function (pduClass, feedCb, varbinds,
}; function subtreeCb (req, varbinds) {
} Session.prototype.subtree = function () {
}; function tableColumnsResponseCb (req, error) { function tableColumnsFeedCb (req, varbinds) {
} Session.prototype.tableColumns = function () {
}; function tableResponseCb (req, error) { function tableFeedCb (req, varbinds) {
} Session.prototype.table = function () {
}; Session.prototype.trap = function () {
}; Session.prototype.unregisterRequest = function (id) { function walkCb (req, error, varbinds) {
} Session.prototype.walk = function () {
}; /***************************************************************************** exports.Session = Session; exports.createSession = function (target, community, options) { exports.isVarbindError = isVarbindError; exports.Version1 = Version1; exports.ErrorStatus = ErrorStatus; exports.ResponseInvalidError = ResponseInvalidError; /** }).call(this,require('_process'),require("buffer").Buffer) |
Thanks. looks like Please see the open issue under browserify for this: It is possible that there are packages that implement this in pure JS. You may follow in 1788 to get more information. You can find the supported in-built modules from node in this page. Hope this helps! |
closing as answered. |
The text was updated successfully, but these errors were encountered: