Skip to content

Commit 40b907d

Browse files
committed
Add mingw required header files and pcap libraries
1 parent 850f464 commit 40b907d

27 files changed

+3565
-0
lines changed

mingw/include/Packet32.h

Lines changed: 359 additions & 0 deletions
Large diffs are not rendered by default.

mingw/include/Win32-Extensions.h

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
3+
* Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
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:
9+
*
10+
* 1. Redistributions of source code must retain the above copyright
11+
* notice, this list of conditions and the following disclaimer.
12+
* 2. Redistributions in binary form must reproduce the above copyright
13+
* notice, this list of conditions and the following disclaimer in the
14+
* documentation and/or other materials provided with the distribution.
15+
* 3. Neither the name of the Politecnico di Torino, CACE Technologies
16+
* nor the names of its contributors may be used to endorse or promote
17+
* products derived from this software without specific prior written
18+
* permission.
19+
*
20+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
*
32+
*/
33+
34+
#ifndef __WIN32_EXTENSIONS_H__
35+
#define __WIN32_EXTENSIONS_H__
36+
37+
#ifdef __cplusplus
38+
extern "C" {
39+
#endif
40+
41+
/* Definitions */
42+
43+
/*!
44+
\brief A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit().
45+
*/
46+
struct pcap_send_queue
47+
{
48+
u_int maxlen; ///< Maximum size of the the queue, in bytes. This variable contains the size of the buffer field.
49+
u_int len; ///< Current size of the queue, in bytes.
50+
char *buffer; ///< Buffer containing the packets to be sent.
51+
};
52+
53+
typedef struct pcap_send_queue pcap_send_queue;
54+
55+
/*!
56+
\brief This typedef is a support for the pcap_get_airpcap_handle() function
57+
*/
58+
#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)
59+
#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
60+
typedef struct _AirpcapHandle *PAirpcapHandle;
61+
#endif
62+
63+
#define BPF_MEM_EX_IMM 0xc0
64+
#define BPF_MEM_EX_IND 0xe0
65+
66+
/*used for ST*/
67+
#define BPF_MEM_EX 0xc0
68+
#define BPF_TME 0x08
69+
70+
#define BPF_LOOKUP 0x90
71+
#define BPF_EXECUTE 0xa0
72+
#define BPF_INIT 0xb0
73+
#define BPF_VALIDATE 0xc0
74+
#define BPF_SET_ACTIVE 0xd0
75+
#define BPF_RESET 0xe0
76+
#define BPF_SET_MEMORY 0x80
77+
#define BPF_GET_REGISTER_VALUE 0x70
78+
#define BPF_SET_REGISTER_VALUE 0x60
79+
#define BPF_SET_WORKING 0x50
80+
#define BPF_SET_ACTIVE_READ 0x40
81+
#define BPF_SET_AUTODELETION 0x30
82+
#define BPF_SEPARATION 0xff
83+
84+
/* Prototypes */
85+
pcap_send_queue* pcap_sendqueue_alloc(u_int memsize);
86+
87+
void pcap_sendqueue_destroy(pcap_send_queue* queue);
88+
89+
int pcap_sendqueue_queue(pcap_send_queue* queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data);
90+
91+
u_int pcap_sendqueue_transmit(pcap_t *p, pcap_send_queue* queue, int sync);
92+
93+
HANDLE pcap_getevent(pcap_t *p);
94+
95+
struct pcap_stat *pcap_stats_ex(pcap_t *p, int *pcap_stat_size);
96+
97+
int pcap_setuserbuffer(pcap_t *p, int size);
98+
99+
int pcap_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks);
100+
101+
int pcap_live_dump_ended(pcap_t *p, int sync);
102+
103+
int pcap_offline_filter(struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data);
104+
105+
int pcap_start_oem(char* err_str, int flags);
106+
107+
PAirpcapHandle pcap_get_airpcap_handle(pcap_t *p);
108+
109+
#ifdef __cplusplus
110+
}
111+
#endif
112+
113+
#endif //__WIN32_EXTENSIONS_H__

mingw/include/arpa/inet.h

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*====================================================================*
2+
*
3+
* Copyright (c) 2011 by Qualcomm Atheros.
4+
*
5+
* Permission to use, copy, modify, and/or distribute this software
6+
* for any purpose with or without fee is hereby granted, provided
7+
* that the above copyright notice and this permission notice appear
8+
* in all copies.
9+
*
10+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11+
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12+
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
13+
* THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14+
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16+
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18+
*
19+
*--------------------------------------------------------------------*/
20+
21+
/*====================================================================*
22+
*
23+
* inet.h - Substitute Linux header for systems without one;
24+
*
25+
* Emulate the POSIX header arpa/inet.h;
26+
*
27+
* specifically, obtain declare endian conversion functions htons(),
28+
* ntohs(), htonl() and ntohl();
29+
*
30+
*. Intellon Linux Toolkit;
31+
*: Published 2007 by Intellon Corp. ALL RIGHTS RESERVED;
32+
*; For demonstration; Not for production use;
33+
*
34+
* Contributor(s):
35+
* Charles Maier <charles.maier@atheros.com>
36+
*
37+
*--------------------------------------------------------------------*/
38+
39+
#ifndef IN_HEADER
40+
#define IN_HEADER
41+
42+
/*====================================================================*
43+
*
44+
*--------------------------------------------------------------------*/
45+
46+
#include <winsock2.h>
47+
48+
/*====================================================================*
49+
*
50+
*--------------------------------------------------------------------*/
51+
52+
#endif
53+
54+

