Results 1 to 4 of 4
Hi,
I want to learn TCP/IP protocol etc., so I want to read raw information from my ethernet card. But I couldn't find eth0 file descriptor in /dev or in ...
- 05-27-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 2
Where is eth0 ?
Hi,
I want to learn TCP/IP protocol etc., so I want to read raw information from my ethernet card. But I couldn't find eth0 file descriptor in /dev or in other directories.
To sum;
-how can I read from eth0?
-is there another way to read raw packets?
Thanks...
- 05-27-2007 #2
You can use tcpdump.
orCode:$tcpdump -i eth0
to read 25 packets from eth0 and then quit.Code:$tcpdump -c 25 -i eth0
If you want a more sophisticated "packet sniffer", you can use Wireshark.
- 05-27-2007 #3Just Joined!
- Join Date
- May 2007
- Posts
- 2
Thank you, I can use it.
But I can not say I'm satisfied. I want to read packets directly from eth0 in my C program. Like reading a file or writing to /dev/audio.
How can I do that?
- 05-27-2007 #4
I don't think you can read directly from a NIC in C but then again, I don't really know C that well. You might be able to read IP packets with a socket interface though.


Reply With Quote
