PCAP_GETERR(3) Library Functions Manual PCAP_GETERR(3)NAME
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(3)
5 April 2008 PCAP_GETERR(3)
Check Out this Related Man Page
PCAP_COMPILE(3) Library Functions Manual PCAP_COMPILE(3)NAME
pcap_compile - compile a filter expression
int pcap_compile(pcap_t *p, struct bpf_program *fp,
const char *str, int optimize, bpf_u_int32 netmask);
pcap_compile() is used to compile the string str into a filter program. See pcap-filter(7) for the syntax of that string. program is a
pointer to a bpf_program struct and is filled in by pcap_compile(). optimize controls whether optimization on the resulting code is per-
formed. netmask specifies the IPv4 netmask of the network on which packets are being captured; it is used only when checking for IPv4
broadcast addresses in the filter program. If the netmask of the network on which packets are being captured isn't known to the program,
or if packets are being captured on the Linux "any" pseudo-interface that can capture on more than one network, a value of PCAP_NET-
MASK_UNKNOWN can be supplied; tests for IPv4 broadcast addreses will fail to compile, but all other tests in the filter program will be OK.
pcap_compile() returns 0 on success and -1 on failure. If -1 is returned, pcap_geterr() or pcap_perror() may be called with p as an argu-
ment to fetch or display the error text.
SEE ALSO pcap(3), pcap_setfilter(3), pcap_freecode(3), pcap_geterr(3), pcap-filter(7)
5 April 2008 PCAP_COMPILE(3)
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)