1/*
2 * Copyright (c) 1999 - 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:
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 nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
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
33#ifndef lint
34static const char rcsid[] _U_ =
35 "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.3 2005/07/10 17:52:54 risso Exp $ (LBL)";
36#endif
37
38#include <pcap-int.h>
39#include <packet32.h>
40#include <Ntddndis.h>
41#ifdef HAVE_DAG_API
42#include <dagnew.h>
43#include <dagapi.h>
44#endif /* HAVE_DAG_API */
45#ifdef __MINGW32__
46int* _errno();
47#define errno (*_errno())
--- 433 unchanged lines hidden (view full) ---
481 case NdisMediumPPPSerial:
482 p->linktype = DLT_PPP_SERIAL;
483 break;
484
485 case NdisMediumNull:
486 p->linktype = DLT_NULL;
487 break;
488
489 default:
490 p->linktype = DLT_EN10MB; /*an unknown adapter is assumed to be ethernet*/
491 break;
492 }
493
494 /* Set promisquous mode */
495 if (promisc) PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_PROMISCUOUS);
496 else PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_ALL_LOCAL);
497
498 /* Set the buffer size */
499 p->bufsize = PcapBufSize;
500
501 /* Store the timeout. Used by pcap_setnonblock() */
502 p->timeout= to_ms;
503
504 /* allocate Packet structure used during the capture */
505 if((p->Packet = PacketAllocatePacket())==NULL)
--- 270 unchanged lines hidden ---
2 * Copyright (c) 1999 - 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:
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 nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
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
33#ifndef lint
34static const char rcsid[] _U_ =
35 "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.25.2.3 2005/07/10 17:52:54 risso Exp $ (LBL)";
36#endif
37
38#include <pcap-int.h>
39#include <packet32.h>
40#include <Ntddndis.h>
41#ifdef HAVE_DAG_API
42#include <dagnew.h>
43#include <dagapi.h>
44#endif /* HAVE_DAG_API */
45#ifdef __MINGW32__
46int* _errno();
47#define errno (*_errno())
--- 433 unchanged lines hidden (view full) ---
481 case NdisMediumPPPSerial:
482 p->linktype = DLT_PPP_SERIAL;
483 break;
484
485 case NdisMediumNull:
486 p->linktype = DLT_NULL;
487 break;
488
489 default:
490 p->linktype = DLT_EN10MB; /*an unknown adapter is assumed to be ethernet*/
491 break;
492 }
493
494 /* Set promisquous mode */
495 if (promisc) PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_PROMISCUOUS);
496 else PacketSetHwFilter(p->adapter,NDIS_PACKET_TYPE_ALL_LOCAL);
497
498 /* Set the buffer size */
499 p->bufsize = PcapBufSize;
500
501 /* Store the timeout. Used by pcap_setnonblock() */
502 p->timeout= to_ms;
503
504 /* allocate Packet structure used during the capture */
505 if((p->Packet = PacketAllocatePacket())==NULL)
--- 270 unchanged lines hidden ---