This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Getting capture stats manually

0

Hello to all, I am curious how can i get the stats from a packet capture manually ( instead of going to statistics->summary menu), such as packet count, total bytes, and avg MBit/sec.

It's just an educational question, i don't want to use it in real life.

Thanks!!!

asked 22 Dec '12, 03:26

EvilDude's gravatar image

EvilDude
1111
accept rate: 0%


One Answer:

0

Isn't going to statistics->summary the manual way to get the statistics? You can get to the stats from the CLI with capinfos:

[email protected]:~$ capinfos http.cap 
File name:           http.cap
File type:           Wireshark - pcapng
File encapsulation:  Ethernet
Packet size limit:   file hdr: (not set)
Number of packets:   186
File size:           109184 bytes
Data size:           102706 bytes
Capture duration:    26 seconds
Start time:          Tue Jul 26 10:51:38 2011
End time:            Tue Jul 26 10:52:03 2011
Data byte rate:      3996.21 bytes/sec
Data bit rate:       31969.72 bits/sec
Average packet size: 552.18 bytes
Average packet rate: 7.24 packets/sec
SHA1:                b17a997e66f0b3acd41d6a6f8359d756a1b206fb
RIPEMD160:           eedf16dd6f4d25e0dba9d1b9b94cdbd1548dbf04
MD5:                 150ffdaaafab74613510e33ca2d39bd4
Strict time order:   True
[email protected]:~$

But maybe you mean how you can calculate the individual values themselves? Well, that would require libpcap programming to read the files and keep count of all the necessary data and then output the results. So basically you would want to write your own capinfos tool :-)

(have a look at the capinfos source code for more details)

answered 22 Dec '12, 03:52

SYN-bit's gravatar image

SYN-bit ♦♦
17.1k957245
accept rate: 20%