Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
failure_message.h
Go to the documentation of this file.
1
13#ifndef __FAILURE_MESSAGE_H__
14#define __FAILURE_MESSAGE_H__
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/*
21 * Generic error message.
22 */
23extern void failure_message(const char *msg_format, va_list ap);
24
25/*
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.
31 */
32extern void open_failure_message(const char *filename, int err,
33 bool for_writing);
34
35/*
36 * Error message for a failed attempt to read from a file other than
37 * a capture file.
38 * "filename" is the name of the file being opened; "err" is assumed
39 * to be a UNIX-style errno.
40 */
41extern void read_failure_message(const char *filename, int err);
42
43/*
44 * Error message for a failed attempt to write to a file other than
45 * a capture file.
46 * "filename" is the name of the file being written to; "err" is assumed
47 * to be a UNIX-style errno.
48 */
49extern void write_failure_message(const char *filename, int err);
50
51/*
52 * Error message for a failed attempt to rename a file other than
53 * a capture file.
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
56 * UNIX-style errno.
57 */
58extern void rename_failure_message(const char *old_filename,
59 const char *new_filename, int err);
60
61/*
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.
66 */
67extern void cfile_open_failure_message(const char *filename, int err,
68 char *err_info);
69
70/*
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.
77 */
78extern void cfile_dump_open_failure_message(const char *filename, int err,
79 char *err_info,
80 int file_type_subtype);
81
82/*
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.
87 */
88extern void cfile_read_failure_message(const char *filename, int err,
89 char *err_info);
90
91/*
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.
101 */
102extern void cfile_write_failure_message(const char *in_filename,
103 const char *out_filename,
104 int err, char *err_info,
105 uint64_t framenum,
106 int file_type_subtype);
107
108/*
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.
113 *
114 * When closing a capture file:
115 *
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);
119 *
120 * data buffered in the low-level file writing code might be
121 * flushed to the file;
122 *
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;
129 *
130 * so we have to check for write errors here.
131 */
132extern void cfile_close_failure_message(const char *filename, int err,
133 char *err_info);
134
135/*
136 * Register these routines with the report_message mechanism.
137 */
138extern void init_report_failure_message(const char *friendly_program_name);
139
140#ifdef __cplusplus
141}
142#endif /* __cplusplus */
143
144#endif /* __FAILURE_MESSAGE_H__ */