]> The Tcpdump Group git mirrors - tcpdump/blob - tcpdump-stdinc.h
Give the file an SCCS and RCS ID.
[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 * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.3 2002-08-05 07:47:24 guy Exp $ (LBL)
22 */
23
24 /*
25 * Include the appropriate OS header files on Windows and various flavors
26 * of UNIX, and also define some additional items and include various
27 * non-OS header files on Windows, and; this isolates most of the platform
28 * differences to this one file.
29 */
30
31 #ifdef WIN32
32
33 #include <winsock2.h>
34 #include "bittypes.h"
35 #include <time.h>
36 #include <io.h>
37 #include "IP6_misc.h"
38 #include <fcntl.h>
39
40 #ifdef __MINGW32__
41 int* _errno();
42 #define errno (*_errno())
43
44 #define INET_ADDRSTRLEN 16
45 #define INET6_ADDRSTRLEN 46
46
47 #endif /* __MINGW32__ */
48
49 #ifndef caddr_t
50 typedef char* caddr_t;
51 #endif /* caddr_t */
52
53 #define MAXHOSTNAMELEN 64
54 #define NI_MAXHOST 1025
55 #define IPPROTO_EGP 8 /* Exterior Gateway Protocol */
56 #define snprintf _snprintf
57 #define vsnprintf _vsnprintf
58 #define RETSIGTYPE void
59
60 #ifndef __MINGW32__
61 #define isascii __isascii
62 #define toascii __toascii
63 #define stat _stat
64 #define open _open
65 #define fstat _fstat
66 #define read _read
67 #define O_RDONLY _O_RDONLY
68
69 typedef short ino_t;
70 #endif /* __MINGW32__ */
71
72 #else /* WIN32 */
73
74 #include <ctype.h>
75 #include <unistd.h>
76 #include <netdb.h>
77 #include <sys/param.h>
78 #include <sys/types.h> /* concession to AIX */
79 #include <sys/time.h>
80 #include <sys/socket.h>
81 #include <netinet/in.h>
82
83 #ifdef TIME_WITH_SYS_TIME
84 #include <time.h>
85 #endif
86
87 #include <arpa/inet.h>
88
89 #endif /* WIN32 */
90
91 #ifdef INET6
92 #include "ip6.h"
93 #endif