]> The Tcpdump Group git mirrors - libpcap/commitdiff
remove additional ifdefs based upon MSDOS
authorMichael Richardson <[email protected]>
Wed, 26 Jul 2023 21:01:58 +0000 (17:01 -0400)
committerMichael Richardson <[email protected]>
Wed, 26 Jul 2023 21:04:08 +0000 (17:04 -0400)
INSTALL.md
gencode.c
optimize.c
pcap-int.h
pcap.c
savefile.c
sf-pcap.c

index f3986b4e154d004678b8e7e059c433cdc131eb95..30229cb35f4be94458955161820d8a80c2612599 100644 (file)
@@ -280,7 +280,7 @@ in `/usr/include/sys/dlpi.h`, and find the corresponding value.
        pcap-dbus.c         - D-Bus capture support
        pcap-dbus.h         - D-Bus capture support
        pcap-dlpi.c         - Data Link Provider Interface support
-       pcap-dos.c          - removed in 2023, after libpcap 1.9
+       pcap-dos.c          - removed in 2023, after libpcap 1.10
        pcap-dpdk.c         - DPDK device support
        pcap-dpdk.h         - DPDK device support
        pcap-enet.c         - enet support
index 501354bba00102694176ba735604f869bd769b66..8f055492e612f82f9b5d4bdcd484edda0127e5c8 100644 (file)
--- a/gencode.c
+++ b/gencode.c
 #include <stdarg.h>
 #include <stdio.h>
 
-#ifdef MSDOS
-#include "pcap-dos.h"
-#endif
-
 #include "pcap-int.h"
 
 #include "extract.h"
index 6adcbc1233edf9beb0d30f116679c5b8a6104f72..f22a092d0099a20d2b39e14ddf760cfbf1674597 100644 (file)
@@ -141,22 +141,6 @@ lowest_set_bit(int mask)
                abort();        /* mask is zero */
        return (u_int)bit;
 }
-#elif (defined(MSDOS) && defined(__WATCOMC__)) || defined(STRINGS_H_DECLARES_FFS)
-  /*
-   * MS-DOS with Watcom C, which has <strings.h> and declares ffs() there,
-   * or some other platform (UN*X conforming to a sufficient recent version
-   * of the Single UNIX Specification).
-   */
-  #include <strings.h>
-  #define lowest_set_bit(mask) (u_int)((ffs((mask)) - 1))
-#elif (defined(MSDOS) && defined(__DJGPP__)) || defined(__hpux)
-  /*
-   * MS-DOS with DJGPP or HP-UX 11i v3, which declare ffs() in <string.h>,
-   * which we've already included.  Place this branch after the <strings.h>
-   * branch, in case a later release of HP-UX makes the declaration available
-   * via the standard header.
-   */
-  #define lowest_set_bit(mask) ((u_int)(ffs((mask)) - 1))
 #else
 /*
  * None of the above.
index 489482387ec74f37227382be00dfc079077c0f4c..d1cf195e7b53183e588754adcfc2cff530cf5154 100644 (file)
 
 #include <pcap/pcap.h>
 
-#ifdef MSDOS
-  #include <fcntl.h>
-  #include <io.h>
-#endif
-
 #include "varattrs.h"
 #include "fmtutils.h"
 
@@ -293,7 +288,6 @@ struct pcap {
         */
        int bpf_codegen_flags;
 
-#if !defined(_WIN32) && !defined(MSDOS)
        int selectable_fd;      /* FD on which select()/poll()/epoll_wait()/kevent()/etc. can be done */
 
        /*
@@ -308,7 +302,6 @@ struct pcap {
         * prepared not to see any packets from the attempt.
         */
        const struct timeval *required_select_timeout;
-#endif
 
        /*
         * Placeholder for filter code if bpf not in kernel.
@@ -469,7 +462,7 @@ int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);
 /*
  * Routines that most pcap implementations can use for non-blocking mode.
  */
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32)
 int    pcap_getnonblock_fd(pcap_t *);
 int    pcap_setnonblock_fd(pcap_t *p, int);
 #endif
@@ -533,7 +526,7 @@ struct pcap_if_list;
 typedef struct pcap_if_list pcap_if_list_t;
 typedef int (*get_if_flags_func)(const char *, bpf_u_int32 *, char *);
 int    pcap_platform_finddevs(pcap_if_list_t *, char *);
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32)
 int    pcap_findalldevs_interfaces(pcap_if_list_t *, char *,
            int (*)(const char *), get_if_flags_func);
 #endif
diff --git a/pcap.c b/pcap.c
index 2db694a23418ef22c004cd52f2f93568e632ad58..d8b0e77505c74d3ad5b778df2fb3226651d36cd0 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -38,9 +38,7 @@
 #include <pcap-types.h>
 #ifndef _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
