-
Notifications
You must be signed in to change notification settings - Fork 256
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
Showing stats for an offline PCAP session #264
Comments
Hi Lance.
This is in fact not possible.
The libpcap library do not support stats for files:
https://www.tcpdump.org/manpages/pcap_stats.3pcap.html
Cheers,
Thibaut
…On Wed, May 20, 2020 at 9:25 AM lance23au ***@***.***> wrote:
Hi All,
Does the pcap stats function - pcap_session.stats work for an offline
session?
I get the following error when using it.
Ideally I would like to count the packets in my pcap file, do some
processing with pcap.decode.packet() then close the session with
pcap_session.close().
.../node_modules/pcap/pcap.js:119
return this.session.stats();
^
Error: Error in pcap_stats
at PcapSession.stats (.../node_modules/pcap/pcap.js:119:25)
at Object. (.../routes/nodediscovery.js:58:26)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (.../app.js:20:27)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
Thanks in advance.
Lance.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#264>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4KPWQW5DZ43O26P5BGWU3RSOAVRANCNFSM4NFVMQAQ>
.
|
Is there any other way to work out how many packets are in the pcap file? Cheers, |
Not simply. You have to parse the file entirely.
You don't need to decode the packets, but go through it entirely, reading
packetHeader one by one to get the size of the packet itself, to be able to
go to next packet, and next one and so on.
You may use https://github.com/kunklejr/node-pcap-parser to do it, and then
count how many packets events you got.
Cheers
Thibaut
…On Wed, May 20, 2020 at 11:24 AM lance23au ***@***.***> wrote:
Is there any other way to work out how many packets are in the pcap file?
Cheers,
Lance.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#264 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD4KPWVL5ZXQFETBHRR37QLRSOOWNANCNFSM4NFVMQAQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi All,
Does the pcap stats function - pcap_session.stats work for an offline session?
I get the following error when using it.
Ideally I would like to count the packets in my pcap file, do some processing with pcap.decode.packet() then close the session with pcap_session.close().
.../node_modules/pcap/pcap.js:119
return this.session.stats();
^
Error: Error in pcap_stats
at PcapSession.stats (.../node_modules/pcap/pcap.js:119:25)
at Object. (.../routes/nodediscovery.js:58:26)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
at Module.load (internal/modules/cjs/loader.js:977:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (.../app.js:20:27)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
Thanks in advance.
Lance.
The text was updated successfully, but these errors were encountered: