3 * Routines to print various "standard" failure messages used in multiple
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * SPDX-License-Identifier: GPL-2.0-or-later
13 #ifndef __FAILURE_MESSAGE_H__
14 #define __FAILURE_MESSAGE_H__
18 #endif /* __cplusplus */
21 * Generic error message.
23 extern void failure_message(const char *msg_format
, va_list ap
);
26 * Error message for a failed attempt to open or create a file
27 * other than a capture file.
28 * "filename" is the name of the file being opened; "err" is assumed
29 * to be a UNIX-style errno; "for_writing" is true if we're opening
30 * the file for writing and false if we're opening it for reading.
32 extern void open_failure_message(const char *filename
, int err
,
36 * Error message for a failed attempt to read from a file other than
38 * "filename" is the name of the file being opened; "err" is assumed
39 * to be a UNIX-style errno.
41 extern void read_failure_message(const char *filename
, int err
);
44 * Error message for a failed attempt to write to a file other than
46 * "filename" is the name of the file being written to; "err" is assumed
47 * to be a UNIX-style errno.
49 extern void write_failure_message(const char *filename
, int err
);
52 * Error message for a failed attempt to rename a file other than
54 * "old_filename" is the name of the file being renamed; "new_filename"
55 * is the name to which it's being renamed; "err" is assumed to be a
58 extern void rename_failure_message(const char *old_filename
,
59 const char *new_filename
, int err
);
62 * Error message for a failed attempt to open a capture file for input.
63 * "filename" is the name of the file being opened; "err" is assumed
64 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
65 * to be a string giving further information for some WTAP_ERR_ values.
67 extern void cfile_open_failure_message(const char *filename
, int err
,
71 * Error message for a failed attempt to open a capture file for output.
72 * "filename" is the name of the file being opened; "err" is assumed
73 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
74 * to be a string giving further information for some WTAP_ERR_ values;
75 * "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value for the type
76 * and subtype of file being opened.
78 extern void cfile_dump_open_failure_message(const char *filename
, int err
,
80 int file_type_subtype
);
83 * Error message for a failed attempt to read from a capture file.
84 * "filename" is the name of the file being opened; "err" is assumed
85 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
86 * to be a string giving further information for some WTAP_ERR_ values.
88 extern void cfile_read_failure_message(const char *filename
, int err
,
92 * Error message for a failed attempt to write to a capture file.
93 * "in_filename" is the name of the file from which the record
94 * being written came; "out_filename" is the name of the file to
95 * which we're writing; "err" is assumed "err" is assumed to be a
96 * UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed to be
97 * a string giving further information for some WTAP_ERR_ values;
98 * "framenum" is the frame number of the record on which the error
99 * occurred; "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value
100 * for the type and subtype of file being written.
102 extern void cfile_write_failure_message(const char *in_filename
,
103 const char *out_filename
,
104 int err
, char *err_info
,
106 int file_type_subtype
);
109 * Error message for a failed attempt to close a capture file.
110 * "filename" is the name of the file being closed; "err" is assumed
111 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
112 * to be a string giving further information for some WTAP_ERR_ values.
114 * When closing a capture file:
116 * some information in the file that can't be determined until
117 * all packets have been written might be written to the file
118 * (such as a table of the file offsets of all packets);
120 * data buffered in the low-level file writing code might be
121 * flushed to the file;
123 * for remote file systems, data written to the file but not
124 * yet sent to the server might be sent to the server or, if
125 * that data was sent asynchronously, "out of space", "disk
126 * quota exceeded", or "I/O error" indications might have
127 * been received but not yet delivered, and the close operation
128 * could deliver them;
130 * so we have to check for write errors here.
132 extern void cfile_close_failure_message(const char *filename
, int err
,
136 * Register these routines with the report_message mechanism.
138 extern void init_report_failure_message(const char *friendly_program_name
);
142 #endif /* __cplusplus */
144 #endif /* __FAILURE_MESSAGE_H__ */