iscsi also has a system port (860) registered in addition to the more common
[obnox/wireshark/wip.git] / pcapio.h
1 /* pcapio.h
2  * Declarations of our own routins for writing libpcap files.
3  *
4  * $Id$
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * Derived from code in the Wiretap Library
11  * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu>
12  *
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.
17  *
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.
22  *
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.
26  */
27
28 /* Returns a FILE * to write to on success, NULL on failure */
29 extern FILE *
30 libpcap_fdopen(int fd, int *err);
31
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*/
35 extern gboolean
36 libpcap_write_file_header(FILE *fp, int linktype, int snaplen, long *bytes_written, int *err);
37
38 /* Write a record for a packet to a dump file.
39    Returns TRUE on success, FALSE on failure. */
40 extern gboolean
41 libpcap_write_packet(FILE *fp, const struct pcap_pkthdr *phdr, const u_char *pd,
42     long *bytes_written, int *err);
43
44 extern gboolean
45 libpcap_write_session_header_block(FILE *fp,
46                                    char *appname,
47                                    long *bytes_written,
48                                    int *err);
49
50 extern gboolean
51 libpcap_write_interface_description_block(FILE *fp,
52                                           char *name,
53                                           char *filter,
54                                           int link_type,
55                                           int snap_len,
56                                           long *bytes_written,
57                                           int *err);
58
59 extern gboolean
60 libpcap_write_interface_statistics_block(FILE *fp,
61                                          guint32 interface_id,
62                                          pcap_t *pd,
63                                          long *bytes_written,
64                                          int *err);
65
66 extern gboolean
67 libpcap_write_enhanced_packet_block(FILE *fp,
68                                     const struct pcap_pkthdr *phdr,
69                                     guint32 interface_id,
70                                     const u_char *pd,
71                                     long *bytes_written,
72                                     int *err);
73
74 extern gboolean
75 libpcap_dump_flush(FILE *pd, int *err);
76
77 extern gboolean
78 libpcap_dump_close(FILE *pd, int *err);