LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2004, 01:57 PM   #1
warned
LQ Newbie
 
Registered: Oct 2003
Distribution: Mandrake and RH
Posts: 22

Rep: Reputation: 15
Question Problem sniffing with raw socket


Hi every body!!

I am working in a kind of sniffer for bandwidth calculating. I am using raw sockets this way:

fd = socket ( PF_INET, SOCK_RAW, IPPROTO_TCP );

and reading with "read" function. I have put the interface into promiscuous mode with "ioctl" too. And everything looks fine, but I can't capture packets generated locally. Every packet sent by my PC is not sniffered.

Did you know what could be hapening??

Thanks in advance,

warned
 
Old 08-25-2004, 10:58 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
hi,

fd=socket(PF_PACKET,SOCK_RAW,htons(ETH_P_ALL));
(i think)
check out the definitions in
/usr/include/linux/if_ether.h
 
Old 08-26-2004, 03:07 AM   #3
warned
LQ Newbie
 
Registered: Oct 2003
Distribution: Mandrake and RH
Posts: 22

Original Poster
Rep: Reputation: 15
I have tried this way but it still capture only the incoming packets. I think it could be possible to capture all the local traffic without using libpcap.

Please, if somebody knows what could be happening, tell me, ok?

Thanx.

warned
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with raw socket programming tuxfood Programming 2 07-25-2005 01:17 PM
Problem sniffing with raw sockets warned Programming 4 08-28-2004 01:10 PM
Using Raw Socket for UDP myself_rajat Linux - Networking 0 05-17-2004 03:35 AM
Socket Raw linuxanswer Programming 1 04-01-2004 09:43 PM
ping without raw socket linuxnw Linux - Networking 3 12-09-2003 11:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration