Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pcap_close(3pcap) [v7 man page]


pcap_close - close a capture device or savefile SYNOPSIS
#include <pcap/pcap.h> void pcap_close(pcap_t *p); DESCRIPTION
pcap_close() closes the files associated with p and deallocates resources. SEE ALSO
pcap(3PCAP) 5 April 2008 PCAP_CLOSE(3PCAP)

Check Out this Related Man Page


pcap_open_offline, pcap_fopen_offline - open a saved capture file for reading SYNOPSIS
#include <pcap/pcap.h> char errbuf[PCAP_ERRBUF_SIZE]; pcap_t *pcap_open_offline(const char *fname, char *errbuf); pcap_t *pcap_fopen_offline(FILE *fp, char *errbuf); DESCRIPTION
pcap_open_offline() is called to open a ``savefile'' for reading. fname specifies the name of the file to open. The file can have the pcap file format as described in pcap-savefile(5@), which is the file format used by, among other programs, tcpdump(1) and tcpslice(1), or can have the pcap-ng file format, although not all pcap-ng files can be read. The name "-" in a synonym for stdin. Alternatively, you may call pcap_fopen_offline() to read dumped data from an existing open stream fp. Note that on Windows, that stream should be opened in binary mode. RETURN VALUE
pcap_open_offline() and pcap_fopen_offline() return a pcap_t * on success and NULL on failure. If NULL is returned, errbuf is filled in with an appropriate error message. errbuf is assumed to be able to hold at least PCAP_ERRBUF_SIZE chars. SEE ALSO
pcap(3PCAP), pcap-savefile(5@) 5 April 2008 PCAP_OPEN_OFFLINE(3PCAP)
Man Page

4 More Discussions You Might Find Interesting

1. Programming

can some1 help me in Modifying sniffex.c

hi plz help me modifying the following code (use pcap) to include concepts of parallel programming or multi threading. I am trying from the past 1 week to change the code and apply concepts of threads but have been unsuccessful.. pls guide me.. /* This section contains additional information... (1 Reply)
Discussion started by: aka.bhagvanji
1 Replies

2. Programming

Modifying sniffex.c to include concepts of parallel programming or threads

HI For the past 1 week i have been trying to include the concepts of parallel programming or thread in the sniffex.c code. Haven't been able to.. Please suggest sm appropriate modifications to the following code: /* * sniffex.c * * Sniffer example of TCP/IP packet capture using... (1 Reply)
Discussion started by: aka.bhagvanji
1 Replies

3. Programming

using libpcap with timeout

I want to write a small application using Libpcap in C on Linux. Currently, it starts to sniff and waits for the packets. But that's not what I need actually. I want it to wait for N seconds and then stop listening. (I think there's something wrong with my usage of 'pcap_open_live'...) How... (0 Replies)
Discussion started by: xyzt
0 Replies

4. Programming

pcap_dispatch hangs on vlan filter

Hi all My application is a monitoring application that monitors the incoming udp packet when ever required. When ever a particular source ip and port and dest ip and port is provided the filter will be framed based them. For eg, char filterExpr; filterExpr = "udp and src host (0 Replies)
Discussion started by: anusha_pixel
0 Replies