pcap_geterr, pcap_perror - get or print libpcap error message text
char *pcap_geterr(pcap_t *p);
void pcap_perror(pcap_t *p, char *prefix);
pcap_geterr() returns the error text pertaining to the last pcap library error. NOTE: the pointer it returns will no longer point to a
valid error message string after the pcap_t passed to it is closed; you must use or copy the string before closing the pcap_t.
pcap_perror() prints the text of the last pcap library error on stderr, prefixed by prefix.
SEE ALSO pcap(3PCAP)
5 April 2008 PCAP_GETERR(3PCAP)
Check Out this Related Man Page
pcap_list_datalinks, pcap_free_datalinks - get a list of link-layer header types supported by a capture device, and free that list
int pcap_list_datalinks(pcap_t *p, int **dlt_buf);
void pcap_free_datalinks(int *dlt_list);
pcap_list_datalinks() is used to get a list of the supported link-layer header types of the interface associated with the pcap descriptor.
pcap_list_datalinks() allocates an array to hold the list and sets *dlt_buf to point to that array.
The caller is responsible for freeing the array with pcap_free_datalinks(), which frees the list of link-layer header types pointed to by
pcap_list_datalinks() returns the number of link-layer header types in the array on success and -1 on failure. If -1 is returned,
pcap_geterr() or pcap_perror() may be called with p as an argument to fetch or display the error text.
SEE ALSO pcap(3PCAP), pcap_geterr(3PCAP), pcap_datalink_val_to_name(3PCAP), pcap-linktype(7)
22 August 2010 PCAP_LIST_DATALINKS(3PCAP)
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)
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:
* Sniffer example of TCP/IP packet capture using... (1 Reply)
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)