delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/09/15:40:44

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Capture packet from Ethernet card ?
Date: Sat, 09 Jan 1999 14:18:58 -0500
Lines: 36
Message-ID: <3697ABA2.5E4D@erols.com>
References: <Pine DOT GSO DOT 4 DOT 05 DOT 9901081535450 DOT 25672-100000 AT Chaokhun DOT kmitl DOT ac DOT th>
Mime-Version: 1.0
X-Trace: pGVXHcGY/rOTEIt7rZZaqVNV9L6kjkh9/rmgFnCIa2Y=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 9 Jan 1999 19:20:07 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019