Wireshark  4.3.0
The Wireshark network protocol analyzer
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
17 extern "C" {
18 #endif /* __cplusplus */
19 
20 /*
21  * Generic error message.
22  */
23 extern 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  */
32 extern 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  */
41 extern 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  */
49 extern void write_failure_message(const char *filename, int err);
50 
51 /*
52  * Error message for a failed attempt to open a capture file for input.
53  * "filename" is the name of the file being opened; "err" is assumed
54  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
55  * to be a string giving further information for some WTAP_ERR_ values.
56  */
57 extern void cfile_open_failure_message(const char *filename, int err,
58  char *err_info);
59 
60 /*
61  * Error message for a failed attempt to open a capture file for output.
62  * "filename" is the name of the file being opened; "err" is assumed
63  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
64  * to be a string giving further information for some WTAP_ERR_ values;
65  * "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value for the type
66  * and subtype of file being opened.
67  */
68 extern void cfile_dump_open_failure_message(const char *filename, int err,
69  char *err_info,
70  int file_type_subtype);
71 
72 /*
73  * Error message for a failed attempt to read from a capture file.
74  * "filename" is the name of the file being opened; "err" is assumed
75  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
76  * to be a string giving further information for some WTAP_ERR_ values.
77  */
78 extern void cfile_read_failure_message(const char *filename, int err,
79  char *err_info);
80 
81 /*
82  * Error message for a failed attempt to write to a capture file.
83  * "in_filename" is the name of the file from which the record
84  * being written came; "out_filename" is the name of the file to
85  * which we're writing; "err" is assumed "err" is assumed to be a
86  * UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed to be
87  * a string giving further information for some WTAP_ERR_ values;
88  * "framenum" is the frame number of the record on which the error
89  * occurred; "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value
90  * for the type and subtype of file being written.
91  */
92 extern void cfile_write_failure_message(const char *in_filename,
93  const char *out_filename,
94  int err, char *err_info,
95  uint32_t framenum,
96  int file_type_subtype);
97 
98 /*
99  * Error message for a failed attempt to close a capture file.
100  * "filename" is the name of the file being closed; "err" is assumed
101  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
102  * to be a string giving further information for some WTAP_ERR_ values.
103  *
104  * When closing a capture file:
105  *
106  * some information in the file that can't be determined until
107  * all packets have been written might be written to the file
108  * (such as a table of the file offsets of all packets);
109  *
110  * data buffered in the low-level file writing code might be
111  * flushed to the file;
112  *
113  * for remote file systems, data written to the file but not
114  * yet sent to the server might be sent to the server or, if
115  * that data was sent asynchronously, "out of space", "disk
116  * quota exceeded", or "I/O error" indications might have
117  * been received but not yet delivered, and the close operation
118  * could deliver them;
119  *
120  * so we have to check for write errors here.
121  */
122 extern void cfile_close_failure_message(const char *filename, int err,
123  char *err_info);
124 
125 #ifdef __cplusplus
126 }
127 #endif /* __cplusplus */
128 
129 #endif /* __FAILURE_MESSAGE_H__ */