Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
export_object.h
Go to the documentation of this file.
1
10#pragma once
11#include "tap.h"
12#include <epan/wmem_scopes.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif /* __cplusplus */
17
18typedef struct _export_object_entry_t {
19 uint32_t pkt_num;
20 char *hostname;
21 char *content_type;
22 char *filename;
23 size_t payload_len;
24 uint8_t *payload_data;
26
31#define EXPORT_OBJECT_MAXFILELEN 255
32
33typedef void (*export_object_object_list_add_entry_cb)(void* gui_data, struct _export_object_entry_t *entry);
34typedef export_object_entry_t* (*export_object_object_list_get_entry_cb)(void* gui_data, int row);
35
36typedef struct _export_object_list_t {
37 export_object_object_list_add_entry_cb add_entry; //GUI specific handler for adding an object entry
38 export_object_object_list_get_entry_cb get_entry; //GUI specific handler for retrieving an object entry
39 void* gui_data; //GUI specific data (for UI representation)
41
44
45/* When a protocol needs intermediate data structures to construct the
46export objects, then it must specify a function that cleans up all
47those data structures. This function is passed to export_object_window
48and called when tap reset or windows closes occurs. If no function is needed
49a NULL value should be passed instead */
50typedef void (*export_object_gui_reset_cb)(void);
51
54extern void export_object_init(void);
55
64WS_DLL_PUBLIC int register_export_object(const int proto_id, tap_packet_cb export_packet_func, export_object_gui_reset_cb reset_cb);
65
71WS_DLL_PUBLIC int get_eo_proto_id(register_eo_t* eo);
72
78WS_DLL_PUBLIC const char* get_eo_tap_listener_name(register_eo_t* eo);
79
85WS_DLL_PUBLIC tap_packet_cb get_eo_packet_func(register_eo_t* eo);
86
92WS_DLL_PUBLIC export_object_gui_reset_cb get_eo_reset_func(register_eo_t* eo);
93
99WS_DLL_PUBLIC register_eo_t* get_eo_by_name(const char* name);
100
106WS_DLL_PUBLIC void eo_iterate_tables(wmem_foreach_func func, void *user_data);
107
115WS_DLL_PUBLIC GString *eo_massage_str(const char *in_str, size_t maxlen, int dup);
116
122WS_DLL_PUBLIC const char *eo_ct2ext(const char *content_type);
123
128WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry);
129
130#ifdef __cplusplus
131}
132#endif /* __cplusplus */
133
134/*
135 * Editor modelines
136 *
137 * Local Variables:
138 * c-basic-offset: 4
139 * tab-width: 8
140 * indent-tabs-mode: nil
141 * End:
142 *
143 * ex: set shiftwidth=4 tabstop=8 expandtab:
144 * :indentSize=4:tabSize=8:noTabs=true:
145 */
WS_DLL_PUBLIC const char * eo_ct2ext(const char *content_type)
Definition export_object.c:144
WS_DLL_PUBLIC register_eo_t * get_eo_by_name(const char *name)
Definition export_object.c:73
WS_DLL_PUBLIC const char * get_eo_tap_listener_name(register_eo_t *eo)
Definition export_object.c:58
WS_DLL_PUBLIC void eo_iterate_tables(wmem_foreach_func func, void *user_data)
Definition export_object.c:78
WS_DLL_PUBLIC export_object_gui_reset_cb get_eo_reset_func(register_eo_t *eo)
Definition export_object.c:68
WS_DLL_PUBLIC GString * eo_massage_str(const char *in_str, size_t maxlen, int dup)
Definition export_object.c:116
void export_object_init(void)
Definition export_object.c:28
WS_DLL_PUBLIC int get_eo_proto_id(register_eo_t *eo)
Definition export_object.c:50
WS_DLL_PUBLIC tap_packet_cb get_eo_packet_func(register_eo_t *eo)
Definition export_object.c:63
WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry)
Definition export_object.c:151
WS_DLL_PUBLIC int register_export_object(const int proto_id, tap_packet_cb export_packet_func, export_object_gui_reset_cb reset_cb)
Definition export_object.c:34
bool(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Function type for processing one node of a tree during a traversal.
Definition wmem_tree.h:389
Definition export_object.h:18
Definition export_object.h:36
Definition export_object.c:19