2 * Declarations of our own routins for writing libpcap files.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * Derived from code in the Wiretap Library
11 * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version 2
16 * of the License, or (at your option) any later version.
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
28 /* Returns a FILE * to write to on success, NULL on failure */
30 libpcap_fdopen(int fd, int *err);
32 /* Write the file header to a dump file.
33 Returns TRUE on success, FALSE on failure.
34 Sets "*err" to an error code, or 0 for a short write, on failure*/
36 libpcap_write_file_header(FILE *fp, int linktype, int snaplen, long *bytes_written, int *err);
38 /* Write a record for a packet to a dump file.
39 Returns TRUE on success, FALSE on failure. */
41 libpcap_write_packet(FILE *fp, const struct pcap_pkthdr *phdr, const u_char *pd,
42 long *bytes_written, int *err);
45 libpcap_write_session_header_block(FILE *fp,
51 libpcap_write_interface_description_block(FILE *fp,
60 libpcap_write_interface_statistics_block(FILE *fp,
67 libpcap_write_enhanced_packet_block(FILE *fp,
68 const struct pcap_pkthdr *phdr,
75 libpcap_dump_flush(FILE *pd, int *err);
78 libpcap_dump_close(FILE *pd, int *err);