| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
/builds/wireshark/wireshark/sharkd.h
Go to the documentation of this file.
1
11
12#ifndef __SHARKD_H
13#define __SHARKD_H
14
15#include <file.h>
16#include <wiretap/wtap_opttypes.h>
17
18#define SHARKD_DISSECT_FLAG_NULL 0x00u
19#define SHARKD_DISSECT_FLAG_BYTES 0x01u
20#define SHARKD_DISSECT_FLAG_COLUMNS 0x02u
21#define SHARKD_DISSECT_FLAG_PROTO_TREE 0x04u
22#define SHARKD_DISSECT_FLAG_COLOR 0x08u
23
24#define SHARKD_MODE_CLASSIC_CONSOLE 1
25#define SHARKD_MODE_CLASSIC_DAEMON 2
26#define SHARKD_MODE_GOLD_CONSOLE 3
27#define SHARKD_MODE_GOLD_DAEMON 4
28
29 typedef void (*sharkd_dissect_func_t)(epan_dissect_t *edt, proto_tree *tree, struct epan_column_info *cinfo, const GSList *data_src, void *data);
30
31#define LONGOPT_FOREGROUND 4000
32
33/* sharkd.c */
34
44 cf_status_t sharkd_cf_open(const char *fname, unsigned int type, bool is_tempfile, int *err);
45
53 int sharkd_load_cap_file(void);
54
64 int sharkd_load_cap_file_with_limits(int max_packet_count, int64_t max_byte_count);
65
73 int sharkd_retap(void);
74
85 int sharkd_filter(const char *dftext, uint8_t **result);
86
93 frame_data *sharkd_get_frame(uint32_t framenum);
94
98 enum dissect_request_status {
99 DISSECT_REQUEST_SUCCESS,
100 DISSECT_REQUEST_NO_SUCH_FRAME,
101 DISSECT_REQUEST_READ_ERROR
102};
103 enum dissect_request_status
104
120 sharkd_dissect_request(uint32_t framenum, uint32_t frame_ref_num,
121 uint32_t prev_dis_num, wtap_rec *rec,
122 column_info *cinfo, uint32_t dissect_flags,
123 sharkd_dissect_func_t cb, void *data,
124 int *err, char **err_info);
125
132wtap_block_t sharkd_get_modified_block(const frame_data *fd);
133
140wtap_block_t sharkd_get_packet_block(const frame_data *fd);
141
149 int sharkd_set_modified_block(frame_data *fd, wtap_block_t new_block);
150
156 const char *sharkd_version(void);
157
163 const struct ws_option* sharkd_long_options(void);
164
170 const char* sharkd_optstring(void);
171
172
173/* sharkd_daemon.c */
174
184 int sharkd_init(int argc, char **argv);
185
195 int sharkd_loop(int argc _U_, char* argv[] _U_);
196
197/* sharkd_session.c */
198
207 int sharkd_session_main(int mode_setting);
208
209#endif /* __SHARKD_H */
210
211/*
212 * Editor modelines - https://www.wireshark.org/tools/modelines.html
213 *
214 * Local variables:
215 * c-basic-offset: 8
216 * tab-width: 8
217 * indent-tabs-mode: t
218 * End:
219 *
220 * vi: set shiftwidth=8 tabstop=8 noexpandtab:
221 * :indentSize=8:tabSize=8:noTabs=false:
222 */
epan_dissect_t
struct epan_dissect epan_dissect_t
Opaque type representing a single packet dissection context.
Definition epan.h:62
file.h
cf_status_t
cf_status_t
Definition file.h:26
frame_data
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
sharkd_set_modified_block
int sharkd_set_modified_block(frame_data *fd, wtap_block_t new_block)
Set a modified block for a frame.
Definition sharkd.c:775
sharkd_dissect_request
enum dissect_request_status sharkd_dissect_request(uint32_t framenum, uint32_t frame_ref_num, uint32_t prev_dis_num, wtap_rec *rec, column_info *cinfo, uint32_t dissect_flags, sharkd_dissect_func_t cb, void *data, int *err, char **err_info)
Dissects a request for packet data.
Definition sharkd.c:542
sharkd_long_options
const struct ws_option * sharkd_long_options(void)
Get the long options for the sharkd daemon.
Definition sharkd.c:106
sharkd_cf_open
cf_status_t sharkd_cf_open(const char *fname, unsigned int type, bool is_tempfile, int *err)
Open a capture file.
Definition sharkd.c:518
sharkd_init
int sharkd_init(int argc, char **argv)
Initialize the sharkd server.
Definition sharkd_daemon.c:273
sharkd_get_packet_block
wtap_block_t sharkd_get_packet_block(const frame_data *fd)
Get the packet block for a given frame.
Definition sharkd.c:750
sharkd_filter
int sharkd_filter(const char *dftext, uint8_t **result)
Apply a display filter to the current capture file and return the results.
Definition sharkd.c:657
sharkd_loop
int sharkd_loop(int argc _U_, char *argv[] _U_)
Main loop for the sharkd daemon.
Definition sharkd_daemon.c:422
sharkd_get_frame
frame_data * sharkd_get_frame(uint32_t framenum)
Get a frame by its number.
Definition sharkd.c:536
sharkd_session_main
int sharkd_session_main(int mode_setting)
Main function for handling sharkd sessions.
Definition sharkd_session.c:6197
sharkd_retap
int sharkd_retap(void)
Retaps all packets in the current capture file.
Definition sharkd.c:599
sharkd_load_cap_file_with_limits
int sharkd_load_cap_file_with_limits(int max_packet_count, int64_t max_byte_count)
Load a capture file with specified limits.
Definition sharkd.c:530
sharkd_version
const char * sharkd_version(void)
Retrieves the version of the SharkD server.
sharkd_get_modified_block
wtap_block_t sharkd_get_modified_block(const frame_data *fd)
Get the modified packet block for a given frame, if available.
Definition sharkd.c:739
sharkd_load_cap_file
int sharkd_load_cap_file(void)
Load a capture file without any limits.
Definition sharkd.c:524
sharkd_optstring
const char * sharkd_optstring(void)
Get the string of valid options for the sharkd daemon.
Definition sharkd.c:111
dissect_request_status
dissect_request_status
Return status for a frame dissection request.
Definition sharkd.h:98
DISSECT_REQUEST_NO_SUCH_FRAME
@ DISSECT_REQUEST_NO_SUCH_FRAME
Definition sharkd.h:100
DISSECT_REQUEST_READ_ERROR
@ DISSECT_REQUEST_READ_ERROR
Definition sharkd.h:101
DISSECT_REQUEST_SUCCESS
@ DISSECT_REQUEST_SUCCESS
Definition sharkd.h:99
epan_column_info
Definition column-info.h:59
ws_option
Structure representing a long-form command-line option.
Definition ws_getopt.h:64
wtap_rec
Represents a single capture record read from or written to a capture file, regardless of record type.
Definition wtap.h:1600
wtap_opttypes.h