mingw/include/bittypes.h

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
* Copyright (C) 1999 WIDE Project.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions
7+
* are met:
8+
* 1. Redistributions of source code must retain the above copyright
9+
* notice, this list of conditions and the following disclaimer.
10+
* 2. Redistributions in binary form must reproduce the above copyright
11+
* notice, this list of conditions and the following disclaimer in the
12+
* documentation and/or other materials provided with the distribution.
13+
* 3. Neither the name of the project nor the names of its contributors
14+
* may be used to endorse or promote products derived from this software
15+
* without specific prior written permission.
16+
*
17+
* THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
* ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23+
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26+
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27+
* SUCH DAMAGE.
28+
*/
29+
#ifndef _BITTYPES_H
30+
#define _BITTYPES_H
31+
32+
#ifndef HAVE_U_INT8_T
33+
34+
#if SIZEOF_CHAR == 1
35+
typedef unsigned char u_int8_t;
36+
typedef signed char int8_t;
37+
#elif SIZEOF_INT == 1
38+
typedef unsigned int u_int8_t;
39+
typedef signed int int8_t;
40+
#else /* XXX */
41+
#error "there's no appropriate type for u_int8_t"
42+
#endif
43+
#define HAVE_U_INT8_T 1
44+
#define HAVE_INT8_T 1
45+
46+
#endif /* HAVE_U_INT8_T */
47+
48+
#ifndef HAVE_U_INT16_T
49+
50+
#if SIZEOF_SHORT == 2
51+
typedef unsigned short u_int16_t;
52+
typedef signed short int16_t;
53+
#elif SIZEOF_INT == 2
54+
typedef unsigned int u_int16_t;
55+
typedef signed int int16_t;
56+
#elif SIZEOF_CHAR == 2
57+
typedef unsigned char u_int16_t;
58+
typedef signed char int16_t;
59+
#else /* XXX */
60+
#error "there's no appropriate type for u_int16_t"
61+
#endif
62+
#define HAVE_U_INT16_T 1
63+
#define HAVE_INT16_T 1
64+
65+
#endif /* HAVE_U_INT16_T */
66+
67+
#ifndef HAVE_U_INT32_T
68+
69+
#if SIZEOF_INT == 4
70+
typedef unsigned int u_int32_t;
71+
typedef signed int int32_t;
72+
#elif SIZEOF_LONG == 4
73+
typedef unsigned long u_int32_t;
74+
typedef signed long int32_t;
75+
#elif SIZEOF_SHORT == 4
76+
typedef unsigned short u_int32_t;
77+
typedef signed short int32_t;
78+
#else /* XXX */
79+
#error "there's no appropriate type for u_int32_t"
80+
#endif
81+
#define HAVE_U_INT32_T 1
82+
#define HAVE_INT32_T 1
83+
84+
#endif /* HAVE_U_INT32_T */
85+
86+
#ifndef HAVE_U_INT64_T
87+
#if SIZEOF_LONG_LONG == 8
88+
typedef unsigned long long u_int64_t;
89+
typedef long long int64_t;
90+
#elif defined(_MSC_EXTENSIONS)
91+
typedef unsigned _int64 u_int64_t;
92+
typedef _int64 int64_t;
93+
#elif SIZEOF_INT == 8
94+
typedef unsigned int u_int64_t;
95+
#elif SIZEOF_LONG == 8
96+
typedef unsigned long u_int64_t;
97+
#elif SIZEOF_SHORT == 8
98+
typedef unsigned short u_int64_t;
99+
#else /* XXX */
100+
#error "there's no appropriate type for u_int64_t"
101+
#endif
102+
103+
#endif /* HAVE_U_INT64_T */
104+
105+
#ifndef PRId64
106+
#ifdef _MSC_EXTENSIONS
107+
#define PRId64 "I64d"
108+
#else /* _MSC_EXTENSIONS */
109+
#define PRId64 "lld"
110+
#endif /* _MSC_EXTENSIONS */
111+
#endif /* PRId64 */
112+
113+
#ifndef PRIo64
114+
#ifdef _MSC_EXTENSIONS
115+
#define PRIo64 "I64o"
116+
#else /* _MSC_EXTENSIONS */
117+
#define PRIo64 "llo"
118+
#endif /* _MSC_EXTENSIONS */
119+
#endif /* PRIo64 */
120+
121+
#ifndef PRIx64
122+
#ifdef _MSC_EXTENSIONS
123+
#define PRIx64 "I64x"
124+
#else /* _MSC_EXTENSIONS */
125+
#define PRIx64 "llx"
126+
#endif /* _MSC_EXTENSIONS */
127+
#endif /* PRIx64 */
128+
129+
#ifndef PRIu64
130+
#ifdef _MSC_EXTENSIONS
131+
#define PRIu64 "I64u"
132+
#else /* _MSC_EXTENSIONS */
133+
#define PRIu64 "llu"
134+
#endif /* _MSC_EXTENSIONS */
135+
#endif /* PRIu64 */
136+
137+
#endif /* _BITTYPES_H */

0 commit comments

Comments
 (0)