LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   code of tcpdump in c/c++ ? (https://www.linuxquestions.org/questions/linux-newbie-8/code-of-tcpdump-in-c-c-652495/)

Amit Aggarwal 06-30-2008 01:06 AM

code of tcpdump in c/c++ ?
 
helo ,
can any one tell me the code of tcpdump in c or c++?

thanx in advance

Nylex 06-30-2008 01:14 AM

Are you asking whether tcpdump is written in C or C++? If so, it's written in C. If not, please clarify your question, because it doesn't really make much sense.

mongoosecage 06-30-2008 01:15 AM

Quote:

Originally Posted by Nylex (Post 3198976)
Are you asking whether tcpdump is written in C or C++? If so, it's written in C. If not, please clarify your question, because it doesn't really make much sense.

think he wants the source code for tcpdump but hell i cant even make sense out of it

Nylex 06-30-2008 01:18 AM

The source can be found here. You'll probably want to read through the documentation for libpcap as well.

UART 05-03-2013 10:04 AM

Nylex? You've done the impossible:hattip:by providing JUST the answer while including suggestions too
Quote:

Nylex: You'll probably want to read through the documentation for libpcap as well.
REGARDLESS of the grammar and getting STRAIGHT to the point (time is money)!

-Kudos-:D


Here in U.S., we've proven this to be very difficult to do thus, I dedicate my very first post to you while appending my 2c as well:

Syntax Examples:
Code:

tcpdump -i eth0
Displays everything communicating via eth0 (yours may vary; Ex:eth1,wlan2,etc..) to and from while the '-i' represents "interface"; straight-forward code.

Here's my favorite:
Code:

tcpdump -i eth0|awk '{print $1,$3,$5}'
This will filter the output and only show the Time, Data_From and Data_To.


All times are GMT -5. The time now is 07:23 AM.