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