Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

# Pcap-win32.c File Reference

`#include <pcap-int.h>`
`#include <packet32.h>`
`#include <Ntddndis.h>`

Go to the source code of this file.

## Data Structures
struct | bpf_hdr
| Packet header. More...
## Defines
#define | PcapBufSize 256000 /*dimension of the buffer in the pcap_t structure*/
#define | SIZE_BUF 1000000
#define | bhp ((struct bpf_hdr *)bp)
## Functions
int | pcap_setfilter_win32 (pcap_t *, struct bpf_program *)
int | pcap_getnonblock_win32 (pcap_t *, char *)
int | pcap_setnonblock_win32 (pcap_t *, int, char *)
int | wsockinit ()
int | pcap_stats_win32 (pcap_t *p, struct pcap_stat *ps)
int | pcap_read_win32 (pcap_t *p, int cnt, pcap_handler callback, u_char *user)
void | pcap_close_win32 (pcap_t *p)
pcap_t * | pcap_open_live (const char *device, int snaplen, int promisc, int to_ms, char *ebuf)
| It opens a live capture from the network.
int | pcap_setmode (pcap_t *p, int mode)
| Win32 Specific. Sets the working mode of the interface p to mode.
int | pcap_sendpacket (pcap_t *p, u_char *buf, int size)
| Win32 Specific. Sends a raw packet.
int | pcap_setbuff (pcap_t *p, int dim)
| Win32 Specific. Sets the size of the kernel buffer associated with an adapter.
int | pcap_setmintocopy (pcap_t *p, int size)
| Win32 Specific. Sets the minumum amount of data received by the kernel in a single call.
## Variables
const char rcsid[] | _U_

## Define Documentation

#define bhp ((struct bpf_hdr *)bp)

| Referenced by pcap_read_win32().

#define PcapBufSize 256000 /*dimension of the buffer in the pcap_t structure*/

| Definition at line 55 of file Pcap-win32.c. Referenced by pcap_open_live().

#define SIZE_BUF 1000000

| Definition at line 56 of file Pcap-win32.c. Referenced by pcap_open_live().

## Function Documentation

void pcap_close_win32 | ( | pcap_t * | p | ) | `[static]`

| Definition at line 226 of file Pcap-win32.c. References PacketCloseAdapter(), and PacketFreePacket(). Referenced by pcap_open_live().

int pcap_getnonblock_win32 | ( | pcap_t * | ,
|  | char * |
| ) | `[static]`

| Definition at line 414 of file Pcap-win32.c. Referenced by pcap_open_live().

int pcap_read_win32 | ( | pcap_t * | p,
|  | int | cnt,
|  | pcap_handler | callback,
|  | u_char * | user
| ) | `[static]`

| Definition at line 100 of file Pcap-win32.c. References bhp, PacketReceivePacket(), PCAP_ERRBUF_SIZE, PCAP_SAMP_1_EVERY_N, PCAP_SAMP_FIRST_AFTER_N_MS, and snprintf. Referenced by pcap_open_live().

int pcap_setfilter_win32 | ( | pcap_t * | ,
|  | struct bpf_program * |
| ) | `[static]`

| Definition at line 402 of file Pcap-win32.c. References PacketSetBpf(), PCAP_ERRBUF_SIZE, pcap_win32strerror(), and snprintf. Referenced by pcap_open_live().

int pcap_setnonblock_win32 | ( | pcap_t * | ,
|  | int | ,
|  | char * |
| ) | `[static]`

| Definition at line 425 of file Pcap-win32.c. References PacketSetReadTimeout(), PCAP_ERRBUF_SIZE, pcap_win32strerror(), and snprintf. Referenced by pcap_open_live().

int pcap_stats_win32 | ( | pcap_t * | p,
|  | struct pcap_stat * | ps
| ) | `[static]`

| Definition at line 88 of file Pcap-win32.c. References PacketGetStats(), PCAP_ERRBUF_SIZE, pcap_win32strerror(), and snprintf. Referenced by pcap_open_live().

int wsockinit | ( |  | ) |

| Definition at line 72 of file Pcap-win32.c. Referenced by pcap_open_live().

## Variable Documentation

const char rcsid [] _U_`[static]`

| Initial value:
        "@(#) $Header: /tcpdump/master/libpcap/pcap-win32.c,v 1.15.2.5 2004/06/16 15:51:32 risso Exp $ (LBL)"
Definition at line 34 of file Pcap-win32.c.

documentation. Copyright (c) 2002-2003 Politecnico di Torino. All rights reserved.