Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
report_message.h
Go to the documentation of this file.
1
22#ifndef __REPORT_MESSAGE_H__
23#define __REPORT_MESSAGE_H__
24
25#include <wireshark.h>
26
27#ifdef __cplusplus
28extern "C" {
29#endif /* __cplusplus */
30
31/*
32 * Initialize the report message routines
33 */
35 void (*vreport_failure)(const char *, va_list);
36 void (*vreport_warning)(const char *, va_list);
37 void (*report_open_failure)(const char *, int, bool);
38 void (*report_read_failure)(const char *, int);
39 void (*report_write_failure)(const char *, int);
40 void (*report_rename_failure)(const char *, const char *, int);
41 void (*report_cfile_open_failure)(const char *, int, char *);
42 void (*report_cfile_dump_open_failure)(const char *, int, char *, int);
43 void (*report_cfile_read_failure)(const char *, int, char *);
44 void (*report_cfile_write_failure)(const char *, const char *,
45 int, char *, uint64_t, int);
46 void (*report_cfile_close_failure)(const char *, int, char *);
47};
48
49WS_DLL_PUBLIC void init_report_message(const char *friendly_program_name,
50 const struct report_message_routines *routines);
51
52/*
53 * Report a general error.
54 */
55WS_DLL_PUBLIC void report_failure(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
56
57/*
58 * Report a general warning.
59 */
60WS_DLL_PUBLIC void report_warning(const char *msg_format, ...) G_GNUC_PRINTF(1, 2);
61
62/*
63 * Report an error when trying to open a file.
64 * "err" is assumed to be an error code from Wiretap; positive values are
65 * UNIX-style errnos, so this can be used for open failures not from
66 * Wiretap as long as the failure code is just an errno.
67 */
68WS_DLL_PUBLIC void report_open_failure(const char *filename, int err,
69 bool for_writing);
70
71/*
72 * Report an error when trying to read a file.
73 * "err" is assumed to be a UNIX-style errno.
74 */
75WS_DLL_PUBLIC void report_read_failure(const char *filename, int err);
76
77/*
78 * Report an error when trying to write a file.
79 * "err" is assumed to be a UNIX-style errno.
80 */
81WS_DLL_PUBLIC void report_write_failure(const char *filename, int err);
82
83/*
84 * Report an error when trying to rename a file.
85 * "err" is assumed to be a UNIX-style errno.
86 */
87WS_DLL_PUBLIC void report_rename_failure(const char *old_filename,
88 const char *new_filename, int err);
89
90/*
91 * Report an error from opening a capture file for reading.
92 */
93WS_DLL_PUBLIC void report_cfile_open_failure(const char *filename,
94 int err, char *err_info);
95
96/*
97 * Report an error from opening a capture file for writing.
98 */
99WS_DLL_PUBLIC void report_cfile_dump_open_failure(const char *filename,
100 int err, char *err_info, int file_type_subtype);
101
102/*
103 * Report an error from attempting to read from a capture file.
104 */
105WS_DLL_PUBLIC void report_cfile_read_failure(const char *filename,
106 int err, char *err_info);
107
108/*
109 * Report an error from attempting to write to a capture file.
110 */
111WS_DLL_PUBLIC void report_cfile_write_failure(const char *in_filename,
112 const char *out_filename, int err, char *err_info, uint64_t framenum,
113 int file_type_subtype);
114
115/*
116 * Report an error from closing a capture file open for writing.
117 */
118WS_DLL_PUBLIC void report_cfile_close_failure(const char *filename,
119 int err, char *err_info);
120
121/*
122 * Return the "friendly" program name.
123 */
124WS_DLL_PUBLIC const char *get_friendly_program_name(void);
125
126#ifdef __cplusplus
127}
128#endif /* __cplusplus */
129
130#endif /* __REPORT_MESSAGE_H__ */
Definition report_message.h:34