Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
follow.h
Go to the documentation of this file.
1
13#ifndef __FOLLOW_H__
14#define __FOLLOW_H__
15
16#include <epan/epan.h>
17#include <epan/packet.h>
18#include <wsutil/inet_cidr.h>
19#include <epan/tap.h>
20#include <epan/wmem_scopes.h>
21#include "ws_symbol_export.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27/* Show Stream */
38
49
50struct _follow_info;
51
52#define SUBSTREAM_UNUSED UINT64_C(0xFFFFFFFFFFFFFFFF)
53
54typedef struct {
55 bool is_server;
56 uint32_t packet_num;
57 uint32_t seq; /* TCP only */
59 GByteArray *data;
61
62typedef struct _follow_info {
63 show_stream_t show_stream;
64 char *filter_out_filter;
65 GList *payload; /* "follow_record_t" entries, in reverse order. */
66 unsigned bytes_written[2]; /* Index with FROM_CLIENT or FROM_SERVER for readability. */
67 uint32_t seq[2]; /* TCP only */
68 GList *fragments[2]; /* TCP only */
69 unsigned client_port;
70 unsigned server_port;
71 address client_ip;
72 address server_ip;
73 void* gui_data;
74 uint64_t substream_id;
76
77struct register_follow;
79
82extern void follow_init(void);
83
84typedef char* (*follow_conv_filter_func)(epan_dissect_t *edt, packet_info *pinfo, unsigned *stream, unsigned *sub_stream);
85typedef char* (*follow_index_filter_func)(unsigned stream, unsigned sub_stream);
86typedef char* (*follow_address_filter_func)(address* src_addr, address* dst_addr, int src_port, int dst_port);
87typedef char* (*follow_port_to_display_func)(wmem_allocator_t *allocator, unsigned port);
88typedef uint32_t (*follow_stream_count_func)(void);
89typedef bool (*follow_sub_stream_id_func)(unsigned stream, unsigned sub_stream, bool le, unsigned *sub_stream_out);
90
91WS_DLL_PUBLIC
92void register_follow_stream(const int proto_id, const char* tap_listener,
93 follow_conv_filter_func conv_filter, follow_index_filter_func index_filter, follow_address_filter_func address_filter,
94 follow_port_to_display_func port_to_display, tap_packet_cb tap_handler,
95 follow_stream_count_func stream_count, follow_sub_stream_id_func sub_stream_id);
96
102WS_DLL_PUBLIC int get_follow_proto_id(register_follow_t* follower);
103
109WS_DLL_PUBLIC const char* get_follow_tap_string(register_follow_t* follower);
110
116WS_DLL_PUBLIC register_follow_t* get_follow_by_name(const char* proto_short_name);
117
123WS_DLL_PUBLIC register_follow_t* get_follow_by_proto_id(const int proto_id);
124
130WS_DLL_PUBLIC follow_conv_filter_func get_follow_conv_func(register_follow_t* follower);
131
137WS_DLL_PUBLIC follow_index_filter_func get_follow_index_func(register_follow_t* follower);
138
144WS_DLL_PUBLIC follow_address_filter_func get_follow_address_func(register_follow_t* follower);
145
151WS_DLL_PUBLIC follow_port_to_display_func get_follow_port_to_display(register_follow_t* follower);
152
158WS_DLL_PUBLIC tap_packet_cb get_follow_tap_handler(register_follow_t* follower);
159
166WS_DLL_PUBLIC follow_stream_count_func get_follow_stream_count_func(register_follow_t* follower);
167
179WS_DLL_PUBLIC follow_sub_stream_id_func get_follow_sub_stream_id_func(register_follow_t* follower);
180
184WS_DLL_PUBLIC tap_packet_status
185follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags);
186
192WS_DLL_PUBLIC void follow_iterate_followers(wmem_foreach_func func, void *user_data);
193
200WS_DLL_PUBLIC char* follow_get_stat_tap_string(register_follow_t* follower);
201
210WS_DLL_PUBLIC void follow_reset_stream(follow_info_t* info);
211
217WS_DLL_PUBLIC void follow_info_free(follow_info_t* follow_info);
218
219#ifdef __cplusplus
220}
221#endif /* __cplusplus */
222
223#endif
union _stream_addr stream_addr
Represents an IP address for a stream, supporting both IPv4 and IPv6.
show_stream_t
Indicates the direction of a network stream for display purposes.
Definition follow.h:33
@ BOTH_HOSTS
Definition follow.h:36
@ FROM_CLIENT
Definition follow.h:34
@ FROM_SERVER
Definition follow.h:35
WS_DLL_PUBLIC void follow_reset_stream(follow_info_t *info)
Definition follow.c:152
WS_DLL_PUBLIC tap_packet_cb get_follow_tap_handler(register_follow_t *follower)
Definition follow.c:106
WS_DLL_PUBLIC follow_address_filter_func get_follow_address_func(register_follow_t *follower)
Definition follow.c:96
WS_DLL_PUBLIC const char * get_follow_tap_string(register_follow_t *follower)
Definition follow.c:78
WS_DLL_PUBLIC follow_stream_count_func get_follow_stream_count_func(register_follow_t *follower)
Definition follow.c:111
WS_DLL_PUBLIC follow_conv_filter_func get_follow_conv_func(register_follow_t *follower)
Definition follow.c:86
WS_DLL_PUBLIC register_follow_t * get_follow_by_proto_id(const int proto_id)
Definition follow.c:126
WS_DLL_PUBLIC follow_sub_stream_id_func get_follow_sub_stream_id_func(register_follow_t *follower)
Definition follow.c:116
WS_DLL_PUBLIC register_follow_t * get_follow_by_name(const char *proto_short_name)
Definition follow.c:121
WS_DLL_PUBLIC follow_index_filter_func get_follow_index_func(register_follow_t *follower)
Definition follow.c:91
void follow_init(void)
Definition follow.c:37
WS_DLL_PUBLIC char * follow_get_stat_tap_string(register_follow_t *follower)
Definition follow.c:141
WS_DLL_PUBLIC void follow_iterate_followers(wmem_foreach_func func, void *user_data)
Definition follow.c:136
WS_DLL_PUBLIC void follow_info_free(follow_info_t *follow_info)
Definition follow.c:205
WS_DLL_PUBLIC follow_port_to_display_func get_follow_port_to_display(register_follow_t *follower)
Definition follow.c:101
WS_DLL_PUBLIC int get_follow_proto_id(register_follow_t *follower)
Definition follow.c:70
WS_DLL_PUBLIC tap_packet_status follow_tvb_tap_listener(void *tapdata, packet_info *pinfo, epan_dissect_t *edt _U_, const void *data, tap_flags_t flags)
Definition follow.c:212
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 address.h:58
Definition follow.h:62
uint64_t substream_id
Definition follow.h:74
Definition packet_info.h:43
Internal memory allocator interface used by the wmem subsystem.
Definition wmem_allocator.h:34
Represents a 128-bit IPv6 address.
Definition inet_addr.h:27
Definition epan_dissect.h:28
Definition follow.h:54
nstime_t abs_ts
Definition follow.h:58
Definition file-pcapng.h:57
Definition nstime.h:26
Definition follow.c:23
Definition stream.c:41
tap_packet_status
Definition tap.h:25
Represents an IP address for a stream, supporting both IPv4 and IPv6.
Definition follow.h:45
uint32_t ipv4
Definition follow.h:46
ws_in6_addr ipv6
Definition follow.h:47