blob: 621e75b5b58a1b1225936b725f5f865f47f02024 [file] [log] [blame]
JP Abgrall511eca32014-02-12 13:46:45 -08001.\" Copyright (c) 1994, 1996, 1997
2.\" The Regents of the University of California. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that: (1) source code distributions
6.\" retain the above copyright notice and this paragraph in its entirety, (2)
7.\" distributions including binary code include the above copyright notice and
8.\" this paragraph in its entirety in the documentation or other materials
9.\" provided with the distribution, and (3) all advertising materials mentioning
10.\" features or use of this software display the following acknowledgement:
11.\" ``This product includes software developed by the University of California,
12.\" Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
13.\" the University nor the names of its contributors may be used to endorse
14.\" or promote products derived from this software without specific prior
15.\" written permission.
16.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
17.\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
18.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19.\"
Elliott Hughes965a4b52017-05-15 10:37:39 -070020.TH PCAP_OPEN_DEAD 3PCAP "3 January 2014"
JP Abgrall511eca32014-02-12 13:46:45 -080021.SH NAME
22pcap_open_dead, pcap_open_dead_with_tstamp_precision \- open a fake
23pcap_t for compiling filters or opening a capture for output
24.SH SYNOPSIS
25.nf
26.ft B
27#include <pcap/pcap.h>
28.ft
29.LP
30.ft B
31pcap_t *pcap_open_dead(int linktype, int snaplen);
32pcap_t *pcap_open_dead_with_tstamp_precision(int linktype, int snaplen,
33 u_int precision);
34.ft
35.fi
36.SH DESCRIPTION
37.PP
38.B pcap_open_dead()
39and
40.B pcap_open_dead_with_tstamp_precision()
41are used for creating a
42.B pcap_t
43structure to use when calling the other functions in libpcap. It is
44typically used when just using libpcap for compiling BPF code; it can
45also be used if using
46.BR pcap_dump_open() ,
47.BR pcap_dump() ,
48and
49.B pcap_dump_close()
50to write a savefile if there is no
51.B pcap_t
52that supplies the packets to be written.
53.PP
54.I linktype
55specifies the link-layer type for the
56.BR pcap_t .
57.PP
58.I snaplen
59specifies the snapshot length for the
60.BR pcap_t .
61.PP
62When
63.BR pcap_open_dead_with_tstamp_precision() ,
64is used to create a
65.B pcap_t
66for use with
67.BR pcap_dump_open() ,
68.I precision
69specifies the time stamp precision for packets;
70.B PCAP_TSTAMP_PRECISION_MICRO
71should be specified if the packets to be written have time stamps in
72seconds and microseconds, and
73.B PCAP_TSTAMP_PRECISION_NANO
74should be specified if the packets to be written have time stamps in
75seconds and nanoseconds. Its value does not affect
76.BR pcap_compile() .
77.SH SEE ALSO
78pcap(3PCAP), pcap_compile(3PCAP), pcap_dump_open(3PCAP),
Haibo Huang165065a2018-07-23 17:26:52 -070079\%pcap-linktype(@MAN_MISC_INFO@)