]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libpcap/pcap_set_immediate_mode.3pcap.in
amd64: use register macros for gdb_cpu_getreg()
[FreeBSD/FreeBSD.git] / contrib / libpcap / pcap_set_immediate_mode.3pcap.in
1 .\"
2 .\" Copyright (c) 1994, 1996, 1997
3 .\"     The Regents of the University of California.  All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that: (1) source code distributions
7 .\" retain the above copyright notice and this paragraph in its entirety, (2)
8 .\" distributions including binary code include the above copyright notice and
9 .\" this paragraph in its entirety in the documentation or other materials
10 .\" provided with the distribution, and (3) all advertising materials mentioning
11 .\" features or use of this software display the following acknowledgement:
12 .\" ``This product includes software developed by the University of California,
13 .\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
14 .\" the University nor the names of its contributors may be used to endorse
15 .\" or promote products derived from this software without specific prior
16 .\" written permission.
17 .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
18 .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
19 .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
20 .\"
21 .TH PCAP_SET_IMMEDIATE_MODE 3PCAP "22 August 2018"
22 .SH NAME
23 pcap_set_immediate_mode \- set immediate mode for a not-yet-activated capture
24 handle
25 .SH SYNOPSIS
26 .nf
27 .ft B
28 #include <pcap/pcap.h>
29 .LP
30 .ft B
31 int pcap_set_immediate_mode(pcap_t *p, int immediate_mode);
32 .ft
33 .fi
34 .SH DESCRIPTION
35 .B pcap_set_immediate_mode()
36 sets whether immediate mode should be set on a capture handle when
37 the handle is activated.  In immediate mode, packets are always
38 delivered as soon as they arrive, with no buffering.
39 If
40 .I immediate_mode
41 is non-zero, immediate mode will be set, otherwise it will not be set.
42 .SH RETURN VALUE
43 .B pcap_set_immediate_mode()
44 returns 0 on success or
45 .B PCAP_ERROR_ACTIVATED
46 if called on a capture handle that has been activated.
47 .SH BACKWARD COMPATIBILITY
48 .PP
49 This function became available in libpcap release 1.5.0.  In previous
50 releases, if immediate delivery of packets is required:
51 .IP
52 on FreeBSD, NetBSD, OpenBSD, DragonFly BSD, macOS, and Solaris 11,
53 immediate mode must be turned on with a
54 .B BIOCIMMEDIATE
55 .BR ioctl (2),
56 as documented in
57 .BR bpf(@MAN_DEVICES@) ,
58 on the descriptor returned by
59 .B pcap_fileno(3PCAP),
60 after
61 .BR pcap_activate(3PCAP)
62 is called;
63 .IP
64 on Solaris 10 and earlier versions of Solaris, immediate mode must be
65 turned on by using a read timeout of 0 when opening the device (this
66 will not provide immediate delivery of packets on other platforms, so
67 don't assume it's sufficient);
68 .IP
69 on Digital UNIX/Tru64 UNIX, immediate mode must be turned on by doing a
70 .B BIOCMBIC
71 .BR ioctl ,
72 as documented in
73 .BR packetfilter(7) ,
74 to clear the
75 .B ENBATCH
76 flag on the descriptor returned by
77 .B pcap_fileno(3PCAP),
78 after
79 .BR pcap_activate(3PCAP)
80 is called;
81 .IP
82 on Windows, immediate mode must be turned on by calling
83 .B pcap_setmintocopy()
84 with a size of 0.
85 .PP
86 On Linux, with previous releases of libpcap, capture devices are always
87 in immediate mode; however, in 1.5.0 and later, they are, by default,
88 .B not
89 in immediate mode, so if
90 .B pcap_set_immediate_mode()
91 is available, it should be used.
92 .PP
93 On other platforms, capture devices are always in immediate mode.
94 .SH SEE ALSO
95 pcap(3PCAP), pcap_create(3PCAP), pcap_activate(3PCAP)