[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


pcap_close Subroutine

Purpose

Closes the open files related to the packet capture descriptor and frees the memory used by the packet capture descriptor.

Library

pcap Library (libpcap.a)

Syntax


#include <pcap.h>


void pcap_close(pcap_t * p);

Description

The pcap_close subroutine closes the files associated with the packet capture descriptor and deallocates resources. If the pcap_open_offline subroutine was previously called, the pcap_close subroutine closes the savefile, a previously saved packet capture data file. Or the pcap_close subroutine closes the packet capture device if the pcap_open_live subroutine was previously called.

Parameters


p Points to a packet capture descriptor as returned by the pcap_open_live or the pcap_open_offline subroutine.

Related Information

The pcap_open_live (pcap_open_live Subroutine) subroutine, pcap_open_offline (pcap_open_offline Subroutine) subroutine.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]