]> The Tcpdump Group git mirrors - tcpdump/blob - tcpdump-stdinc.h
Add Loris Digioanni, as he's credited as the main programmer on the
[tcpdump] / tcpdump-stdinc.h
1 /*
2 * Copyright (c) 2002
3 * Politecnico di Torino. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that: (1) source code distributions
7 * retain the above copyright notice and this paragraph in its entirety, (2)
8 * distributions including binary code include the above copyright notice and
9 * this paragraph in its entirety in the documentation or other materials
10 * provided with the distribution, and (3) all advertising materials mentioning
11 * features or use of this software display the following acknowledgement:
12 * ``This product includes software developed by the Politecnico
13 * di Torino, and its contributors.'' Neither the name of
14 * the University nor the names of its contributors may be used to endorse
15 * or promote products derived from this software without specific prior
16 * written permission.
17 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 */
21
22 /*
23 * Include the appropriate OS header files on Windows and various flavors
24 * of UNIX, and also define some additional items and include various
25 * non-OS header files on Windows, and; this isolates most of the platform
26 * differences to this one file.
27 */
28
29 #ifdef WIN32
30
31 #include <winsock2.h>
32 #include "bittypes.h"
33 #include <time.h>
34 #include <io.h>
35 #include "IP6_misc.h"
36 #include <fcntl.h>
37
38 #ifdef __MINGW32__
39 int* _errno();
40 #define errno (*_errno())
41
42 #define INET_ADDRSTRLEN 16
43 #define INET6_ADDRSTRLEN 46
44
45 #endif /* __MINGW32__ */
46
47 #ifndef caddr_t
48 typedef char* caddr_t;
49 #endif /* caddr_t */
50
51 #define MAXHOSTNAMELEN 64
52 #define NI_MAXHOST 1025
53 #define IPPROTO_EGP 8 /* Exterior Gateway Protocol */
54 #define snprintf _snprintf
55 #define vsnprintf _vsnprintf
56 #define RETSIGTYPE void
57
58 #ifndef __MINGW32__
59 #define isascii __isascii
60 #define toascii __toascii
61 #define stat _stat
62 #define open _open
63 #define fstat _fstat
64 #define read _read
65 #define O_RDONLY _O_RDONLY
66
67 typedef short ino_t;
68 #endif /* __MINGW32__ */
69
70 #else /* WIN32 */
71
72 #include <ctype.h>
73 #include <unistd.h>
74 #include <netdb.h>
75 #include <sys/param.h>
76 #include <sys/types.h> /* concession to AIX */
77 #include <sys/time.h>
78 #include <sys/socket.h>
79 #include <netinet/in.h>
80
81 #ifdef TIME_WITH_SYS_TIME
82 #include <time.h>
83 #endif
84
85 #include <arpa/inet.h>
86
87 #endif /* WIN32 */
88
89 #ifdef INET6
90 #include "ip6.h"
91 #endif