Hi, I'm trying to write a DHCP parser for decoding DHCP also make a contribution. I wrote a dhcp.js in decode folder and using eventsOnDecode = true, but I can't see the decode results.
var buffer = require('buffer');
var pcap = require('pcap');
function main() {
var pcap_session = pcap.createOfflineSession("pcaps/dhcp.pcap",'ip proto \\udp');
pcap_session.on('packet', function (raw_packet) {
var packet = pcap.decode.packet(raw_packet);
var linkLayer = packet.payload;
var networkLayer = packet.payload.payload;
var tranportLayer = packet.payload.payload.payload;
console.log(tranportLayer);
});
}
main();
Hi, I'm trying to write a DHCP parser for decoding DHCP also make a contribution. I wrote a
dhcp.js
in decode folder and usingeventsOnDecode = true
, but I can't see the decode results.Here is my example code
And it output was
I expected it output will like this
It seems
dhcp.js
not been used whenevent decode
. How to fix this problem? Thanks :smiley: