Permalink
Browse files

From Gisle Vanem: MS-DOS support.

  • Loading branch information...
1 parent f912cc3 commit f8a76d1d7613b5c4708e8ed8cfbdd19906672bba @yuguy yuguy committed Dec 18, 2004
Showing with 6,168 additions and 39 deletions.
  1. +15 −0 FILES
  2. +4 −1 INSTALL.txt
  3. +5 −1 gencode.c
  4. +8 −6 inet.c
  5. +43 −0 msdos/bin2c.c
  6. +79 −0 msdos/common.dj
  7. +184 −0 msdos/makefile
  8. +147 −0 msdos/makefile.dj
  9. +131 −0 msdos/makefile.wc
  10. +860 −0 msdos/ndis2.c
  11. +559 −0 msdos/ndis2.h
  12. +188 −0 msdos/ndis_0.asm
  13. +197 −0 msdos/pkt_rx0.asm
  14. +155 −0 msdos/pkt_rx1.s
  15. +1,437 −0 msdos/pktdrvr.c
  16. +153 −0 msdos/pktdrvr.h
  17. +156 −0 msdos/readme.dos
  18. +7 −1 optimize.c
  19. +6 −1 pcap-bpf.h
  20. +1,473 −0 pcap-dos.c
  21. +227 −0 pcap-dos.h
  22. +12 −2 pcap-int.h
  23. +42 −8 pcap.c
  24. +59 −11 pcap.h
  25. +21 −8 savefile.c
