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