diff options
Diffstat (limited to 'msdos')
-rw-r--r-- | msdos/bin2c.c | 4 | ||||
-rw-r--r-- | msdos/common.dj | 17 | ||||
-rw-r--r-- | msdos/makefile | 2 | ||||
-rw-r--r-- | msdos/makefile.dj | 128 | ||||
-rw-r--r-- | msdos/makefile.wc | 33 | ||||
-rw-r--r-- | msdos/ndis2.c | 10 | ||||
-rw-r--r-- | msdos/ndis2.h | 2 | ||||
-rw-r--r-- | msdos/ndis_0.asm | 376 | ||||
-rw-r--r-- | msdos/pkt_rx0.asm | 394 | ||||
-rw-r--r-- | msdos/pkt_rx1.s | 2 | ||||
-rw-r--r-- | msdos/pktdrvr.c | 6 | ||||
-rw-r--r-- | msdos/pktdrvr.h | 2 | ||||
-rw-r--r-- | msdos/readme.dos | 60 |
13 files changed, 514 insertions, 522 deletions
diff --git a/msdos/bin2c.c b/msdos/bin2c.c index a6a3c8874810..26d90083fbfb 100644 --- a/msdos/bin2c.c +++ b/msdos/bin2c.c @@ -3,7 +3,7 @@ #include <stdarg.h> #include <time.h> -static void Abort (char *fmt,...) +static void Abort (const char *fmt,...) { va_list args; va_start (args, fmt); @@ -27,7 +27,7 @@ int main (int argc, char **argv) fprintf (outFile, "/* data statements for file %s at %.24s */\n" - "/* Generated by BIN2C, G.Vanem 1995 */\n", + "/* Generated by BIN2C, G. Vanem 1995 */\n", argv[1], ctime(&now)); i = 0; diff --git a/msdos/common.dj b/msdos/common.dj index ec0ce02b2449..dacfd1fdfcc4 100644 --- a/msdos/common.dj +++ b/msdos/common.dj @@ -7,7 +7,13 @@ default: check_gcclib all -GCCLIB = /djgpp/lib/gcc-lib/djgpp/3.31 +# +# This value is normally not important. Used by 'dxe3gen' in +# msdos/pm_drvr/makefile.dj to make "dynamically loaded modules". +# But this is not finished. +# +#GCC_LIB = $(shell gcc -print-libgcc-file-name) +GCC_LIB = . MAKEFILE = Makefile.dj # @@ -19,10 +25,11 @@ MAKEFILE = Makefile.dj WATT32_ROOT = $(subst \,/,$(WATT_ROOT)) +OBJ_DIR = djgpp.obj -ifeq ($(wildcard $(GCCLIB)/libgcc.a),) +ifeq ($(wildcard $(GCC_LIB)),) check_gcclib: - @echo libgcc.a not found. Set \"$(GCCLIB)\" to \"/djgpp/lib/gcc-lib/djgpp/3.X\" + @echo libgcc.a not found. Set \"$(GCC_LIB)\" to \"/djgpp/lib/gcc/djgpp/4.X/libgcc.a\" endif @@ -54,7 +61,7 @@ ASM = nasm.exe -fbin -dDEBUG YACC = bison.exe LEX = flex.exe -CFLAGS = -g -gcoff -O2 -Wall -I. -I$(WATT32_ROOT)/inc +CFLAGS = -g -O2 -Wall -I. -I$(WATT32_ROOT)/inc ifeq ($(USE_EXCEPT),1) CFLAGS += -DUSE_EXCEPT @@ -70,7 +77,7 @@ ifeq ($(USE_32BIT_DRIVERS),1) endif %.o: %.c - $(CC) -c $(CFLAGS) $< + $(CC) -c $(CFLAGS) -o $@ $< @echo %.o: %.s diff --git a/msdos/makefile b/msdos/makefile index f74684f2a657..234a2763dbc9 100644 --- a/msdos/makefile +++ b/msdos/makefile @@ -101,7 +101,7 @@ clean: # # dependencies -# +# pkt_rx0.obj: msdos\pkt_rx0.asm bpf_filt.obj: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h diff --git a/msdos/makefile.dj b/msdos/makefile.dj index 28e3f2d71120..3f56da968600 100644 --- a/msdos/makefile.dj +++ b/msdos/makefile.dj @@ -6,43 +6,49 @@ # # c:\net\pcap> make -f msdos/makefile.dj # +# Note: you should do a "set LFN=y" before running this makefile. +# -VPATH = missing msdos +VPATH = missing msdos bpf/net PREREQUISITES = scanner.c grammar.c tokdefs.h version.h msdos/pkt_stub.inc -include msdos/common.dj +include ./msdos/common.dj DRIVER_DIR = ./msdos/pm_drvr -CFLAGS += -DDEBUG -DNDIS_DEBUG -DHAVE_LIMITS_H -DHAVE_STRERROR \ - -D_U_='__attribute__((unused))' -DHAVE_VERSION_H +CFLAGS += -DDEBUG -DNDIS_DEBUG -DHAVE_LIMITS_H -DHAVE_STRERROR -DHAVE_SNPRINTF -DHAVE_VSNPRINTF\ + -D_U_='__attribute__((unused))' -# CFLAGS += -Dyylval=pcap_lval -DBDEBUG -DNDEBUG +CFLAGS += -Dyylval=pcap_lval # -DBDEBUG -DNDEBUG -SOURCES = grammar.c scanner.c bpf_filt.c bpf_imag.c bpf_dump.c \ - etherent.c gencode.c nametoad.c pcap-dos.c optimize.c \ - savefile.c pcap.c inet.c msdos\pktdrvr.c msdos/ndis2.c \ - missing/snprintf.c +SOURCES = grammar.c scanner.c bpf/net/bpf_filter.c bpf_image.c bpf_dump.c \ + etherent.c gencode.c nametoaddr.c pcap-common.c pcap-dos.c optimize.c \ + savefile.c pcap.c sf-pcap.c sf-pcap-ng.c inet.c \ + msdos/pktdrvr.c msdos/ndis2.c # missing/snprintf.c -OBJECTS = $(notdir $(SOURCES:.c=.o)) +OBJECTS = $(addprefix $(OBJ_DIR)/, $(notdir $(SOURCES:.c=.o))) TEMPBIN = tmp.bin ifeq ($(USE_32BIT_DRIVERS),1) - PM_OBJECTS = $(addprefix $(DRIVER_DIR)/, \ + PM_OBJECTS = $(addprefix $(OBJ_DIR)/, \ printk.o pci.o pci-scan.o bios32.o dma.o irq.o intwrap.o \ lock.o kmalloc.o quirks.o timer.o net_init.o) # # Static link of drivers # ifeq ($(USE_32BIT_MODULES),0) - PM_OBJECTS += $(addprefix $(DRIVER_DIR)/, \ + PM_OBJECTS += $(addprefix $(OBJ_DIR)/, \ accton.o 8390.o 3c503.o 3c509.o 3c59x.o 3c515.o \ 3c575_cb.o 3c90x.o ne.o wd.o cs89x0.o rtl8139.o) endif endif -all: libpcap.a +TARGETS = msdos/bin2c.exe libpcap.a filtertest.exe findalldevstest.exe \ + nonblocktest.exe opentest.exe + +all: $(TARGETS) + @echo 'Welcome to libpcap/djgpp with samples.' ifeq ($(USE_32BIT_DRIVERS),1) $(PM_OBJECTS): @@ -53,6 +59,22 @@ libpcap.a: version.h $(OBJECTS) $(PM_OBJECTS) rm -f $@ ar rs $@ $^ +filtertest.exe: tests/filtertest.c libpcap.a + $(CC) $(CFLAGS) -Din_addr_t=u_long -o $@ $^ $(WATT32_ROOT)/lib/libwatt.a + @echo + +findalldevstest.exe: tests/findalldevstest.c libpcap.a + $(CC) $(CFLAGS) -o $@ $^ $(WATT32_ROOT)/lib/libwatt.a + @echo + +nonblocktest.exe: tests/nonblocktest.c libpcap.a + $(CC) $(CFLAGS) -o $@ $^ $(WATT32_ROOT)/lib/libwatt.a + @echo + +opentest.exe: tests/opentest.c libpcap.a + $(CC) $(CFLAGS) -o $@ $^ $(WATT32_ROOT)/lib/libwatt.a + @echo + msdos/pkt_stub.inc: msdos/bin2c.exe msdos/pkt_rx1.S $(ASM) -o $(TEMPBIN) -lmsdos/pkt_rx1.lst msdos/pkt_rx1.S ./msdos/bin2c $(TEMPBIN) > $@ @@ -61,8 +83,8 @@ msdos/pkt_stub.inc: msdos/bin2c.exe msdos/pkt_rx1.S grammar.c tokdefs.h: grammar.y rm -f grammar.c tokdefs.h $(YACC) --name-prefix=pcap_ --yacc --defines grammar.y - mv -f y_tab.c grammar.c - mv -f y_tab.h tokdefs.h + mv -f y.tab.c grammar.c + mv -f y.tab.h tokdefs.h version.h: ./VERSION @echo '/* Generated from VERSION. Do not edit */' > $@ @@ -76,76 +98,30 @@ msdos/bin2c.exe: msdos/bin2c.c $(CC) $*.c -o $*.exe clean: - $(MAKE) -f Makefile.dj -C $(DRIVER_DIR) clean - $(MAKE) -f Makefile.dj -C libcpcap clean - rm -f $(OBJECTS) msdos/pkt_rx1.lst Makefile.bak $(PREREQUISITES) + rm -f $(OBJECTS) msdos/pkt_rx1.lst Makefile.bak .depend.dj $(PREREQUISITES) +# $(MAKE) -f Makefile.dj -C $(DRIVER_DIR) clean vclean: clean - rm -f libpcap.a msdos/bin2c.exe - -# -# Generated dependencies; Due to some hacks in gcc 2.95 and djgpp 2.03 -# we must prevent "$(DJDIR)/bin/../include/sys/version.h" from beeing -# included in dependency output (or else this makefile cannot be used on -# another machine). We therefore use a special 'specs' file during -# pre-processing. -# -MM_SPECS = specs.tmp -MAKEFILE = msdos/Makefile.dj - -depend: $(PREREQUISITES) - @echo Generating dependencies.. - @cp $(MAKEFILE) Makefile.bak - @echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $(MM_SPECS) - sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > $(MAKEFILE) - echo "# DO NOT DELETE THIS LINE" >> $(MAKEFILE) - $(CC) -MM -specs=$(MM_SPECS) $(CFLAGS) $(SOURCES) >> $(MAKEFILE) - rm -f $(MM_SPECS) + rm -f $(TARGETS) + -rmdir $(OBJ_DIR) # # Manually generated dependencies -# +# msdos/pktdrvr.c: msdos/pkt_stub.inc scanner.c: scanner.l grammar.c tokdefs.h: grammar.y grammar.h: grammar.y -scanner.l: pcap-int.h pcap-namedb.h gencode.h grammar.h gnuc.h -grammar.y: pcap-int.h gencode.h pcap-namedb.h gnuc.h +scanner.l: pcap-int.h pcap-namedb.h gencode.h grammar.h +grammar.y: pcap-int.h gencode.h pcap-namedb.h # -# Automatically generated dependencies +# Generate dependencies. # -# DO NOT DELETE THIS LINE -grammar.o: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h pf.h \ - pcap-namedb.h -scanner.o: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h pcap-namedb.h \ - tokdefs.h -bpf_filt.o: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h -bpf_imag.o: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h -bpf_dump.o: bpf_dump.c pcap.h pcap-bpf.h -etherent.o: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h -gencode.o: gencode.c pcap-dos.h msdos/pm_drvr/lock.h pcap-int.h pcap.h \ - pcap-bpf.h ethertype.h nlpid.h llc.h gencode.h atmuni31.h sunatmpos.h \ - ppp.h sll.h arcnet.h pf.h pcap-namedb.h -nametoad.o: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h \ - pcap-namedb.h ethertype.h -pcap-dos.o: pcap-dos.c msdos/pm_drvr/pmdrvr.h msdos/pm_drvr/iface.h \ - msdos/pm_drvr/lock.h msdos/pm_drvr/ioport.h pcap-dos.h pcap-int.h \ - pcap.h pcap-bpf.h msdos/pm_drvr/kmalloc.h msdos/pm_drvr/bitops.h \ - msdos/pm_drvr/timer.h msdos/pm_drvr/dma.h msdos/pm_drvr/irq.h \ - msdos/pm_drvr/printk.h msdos/pm_drvr/pci.h msdos/pm_drvr/bios32.h \ - msdos/pm_drvr/module.h msdos/pm_drvr/3c501.h msdos/pm_drvr/3c503.h \ - msdos/pm_drvr/3c509.h msdos/pm_drvr/3c59x.h msdos/pm_drvr/3c515.h \ - msdos/pm_drvr/3c90x.h msdos/pm_drvr/3c575_cb.h msdos/pm_drvr/ne.h \ - msdos/pm_drvr/wd.h msdos/pm_drvr/accton.h msdos/pm_drvr/cs89x0.h \ - msdos/pm_drvr/rtl8139.h msdos/pm_drvr/ne2k-pci.h msdos/pktdrvr.h -optimize.o: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h -savefile.o: savefile.c pcap-int.h pcap.h pcap-bpf.h -pcap.o: pcap.c pcap-dos.h msdos/pm_drvr/lock.h pcap-int.h pcap.h \ - pcap-bpf.h -inet.o: inet.c pcap-int.h pcap.h pcap-bpf.h -pktdrvr.o: msdos/pktdrvr.c gnuc.h pcap-dos.h msdos/pm_drvr/lock.h \ - pcap-int.h pcap.h pcap-bpf.h msdos/pktdrvr.h msdos/pkt_stub.inc -ndis2.o: msdos/ndis2.c pcap-dos.h msdos/pm_drvr/lock.h pcap-int.h pcap.h \ - pcap-bpf.h msdos/ndis2.h -snprintf.o: missing/snprintf.c pcap-int.h pcap.h pcap-bpf.h +REPLACE = sed -e 's/\(.*\)\.o: /\n$$(OBJ_DIR)\/\1.o: /' + +depend: $(PREREQUISITES) + $(CC) -MM $(CFLAGS) $(SOURCES) | $(REPLACE) > .depend.dj + +-include .depend.dj + diff --git a/msdos/makefile.wc b/msdos/makefile.wc index e7edde64f065..61ba137820ee 100644 --- a/msdos/makefile.wc +++ b/msdos/makefile.wc @@ -24,11 +24,11 @@ DEFS = -dDEBUG -dNDIS_DEBUG -d_U_= -dHAVE_LIMITS_H -dHAVE_STRERROR & CC = wcc386.exe ASM = wasm.exe -$(MODEL) $(DEFS) -dDOSX -dDOS4GW -zq -bt=dos -fr=nul -d3 -s -OBJS = $(OBJDIR)\grammar.obj $(OBJDIR)\scanner.obj $(OBJDIR)\pcap.obj & - $(OBJDIR)\bpf_filt.obj $(OBJDIR)\bpf_imag.obj $(OBJDIR)\bpf_dump.obj & - $(OBJDIR)\etherent.obj $(OBJDIR)\gencode.obj $(OBJDIR)\nametoad.obj & - $(OBJDIR)\pcap-dos.obj $(OBJDIR)\pktdrvr.obj $(OBJDIR)\optimize.obj & - $(OBJDIR)\savefile.obj $(OBJDIR)\inet.obj $(OBJDIR)\ndis2.obj +OBJS = $(OBJDIR)\grammar.obj $(OBJDIR)\scanner.obj $(OBJDIR)\pcap.obj & + $(OBJDIR)\bpf_filter.obj $(OBJDIR)\bpf_imag.obj $(OBJDIR)\bpf_dump.obj & + $(OBJDIR)\etherent.obj $(OBJDIR)\gencode.obj $(OBJDIR)\nametoad.obj & + $(OBJDIR)\pcap-dos.obj $(OBJDIR)\pktdrvr.obj $(OBJDIR)\optimize.obj & + $(OBJDIR)\savefile.obj $(OBJDIR)\inet.obj $(OBJDIR)\ndis2.obj CFLAGS = $(DEFS) $(YYDEFS) -I. -I$(%watt_root)\inc -I.\msdos\pm_drvr & -$(MODEL) -mf -zff -zgf -zq -bt=dos -fr=nul -w6 -fpi & @@ -48,10 +48,13 @@ wlib.arg: msdos\makefile.wc %create $^@ for %f in ($(OBJS)) do %append $^@ +- %f -$(OBJDIR)\pktdrvr.obj: msdos\pkt_stub.inc msdos\pktdrvr.c gnuc.h & +$(OBJDIR)\pktdrvr.obj: msdos\pkt_stub.inc msdos\pktdrvr.c & pcap-dos.h pcap-int.h pcap.h msdos\pktdrvr.h *$(CC) $(CFLAGS) msdos\pktdrvr.c -fo=$@ +$(OBJDIR)\bpf_filter.obj: bpf\net\bpf_filter.c + *$(CC) $(CFLAGS) bpf\net\bpf_filter.c -fo=$@ + $(OBJDIR)\ndis2.obj: msdos\ndis2.c *$(CC) $(CFLAGS) msdos\ndis2.c -fo=$@ @@ -59,7 +62,7 @@ $(OBJDIR)\ndis2.obj: msdos\ndis2.c .c{$(OBJDIR)}.obj: *$(CC) $(CFLAGS) $[@ -fo=$@ -grammar.c tokdefs.h: grammar.y +grammar.c tokdefs.h: grammar.y bison --name-prefix=pcap_ --yacc --defines $[@ - @del grammar.c - @del tokdefs.h @@ -90,14 +93,14 @@ clean realclean vclean: .SYMBOLIC # # dependencies -# -$(OBJDIR)\bpf_filt.obj: bpf_filt.c pcap-int.h pcap.h pcap-bpf.h gnuc.h +# +$(OBJDIR)\bpf_filter.obj: bpf\net\bpf_filter.c pcap-int.h pcap.h pcap-bpf.h $(OBJDIR)\bpf_imag.obj: bpf_imag.c pcap-int.h pcap.h pcap-bpf.h $(OBJDIR)\bpf_dump.obj: bpf_dump.c pcap.h pcap-bpf.h -$(OBJDIR)\etherent.obj: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-nam.h +$(OBJDIR)\etherent.obj: etherent.c pcap-int.h pcap.h pcap-bpf.h pcap-namedb.h $(OBJDIR)\optimize.obj: optimize.c pcap-int.h pcap.h pcap-bpf.h gencode.h @@ -108,22 +111,22 @@ $(OBJDIR)\pcap.obj: pcap.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h $(OBJDIR)\inet.obj: inet.c pcap-int.h pcap.h pcap-bpf.h $(OBJDIR)\grammar.obj: grammar.c pcap-int.h pcap.h pcap-bpf.h gencode.h & - pf.h pcap-nam.h + pcap-namedb.h $(OBJDIR)\scanner.obj: scanner.c pcap-int.h pcap.h pcap-bpf.h gencode.h & - pcap-nam.h tokdefs.h + pcap-namedb.h tokdefs.h $(OBJDIR)\gencode.obj: gencode.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h & ethertyp.h nlpid.h llc.h gencode.h atmuni31.h sunatmpo.h ppp.h sll.h & - arcnet.h pf.h pcap-nam.h + arcnet.h pcap-namedb.h $(OBJDIR)\nametoad.obj: nametoad.c pcap-int.h pcap.h pcap-bpf.h gencode.h & - pcap-nam.h ethertyp.h + pcap-namedb.h ethertyp.h $(OBJDIR)\pcap-dos.obj: pcap-dos.c pcap.h pcap-bpf.h pcap-dos.h pcap-int.h & msdos\pktdrvr.h -$(OBJDIR)\pktdrvr.obj: msdos\pktdrvr.c gnuc.h pcap-dos.h pcap-int.h & +$(OBJDIR)\pktdrvr.obj: msdos\pktdrvr.c pcap-dos.h pcap-int.h & pcap.h pcap-bpf.h msdos\pktdrvr.h msdos\pkt_stub.inc $(OBJDIR)\ndis2.obj: msdos\ndis2.c pcap-dos.h pcap-int.h pcap.h pcap-bpf.h & diff --git a/msdos/ndis2.c b/msdos/ndis2.c index 8cebe6e076c2..526b22199efe 100644 --- a/msdos/ndis2.c +++ b/msdos/ndis2.c @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1993,1994 * Texas A&M University. All rights reserved. * @@ -198,7 +198,7 @@ static struct { /* * Some handy macros - */ + */ #define PERROR(str) printf("%s (%d): %s\n", __FILE__,__LINE__,str) #define DEBUG_RING() (debugStrings[stopDebug+1 == MAX_NUM_DEBUG_STRINGS ? \ stopDebug = 0 : ++stopDebug]) @@ -444,7 +444,7 @@ CALLBACK (NdisReceiveChain (WORD macId, WORD frameSize, WORD reqHandle, ARGSUSED (frameSize); ARGSUSED (reqHandle); ARGSUSED (indicate); - ARGSUSED (protDS); + ARGSUSED (protDS); /* This frees up the buffer for the MAC to use */ @@ -484,7 +484,7 @@ CALLBACK (NdisStatusProc (WORD macId, WORD param1, BYTE *indicate, * Tell the NDIS driver to start the delivery of the packet */ int NdisSendPacket (struct _PktBuf *pktBuf, int macId) -{ +{ struct _TxBufDescr txBufDescr; int result; @@ -513,7 +513,7 @@ int NdisSendPacket (struct _PktBuf *pktBuf, int macId) return (0); case ERR_SUCCESS: - /* Everything was hunky dory and synchronous. Free up the + /* Everything was hunky dory and synchronous. Free up the * packet buffer */ xmitPending--; diff --git a/msdos/ndis2.h b/msdos/ndis2.h index 958575fabf2a..f278b5dcd6cd 100644 --- a/msdos/ndis2.h +++ b/msdos/ndis2.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (c) 1993,1994 * Texas A&M University. All rights reserved. * diff --git a/msdos/ndis_0.asm b/msdos/ndis_0.asm index 2990985fee30..ea65e0f8e15e 100644 --- a/msdos/ndis_0.asm +++ b/msdos/ndis_0.asm @@ -1,188 +1,188 @@ -PAGE 60,132
-NAME NDIS_0
-
-ifdef DOSX
- .386
- _TEXT SEGMENT PUBLIC DWORD USE16 'CODE'
- _TEXT ENDS
- _DATA SEGMENT PUBLIC DWORD USE16 'CODE'
- _DATA ENDS
- _TEXT32 SEGMENT PUBLIC BYTE USE32 'CODE'
- _TEXT32 ENDS
- CB_DSEG EQU <CS> ; DOSX is tiny-model
- D_SEG EQU <_TEXT SEGMENT>
- D_END EQU <_TEXT ENDS>
- ASSUME CS:_TEXT,DS:_TEXT
-
- PUSHREGS equ <pushad>
- POPREGS equ <popad>
-
- PUBPROC macro name
- align 4
- public @&name
- @&name label near
- endm
-else
- .286
- _TEXT SEGMENT PUBLIC DWORD 'CODE'
- _TEXT ENDS
- _DATA SEGMENT PUBLIC DWORD 'DATA'
- _DATA ENDS
- CB_DSEG EQU <SEG _DATA> ; 16bit is small/large model
- D_SEG EQU <_DATA SEGMENT>
- D_END EQU <_DATA ENDS>
- ASSUME CS:_TEXT,DS:_DATA
-
- PUSHREGS equ <pusha>
- POPREGS equ <popa>
-
- PUBPROC macro name
- public _&name
- _&name label far
- endm
-endif
-
-;-------------------------------------------
-
-D_SEG
-
-D_END
-
-
-_TEXT SEGMENT
-
-EXTRN _NdisSystemRequest : near
-EXTRN _NdisRequestConfirm : near
-EXTRN _NdisTransmitConfirm : near
-EXTRN _NdisReceiveLookahead : near
-EXTRN _NdisIndicationComplete : near
-EXTRN _NdisReceiveChain : near
-EXTRN _NdisStatusProc : near
-EXTRN _NdisAllocStack : near
-EXTRN _NdisFreeStack : near
-
-;
-; *ALL* interrupt threads come through this macro.
-;
-CALLBACK macro callbackProc, argsSize
-
- pushf
- PUSHREGS ;; Save the registers
-
- push es
- push ds
- mov ax,CB_DSEG ;; Load DS
- mov ds,ax
- call _NdisAllocStack ;; Get and install a stack.
-
- mov bx,ss ;; Save off the old stack in other regs
- mov cx,sp
- mov ss,dx ;; Install the new one
- mov sp,ax
- push bx ;; Save the old one on to the new stack
- push cx
- sub sp,&argsSize ;; Allocate space for arguments on the stack
-
- mov ax,ss ;; Set up the destination for the move
- mov es,ax
- mov di,sp
- mov ds,bx ;; Set up the source for the move.
- mov si,cx
- add si,4+6+32
-
- mov cx,&argsSize ;; Move the arguments to the stack.
- shr cx,1
- cld
- rep movsw
-
- mov ax,CB_DSEG ;; Set my data segment again.
- mov ds,ax
-
- call &callbackProc ;; Call the real callback.
- pop di ;; Pop off the old stack
- pop si
- mov bx,ss ;; Save off the current allocated stack.
- mov cx,sp
- mov ss,si ;; Restore the old stack
- mov sp,di
- push ax ;; Save the return code
- push bx ;; Free the stack. Push the pointer to it
- push cx
- call _NdisFreeStack
- add sp,4
- pop ax ;; Get the return code back
- add di,32 ;; Get a pointer to ax on the stack
- mov word ptr ss:[di],ax
- pop ds
- pop es
-
- POPREGS
- popf
-endm
-
-;
-; Define all of the callbacks for the NDIS procs.
-;
-
-PUBPROC systemRequestGlue
-CALLBACK _NdisSystemRequest,14
-RETF
-
-PUBPROC requestConfirmGlue
-CALLBACK _NdisRequestConfirm,12
-RETF
-
-PUBPROC transmitConfirmGlue
-CALLBACK _NdisTransmitConfirm,10
-RETF
-
-PUBPROC receiveLookaheadGlue
-CALLBACK _NdisReceiveLookahead,16
-RETF
-
-PUBPROC indicationCompleteGlue
-CALLBACK _NdisIndicationComplete,4
-RETF
-
-PUBPROC receiveChainGlue
-CALLBACK _NdisReceiveChain,16
-RETF
-
-PUBPROC statusGlue
-CALLBACK _NdisStatusProc,12
-RETF
-
-;
-; int FAR NdisGetLinkage (int handle, char *data, int size);
-;
-
-ifdef DOSX
- PUBPROC NdisGetLinkage
- push ebx
- mov ebx, [esp+8] ; device handle
- mov eax, 4402h ; IOCTRL read function
- mov edx, [esp+12] ; DS:EDX -> result data
- mov ecx, [esp+16] ; ECX = length
- int 21h
- pop ebx
- jc @fail
- xor eax, eax
- @fail: ret
-
-else
- PUBPROC NdisGetLinkage
- enter 0, 0
- mov bx, [bp+6]
- mov ax, 4402h
- mov dx, [bp+8]
- mov cx, [bp+12]
- int 21h
- jc @fail
- xor ax, ax
- @fail: leave
- retf
-endif
-
-ENDS
-
-END
+PAGE 60,132 +NAME NDIS_0 + +ifdef DOSX + .386 + _TEXT SEGMENT PUBLIC DWORD USE16 'CODE' + _TEXT ENDS + _DATA SEGMENT PUBLIC DWORD USE16 'CODE' + _DATA ENDS + _TEXT32 SEGMENT PUBLIC BYTE USE32 'CODE' + _TEXT32 ENDS + CB_DSEG EQU <CS> ; DOSX is tiny-model + D_SEG EQU <_TEXT SEGMENT> + D_END EQU <_TEXT ENDS> + ASSUME CS:_TEXT,DS:_TEXT + + PUSHREGS equ <pushad> + POPREGS equ <popad> + + PUBPROC macro name + align 4 + public @&name + @&name label near + endm +else + .286 + _TEXT SEGMENT PUBLIC DWORD 'CODE' + _TEXT ENDS + _DATA SEGMENT PUBLIC DWORD 'DATA' + _DATA ENDS + CB_DSEG EQU <SEG _DATA> ; 16bit is small/large model + D_SEG EQU <_DATA SEGMENT> + D_END EQU <_DATA ENDS> + ASSUME CS:_TEXT,DS:_DATA + + PUSHREGS equ <pusha> + POPREGS equ <popa> + + PUBPROC macro name + public _&name + _&name label far + endm +endif + +;------------------------------------------- + +D_SEG + +D_END + + +_TEXT SEGMENT + +EXTRN _NdisSystemRequest : near +EXTRN _NdisRequestConfirm : near +EXTRN _NdisTransmitConfirm : near +EXTRN _NdisReceiveLookahead : near +EXTRN _NdisIndicationComplete : near +EXTRN _NdisReceiveChain : near +EXTRN _NdisStatusProc : near +EXTRN _NdisAllocStack : near +EXTRN _NdisFreeStack : near + +; +; *ALL* interrupt threads come through this macro. +; +CALLBACK macro callbackProc, argsSize + + pushf + PUSHREGS ;; Save the registers + + push es + push ds + mov ax,CB_DSEG ;; Load DS + mov ds,ax + call _NdisAllocStack ;; Get and install a stack. + + mov bx,ss ;; Save off the old stack in other regs + mov cx,sp + mov ss,dx ;; Install the new one + mov sp,ax + push bx ;; Save the old one on to the new stack + push cx + sub sp,&argsSize ;; Allocate space for arguments on the stack + + mov ax,ss ;; Set up the destination for the move + mov es,ax + mov di,sp + mov ds,bx ;; Set up the source for the move. + mov si,cx + add si,4+6+32 + + mov cx,&argsSize ;; Move the arguments to the stack. + shr cx,1 + cld + rep movsw + + mov ax,CB_DSEG ;; Set my data segment again. + mov ds,ax + + call &callbackProc ;; Call the real callback. + pop di ;; Pop off the old stack + pop si + mov bx,ss ;; Save off the current allocated stack. + mov cx,sp + mov ss,si ;; Restore the old stack + mov sp,di + push ax ;; Save the return code + push bx ;; Free the stack. Push the pointer to it + push cx + call _NdisFreeStack + add sp,4 + pop ax ;; Get the return code back + add di,32 ;; Get a pointer to ax on the stack + mov word ptr ss:[di],ax + pop ds + pop es + + POPREGS + popf +endm + +; +; Define all of the callbacks for the NDIS procs. +; + +PUBPROC systemRequestGlue +CALLBACK _NdisSystemRequest,14 +RETF + +PUBPROC requestConfirmGlue +CALLBACK _NdisRequestConfirm,12 +RETF + +PUBPROC transmitConfirmGlue +CALLBACK _NdisTransmitConfirm,10 +RETF + +PUBPROC receiveLookaheadGlue +CALLBACK _NdisReceiveLookahead,16 +RETF + +PUBPROC indicationCompleteGlue +CALLBACK _NdisIndicationComplete,4 +RETF + +PUBPROC receiveChainGlue +CALLBACK _NdisReceiveChain,16 +RETF + +PUBPROC statusGlue +CALLBACK _NdisStatusProc,12 +RETF + +; +; int FAR NdisGetLinkage (int handle, char *data, int size); +; + +ifdef DOSX + PUBPROC NdisGetLinkage + push ebx + mov ebx, [esp+8] ; device handle + mov eax, 4402h ; IOCTRL read function + mov edx, [esp+12] ; DS:EDX -> result data + mov ecx, [esp+16] ; ECX = length + int 21h + pop ebx + jc @fail + xor eax, eax + @fail: ret + +else + PUBPROC NdisGetLinkage + enter 0, 0 + mov bx, [bp+6] + mov ax, 4402h + mov dx, [bp+8] + mov cx, [bp+12] + int 21h + jc @fail + xor ax, ax + @fail: leave + retf +endif + +ENDS + +END diff --git a/msdos/pkt_rx0.asm b/msdos/pkt_rx0.asm index 94f3d098c370..d604fa14be67 100644 --- a/msdos/pkt_rx0.asm +++ b/msdos/pkt_rx0.asm @@ -1,197 +1,197 @@ -PAGE 60,132
-NAME PKT_RX
-
-ifdef ??version ; using TASM
- masm
- jumps
-endif
-
-PUBLIC _pktDrop, _pktRxBuf, _pktTxBuf, _pktTemp
-PUBLIC _rxOutOfs, _rxInOfs, _PktReceiver, _pktRxEnd
-
-;
-; these sizes MUST be equal to the sizes in PKTDRVR.H
-;
-
-RX_BUF_SIZE = 1500 ; max message size on Ethernet
-TX_BUF_SIZE = 1500
-
-ifdef DOSX
- .386
- NUM_RX_BUF = 32 ; # of RX element buffers
- _TEXT SEGMENT PUBLIC DWORD USE16 'CODE'
- _TEXT ENDS
- _DATA SEGMENT PUBLIC DWORD USE16 'CODE'
- _DATA ENDS
- D_SEG EQU <_TEXT SEGMENT>
- D_END EQU <_TEXT ENDS>
- ASSUME CS:_TEXT,DS:_TEXT
-else
- .286
- NUM_RX_BUF = 10
- _TEXT SEGMENT PUBLIC DWORD 'CODE'
- _TEXT ENDS
- _DATA SEGMENT PUBLIC DWORD 'DATA'
- _DATA ENDS
- D_SEG EQU <_DATA SEGMENT>
- D_END EQU <_DATA ENDS>
- ASSUME CS:_TEXT,DS:_DATA
-endif
-
-;-------------------------------------------
-
-D_SEG
-
-RX_ELEMENT STRUC
- firstCount dw 0 ; # of bytes on 1st call
- secondCount dw 0 ; # of bytes on 2nd call
- handle dw 0 ; handle for upcall
- destinAdr db 6 dup (0) ; packet destination address
- sourceAdr db 6 dup (0) ; packet source address
- protocol dw 0 ; packet protocol number
- rxBuffer db RX_BUF_SIZE dup (0) ; RX buffer
-ENDS
- align 4
-_rxOutOfs dw offset _pktRxBuf ; ring buffer offsets
-_rxInOfs dw offset _pktRxBuf ; into _pktRxBuf
-_pktDrop dw 0,0 ; packet drop counter
-_pktTemp db 20 dup (0) ; temp work area
-_pktTxBuf db (TX_BUF_SIZE+14) dup (0) ; TX buffer
-_pktRxBuf RX_ELEMENT NUM_RX_BUF dup (<>) ; RX structures
- LAST_OFS = offset $
-
- screenSeg dw 0B800h
- newInOffset dw 0
-
- fanChars db '-\|/'
- fanIndex dw 0
-
-D_END
-
-_TEXT SEGMENT
-
-
-SHOW_RX MACRO
- push es
- push bx
- mov bx, screenSeg
- mov es, bx ;; r-mode segment of colour screen
- mov di, 158 ;; upper right corner - 1
- mov bx, fanIndex
- mov al, fanChars[bx] ;; get write char
- mov ah, 15 ;; and white colour
- stosw ;; write to screen at ES:EDI
- inc fanIndex ;; update next index
- and fanIndex, 3
- pop bx
- pop es
-ENDM
-
-;------------------------------------------------------------------------
-;
-; This macro return ES:DI to tail of Rx queue
-
-ENQUEUE MACRO
- LOCAL @noWrap
- mov ax, _rxInOfs ;; DI = current in-offset
- add ax, SIZE RX_ELEMENT ;; point to next _pktRxBuf buffer
- cmp ax, LAST_OFS ;; pointing past last ?
- jb @noWrap ;; no - jump
- lea ax, _pktRxBuf ;; yes, point to 1st buffer
- align 4
-@noWrap: cmp ax, _rxOutOfs ;; in-ofs = out-ofs ?
- je @dump ;; yes, queue is full
- mov di, _rxInOfs ;; ES:DI -> buffer at queue input
- mov newInOffset, ax ;; remember new input offset
-
- ;; NOTE. rxInOfs is updated after the packet has been copied
- ;; to ES:DI (= DS:SI on 2nd call) by the packet driver
-
-ENDM
-
-;------------------------------------------------------------------------
-;
-; This routine gets called by the packet driver twice:
-; 1st time (AX=0) it requests an address where to put the packet
-;
-; 2nd time (AX=1) the packet has been copied to this location (DS:SI)
-; BX has client handle (stored in RX_ELEMENT.handle).
-; CX has # of bytes in packet on both call. They should be equal.
-;
-; A test for equality is done by putting CX in _pktRxBuf [n].firstCount
-; and _pktRxBuf[n].secondCount, and CL on first call in
-; _pktRxBuf[n].rxBuffer[CX]. These values are checked in "PktReceive"
-; (PKTDRVR.C)
-;
-;---------------------------------------------------------------------
-
-_PktReceiver:
- pushf
- cli ; no distraction wanted !
- push ds
- push bx
-ifdef DOSX
- mov bx, cs
-else
- mov bx, SEG _DATA
-endif
- mov ds, bx
- mov es, bx ; ES = DS = CS or seg _DATA
- pop bx ; restore handle
-
- cmp ax, 0 ; first call? (AX=0)
- jne @post ; AX=1: second call, do post process
-
-ifdef DEBUG
- SHOW_RX ; show that a packet is received
-endif
- cmp cx, RX_BUF_SIZE+14 ; size OK ?
- ja @skip ; no, packet to large for us
-
- ENQUEUE ; ES:DI -> _pktRxBuf[n]
-
- mov [di].firstCount, cx ; remember the first count.
- mov [di].handle, bx ; remember the handle.
- add di, 6 ; ES:DI -> _pktRxBuf[n].destinAdr
- pop ds
- popf
- retf ; far return to driver with ES:DI
-
- align 4
-@dump: inc _pktDrop[0] ; discard the packet on 1st call
- adc _pktDrop[2], 0 ; increment packets lost
-
-@skip: xor di, di ; return ES:DI = NIL pointer
- xor ax, ax
- mov es, ax
- pop ds
- popf
- retf
-
- align 4
-@post: or si, si ; DS:SI->_pktRxBuf[n][n].destinAdr
- jz @discard ; make sure we don't use NULL-pointer
-
- sub si, 6 ; DS:SI -> _pktRxBuf[n].destinAdr
- ;
- ; push si
- ; push [si].firstCount
- ; call bpf_filter_match ; run the filter here some day?
- ; add sp, 4
- ; cmp ax, 0
- ; je @discard
-
- mov [si].secondCount, cx
- mov ax, newInOffset
- mov _rxInOfs, ax ; update _pktRxBuf input offset
-
- align 4
-@discard:pop ds
- popf
- retf
-
-_pktRxEnd db 0 ; marker for end of r-mode code/data
-
-_TEXT ENDS
-
-END
+PAGE 60,132 +NAME PKT_RX + +ifdef ??version ; using TASM + masm + jumps +endif + +PUBLIC _pktDrop, _pktRxBuf, _pktTxBuf, _pktTemp +PUBLIC _rxOutOfs, _rxInOfs, _PktReceiver, _pktRxEnd + +; +; these sizes MUST be equal to the sizes in PKTDRVR.H +; + +RX_BUF_SIZE = 1500 ; max message size on Ethernet +TX_BUF_SIZE = 1500 + +ifdef DOSX + .386 + NUM_RX_BUF = 32 ; # of RX element buffers + _TEXT SEGMENT PUBLIC DWORD USE16 'CODE' + _TEXT ENDS + _DATA SEGMENT PUBLIC DWORD USE16 'CODE' + _DATA ENDS + D_SEG EQU <_TEXT SEGMENT> + D_END EQU <_TEXT ENDS> + ASSUME CS:_TEXT,DS:_TEXT +else + .286 + NUM_RX_BUF = 10 + _TEXT SEGMENT PUBLIC DWORD 'CODE' + _TEXT ENDS + _DATA SEGMENT PUBLIC DWORD 'DATA' + _DATA ENDS + D_SEG EQU <_DATA SEGMENT> + D_END EQU <_DATA ENDS> + ASSUME CS:_TEXT,DS:_DATA +endif + +;------------------------------------------- + +D_SEG + +RX_ELEMENT STRUC + firstCount dw 0 ; # of bytes on 1st call + secondCount dw 0 ; # of bytes on 2nd call + handle dw 0 ; handle for upcall + destinAdr db 6 dup (0) ; packet destination address + sourceAdr db 6 dup (0) ; packet source address + protocol dw 0 ; packet protocol number + rxBuffer db RX_BUF_SIZE dup (0) ; RX buffer +ENDS + align 4 +_rxOutOfs dw offset _pktRxBuf ; ring buffer offsets +_rxInOfs dw offset _pktRxBuf ; into _pktRxBuf +_pktDrop dw 0,0 ; packet drop counter +_pktTemp db 20 dup (0) ; temp work area +_pktTxBuf db (TX_BUF_SIZE+14) dup (0) ; TX buffer +_pktRxBuf RX_ELEMENT NUM_RX_BUF dup (<>) ; RX structures + LAST_OFS = offset $ + + screenSeg dw 0B800h + newInOffset dw 0 + + fanChars db '-\|/' + fanIndex dw 0 + +D_END + +_TEXT SEGMENT + + +SHOW_RX MACRO + push es + push bx + mov bx, screenSeg + mov es, bx ;; r-mode segment of colour screen + mov di, 158 ;; upper right corner - 1 + mov bx, fanIndex + mov al, fanChars[bx] ;; get write char + mov ah, 15 ;; and white colour + stosw ;; write to screen at ES:EDI + inc fanIndex ;; update next index + and fanIndex, 3 + pop bx + pop es +ENDM + +;------------------------------------------------------------------------ +; +; This macro return ES:DI to tail of Rx queue + +ENQUEUE MACRO + LOCAL @noWrap + mov ax, _rxInOfs ;; DI = current in-offset + add ax, SIZE RX_ELEMENT ;; point to next _pktRxBuf buffer + cmp ax, LAST_OFS ;; pointing past last ? + jb @noWrap ;; no - jump + lea ax, _pktRxBuf ;; yes, point to 1st buffer + align 4 +@noWrap: cmp ax, _rxOutOfs ;; in-ofs = out-ofs ? + je @dump ;; yes, queue is full + mov di, _rxInOfs ;; ES:DI -> buffer at queue input + mov newInOffset, ax ;; remember new input offset + + ;; NOTE. rxInOfs is updated after the packet has been copied + ;; to ES:DI (= DS:SI on 2nd call) by the packet driver + +ENDM + +;------------------------------------------------------------------------ +; +; This routine gets called by the packet driver twice: +; 1st time (AX=0) it requests an address where to put the packet +; +; 2nd time (AX=1) the packet has been copied to this location (DS:SI) +; BX has client handle (stored in RX_ELEMENT.handle). +; CX has # of bytes in packet on both call. They should be equal. +; +; A test for equality is done by putting CX in _pktRxBuf [n].firstCount +; and _pktRxBuf[n].secondCount, and CL on first call in +; _pktRxBuf[n].rxBuffer[CX]. These values are checked in "PktReceive" +; (PKTDRVR.C) +; +;--------------------------------------------------------------------- + +_PktReceiver: + pushf + cli ; no distraction wanted ! + push ds + push bx +ifdef DOSX + mov bx, cs +else + mov bx, SEG _DATA +endif + mov ds, bx + mov es, bx ; ES = DS = CS or seg _DATA + pop bx ; restore handle + + cmp ax, 0 ; first call? (AX=0) + jne @post ; AX=1: second call, do post process + +ifdef DEBUG + SHOW_RX ; show that a packet is received +endif + cmp cx, RX_BUF_SIZE+14 ; size OK ? + ja @skip ; no, packet to large for us + + ENQUEUE ; ES:DI -> _pktRxBuf[n] + + mov [di].firstCount, cx ; remember the first count. + mov [di].handle, bx ; remember the handle. + add di, 6 ; ES:DI -> _pktRxBuf[n].destinAdr + pop ds + popf + retf ; far return to driver with ES:DI + + align 4 +@dump: inc _pktDrop[0] ; discard the packet on 1st call + adc _pktDrop[2], 0 ; increment packets lost + +@skip: xor di, di ; return ES:DI = NIL pointer + xor ax, ax + mov es, ax + pop ds + popf + retf + + align 4 +@post: or si, si ; DS:SI->_pktRxBuf[n][n].destinAdr + jz @discard ; make sure we don't use NULL-pointer + + sub si, 6 ; DS:SI -> _pktRxBuf[n].destinAdr + ; + ; push si + ; push [si].firstCount + ; call bpf_filter_match ; run the filter here some day? + ; add sp, 4 + ; cmp ax, 0 + ; je @discard + + mov [si].secondCount, cx + mov ax, newInOffset + mov _rxInOfs, ax ; update _pktRxBuf input offset + + align 4 +@discard:pop ds + popf + retf + +_pktRxEnd db 0 ; marker for end of r-mode code/data + +_TEXT ENDS + +END diff --git a/msdos/pkt_rx1.s b/msdos/pkt_rx1.s index 98eafafc70de..654e6577790a 100644 --- a/msdos/pkt_rx1.s +++ b/msdos/pkt_rx1.s @@ -7,7 +7,7 @@ ; %define ETH_MTU 1500 ; max data size on Ethernet %define ETH_MIN 60 ; min/max total frame size -%define ETH_MAX (ETH_MTU+2*6+2) +%define ETH_MAX (ETH_MTU+2*6+2) ; =1514 %define NUM_RX_BUF 32 ; # of RX element buffers %define RX_SIZE (ETH_MAX+6) ; sizeof(RX_ELEMENT) = 1514+6 %idefine offset diff --git a/msdos/pktdrvr.c b/msdos/pktdrvr.c index 360c89313993..37fc8a41e776 100644 --- a/msdos/pktdrvr.c +++ b/msdos/pktdrvr.c @@ -209,7 +209,7 @@ LOCAL struct { /* internal statistics */ DWORD tooLarge; /* size > ETH_MAX */ DWORD badSync; /* count_1 != count_2 */ DWORD wrongHandle; /* upcall to wrong handle */ - } intStat; + } intStat; /***************************************************************************/ @@ -248,7 +248,7 @@ PUBLIC const char *PktGetErrorStr (int errNum) PUBLIC const char *PktGetClassName (WORD class) { switch (class) - { + { case PD_ETHER: return ("DIX-Ether"); case PD_PRONET10: @@ -1036,7 +1036,7 @@ LOCAL __inline void PktFreeMem (void) /**************************************************************************/ PUBLIC BOOL PktExitDriver (void) -{ +{ if (pktInfo.handle) { if (!PktSetReceiverMode(PDRX_BROADCAST)) diff --git a/msdos/pktdrvr.h b/msdos/pktdrvr.h index 50b7b4b58071..3e0cfe017b4f 100644 --- a/msdos/pktdrvr.h +++ b/msdos/pktdrvr.h @@ -79,7 +79,7 @@ typedef struct { DWORD outErrors; /* # of transmission errors */ DWORD lost; /* # of packets lost (RX) */ } PKT_STAT; - + typedef struct { ETHER destin; diff --git a/msdos/readme.dos b/msdos/readme.dos index 913c4e697042..990a2e8a63d1 100644 --- a/msdos/readme.dos +++ b/msdos/readme.dos @@ -10,19 +10,21 @@ supported: - GNU C 2.7+ with djgpp 2.01+ DOS extender - Watcom C 11.x with DOS4GW extender -Note: the files in the libpcap.zip contains short trucated filenames. +Note: the files in the libpcap.zip contains short truncated filenames. So for djgpp to work with these, disable the use of long file names by - setting "LFN=n" in the environment. + setting "LFN=n" in the environment. On the other hand, if you get libpcap + from Github or the official libpcap.tar.gz, some filenames are beyond 8+3. + In this case set "LFN=y". Files specific to DOS are pcap-dos.[ch] and the assembly and C files in -the MSDOS sub-directory. Remember to built lipcap libraries from the top +the MSDOS sub-directory. Remember to built the libpcap library from the top install directory. And not from the MSDOS sub-directory. Note for djgpp users: If you got the libpcap from the official site www.tcpdump, then that distribution does NOT contain any sources for building 32-bit drivers. Instead get the full version at - http://www.bgnett.no/~giva/pcap/libpcap.zip + http://www.watt-32.net/pcap/libpcap.zip and set "USE_32BIT_DRIVERS = 1" in msdos\common.dj. @@ -49,30 +51,28 @@ The following packages and tools must be present for all targets. receive network data. It's mostly used to access the 'hosts' file and other <netdb.h> features. Get 'watt32s*.zip' at: - http://www.bgnett.no/~giva/ + http://www.watt-32.net 2. Exception handler and disassember library (libexc.a) is needed if "USE_EXCEPT = 1" in common.dj. Available at: - http://www.bgnett.no/~giva/misc/exc_dx07.zip + http://www.watt-32.net/misc/exc_dx07.zip 3. Flex & Bison is used to generate parser for the filter handler pcap_compile: - - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/flx254b.zip - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/bsn128b.zip + ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/flx254b.zip + ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/bsn241b.zip 4. NASM assembler v 0.98 or later is required when building djgpp and Watcom targets: - - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2tk/nasm098p.zip + http://www.nasm.us/ 5. sed (Stream Editor) is required for doing `make depend'. - It's available at - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/sed*.zip + It's available at: + ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/sed422b.zip - A touch tool to update the time-stamp of a file. E.g. - ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/grep*.zip + A touch tool to update the time-stamp of a file. E.g.: + ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/grep29b.zip 6. For djgpp rm.exe and cp.exe are required. These should already be part of your djgpp installation. Also required (experimental at the @@ -121,10 +121,17 @@ Follow these steps in building libpcap: Note: Code in `USE_NDIS2' does not work at the moment. -4. The resulting libraries are put in current directory. There's no - test-program for `libpcap'. Linking the library with `tcpdump' is - the ultimate test anyway. +4. The resulting library is put in current directory. There's some + test-program for `libpcap': `filtertest.exe', `findalldevstest.exe', + `nonblocktest.exe' and `opentest.exe'. + + But linking the library with `tcpdump' is the ultimate test. DOS/djgpp + should now hopefully be a supported target. Get the sources at: + http://www.tcpdump.org/ + or + https://github.com/the-tcpdump-group/tcpdump/ + (click on the 'Download ZIP' on the right side of that page.) Extensions to libpcap @@ -132,14 +139,14 @@ Extensions to libpcap I've included some extra functions to DOS-libpcap: - `pcap_config_hook (const char *name, const char *value)' + `pcap_config_hook (const char *keyword, const char *value)' : Allows an application to set values of internal libpcap variables. - `name' is typically a left-side keyword with an associated `value' - that is called from application's configure process (see tcpdump's - config.c file). libpcap keeps a set of tables that are searched for - a name/value match. Currently only used to set debug-levels and - parameters for the 32-bit network drivers. + `keyword' and an associated `value' should be present in the `debug_tab[]' + array in pcap-dos.c (currently only used to set debug-levels and parameters + for the 32-bit network drivers.) Thus an application using DOS-libpcap can + override the default value during it's configure process (see tcpdump's + msdos/config.c file for an extended example). `pcap_set_wait (pcap_t *, void (*)(void), int)' : @@ -153,8 +160,7 @@ I've included some extra functions to DOS-libpcap: Happy sniffing ! -Gisle Vanem <giva@bgnett.no> - <gvanem@broadpark.no> +Gisle Vanem <gvanem@yahoo.no> -October 1999, 2004 +October 1999, 2004, 2006, 2013 |