Wireshark 2.9.0-477-g68ec514b The Wireshark network protocol analyzer

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

failure_message.h
1 /* failure_message.h
2 * Routines to print various "standard" failure messages used in multiple
3 * places
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12 #ifndef __FAILURE_MESSAGE_H__
13 #define __FAILURE_MESSAGE_H__
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif /* __cplusplus */
18
19 /*
20 * Error message for a failed attempt to open a capture file for input.
21 * "progname" is the name of the program trying to open the file;
22 * "filename" is the name of the file being opened; "err" is assumed
23 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
24 * to be a string giving further information for some WTAP_ERR_ values.
25 */
26 extern void cfile_open_failure_message(const char *progname,
27 const char *filename, int err,
28 gchar *err_info);
29
30 /*
31 * Error message for a failed attempt to open a capture file for writing.
32 * "progname" is the name of the program trying to open the file;
33 * "filename" is the name of the file being opened; "err" is assumed
34 * to be a UNIX-style errno or a WTAP_ERR_ value; "file_type_subtype" is
35 * a WTAP_FILE_TYPE_SUBTYPE_ value for the type and subtype of file being
36 * opened.
37 */
38 extern void cfile_dump_open_failure_message(const char *progname,
39 const char *filename, int err,
40 int file_type_subtype);
41
42 /*
43 * Error message for a failed attempt to read from a capture file.
44 * "progname" is the name of the program trying to open the file;
45 * "filename" is the name of the file being opened; "err" is assumed
46 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
47 * to be a string giving further information for some WTAP_ERR_ values.
48 */
49 extern void cfile_read_failure_message(const char *progname,
50 const char *filename, int err,
51 gchar *err_info);
52
53 /*
54 * Error message for a failed attempt to write to a capture file.
55 * "progname" is the name of the program trying to open the file;
56 * "in_filename" is the name of the file from which the record
57 * being written came; "out_filename" is the name of the file to
58 * which we're writing; "err" is assumed "err" is assumed to be a
59 * UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed to be
60 * a string giving further information for some WTAP_ERR_ values;
61 * "framenum" is the frame number of the record on which the error
62 * occurred; "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value
63 * for the type and subtype of file being written.
64 */
65 extern void cfile_write_failure_message(const char *progname,
66 const char *in_filename,
67 const char *out_filename,
68 int err, gchar *err_info,
69 guint32 framenum,
70 int file_type_subtype);
71
72 /*
73 * Error message for a failed attempt to close a capture file.
74 * "filename" is the name of the file being closed; "err" is assumed
75 * to be a UNIX-style errno or a WTAP_ERR_ value.
76 *
77 * When closing a capture file:
78 *
79 * some information in the file that can't be determined until
80 * all packets have been written might be written to the file
81 * (such as a table of the file offsets of all packets);
82 *
83 * data buffered in the low-level file writing code might be
84 * flushed to the file;
85 *
86 * for remote file systems, data written to the file but not
87 * yet sent to the server might be sent to the server or, if
88 * that data was sent asynchronously, "out of space", "disk
89 * quota exceeded", or "I/O error" indications might have
90 * been received but not yet delivered, and the close operation
91 * could deliver them;
92 *
93 * so we have to check for write errors here.
94 */
95 extern void cfile_close_failure_message(const char *filename, int err);
96
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100
101 #endif /* __FAILURE_MESSAGE_H__ */
102
103 /*
104 * Editor modelines
105 *
106 * Local Variables:
107 * c-basic-offset: 4
108 * tab-width: 8
109 * indent-tabs-mode: nil
110 * End:
111 *
112 * ex: set shiftwidth=4 tabstop=8 expandtab:
113 * :indentSize=4:tabSize=8:noTabs=true:
114 */