1478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project/*
2511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
3511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
4478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * All rights reserved.
5478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project *
6478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * Redistribution and use in source and binary forms, with or without
7478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * modification, are permitted provided that the following conditions
8478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * are met:
9478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project *
10478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * 1. Redistributions of source code must retain the above copyright
11478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * notice, this list of conditions and the following disclaimer.
12478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * 2. Redistributions in binary form must reproduce the above copyright
13478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * notice, this list of conditions and the following disclaimer in the
14478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * documentation and/or other materials provided with the distribution.
15478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * 3. Neither the name of the Politecnico di Torino nor the names of its
16478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * contributors may be used to endorse or promote products derived from
17478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * this software without specific prior written permission.
18478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project *
19478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project */
31511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#ifndef pcap_stdinc_h
32511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#define pcap_stdinc_h
33478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project
34478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project/*
35d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes * Avoids a compiler warning in case this was already defined
36478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
37478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project * to prevent it from including 'winsock.h')
38478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project */
39478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#ifdef _WINSOCKAPI_
40478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#undef _WINSOCKAPI_
41478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#endif
42478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project
43d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes#include <winsock2.h>
44478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#include <fcntl.h>
45478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#include <time.h>
46478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#include <io.h>
47478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project
48d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes#include "bittypes.h"
49478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#include "IP6_misc.h"
50478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project
51478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project#define caddr_t char*
52478ab6c8b5bc982589be32eae1e5736efe721b58The Android Open Source Project
53d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes#if defined(_MSC_VER)
54d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #define snprintf  _snprintf
55d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #define vsnprintf _vsnprintf
56d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #define strdup    _strdup
57511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#endif
58511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall
59d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes#define inline __inline
60511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall
61511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#ifdef __MINGW32__
62d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #include <stdint.h>
63511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#else
64d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #ifndef _UINTPTR_T_DEFINED
65d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #ifdef  _WIN64
66d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes      typedef unsigned __int64    uintptr_t;
67d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #else
68d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes      typedef _W64 unsigned int   uintptr_t;
69d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #endif
70d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #define _UINTPTR_T_DEFINED
71d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #endif
72511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall
73d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #ifndef _INTPTR_T_DEFINED
74d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #ifdef  _WIN64
75d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes      typedef __int64    intptr_t;
76d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #else
77d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes      typedef _W64 int   intptr_t;
78d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #endif
79d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes    #define _INTPTR_T_DEFINED
80d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes  #endif
81511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#endif /*__MINGW32__*/
82d8845d7191ca81aae8aab4c29410fc8a3d012687Elliott Hughes
83511eca30a483e912c274e1d8ba3a0f8f081e2227JP Abgrall#endif /* pcap_stdinc_h */
84