Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
failure_message_simple.h
Go to the documentation of this file.
1
23#ifndef __FAILURE_MESSAGE_SIMPLE_H__
24#define __FAILURE_MESSAGE_SIMPLE_H__
25
26#ifdef __cplusplus
27extern "C" {
28#endif /* __cplusplus */
29
30/*
31 * Generic error message.
32 */
33extern void failure_message_simple(const char *msg_format, va_list ap);
34
35/*
36 * Error message for a failed attempt to open or create a file
37 * other than a capture file.
38 * "filename" is the name of the file being opened; "err" is assumed
39 * to be a UNIX-style errno; "for_writing" is true if we're opening
40 * the file for writing and false if we're opening it for reading.
41 */
42extern void open_failure_message_simple(const char *filename, int err,
43 bool for_writing);
44
45/*
46 * Error message for a failed attempt to read from a file other than
47 * a capture file.
48 * "filename" is the name of the file being opened; "err" is assumed
49 * to be a UNIX-style errno.
50 */
51extern void read_failure_message_simple(const char *filename, int err);
52
53/*
54 * Error message for a failed attempt to write to a file other than
55 * a capture file.
56 * "filename" is the name of the file being written to; "err" is assumed
57 * to be a UNIX-style errno.
58 */
59extern void write_failure_message_simple(const char *filename, int err);
60
61/*
62 * Error message for a failed attempt to rename a file other than
63 * a capture file.
64 * "old_filename" is the name of the file being renamed; "new_filename"
65 * is the name to which it's being renamed; "err" is assumed to be a
66 * UNIX-style errno.
67 */
68extern void rename_failure_message_simple(const char *old_filename,
69 const char *new_filename, int err);
70
71/* XXX - The cfile_ routines below here should not be called. */
72
73/*
74 * Error message for a failed attempt to open a capture file for input.
75 * "filename" is the name of the file being opened; "err" is assumed
76 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
77 * to be a string giving further information for some WTAP_ERR_ values.
78 */
79extern void cfile_open_failure_message_simple(const char* filename, int err,
80 char* err_info);
81
82/*
83 * Error message for a failed attempt to open a capture file for output.
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;
87 * "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value for the type
88 * and subtype of file being opened.
89 */
90extern void cfile_dump_open_failure_message_simple(const char* filename, int err,
91 char* err_info,
92 int file_type_subtype _U_);
93
94/*
95 * Error message for a failed attempt to read from a capture file.
96 * "filename" is the name of the file being opened; "err" is assumed
97 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
98 * to be a string giving further information for some WTAP_ERR_ values.
99 */
100extern void cfile_read_failure_message_simple(const char* filename, int err,
101 char* err_info);
102
103/*
104 * Error message for a failed attempt to write to a capture file.
105 * "in_filename" is the name of the file from which the record
106 * being written came; "out_filename" is the name of the file to
107 * which we're writing; "err" is assumed "err" is assumed to be a
108 * UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed to be
109 * a string giving further information for some WTAP_ERR_ values;
110 * "framenum" is the frame number of the record on which the error
111 * occurred; "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value
112 * for the type and subtype of file being written.
113 */
114extern void cfile_write_failure_message_simple(const char* in_filename,
115 const char* out_filename,
116 int err, char* err_info,
117 uint64_t framenum,
118 int file_type_subtype _U_);
119
120/*
121 * Error message for a failed attempt to close a capture file.
122 * "filename" is the name of the file being closed; "err" is assumed
123 * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
124 * to be a string giving further information for some WTAP_ERR_ values.
125 *
126 * When closing a capture file:
127 *
128 * some information in the file that can't be determined until
129 * all packets have been written might be written to the file
130 * (such as a table of the file offsets of all packets);
131 *
132 * data buffered in the low-level file writing code might be
133 * flushed to the file;
134 *
135 * for remote file systems, data written to the file but not
136 * yet sent to the server might be sent to the server or, if
137 * that data was sent asynchronously, "out of space", "disk
138 * quota exceeded", or "I/O error" indications might have
139 * been received but not yet delivered, and the close operation
140 * could deliver them;
141 *
142 * so we have to check for write errors here.
143 */
144extern void cfile_close_failure_message_simple(const char* filename, int err,
145 char* err_info);
146
147/*
148 * Register these routines with the report_message mechanism.
149 */
150extern void init_report_failure_message_simple(const char *friendly_program_name);
151
152#ifdef __cplusplus
153}
154#endif /* __cplusplus */
155
156#endif /* __FAILURE_MESSAGE_SIMPLE_H__ */