Wireshark  4.3.0
The Wireshark network protocol analyzer
alert_box.h
Go to the documentation of this file.
1 
13 #ifndef __ALERT_BOX_H__
14 #define __ALERT_BOX_H__
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
20 /*
21  * Alert box for general errors.
22  */
23 extern void failure_alert_box(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
24 extern void vfailure_alert_box(const char *msg_format, va_list ap);
25 
26 /*
27  * Alert box for general warnings.
28  */
29 extern void vwarning_alert_box(const char *msg_format, va_list ap);
30 
31 /*
32  * Alert box for a failed attempt to open a capture file for reading.
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; "err_info" is assumed
35  * to be a string giving further information for some WTAP_ERR_ values..
36  */
37 extern void cfile_open_failure_alert_box(const char *filename, int err,
38  char *err_info);
39 
40 /*
41  * Alert box for a failed attempt to open a capture file for writing.
42  * "filename" is the name of the file being opened; "err" is assumed
43  * to be a UNIX-style errno or a WTAP_ERR_ value; "err_info" is assumed
44  * to be a string giving further information for some WTAP_ERR_ values;
45  * "file_type_subtype" is a WTAP_FILE_TYPE_SUBTYPE_ value for the type
46  * and subtype of file being opened.
47  */
48 extern void cfile_dump_open_failure_alert_box(const char *filename, int err,
49  char *err_info,
50  int file_type_subtype);
51 
52 /*
53  * Alert box for a failed attempt to read from a capture file.
54  * "err" is assumed to be a UNIX-style errno or a WTAP_ERR_ value;
55  * "err_info" is assumed to be a string giving further information for
56  * some WTAP_ERR_ values.
57  */
58 extern void cfile_read_failure_alert_box(const char *filename, int err,
59  char *err_info);
60 
61 /*
62  * Alert box for a failed attempt to write to a capture file.
63  * "in_filename" is the name of the file from which the record being
64  * written came; "out_filename" is the name of the file to which we're
65  * writing; "err" is assumed "err" is assumed to be a UNIX-style errno
66  * or a WTAP_ERR_ value; "err_info" is assumed to be a string giving
67  * further information for some WTAP_ERR_ values; "framenum" is the frame
68  * number of the record on which the error occurred; "file_type_subtype"
69  * is a WTAP_FILE_TYPE_SUBTYPE_ value for the type and subtype of file
70  * being written.
71  */
72 extern void cfile_write_failure_alert_box(const char *in_filename,
73  const char *out_filename,
74  int err, char *err_info,
75  uint32_t framenum,
76  int file_type_subtype);
77 
78 /*
79  * Alert box for a failed attempt to close a capture file.
80  * "err" is assumed to be a UNIX-style errno or a WTAP_ERR_ value;
81  * "err_info" is assumed to be a string giving further information for
82  * some WTAP_ERR_ values.
83  *
84  * When closing a capture file:
85  *
86  * some information in the file that can't be determined until
87  * all packets have been written might be written to the file
88  * (such as a table of the file offsets of all packets);
89  *
90  * data buffered in the low-level file writing code might be
91  * flushed to the file;
92  *
93  * for remote file systems, data written to the file but not
94  * yet sent to the server might be sent to the server or, if
95  * that data was sent asynchronously, "out of space", "disk
96  * quota exceeded", or "I/O error" indications might have
97  * been received but not yet delivered, and the close operation
98  * could deliver them;
99  *
100  * so we have to check for write errors here.
101  */
102 extern void cfile_close_failure_alert_box(const char *filename, int err,
103  char *err_info);
104 
105 /*
106  * Alert box for a failed attempt to open or create a file.
107  * "err" is assumed to be a UNIX-style errno; "for_writing" is true if
108  * the file is being opened for writing and false if it's being opened
109  * for reading.
110  */
111 extern void open_failure_alert_box(const char *filename, int err,
112  bool for_writing);
113 
114 /*
115  * Alert box for a failed attempt to read a file.
116  * "err" is assumed to be a UNIX-style errno.
117  */
118 extern void read_failure_alert_box(const char *filename, int err);
119 
120 /*
121  * Alert box for a failed attempt to write to a file.
122  * "err" is assumed to be a UNIX-style errno.
123  */
124 extern void write_failure_alert_box(const char *filename, int err);
125 
126 #ifdef __cplusplus
127 }
128 #endif /* __cplusplus */
129 
130 #endif /* __ALERT_BOX_H__ */