View
@@ -53,6 +53,19 @@ lbl/os-ultrix4.h
llc.h
missing/snprintf.c
mkdep
+msdos/bin2c.c
+msdos/common.dj
+msdos/makefile
+msdos/makefile.dj
+msdos/makefile.wc
+msdos/ndis2.c
+msdos/ndis2.h
+msdos/ndis_0.asm
+msdos/pkt_rx0.asm
+msdos/pkt_rx1.s
+msdos/pktdrvr.c
+msdos/pktdrvr.h
+msdos/readme.dos
nametoaddr.c
nlpid.h
optimize.c
@@ -63,6 +76,8 @@ pcap-bpf.h
pcap-dag.c
pcap-dag.h
pcap-dlpi.c
+pcap-dos.c
+pcap-dos.h
pcap-enet.c
pcap-int.h
pcap-linux.c
View
@@ -1,4 +1,4 @@
-@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.11 2004-10-18 09:51:02 guy Exp $ (LBL)
+@(#) $Header: /tcpdump/master/libpcap/INSTALL.txt,v 1.12 2004-12-18 08:52:08 guy Exp $ (LBL)
To build libpcap, run "./configure" (a shell script). The configure
script will determine your system attributes and generate an
@@ -341,6 +341,7 @@ lbl/os-*.h - OS-dependent defines and prototypes
llc.h - 802.2 LLC SAP definitions
missing/* - replacements for missing library functions
mkdep - construct Makefile dependency list
+msdos/* - drivers for MS-DOS capture support
nametoaddr.c - hostname to address routines
nlpid.h - OSI network layer protocol identifier definitions
net - symlink to bpf/net
@@ -351,6 +352,8 @@ pcap-bpf.h - BPF definitions
pcap-dag.c - Endace DAG device capture support
pcap-dag.h - Endace DAG device capture support
pcap-dlpi.c - Data Link Provider Interface support
+pcap-dos.c - MS-DOS capture support
+pcap-dos.h - headers for MS-DOS capture support
pcap-enet.c - enet support
pcap-int.h - internal libpcap definitions
pcap-linux.c - Linux packet socket support
View
@@ -21,7 +21,7 @@
*/
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.214 2004-12-17 20:16:44 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.215 2004-12-18 08:52:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -58,6 +58,10 @@ static const char rcsid[] _U_ =
#include <setjmp.h>
#include <stdarg.h>
+#ifdef MSDOS
+#include "pcap-dos.h"
+#endif
+
#include "pcap-int.h"
#include "ethertype.h"
View
@@ -34,7 +34,7 @@
#ifndef lint
static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.62 2004-12-17 20:32:35 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.63 2004-12-18 08:52:09 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -46,7 +46,9 @@ static const char rcsid[] _U_ =
#else /* WIN32 */
#include <sys/param.h>
+#ifndef MSDOS
#include <sys/file.h>
+#endif
#include <sys/ioctl.h>
#include <sys/socket.h>
#ifdef HAVE_SYS_SOCKIO_H
@@ -65,9 +67,9 @@ struct rtentry; /* declarations in <net/if.h> */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef WIN32
+#if !defined(WIN32) && !defined(__BORLANDC__)
#include <unistd.h>
-#endif /* WIN32 */
+#endif /* !WIN32 && !__BORLANDC__ */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#else
@@ -446,7 +448,7 @@ pcap_freealldevs(pcap_if_t *alldevs)
}
}
-#ifndef WIN32
+#if !defined(WIN32) && !defined(MSDOS)
/*
* Return the name of a network interface attached to the system, or NULL
@@ -570,7 +572,7 @@ pcap_lookupnet(device, netp, maskp, errbuf)
return (0);
}
-#else /* WIN32 */
+#elif defined(WIN32)
/*
* Return the name of a network interface attached to the system, or NULL
@@ -696,4 +698,4 @@ pcap_lookupnet(device, netp, maskp, errbuf)
return (0);
}
-#endif /* WIN32 */
+#endif /* !WIN32 && !MSDOS */
View
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <time.h>
+
+static void Abort (char *fmt,...)
+{
+ va_list args;
+ va_start (args, fmt);
+ vfprintf (stderr, fmt, args);
+ va_end (args);
+ exit (1);
+}
+
+int main (int argc, char **argv)
+{
+ FILE *inFile;
+ FILE *outFile = stdout;
+ time_t now = time (NULL);
+ int ch, i;
+
+ if (argc != 2)
+ Abort ("Usage: %s bin-file [> result]", argv[0]);
+
+ if ((inFile = fopen(argv[1],"rb")) == NULL)
+ Abort ("Cannot open %s\n", argv[1]);
+
+ fprintf (outFile,
+ "/* data statements for file %s at %.24s */\n"
+ "/* Generated by BIN2C, G.Vanem 1995 */\n",
+ argv[1], ctime(&now));
+
+ i = 0;
+ while ((ch = fgetc(inFile)) != EOF)
+ {
+ if (i++ % 12 == 0)
+ fputs ("\n ", outFile);
+ fprintf (outFile, "0x%02X,", ch);
+ }
+ fputc ('\n', outFile);
+ fclose (inFile);
+ return (0);
+}
View
@@ -0,0 +1,79 @@
+#
+# Common defines for libpcap and 16/32-bit network drivers (djgpp)
+#
+
+.SUFFIXES: .exe .wlm .dxe .l .y
+.PHONY: check_gcclib
+
+default: check_gcclib all
+
+GCCLIB = /djgpp/lib/gcc-lib/djgpp/3.31
+MAKEFILE = Makefile.dj
+
+#
+# DLX 2.91+ lib. Change path to suite.
+# Not used anymore. Uses DXE3 now.
+#
+# DLX_LIB = $(DJDIR)/contrib/dlx.291/libdlx.a
+# DLX_LINK = $(DJDIR)/bin/dlxgen.exe
+
+WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
+
+
+ifeq ($(wildcard $(GCCLIB)/libgcc.a),)
+check_gcclib:
+ @echo libgcc.a not found. Set \"$(GCCLIB)\" to \"/djgpp/lib/gcc-lib/djgpp/3.X\"
+endif
+
+
+#
+# Include 32-bit driver support
+#
+USE_32BIT_DRIVERS = 1
+
+#
+# Use loadable driver modules instead of statically linking
+# all drivers.
+#
+USE_32BIT_MODULES = 0
+
+#
+# Put interrupt sensitive code/data in locked sections
+# Do `make clean' in all affected directories after changing this.
+#
+USE_SECTION_LOCKING = 0
+
+#
+# Set to 1 to use exception handler lib (only for me)
+#
+USE_EXCEPT = 0
+
+CC = gcc.exe
+LD = ld.exe
+ASM = nasm.exe -fbin -dDEBUG
+YACC = bison.exe
+LEX = flex.exe
+
+CFLAGS = -g -gcoff -O2 -Wall -I. -I$(WATT32_ROOT)/inc
+
+ifeq ($(USE_EXCEPT),1)
+ CFLAGS += -DUSE_EXCEPT
+ EXC_LIB = d:/prog/mw/except/lib/libexc.a
+endif
+
+ifeq ($(USE_SECTION_LOCKING),1)
+ CFLAGS += -DUSE_SECTION_LOCKING
+endif
+
+ifeq ($(USE_32BIT_DRIVERS),1)
+ CFLAGS += -DUSE_32BIT_DRIVERS
+endif
+
+%.o: %.c
+ $(CC) -c $(CFLAGS) $<
+ @echo
+
+%.o: %.s
+ $(CC) -c $(CFLAGS) -x assembler-with-cpp -o $@ $<
+ @echo
+
Oops, something went wrong. Retry.

0 comments on commit f8a76d1

Please sign in to comment.