Re: sending MAC packets --- again, and again

2005-05-21 Thread Daniel Valencia
Hello --- Charles Swiger <[EMAIL PROTECTED]> wrote: > pcap_dispatch() will not > necessarily > return when the read times out; on some > platforms, the read > timeout > isn't supported, and, on other platforms, > the timer doesn't > start until > at least one packe

Re: sending MAC packets --- again, and again

2005-05-21 Thread Charles Swiger
On May 21, 2005, at 12:27 PM, Daniel Valencia wrote: [ ...pcap reading code stalling... ] Is this normal pcap behaviour, or is it some FreeBSD-specific behaviour, or is it just me? It's unfortunately normal. You're running into this (from "man pcap"): NOTE: when reading a live capture

Re: sending MAC packets --- again, and again

2005-05-21 Thread Charles Swiger
On May 20, 2005, at 11:16 PM, Daniel Valencia wrote: I know this may sound funny, but I'm still wrestling with libpcap because I send packets and I cannot read them. I tried also some example code of a toy sniffer from a tutorial to pcap, and it behaves just like my code. As my code is pretty c

Re: sending MAC packets --- again, and again

2005-05-21 Thread Daniel Valencia
Hello and thanks for your prompt answer... I followed your (Jon Simola's) advice, so i defined BUFSIZ as 2000, although my tutorial said it was defined somewhere in the pcap headers, and added a pcap_loop instead of the pcap_next. I also modified the program to only show packets that are sent fro

Re: sending MAC packets --- again, and again

2005-05-20 Thread Jon Simola
On 5/20/05, Daniel Valencia <[EMAIL PROTECTED]> wrote: > my sniffer just stalls and eventually will report a totally unrelated message. ... > handle = pcap_open_live( "xl0", BUFSIZ, 1, 0, errbuf ); Uh, you're asking it to wait forever to see a packet. I don't see a #define in there for BU

Re: sending MAC packets --- again, and again

2005-05-20 Thread Daniel Valencia
Hello all, I know this may sound funny, but I'm still wrestling with libpcap because I send packets and I cannot read them. I tried also some example code of a toy sniffer from a tutorial to pcap, and it behaves just like my code. As my code is pretty compact, I'm posting it here. I'm sending

Re: sending MAC packets --- again

2005-05-11 Thread Chuck Swiger
Daniel Valencia wrote: About my previous message, I think that the problem is that i'm using a switch, where I thought I had a hub... If I'm sending ethernet broadcast packets... will they be forwarded to all the ports of a switch?? Broadcast packets will go to all the ports on a switch. They'd ha

Re: sending MAC packets --- again

2005-05-11 Thread Chuck Swiger
Daniel Valencia wrote: [ ...pcap delays... ] Has anyone in this list had any experience with libpcap over fbsd that can point me into the right direction? Sure. Are you trying to use non-blocking mode of PCAP by any chance? I found that to be fairly busted on FreeBSD and would drop lots of packe

Re: sending MAC packets --- again

2005-05-11 Thread Daniel Valencia
Uhmm... About my previous message, I think that the problem is that i'm using a switch, where I thought I had a hub... If I'm sending ethernet broadcast packets... will they be forwarded to all the ports of a switch?? Probably the answer is No, and that's why I'm getting that behaviour Thank yo

Re: sending MAC packets --- again

2005-05-11 Thread Daniel Valencia
Hello all, and thanks for your input. I was able to send packets using libnet, and i could confirm that the messages were propperly sent using tcpdump... Now I needed to read the packets from another node, so I tried libpcap... then the problem arised. It would wait for ages, even after I sent a