Mail Archives: djgpp/1999/01/09/15:40:44
Thanathip Tharavanich wrote:
>
> Does anyone know how to capture any packets from ethernet card ?
>
> Where can i get any library to do that ?
>
> I want to develope program like monet lan analyser that can be capture
> packet .
I wrote one for my own use. It is kludgy and not well commented,
but if you don't find something better, ask me and I can send you
a copy.
I used a crynwr packet driver. Since I didn't want to figure out
how to make my Netware client use a crynwr driver, I put a second
network card in my PC and left the Netware client untouched.
I didn't want to take the time to learn to do real mode callbacks
in DJGPP (and I was worried packets might be dropped by the extra
overhead). I wrote the capture program in 16-bit Turbo C and
assembler. It dumps a little info about each packet to the screen
and writes the whole raw packet to disk.
A second program (using DJGPP, which doesn't make this post on-topic,
but it helps a little) is run after you stop the first one. The second
program reads the disk file and formats a number of different NCP and
TCP/IP packet types to show what was happening during the capture.
I built it to diagnose problems on one network. I put packet types
and other features in only when I needed them for whatever problem I
was working on. This made the whole thing grow into a strange
collection of code. There are a lot of details on some packet types
and none at all on others.
--
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
- Raw text -