1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/emulator/emulatorbsp/wpdpack/include/Win32-Extensions.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,113 @@
1.4 +/*
1.5 + * Copyright (c) 1999 - 2005 NetGroup, Politecnico di Torino (Italy)
1.6 + * Copyright (c) 2005 - 2006 CACE Technologies, Davis (California)
1.7 + * All rights reserved.
1.8 + *
1.9 + * Redistribution and use in source and binary forms, with or without
1.10 + * modification, are permitted provided that the following conditions
1.11 + * are met:
1.12 + *
1.13 + * 1. Redistributions of source code must retain the above copyright
1.14 + * notice, this list of conditions and the following disclaimer.
1.15 + * 2. Redistributions in binary form must reproduce the above copyright
1.16 + * notice, this list of conditions and the following disclaimer in the
1.17 + * documentation and/or other materials provided with the distribution.
1.18 + * 3. Neither the name of the Politecnico di Torino, CACE Technologies
1.19 + * nor the names of its contributors may be used to endorse or promote
1.20 + * products derived from this software without specific prior written
1.21 + * permission.
1.22 + *
1.23 + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1.24 + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1.25 + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1.26 + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
1.27 + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1.28 + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
1.29 + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
1.30 + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
1.31 + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
1.32 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
1.33 + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1.34 + *
1.35 + */
1.36 +
1.37 +#ifndef __WIN32_EXTENSIONS_H__
1.38 +#define __WIN32_EXTENSIONS_H__
1.39 +
1.40 +#ifdef __cplusplus
1.41 +extern "C" {
1.42 +#endif
1.43 +
1.44 +/* Definitions */
1.45 +
1.46 +/*!
1.47 + \brief A queue of raw packets that will be sent to the network with pcap_sendqueue_transmit().
1.48 +*/
1.49 +struct pcap_send_queue
1.50 +{
1.51 + u_int maxlen; ///< Maximum size of the the queue, in bytes. This variable contains the size of the buffer field.
1.52 + u_int len; ///< Current size of the queue, in bytes.
1.53 + char *buffer; ///< Buffer containing the packets to be sent.
1.54 +};
1.55 +
1.56 +typedef struct pcap_send_queue pcap_send_queue;
1.57 +
1.58 +/*!
1.59 + \brief This typedef is a support for the pcap_get_airpcap_handle() function
1.60 +*/
1.61 +#if !defined(AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_)
1.62 +#define AIRPCAP_HANDLE__EAE405F5_0171_9592_B3C2_C19EC426AD34__DEFINED_
1.63 +typedef struct _AirpcapHandle *PAirpcapHandle;
1.64 +#endif
1.65 +
1.66 +#define BPF_MEM_EX_IMM 0xc0
1.67 +#define BPF_MEM_EX_IND 0xe0
1.68 +
1.69 +/*used for ST*/
1.70 +#define BPF_MEM_EX 0xc0
1.71 +#define BPF_TME 0x08
1.72 +
1.73 +#define BPF_LOOKUP 0x90
1.74 +#define BPF_EXECUTE 0xa0
1.75 +#define BPF_INIT 0xb0
1.76 +#define BPF_VALIDATE 0xc0
1.77 +#define BPF_SET_ACTIVE 0xd0
1.78 +#define BPF_RESET 0xe0
1.79 +#define BPF_SET_MEMORY 0x80
1.80 +#define BPF_GET_REGISTER_VALUE 0x70
1.81 +#define BPF_SET_REGISTER_VALUE 0x60
1.82 +#define BPF_SET_WORKING 0x50
1.83 +#define BPF_SET_ACTIVE_READ 0x40
1.84 +#define BPF_SET_AUTODELETION 0x30
1.85 +#define BPF_SEPARATION 0xff
1.86 +
1.87 +/* Prototypes */
1.88 +pcap_send_queue* pcap_sendqueue_alloc(u_int memsize);
1.89 +
1.90 +void pcap_sendqueue_destroy(pcap_send_queue* queue);
1.91 +
1.92 +int pcap_sendqueue_queue(pcap_send_queue* queue, const struct pcap_pkthdr *pkt_header, const u_char *pkt_data);
1.93 +
1.94 +u_int pcap_sendqueue_transmit(pcap_t *p, pcap_send_queue* queue, int sync);
1.95 +
1.96 +HANDLE pcap_getevent(pcap_t *p);
1.97 +
1.98 +struct pcap_stat *pcap_stats_ex(pcap_t *p, int *pcap_stat_size);
1.99 +
1.100 +int pcap_setuserbuffer(pcap_t *p, int size);
1.101 +
1.102 +int pcap_live_dump(pcap_t *p, char *filename, int maxsize, int maxpacks);
1.103 +
1.104 +int pcap_live_dump_ended(pcap_t *p, int sync);
1.105 +
1.106 +int pcap_offline_filter(struct bpf_program *prog, const struct pcap_pkthdr *header, const u_char *pkt_data);
1.107 +
1.108 +int pcap_start_oem(char* err_str, int flags);
1.109 +
1.110 +PAirpcapHandle pcap_get_airpcap_handle(pcap_t *p);
1.111 +
1.112 +#ifdef __cplusplus
1.113 +}
1.114 +#endif
1.115 +
1.116 +#endif //__WIN32_EXTENSIONS_H__