JP Abgrall | 511eca3 | 2014-02-12 13:46:45 -0800 | [diff] [blame] | 1 | .\" @(#) $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 |
| 24 | pcap_open_dead, pcap_open_dead_with_tstamp_precision \- open a fake |
| 25 | pcap_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 |
| 33 | pcap_t *pcap_open_dead(int linktype, int snaplen); |
| 34 | pcap_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() |
| 41 | and |
| 42 | .B pcap_open_dead_with_tstamp_precision() |
| 43 | are used for creating a |
| 44 | .B pcap_t |
| 45 | structure to use when calling the other functions in libpcap. It is |
| 46 | typically used when just using libpcap for compiling BPF code; it can |
| 47 | also be used if using |
| 48 | .BR pcap_dump_open() , |
| 49 | .BR pcap_dump() , |
| 50 | and |
| 51 | .B pcap_dump_close() |
| 52 | to write a savefile if there is no |
| 53 | .B pcap_t |
| 54 | that supplies the packets to be written. |
| 55 | .PP |
| 56 | .I linktype |
| 57 | specifies the link-layer type for the |
| 58 | .BR pcap_t . |
| 59 | .PP |
| 60 | .I snaplen |
| 61 | specifies the snapshot length for the |
| 62 | .BR pcap_t . |
| 63 | .PP |
| 64 | When |
| 65 | .BR pcap_open_dead_with_tstamp_precision() , |
| 66 | is used to create a |
| 67 | .B pcap_t |
| 68 | for use with |
| 69 | .BR pcap_dump_open() , |
| 70 | .I precision |
| 71 | specifies the time stamp precision for packets; |
| 72 | .B PCAP_TSTAMP_PRECISION_MICRO |
| 73 | should be specified if the packets to be written have time stamps in |
| 74 | seconds and microseconds, and |
| 75 | .B PCAP_TSTAMP_PRECISION_NANO |
| 76 | should be specified if the packets to be written have time stamps in |
| 77 | seconds and nanoseconds. Its value does not affect |
| 78 | .BR pcap_compile() . |
| 79 | .SH SEE ALSO |
| 80 | pcap(3PCAP), pcap_compile(3PCAP), pcap_dump_open(3PCAP), |
| 81 | pcap-linktype(@MAN_MISC_INFO@) |