This is our old Q&A Site. Please post any new questions and answers at

I have a 2 questions- 1. I need to a write a C program through which I need to monitor the network packets of the Tshark, in the LINUX. How could I do this?? 2. Is it possible to monitor the rate at which the packets are flowing in the network, if yes how could I do this.

Please answer these questions.

asked 26 Jun '13, 18:03

rahuulbp's gravatar image

accept rate: 0%

Wireshark (and tshark) are packet analysers, not network traffic monitors. You are probably looking at the wrong tools for your task.

permanent link

answered 27 Jun '13, 02:25

grahamb's gravatar image

grahamb ♦
accept rate: 22%

Yes i understand, but I need to count the number of packets from the terminal window in the tshark and write a C program accordingly. My question is how can we count the number of packets of the tshark and connect/map that to the C program.

(27 Jun '13, 07:50) rahuulbp

Have a look at dumpcap. That outputs the packets seen as a count and unlike tshark won't run out of memory if capturing for an extended length of time.

I guess your C program could spawn dumpcap and grab the stdout to inspect the packet count.

(27 Jun '13, 08:12) grahamb ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 26 Jun '13, 18:03

question was seen: 1,455 times

last updated: 27 Jun '13, 08:12

p​o​w​e​r​e​d by O​S​Q​A