GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PCAP_SETNONBLOCK (3)

NAME

pcap_setnonblock, pcap_getnonblock - set or get the state of non-blocking mode on a capture device

CONTENTS

Synopsis
Description
Return Value
See Also

SYNOPSIS


#include <pcap/pcap.h>


char errbuf[PCAP_ERRBUF_SIZE];

int pcap_setnonblock(pcap_t *p, int nonblock, char *errbuf); int pcap_getnonblock(pcap_t *p, char *errbuf);

DESCRIPTION

pcap_setnonblock() puts a capture handle into ‘‘non-blocking’’ mode, or takes it out of ‘‘non-blocking’’ mode, depending on whether the nonblock argument is non-zero or zero. It has no effect on ‘‘savefiles’’. If there is an error, -1 is returned and errbuf is filled in with an appropriate error message; otherwise, 0 is returned. In ‘‘non-blocking’’ mode, an attempt to read from the capture descriptor with pcap_dispatch() will, if no packets are currently available to be read, return 0 immediately rather than blocking waiting for packets to arrive. pcap_loop() and pcap_next() will not work in ‘‘non-blocking’’ mode.

RETURN VALUE

pcap_getnonblock() returns the current ‘‘non-blocking’’ state of the capture descriptor; it always returns 0 on ‘‘savefiles’’. If there is an error, -1 is returned and 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(3), pcap_loop(3), pcap_next_ex(3), pcap_geterr(3)
Search for    or go to Top of page |  Section 3 |  Main Index


--> PCAP_SETNONBLOCK (3) 5 April 2008

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.