forked from gvanem/libpcap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpcap-dos.h
109 lines (86 loc) · 2.11 KB
/
pcap-dos.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Internal details for libpcap on DOS.
* 32-bit targets: djgpp, Pharlap or DOS4GW.
*/
#ifndef __PCAP_DOS_H
#define __PCAP_DOS_H
#ifdef __DJGPP__
#include <pc.h> /* simple non-conio kbhit */
#else
#include <conio.h>
#endif
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef BYTE ETHER[6];
#define ETH_ALEN sizeof(ETHER) /* Ether address length */
#define ETH_HLEN (2*ETH_ALEN+2) /* Ether header length */
#define ETH_MTU 1500
#define ETH_MIN 60
#define ETH_MAX (ETH_MTU+ETH_HLEN)
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
#define PHARLAP 1
#define DJGPP 2
#define DOS4GW 4
#ifdef __DJGPP__
#undef DOSX
#define DOSX DJGPP
#endif
#ifdef __WATCOMC__
#undef DOSX
#define DOSX DOS4GW
#endif
#ifdef __HIGHC__
#include <pharlap.h>
#undef DOSX
#define DOSX PHARLAP
#define inline
#else
typedef unsigned int UINT;
#endif
#if defined(__GNUC__) || defined(__HIGHC__)
typedef unsigned long long uint64;
typedef unsigned long long QWORD;
#endif
#if defined(__WATCOMC__)
typedef unsigned __int64 uint64;
typedef unsigned __int64 QWORD;
#endif
#define ARGSUSED(x) (void) x
#if defined (__SMALL__) || defined(__LARGE__)
#define DOSX 0
#elif !defined(DOSX)
#error DOSX not defined; 1 = PharLap, 2 = djgpp, 4 = DOS4GW
#endif
#ifdef __HIGHC__
#define min(a,b) _min(a,b)
#define max(a,b) _max(a,b)
#endif
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) ((a) < (b) ? (b) : (a))
#endif
#if !defined(_U_) && defined(__GNUC__)
#define _U_ __attribute__((unused))
#endif
#ifndef _U_
#define _U_
#endif
extern int pcap_pkt_debug;
extern void _w32_os_yield (void); /* Watt-32's misc.c */
#ifdef NDEBUG
#define PCAP_ASSERT(x) ((void)0)
#else
extern void pcap_assert (const char *what, const char *file, unsigned line);
#define PCAP_ASSERT(x) do { \
if (!(x)) \
pcap_assert (#x, __FILE__, __LINE__); \
} while (0)
#endif
#endif /* __PCAP_DOS_H */