Skip to content

Commit 4aa89c4

Browse files
committed
remove additional ifdefs based upon MSDOS
1 parent f4f6fee commit 4aa89c4

File tree

7 files changed

+11
-61
lines changed

7 files changed

+11
-61
lines changed

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ in `/usr/include/sys/dlpi.h`, and find the corresponding value.
280280
pcap-dbus.c - D-Bus capture support
281281
pcap-dbus.h - D-Bus capture support
282282
pcap-dlpi.c - Data Link Provider Interface support
283-
pcap-dos.c - removed in 2023, after libpcap 1.9
283+
pcap-dos.c - removed in 2023, after libpcap 1.10
284284
pcap-dpdk.c - DPDK device support
285285
pcap-dpdk.h - DPDK device support
286286
pcap-enet.c - enet support

gencode.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
#include <stdarg.h>
4444
#include <stdio.h>
4545

46-
#ifdef MSDOS
47-
#include "pcap-dos.h"
48-
#endif
49-
5046
#include "pcap-int.h"
5147

5248
#include "extract.h"

optimize.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,22 +141,6 @@ lowest_set_bit(int mask)
141141
abort(); /* mask is zero */
142142
return (u_int)bit;
143143
}
144-
#elif (defined(MSDOS) && defined(__WATCOMC__)) || defined(STRINGS_H_DECLARES_FFS)
145-
/*
146-
* MS-DOS with Watcom C, which has <strings.h> and declares ffs() there,
147-
* or some other platform (UN*X conforming to a sufficient recent version
148-
* of the Single UNIX Specification).
149-
*/
150-
#include <strings.h>
151-
#define lowest_set_bit(mask) (u_int)((ffs((mask)) - 1))
152-
#elif (defined(MSDOS) && defined(__DJGPP__)) || defined(__hpux)
153-
/*
154-
* MS-DOS with DJGPP or HP-UX 11i v3, which declare ffs() in <string.h>,
155-
* which we've already included. Place this branch after the <strings.h>
156-
* branch, in case a later release of HP-UX makes the declaration available
157-
* via the standard header.
158-
*/
159-
#define lowest_set_bit(mask) ((u_int)(ffs((mask)) - 1))
160144
#else
161145
/*
162146
* None of the above.

pcap-int.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040

4141
#include <pcap/pcap.h>
4242

43-
#ifdef MSDOS
44-
#include <fcntl.h>
45-
#include <io.h>
46-
#endif
47-
4843
#include "varattrs.h"
4944
#include "fmtutils.h"
5045

@@ -293,7 +288,6 @@ struct pcap {
293288
*/
294289
int bpf_codegen_flags;
295290

296-
#if !defined(_WIN32) && !defined(MSDOS)
297291
int selectable_fd; /* FD on which select()/poll()/epoll_wait()/kevent()/etc. can be done */
298292

299293
/*
@@ -308,7 +302,6 @@ struct pcap {
308302
* prepared not to see any packets from the attempt.
309303
*/
310304
const struct timeval *required_select_timeout;
311-
#endif
312305

313306
/*
314307
* Placeholder for filter code if bpf not in kernel.
@@ -469,7 +462,7 @@ int pcap_offline_read(pcap_t *, int, pcap_handler, u_char *);
469462
/*
470463
* Routines that most pcap implementations can use for non-blocking mode.
471464
*/
472-
#if !defined(_WIN32) && !defined(MSDOS)
465+
#if !defined(_WIN32)
473466
int pcap_getnonblock_fd(pcap_t *);
474467
int pcap_setnonblock_fd(pcap_t *p, int);
475468
#endif
@@ -533,7 +526,7 @@ struct pcap_if_list;
533526
typedef struct pcap_if_list pcap_if_list_t;
534527
typedef int (*get_if_flags_func)(const char *, bpf_u_int32 *, char *);
535528
int pcap_platform_finddevs(pcap_if_list_t *, char *);
536-
#if !defined(_WIN32) && !defined(MSDOS)
529+
#if !defined(_WIN32)
537530
int pcap_findalldevs_interfaces(pcap_if_list_t *, char *,
538531
int (*)(const char *), get_if_flags_func);
539532
#endif

pcap.c

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
#include <pcap-types.h>
3939
#ifndef _WIN32
4040
#include <sys/param.h>
41-
#ifndef MSDOS
4241
#include <sys/file.h>
43-
#endif
4442
#include <sys/ioctl.h>
4543
#include <sys/socket.h>
4644
#ifdef HAVE_SYS_SOCKIO_H
@@ -71,10 +69,6 @@ struct rtentry; /* declarations in <net/if.h> */
7169
#include "os-proto.h"
7270
#endif
7371

74-
#ifdef MSDOS
75-
#include "pcap-dos.h"
76-
#endif
77-
7872
#include "pcap-int.h"
7973

