| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet_range.h
Go to the documentation of this file.
1
14
15#ifndef __PACKET_RANGE_H__
16#define __PACKET_RANGE_H__
17
18#include <glib.h>
19
20#include <epan/range.h>
21#include <epan/frame_data.h>
22
23#include <epan/cfile.h>
24
25#ifdef __cplusplus
26 extern "C" {
27#endif /* __cplusplus */
28
29 extern uint32_t curr_selected_frame;
30
34 typedef enum {
35 range_process_all,
36 range_process_selected,
37 range_process_marked,
38 range_process_marked_range,
39 range_process_user_range
40} packet_range_e;
41
46 typedef struct packet_range_tag {
47
48 /* --- UI-supplied settings --- */
49
50 packet_range_e process;
51 bool process_filtered;
52 bool remove_ignored;
53 bool include_dependents;
54
55 /* --- User-specified range --- */
56
57 range_t *user_range;
58 convert_ret_t user_range_status;
59
60 /* --- Calculated selection range --- */
61
62 range_t *selection_range;
63 convert_ret_t selection_range_status;
64
65 /* --- Captured packet counts --- */
66
67 capture_file *cf;
68 uint32_t mark_range_cnt;
69 uint32_t user_range_cnt;
70 uint32_t selection_range_cnt;
71 uint32_t marked_plus_depends_cnt;
72 uint32_t mark_range_plus_depends_cnt;
73 uint32_t user_range_plus_depends_cnt;
74 uint32_t selected_plus_depends_cnt;
75 uint32_t ignored_cnt;
76 uint32_t ignored_marked_cnt;
77 uint32_t ignored_mark_range_cnt;
78 uint32_t ignored_user_range_cnt;
79 uint32_t ignored_selection_range_cnt;
80
81 /* --- Displayed (filtered) packet counts --- */
82
83 uint32_t displayed_cnt;
84 uint32_t displayed_plus_dependents_cnt;
85 uint32_t displayed_marked_cnt;
86 uint32_t displayed_mark_range_cnt;
87 uint32_t displayed_user_range_cnt;
88 uint32_t displayed_marked_plus_depends_cnt;
89 uint32_t displayed_mark_range_plus_depends_cnt;
90 uint32_t displayed_user_range_plus_depends_cnt;
91 uint32_t displayed_selection_range_cnt;
92 uint32_t displayed_selected_plus_depends_cnt;
93 uint32_t displayed_ignored_cnt;
94 uint32_t displayed_ignored_marked_cnt;
95 uint32_t displayed_ignored_mark_range_cnt;
96 uint32_t displayed_ignored_user_range_cnt;
97 uint32_t displayed_ignored_selection_range_cnt;
98
99 /* --- Dependency hash sets --- */
100
101 GHashTable *marked_plus_depends;
102 GHashTable *displayed_marked_plus_depends;
103 GHashTable *mark_range_plus_depends;
104 GHashTable *displayed_mark_range_plus_depends;
105 GHashTable *user_range_plus_depends;
106 GHashTable *displayed_user_range_plus_depends;
107 GHashTable *selected_plus_depends;
108 GHashTable *displayed_selected_plus_depends;
109
110 /* --- Enumeration state --- */
111
112 bool marked_range_active;
113 uint32_t marked_range_left;
114
115} packet_range_t;
116
120 typedef enum {
121 range_process_this,
122 range_process_next,
123 range_processing_finished
124} range_process_e;
125
129 typedef struct packet_range_iter {
130 packet_range_t *range;
131 uint32_t current_frame;
132} packet_range_iter_t;
133
134/* init the range structure */
135
142 extern void packet_range_init(packet_range_t *range, capture_file *cf);
143
149 extern void packet_range_cleanup(packet_range_t *range);
150
157 extern convert_ret_t packet_range_check(packet_range_t *range);
158
164 extern void packet_range_process_init(packet_range_t *range);
165
172 extern bool packet_range_process_all(packet_range_t *range);
173
181 extern range_process_e packet_range_process_packet(packet_range_t *range, frame_data *fdata);
182
189 extern void packet_range_convert_str(packet_range_t *range, const char *es);
190
199 extern void packet_range_convert_selection_str(packet_range_t *range, const char *es);
200
211 extern uint32_t packet_range_count(const packet_range_t *range);
212
222 extern void packet_range_iter_init(packet_range_iter_t *iter, packet_range_t *range);
223
230 extern frame_data* packet_range_iter_next(packet_range_iter_t *iter);
231
232#ifdef __cplusplus
233}
234#endif /* __cplusplus */
235
236#endif /* __PACKET_RANGE_H__ */
cfile.h
capture_file
struct _capture_file capture_file
Represents a capture file and its associated metadata.
frame_data.h
frame_data
DIAG_OFF_PEDANTIC struct _frame_data frame_data
Frame data structure.
packet_range_convert_selection_str
void packet_range_convert_selection_str(packet_range_t *range, const char *es)
Convert a selection string to a packet range.
Definition packet_range.c:516
packet_range_process_all
bool packet_range_process_all(packet_range_t *range)
Check if all packets in the range need to be processed.
Definition packet_range.c:342
packet_range_process_init
void packet_range_process_init(packet_range_t *range)
Initialize the processing run for a packet range.
Definition packet_range.c:326
packet_range_t
struct packet_range_tag packet_range_t
Fully describes a packet range selection, including UI settings, derived counts, and dependency sets ...
packet_range_check
convert_ret_t packet_range_check(packet_range_t *range)
Check whether the packet range is OK.
Definition packet_range.c:313
packet_range_iter_t
struct packet_range_iter packet_range_iter_t
Iterator state for stepping through a packet range one frame at a time.
packet_range_process_packet
range_process_e packet_range_process_packet(packet_range_t *range, frame_data *fdata)
Check if a packet should be processed based on the given range.
Definition packet_range.c:410
packet_range_init
void packet_range_init(packet_range_t *range, capture_file *cf)
Initialize a packet range structure.
Definition packet_range.c:277
packet_range_iter_next
frame_data * packet_range_iter_next(packet_range_iter_t *iter)
Get the next frame data to process from a packet range.
Definition packet_range.c:667
packet_range_e
packet_range_e
Selects which subset of packets in a capture file should be processed.
Definition packet_range.h:34
range_process_all
@ range_process_all
Definition packet_range.h:35
range_process_marked
@ range_process_marked
Definition packet_range.h:37
range_process_marked_range
@ range_process_marked_range
Definition packet_range.h:38
range_process_selected
@ range_process_selected
Definition packet_range.h:36
range_process_user_range
@ range_process_user_range
Definition packet_range.h:39
range_process_e
range_process_e
Disposition returned per-packet by the range enumeration callback to control iteration.
Definition packet_range.h:120
range_processing_finished
@ range_processing_finished
Definition packet_range.h:123
range_process_next
@ range_process_next
Definition packet_range.h:122
range_process_this
@ range_process_this
Definition packet_range.h:121
packet_range_count
uint32_t packet_range_count(const packet_range_t *range)
Return the number of packets that will be processed.
Definition packet_range.c:547
packet_range_cleanup
void packet_range_cleanup(packet_range_t *range)
Cleanup the range structure before the caller frees "range".
Definition packet_range.c:299
packet_range_iter_init
void packet_range_iter_init(packet_range_iter_t *iter, packet_range_t *range)
Initialize an iterator over a packet range.
Definition packet_range.c:659
packet_range_convert_str
void packet_range_convert_str(packet_range_t *range, const char *es)
Convert a user-given string to an internal selection specified range representation.
Definition packet_range.c:485
range.h
range_t
struct epan_range range_t
convert_ret_t
convert_ret_t
Return value from range_convert_str().
Definition range.h:50
packet_range_iter
Iterator state for stepping through a packet range one frame at a time.
Definition packet_range.h:129
packet_range_iter::current_frame
uint32_t current_frame
Definition packet_range.h:131
packet_range_iter::range
packet_range_t * range
Definition packet_range.h:130
packet_range_tag
Fully describes a packet range selection, including UI settings, derived counts, and dependency sets ...
Definition packet_range.h:46
packet_range_tag::marked_plus_depends
GHashTable * marked_plus_depends
Definition packet_range.h:101
packet_range_tag::remove_ignored
bool remove_ignored
Definition packet_range.h:52
packet_range_tag::selected_plus_depends_cnt
uint32_t selected_plus_depends_cnt
Definition packet_range.h:74
packet_range_tag::displayed_user_range_cnt
uint32_t displayed_user_range_cnt
Definition packet_range.h:87
packet_range_tag::displayed_user_range_plus_depends_cnt
uint32_t displayed_user_range_plus_depends_cnt
Definition packet_range.h:90
packet_range_tag::displayed_cnt
uint32_t displayed_cnt
Definition packet_range.h:83
packet_range_tag::mark_range_cnt
uint32_t mark_range_cnt
Definition packet_range.h:68
packet_range_tag::displayed_mark_range_plus_depends_cnt
uint32_t displayed_mark_range_plus_depends_cnt
Definition packet_range.h:89
packet_range_tag::user_range_plus_depends_cnt
uint32_t user_range_plus_depends_cnt
Definition packet_range.h:73
packet_range_tag::displayed_mark_range_plus_depends
GHashTable * displayed_mark_range_plus_depends
Definition packet_range.h:104
packet_range_tag::displayed_selected_plus_depends
GHashTable * displayed_selected_plus_depends
Definition packet_range.h:108
packet_range_tag::displayed_mark_range_cnt
uint32_t displayed_mark_range_cnt
Definition packet_range.h:86
packet_range_tag::ignored_user_range_cnt
uint32_t ignored_user_range_cnt
Definition packet_range.h:78
packet_range_tag::user_range
range_t * user_range
Definition packet_range.h:57
packet_range_tag::displayed_ignored_user_range_cnt
uint32_t displayed_ignored_user_range_cnt
Definition packet_range.h:96
packet_range_tag::selection_range_cnt
uint32_t selection_range_cnt
Definition packet_range.h:70
packet_range_tag::include_dependents
bool include_dependents
Definition packet_range.h:53
packet_range_tag::selection_range
range_t * selection_range
Definition packet_range.h:62
packet_range_tag::user_range_status
convert_ret_t user_range_status
Definition packet_range.h:58
packet_range_tag::displayed_ignored_selection_range_cnt
uint32_t displayed_ignored_selection_range_cnt
Definition packet_range.h:97
packet_range_tag::ignored_selection_range_cnt
uint32_t ignored_selection_range_cnt
Definition packet_range.h:79
packet_range_tag::marked_range_active
bool marked_range_active
Definition packet_range.h:112
packet_range_tag::displayed_ignored_marked_cnt
uint32_t displayed_ignored_marked_cnt
Definition packet_range.h:94
packet_range_tag::marked_range_left
uint32_t marked_range_left
Definition packet_range.h:113
packet_range_tag::ignored_cnt
uint32_t ignored_cnt
Definition packet_range.h:75
packet_range_tag::displayed_selected_plus_depends_cnt
uint32_t displayed_selected_plus_depends_cnt
Definition packet_range.h:92
packet_range_tag::marked_plus_depends_cnt
uint32_t marked_plus_depends_cnt
Definition packet_range.h:71
packet_range_tag::mark_range_plus_depends_cnt
uint32_t mark_range_plus_depends_cnt
Definition packet_range.h:72
packet_range_tag::ignored_marked_cnt
uint32_t ignored_marked_cnt
Definition packet_range.h:76
packet_range_tag::displayed_ignored_cnt
uint32_t displayed_ignored_cnt
Definition packet_range.h:93
packet_range_tag::ignored_mark_range_cnt
uint32_t ignored_mark_range_cnt
Definition packet_range.h:77
packet_range_tag::process_filtered
bool process_filtered
Definition packet_range.h:51
packet_range_tag::displayed_marked_plus_depends
GHashTable * displayed_marked_plus_depends
Definition packet_range.h:102
packet_range_tag::displayed_ignored_mark_range_cnt
uint32_t displayed_ignored_mark_range_cnt
Definition packet_range.h:95
packet_range_tag::user_range_plus_depends
GHashTable * user_range_plus_depends
Definition packet_range.h:105
packet_range_tag::displayed_user_range_plus_depends
GHashTable * displayed_user_range_plus_depends
Definition packet_range.h:106
packet_range_tag::selected_plus_depends
GHashTable * selected_plus_depends
Definition packet_range.h:107
packet_range_tag::displayed_marked_plus_depends_cnt
uint32_t displayed_marked_plus_depends_cnt
Definition packet_range.h:88
packet_range_tag::process
packet_range_e process
Definition packet_range.h:50
packet_range_tag::displayed_selection_range_cnt
uint32_t displayed_selection_range_cnt
Definition packet_range.h:91
packet_range_tag::displayed_plus_dependents_cnt
uint32_t displayed_plus_dependents_cnt
Definition packet_range.h:84
packet_range_tag::displayed_marked_cnt
uint32_t displayed_marked_cnt
Definition packet_range.h:85
packet_range_tag::selection_range_status
convert_ret_t selection_range_status
Definition packet_range.h:63
packet_range_tag::user_range_cnt
uint32_t user_range_cnt
Definition packet_range.h:69
packet_range_tag::mark_range_plus_depends
GHashTable * mark_range_plus_depends
Definition packet_range.h:103
packet_range_tag::cf
capture_file * cf
Definition packet_range.h:67