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

Technical Reference: Base Operating System and Extensions, Volume 1


pcap_geterr Subroutine

Purpose

Obtains the most recent pcap error message.

Library

pcap Library (libpcap.a)

Syntax


#include <pcap.h>


char *pcap_geterr(pcap_t * p);

Description

The pcap_geterr subroutine returns the error text pertaining to the last pcap library error. This subroutine is useful in obtaining error text from those subroutines that do not return an error string. Since the pointer returned points to a memory space that will be reused by the pcap library subroutines, it is important to copy this message into a new buffer if the error text needs to be saved.

Parameters


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

Return Values

The pcap_geterr subroutine returns a pointer to the most recent error message from a pcap library subroutine. If there were no previous error messages, a string with 0 as the first byte is returned.

Related Information

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


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