@@ -71,10 +69,6 @@ struct rtentry;              /* declarations in <net/if.h> */
 #include "os-proto.h"
 #endif
 
-#ifdef MSDOS
-#include "pcap-dos.h"
-#endif
-
 #include "pcap-int.h"
 
 #include "optimize.h"
@@ -1508,13 +1502,10 @@ pcap_freealldevs(pcap_if_t *alldevs)
  * it actually returns the names of all interfaces, with a NUL separator
  * between them; some callers may depend on that.
  *
- * MS-DOS has its own pcap_lookupdev(), but that might be useful only
- * as an optimization.
- *
  * In all other cases, we just use pcap_findalldevs() to get a list of
  * devices, and pick from that list.
  */
-#if !defined(HAVE_PACKET32) && !defined(MSDOS)
+#if !defined(HAVE_PACKET32) 
 /*
  * Return the name of a network interface attached to the system, or NULL
  * if none can be found.  The interface must be configured up; the
@@ -1585,9 +1576,9 @@ pcap_lookupdev(char *errbuf)
        pcap_freealldevs(alldevs);
        return (ret);
 }
-#endif /* !defined(HAVE_PACKET32) && !defined(MSDOS) */
+#endif /* !defined(HAVE_PACKET32) */
 
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32) 
 /*
  * We don't just fetch the entire list of devices, search for the
  * particular device, and use its first IPv4 address, as that's too
@@ -1709,7 +1700,7 @@ pcap_lookupnet(const char *device, bpf_u_int32 *netp, bpf_u_int32 *maskp,
        *netp &= *maskp;
        return (0);
 }
-#endif /* !defined(_WIN32) && !defined(MSDOS) */
+#endif /* !defined(_WIN32) */
 
 #ifdef ENABLE_REMOTE
 #include "pcap-rpcap.h"
@@ -2512,10 +2503,8 @@ pcap_alloc_pcap_t(char *ebuf, size_t total_size, size_t private_offset)
        p->handle = INVALID_HANDLE_VALUE;       /* not opened yet */
 #else /* _WIN32 */
        p->fd = -1;     /* not opened yet */
-#ifndef MSDOS
        p->selectable_fd = -1;
        p->required_select_timeout = NULL;
-#endif /* MSDOS */
 #endif /* _WIN32 */
 
        /*
@@ -3565,7 +3554,7 @@ pcap_fileno(pcap_t *p)
 }
 #endif /* _WIN32 */
 
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32) 
 int
 pcap_get_selectable_fd(pcap_t *p)
 {
@@ -3616,7 +3605,7 @@ pcap_getnonblock(pcap_t *p, char *errbuf)
  * Get the current non-blocking mode setting, under the assumption that
  * it's just the standard POSIX non-blocking flag.
  */
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32) 
 int
 pcap_getnonblock_fd(pcap_t *p)
 {
@@ -3656,7 +3645,7 @@ pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf)
        return (ret);
 }
 
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32) 
 /*
  * Set non-blocking mode, under the assumption that it's just the
  * standard POSIX non-blocking flag.  (This can be called by the
@@ -4094,7 +4083,7 @@ pcap_cleanup_live_common(pcap_t *p)
                p->tstamp_precision_count = 0;
        }
        pcap_freecode(&p->fcode);
-#if !defined(_WIN32) && !defined(MSDOS)
+#if !defined(_WIN32) 
        if (p->fd >= 0) {
                close(p->fd);
                p->fd = -1;
index 3bf2e77ba11f69be8cdf8f0be71aa27c6b3b81b2..1fc7e0116df3f257073402a4aa19847cc0f382d3 100644 (file)
@@ -77,12 +77,6 @@ static pcap_t *pcap_fopen_offline_with_tstamp_precision(FILE *, u_int, char *);
  */
 #if defined(_WIN32)
   #define SET_BINMODE(f)  _setmode(_fileno(f), _O_BINARY)
-#elif defined(MSDOS)
-  #if defined(__HIGHC__)
-  #define SET_BINMODE(f)  setmode(f, O_BINARY)
-  #else
-  #define SET_BINMODE(f)  setmode(fileno(f), O_BINARY)
-  #endif
 #endif
 
 static int
index 54b5c8513142ea500b400ff1a0c6d18c698d805b..2c31077323ab2a3db9345b7ce824a27e8952961a 100644 (file)
--- a/sf-pcap.c
+++ b/sf-pcap.c
  */
 #if defined(_WIN32)
   #define SET_BINMODE(f)  _setmode(_fileno(f), _O_BINARY)
-#elif defined(MSDOS)
-  #if defined(__HIGHC__)
-  #define SET_BINMODE(f)  setmode(f, O_BINARY)
-  #else
-  #define SET_BINMODE(f)  setmode(fileno(f), O_BINARY)
-  #endif
 #endif
 
 /*