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