🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.net
2 messages
2 total messages Started by Dave Denson Mon, 16 Nov 1992 06:25
Packet Driver Programming Problem
#9
Author: Dave Denson
Date: Mon, 16 Nov 1992 06:25
80 lines
2881 bytes
I am trying to learn how to program using a packet driver, and am having a
very difficult time trying to set up a handler using the "access_type" call to
packet driver.  I have some code below, which has been reworked numerous times,
always with the same results.  I get a valid handler back with no errors, but
when I ping my pc from a unix box, the far assembly procedure MyRoutine does
not get called.  (I am using Turbo Pascal 6.0, BTW.  I know C would be better,
but I do not have a decent C compiler at home [yet]).

A few notes: 
	I have tried TypeLen (CX) set to 0, which, according the packet driver
	specs, should call MyRoutine _every_ time a packet is received. 

	I have tried byte-swapping the word constant IP--no difference.

	I _can_ get the thing to generate errors if I purposely set illegal
	if{Type,Class,Number} values.

	All the other basic packet driver functions (AH={1,2,3,4,5,6,7}) work
	fine.

Here is the routine (which has become a bit messy over time).  I have coded it
entirely in assembly, BTW, with no luck.

I would greatly appreciate any help.  I'm pulling my hair out over this.



function pkt_AccessType;

var
	Error: byte;
	TypeSeg, TypeOfs, RecSeg, RecOfs, Handle, Temp: word;
	r: Registers;

begin
	RecSeg := Seg(MyRoutine);	{MyRoutine is a far assembly procedure}
	RecOfs := Ofs(MyRoutine);

	TypeSeg := Seg(IP);		{IP is a word containing $0008}
	TypeOfs := Ofs(IP);

	asm
		push	DS		{I have a hunch that this is needed}
		mov	AX,RecSeg	{RecSeg}
		mov	ES,AX
		mov	DI,RecOfs	{RecOfs}

		mov	AX,TypeSeg
		mov	DS,AX
		mov	SI,TypeOfs

{I have set the following to constants instead of the passed parameters here}
		mov	AL,1		{ifClass-DIX Ethernet}
		mov	BX,14		{ifType-WD8003}
		mov	DL,0		{ifNumber}

		mov	CX,2		{TypeLen}

		mov	AH,2
		int	$60
		pop	DS

		jnc	@NoError
		mov	Error,DH	{Error found}
		jmp @exit

	 @NoError:
		mov	Error, 0
		mov	Temp,AX
	 @exit:
	end;
	pkt_AccessType := Temp;	
	pkt_Result := Error;		{pkt_result is a global variable}
end;
-- 
------ Dave Denson                      (Preferred:  densond@storm.cs.orst.edu)
Computer Sciences Corporation                       (densond@heart.cor.epa.gov)
US EPA Corvallis Environmental Research Lab
The above opinions are by no means whatsoever endorsed by US EPA, CSC, or OSU.
Packet Driver Programming Problem
#10
Author: Russell Nelson
Date: Tue, 17 Nov 1992 14:17
35 lines
2061 bytes
In article <1e7eshINNhvt@flop.ENGR.ORST.EDU> densond@xanth.CS.ORST.EDU writes:

   I am trying to learn how to program using a packet driver, and am
   having a very difficult time trying to set up a handler using the
   "access_type" call to packet driver.  I have some code below,
   which has been reworked numerous times,   always with the same
   results.  I get a valid handler back with no errors, but when I
   ping my pc from a unix box, the far assembly procedure MyRoutine
   does not get called.  (I am using Turbo Pascal 6.0, BTW.  I know C
   would be better, but I do not have a decent C compiler at home
   [yet]).

Well, first of all, do you have your packet driver installed
correctly?  If not, you'll never get anything.  Try running pktall
and see if it prints anything.

   A few notes:
           I have tried TypeLen (CX) set to 0, which, according the packet driver
           specs, should call MyRoutine _every_ time a packet is received. 

Yup.

                   push    DS              {I have a hunch that this is needed}

Yup.

                   mov     BX,14           {ifType-WD8003}

Use -1 here.  That way your program will work on any packet driver,
not just wd8003e's.

-russ <nelson@crynwr.com> What canst *thou* say?
Crynwr Software           Crynwr Software sells packet driver support.
11 Grant St.              315-268-1925 Voice  |  LPF member - ask me about
Potsdam, NY 13676         315-268-9201 FAX    |  the harm software patents do.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads