Deleted Added
full compact
tcpdump-stdinc.h (190207) tcpdump-stdinc.h (214478)
1/*
2 * Copyright (c) 2002 - 2003
3 * NetGroup, Politecnico di Torino (Italy)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 *
1/*
2 * Copyright (c) 2002 - 2003
3 * NetGroup, Politecnico di Torino (Italy)
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 15 unchanged lines hidden (view full) ---

24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 *
31 *
32 * $FreeBSD: head/contrib/tcpdump/tcpdump-stdinc.h 190207 2009-03-21 18:30:25Z rpaulo $
33 * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.17 2006-05-19 17:55:34 hannes Exp $ (LBL)
32 * @(#) $Header: /tcpdump/master/tcpdump/tcpdump-stdinc.h,v 1.18 2007-11-24 18:13:33 mcr Exp $ (LBL)
34 */
35
36/*
37 * Include the appropriate OS header files on Windows and various flavors
38 * of UNIX, and also define some additional items and include various
39 * non-OS header files on Windows, and; this isolates most of the platform
40 * differences to this one file.
41 */

--- 9 unchanged lines hidden (view full) ---

51#include "bittypes.h"
52#include <ctype.h>
53#include <time.h>
54#include <io.h>
55#include <fcntl.h>
56#include <sys/types.h>
57#include <net/netdb.h> /* in wpcap's Win32/include */
58
33 */
34
35/*
36 * Include the appropriate OS header files on Windows and various flavors
37 * of UNIX, and also define some additional items and include various
38 * non-OS header files on Windows, and; this isolates most of the platform
39 * differences to this one file.
40 */

--- 9 unchanged lines hidden (view full) ---

50#include "bittypes.h"
51#include <ctype.h>
52#include <time.h>
53#include <io.h>
54#include <fcntl.h>
55#include <sys/types.h>
56#include <net/netdb.h> /* in wpcap's Win32/include */
57
58#ifndef NBBY
59#define NBBY 8
60#endif
61
59#if !defined(__MINGW32__) && !defined(__WATCOMC__)
60#undef toascii
61#define isascii __isascii
62#define toascii __toascii
63#define stat _stat
64#define open _open
65#define fstat _fstat
66#define read _read

--- 72 unchanged lines hidden (view full) ---

139 #define FOPEN_WRITE_BIN "wb"
140#else
141 #define FOPEN_READ_TXT "r"
142 #define FOPEN_READ_BIN FOPEN_READ_TXT
143 #define FOPEN_WRITE_TXT "w"
144 #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT
145#endif
146
62#if !defined(__MINGW32__) && !defined(__WATCOMC__)
63#undef toascii
64#define isascii __isascii
65#define toascii __toascii
66#define stat _stat
67#define open _open
68#define fstat _fstat
69#define read _read

--- 72 unchanged lines hidden (view full) ---

142 #define FOPEN_WRITE_BIN "wb"
143#else
144 #define FOPEN_READ_TXT "r"
145 #define FOPEN_READ_BIN FOPEN_READ_TXT
146 #define FOPEN_WRITE_TXT "w"
147 #define FOPEN_WRITE_BIN FOPEN_WRITE_TXT
148#endif
149
150#if defined(__GNUC__) && defined(__i386__) && !defined(__ntohl)
151 #undef ntohl
152 #undef ntohs
153 #undef htonl
154 #undef htons
155
156 static __inline__ unsigned long __ntohl (unsigned long x);
157 static __inline__ unsigned short __ntohs (unsigned short x);
158
159 #define ntohl(x) __ntohl(x)
160 #define ntohs(x) __ntohs(x)
161 #define htonl(x) __ntohl(x)
162 #define htons(x) __ntohs(x)
163
164 static __inline__ unsigned long __ntohl (unsigned long x)
165 {
166 __asm__ ("xchgb %b0, %h0\n\t" /* swap lower bytes */
167 "rorl $16, %0\n\t" /* swap words */
168 "xchgb %b0, %h0" /* swap higher bytes */
169 : "=q" (x) : "0" (x));
170 return (x);
171 }
172
173 static __inline__ unsigned short __ntohs (unsigned short x)
174 {
175 __asm__ ("xchgb %b0, %h0" /* swap bytes */
176 : "=q" (x) : "0" (x));
177 return (x);
178 }
179#endif
180
147#ifndef INET_ADDRSTRLEN
148#define INET_ADDRSTRLEN 16
149#endif
150
151#ifndef TRUE
152#define TRUE 1
153#endif
154
155#ifndef FALSE
156#define FALSE 0
157#endif
158
159#endif /* tcpdump_stdinc_h */
181#ifndef INET_ADDRSTRLEN
182#define INET_ADDRSTRLEN 16
183#endif
184
185#ifndef TRUE
186#define TRUE 1
187#endif
188
189#ifndef FALSE
190#define FALSE 0
191#endif
192
193#endif /* tcpdump_stdinc_h */