8074
#include "optimize.h"
@@ -1508,13 +1502,10 @@ pcap_freealldevs(pcap_if_t *alldevs)
15081502
* it actually returns the names of all interfaces, with a NUL separator
15091503
* between them; some callers may depend on that.
15101504
*
1511-
* MS-DOS has its own pcap_lookupdev(), but that might be useful only
1512-
* as an optimization.
1513-
*
15141505
* In all other cases, we just use pcap_findalldevs() to get a list of
15151506
* devices, and pick from that list.
15161507
*/
1517-
#if !defined(HAVE_PACKET32) && !defined(MSDOS)
1508+
#if !defined(HAVE_PACKET32)
15181509
/*
15191510
* Return the name of a network interface attached to the system, or NULL
15201511
* if none can be found. The interface must be configured up; the
@@ -1585,9 +1576,9 @@ pcap_lookupdev(char *errbuf)
15851576
pcap_freealldevs(alldevs);
15861577
return (ret);
15871578
}
1588-
#endif /* !defined(HAVE_PACKET32) && !defined(MSDOS) */
1579+
#endif /* !defined(HAVE_PACKET32) */
15891580

1590-
#if !defined(_WIN32) && !defined(MSDOS)
1581+
#if !defined(_WIN32)
15911582
/*
15921583
* We don't just fetch the entire list of devices, search for the
15931584
* 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,
17091700
*netp &= *maskp;
17101701
return (0);
17111702
}
1712-
#endif /* !defined(_WIN32) && !defined(MSDOS) */
1703+
#endif /* !defined(_WIN32) */
17131704

17141705
#ifdef ENABLE_REMOTE
17151706
#include "pcap-rpcap.h"
@@ -2512,10 +2503,8 @@ pcap_alloc_pcap_t(char *ebuf, size_t total_size, size_t private_offset)
25122503
p->handle = INVALID_HANDLE_VALUE; /* not opened yet */
25132504
#else /* _WIN32 */
25142505
p->fd = -1; /* not opened yet */
2515-
#ifndef MSDOS
25162506
p->selectable_fd = -1;
25172507
p->required_select_timeout = NULL;
2518-
#endif /* MSDOS */
25192508
#endif /* _WIN32 */
25202509

25212510
/*
@@ -3565,7 +3554,7 @@ pcap_fileno(pcap_t *p)
35653554
}
35663555
#endif /* _WIN32 */
35673556

3568-
#if !defined(_WIN32) && !defined(MSDOS)
3557+
#if !defined(_WIN32)
35693558
int
35703559
pcap_get_selectable_fd(pcap_t *p)
35713560
{
@@ -3616,7 +3605,7 @@ pcap_getnonblock(pcap_t *p, char *errbuf)
36163605
* Get the current non-blocking mode setting, under the assumption that
36173606
* it's just the standard POSIX non-blocking flag.
36183607
*/
3619-
#if !defined(_WIN32) && !defined(MSDOS)
3608+
#if !defined(_WIN32)
36203609
int
36213610
pcap_getnonblock_fd(pcap_t *p)
36223611
{
@@ -3656,7 +3645,7 @@ pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf)
36563645
return (ret);
36573646
}
36583647

3659-
#if !defined(_WIN32) && !defined(MSDOS)
3648+
#if !defined(_WIN32)
36603649
/*
36613650
* Set non-blocking mode, under the assumption that it's just the
36623651
* standard POSIX non-blocking flag. (This can be called by the
@@ -4094,7 +4083,7 @@ pcap_cleanup_live_common(pcap_t *p)
40944083
p->tstamp_precision_count = 0;
40954084
}
40964085
pcap_freecode(&p->fcode);
4097-
#if !defined(_WIN32) && !defined(MSDOS)
4086+
#if !defined(_WIN32)
40984087
if (p->fd >= 0) {
40994088
close(p->fd);
41004089
p->fd = -1;

savefile.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,6 @@ static pcap_t *pcap_fopen_offline_with_tstamp_precision(FILE *, u_int, char *);
7777
*/
7878
#if defined(_WIN32)
7979
#define SET_BINMODE(f) _setmode(_fileno(f), _O_BINARY)
80-
#elif defined(MSDOS)
81-
#if defined(__HIGHC__)
82-
#define SET_BINMODE(f) setmode(f, O_BINARY)
83-
#else
84-
#define SET_BINMODE(f) setmode(fileno(f), O_BINARY)
85-
#endif
8680
#endif
8781

8882
static int

sf-pcap.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@
6161
*/
6262
#if defined(_WIN32)
6363
#define SET_BINMODE(f) _setmode(_fileno(f), _O_BINARY)
64-
#elif defined(MSDOS)
65-
#if defined(__HIGHC__)
66-
#define SET_BINMODE(f) setmode(f, O_BINARY)
67-
#else
68-
#define SET_BINMODE(f) setmode(fileno(f), O_BINARY)
69-
#endif
7064
#endif
7165

7266
/*

0 commit comments

Comments
 (0)