Wireshark  4.3.0
The Wireshark network protocol analyzer
export_object.h
Go to the documentation of this file.
1 
11 #ifndef __EXPORT_OBJECT_H__
12 #define __EXPORT_OBJECT_H__
13 
14 #include "tap.h"
15 #include <epan/wmem_scopes.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 typedef struct _export_object_entry_t {
22  guint32 pkt_num;
23  gchar *hostname;
24  gchar *content_type;
25  gchar *filename;
26  size_t payload_len;
27  guint8 *payload_data;
29 
34 #define EXPORT_OBJECT_MAXFILELEN 255
35 
36 typedef void (*export_object_object_list_add_entry_cb)(void* gui_data, struct _export_object_entry_t *entry);
37 typedef export_object_entry_t* (*export_object_object_list_get_entry_cb)(void* gui_data, int row);
38 
39 typedef struct _export_object_list_t {
40  export_object_object_list_add_entry_cb add_entry; //GUI specific handler for adding an object entry
41  export_object_object_list_get_entry_cb get_entry; //GUI specific handler for retrieving an object entry
42  void* gui_data; //GUI specific data (for UI representation)
44 
46 typedef struct register_eo register_eo_t;
47 
48 /* When a protocol needs intermediate data structures to construct the
49 export objects, then it must specify a function that cleans up all
50 those data structures. This function is passed to export_object_window
51 and called when tap reset or windows closes occurs. If no function is needed
52 a NULL value should be passed instead */
53 typedef void (*export_object_gui_reset_cb)(void);
54 
63 WS_DLL_PUBLIC int register_export_object(const int proto_id, tap_packet_cb export_packet_func, export_object_gui_reset_cb reset_cb);
64 
70 WS_DLL_PUBLIC int get_eo_proto_id(register_eo_t* eo);
71 
77 WS_DLL_PUBLIC const char* get_eo_tap_listener_name(register_eo_t* eo);
78 
84 WS_DLL_PUBLIC tap_packet_cb get_eo_packet_func(register_eo_t* eo);
85 
91 WS_DLL_PUBLIC export_object_gui_reset_cb get_eo_reset_func(register_eo_t* eo);
92 
98 WS_DLL_PUBLIC register_eo_t* get_eo_by_name(const char* name);
99 
105 WS_DLL_PUBLIC void eo_iterate_tables(wmem_foreach_func func, gpointer user_data);
106 
114 WS_DLL_PUBLIC GString *eo_massage_str(const gchar *in_str, gsize maxlen, int dup);
115 
121 WS_DLL_PUBLIC const char *eo_ct2ext(const char *content_type);
122 
127 WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry);
128 
129 #ifdef __cplusplus
130 }
131 #endif /* __cplusplus */
132 
133 #endif /* __EXPORT_OBJECT_H__ */
134 
135 /*
136  * Editor modelines
137  *
138  * Local Variables:
139  * c-basic-offset: 4
140  * tab-width: 8
141  * indent-tabs-mode: nil
142  * End:
143  *
144  * ex: set shiftwidth=4 tabstop=8 expandtab:
145  * :indentSize=4:tabSize=8:noTabs=true:
146  */
WS_DLL_PUBLIC const char * eo_ct2ext(const char *content_type)
Definition: export_object.c:142
WS_DLL_PUBLIC GString * eo_massage_str(const gchar *in_str, gsize maxlen, int dup)
Definition: export_object.c:114
WS_DLL_PUBLIC export_object_gui_reset_cb get_eo_reset_func(register_eo_t *eo)
Definition: export_object.c:66
WS_DLL_PUBLIC void eo_iterate_tables(wmem_foreach_func func, gpointer user_data)
Definition: export_object.c:76
WS_DLL_PUBLIC int get_eo_proto_id(register_eo_t *eo)
Definition: export_object.c:48
WS_DLL_PUBLIC tap_packet_cb get_eo_packet_func(register_eo_t *eo)
Definition: export_object.c:61
WS_DLL_PUBLIC void eo_free_entry(export_object_entry_t *entry)
Definition: export_object.c:149
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:29
WS_DLL_PUBLIC register_eo_t * get_eo_by_name(const char *name)
Definition: export_object.c:71
WS_DLL_PUBLIC const char * get_eo_tap_listener_name(register_eo_t *eo)
Definition: export_object.c:56
bool(* wmem_foreach_func)(const void *key, void *value, void *userdata)
Definition: wmem_tree.h:220
Definition: export_object.h:21
Definition: export_object.h:39
Definition: export_object.c:19