Capture raw socket
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Capture raw socket




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Capture raw socket  
grobteam


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-11-05 01:48 AM

Hi,

It is not possible to capture udp raw socket except via libpcap or
something like that. I suppose libpcap puts the NIC in promicous mode
and sniff the network (someone can confirm this please). Secondly, can
someone know why this is impossible to receive udp raw socket? I mean
why the kernel has been implemented in this way, what are the
motivation?

Thank you






[ Post a follow-up to this message ]



    Re: Capture raw socket  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-11-05 10:53 PM

In article <1121043975.361779.167620@g14g2000cwa.googlegroups.com>,
"grobteam" <grobteam@gmail.com> wrote:

> Hi,
>
> It is not possible to capture udp raw socket except via libpcap or
> something like that. I suppose libpcap puts the NIC in promicous mode
> and sniff the network (someone can confirm this please). Secondly, can
> someone know why this is impossible to receive udp raw socket? I mean
> why the kernel has been implemented in this way, what are the
> motivation?

You should be able to do this using libpcap.  That's how tcpdump and
Ethereal work, I believe.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: Capture raw socket  
grobteam


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-22-05 07:56 AM



Barry Margolin wrote:
> In article <1121043975.361779.167620@g14g2000cwa.googlegroups.com>,
>  "grobteam" <grobteam@gmail.com> wrote:
> 
>
> You should be able to do this using libpcap.  That's how tcpdump and
> Ethereal work, I believe.


hum yeah but how libpcap do it? It is userspace too....

>
> --
> Barry Margolin, barmar@alum.mit.edu
> Arlington, MA
> *** PLEASE post questions in newsgroups, not directly to me ***






[ Post a follow-up to this message ]



    Re: Capture raw socket  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-22-05 07:56 AM

In article <1122001947.023248.227530@z14g2000cwz.googlegroups.com>,
"grobteam" <grobteam@gmail.com> wrote:

> Barry Margolin wrote: 
>
> hum yeah but how libpcap do it? It is userspace too....

It's OS-dependent.  Typically it's done is by opening a special device,
like /dev/bpf<number> or something in /proc/net.  You can then perform
ioctls to enable promiscuous mode and configure a filter expression.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Re: Capture raw socket  
grobteam


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-22-05 10:55 PM


>
> It's OS-dependent.  Typically it's done is by opening a special device,
> like /dev/bpf<number> or something in /proc/net.  You can then perform
> ioctls to enable promiscuous mode and configure a filter expression.

Ok, so the only way is to put the NIC in promiscuous mode, I dont
understand this design choice but btw thank you I know now how to do it







[ Post a follow-up to this message ]



    Re: Capture raw socket  
Barry Margolin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-23-05 01:48 AM

In article <1122044129.580493.201730@g44g2000cwa.googlegroups.com>,
"grobteam" <grobteam@gmail.com> wrote:
 
>
> Ok, so the only way is to put the NIC in promiscuous mode, I dont
> understand this design choice but btw thank you I know now how to do it
> 

You only have to put the NIC in promiscuous mode if you want to see
traffic to other systems.  If you're only interested in packets to or
from this system you don't need it.  I was just giving examples of the
kinds of things you can do when you open these devices.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:23 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register