Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/10/my-perl-cwmp-patches-are-merged.html
All posts by Anonymous
Why MVC?
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/10/why-mvc.html
However, if you have a case of a software that has to be rewriten constantly – introducing new functionality, new features, fixing it, you have a lot of other issues to deal with. Your major problem will be the maintainability and readability of your code.
And I am sure everyone will agree that having all your control code, execution and control flow merged in the same code structure is much better, than having them split among a lot of data processing code and UI visualisations.
If you have a huge HTML code with a lot of javascript code separated and bound directly into the tags (non MVC) it is extremely hard to know and keep in mind what are all the events that happens and what is the order of the execution of the code. MVC will make that much much easier, even though in the beginning it may be costly with an extra overhead.
Sencha ExtJS grid update in real time from the back-end
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/10/sencha-extjs-grid-update-in-real-time.html
Fun with JavaScript inheritance
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/fun-with-javascript-inheritance.html
Operator overloading with JavaScript
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/operator-overloading-with-javascript.html
New improved version of the node-netflowv9 module for Node.JS
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/new-improved-version-of-node-netflowv9.html
- bug fixes (including avoidance of an issue that happens with ASR9k and IOS XR 4.3)
- now you can start the collector (with a second parameter of true) in a mode where you want to receive only one call back per packet instead of one callback per flow (the default mode). That could be useful if you want to count the lost packets (otherwise the relation netflow packet – callback is lost)
- decrease of the code size
- now the module compiles the templates dynamically into a function (using new Function). I like this approach very much, as it creates really fast functions (in contrast to eval, Function is always JIT processed) and it allows me to spare loops, function calls and memory copy. I like to do things like that with every data structure that allows it. Anyway, as an effect of this, the new module is about 3 times faster with all the live tests I was able to perform
Simple example for Node.JS sflow collector
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/simple-example-for-nodejs-sflow.html
RTMP Api for Node.JS to ease the implementation of RTMP servers and clients
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/rtmp-api-for-nodejs-to-ease.html
AMF0/3 encoding/decoding in Node.JS
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/amf03-encodingdecoding-in-nodejs.html
- It can encode/decode all the objects defined in both AMF0 and AMF3 (the other AMF modules in the npm repository supports partial AMF0 or partial AMF3)
- It uses Node.JS buffers (it is not necessary to do string to buffer to string conversion, as you have to do with the other modules)
It is easy to use this module. You just have to do something like this:
var amfUtils = require('node-amfutils');
var buffer = amfUtils.amf0Encode([{ a: "xxx"},b: null]);
SFlow version 5 module for Node.JS
Post Syndicated from Anonymous original http://deliantech.blogspot.com/2014/06/sflow-version-5-module-for-nodejs.html
var Collector = require('node-sflow');
Collector(function(flow) {
console.log(flow);
}).listen(3000);
However, the SFlow support in the agents – the networking equipment is usually extremely simplified – far from the richness and complexity the SFlow protocol may provide. Most of the vendors just do packet sampling and send them over SFlow as raw packet/frame header with an associated unclear counter.
In case of you having the issue specified above, this module cannot help much. You will just get the raw packet header (usually Ethernet + IP header) as a Node.JS buffer and then you have to decode it on your own. I want to keep the node-sflow module simple and I don’t plan to decode raw packet headers there as this feature is not a feature of the SFlow itself.
If you need to decode the raw packet header I can suggest one easy solution for you. You can use the pcap module from the npm repository and decode the raw header with it:
var Collector = require('node-sflow');
var pcap = require('pcap');
Collector(function(flow) {
if (flow && flow.flow.records && flow.flow.records.length>0) {
flow.flow.records.forEach(function(n) {
if (n.type == 'raw') {
if (n.protocolText == 'ethernet') {
try {
var pkt = pcap.decode.ethernet(n.header, 0);
if (pkt.ethertype!=2048) return;
console.log('VLAN',pkt.vlan?pkt.vlan.id:'none','Packet',pkt.ip.protocol_name,pkt.ip.saddr,':',pkt.ip.tcp?pkt.ip.tcp.sport:pkt.ip.udp.sport,'->',pkt.ip.daddr,':',pkt.ip.tcp?pkt.ip.tcp.dport:pkt.ip.udp.dport)
} catch(e) { console.log(e); }
}
}
});
}
}).listen(3000);