2 * Packet range routines (save, print, ...)
4 * Dick Gooris <gooris@lucent.com>
5 * Ulf Lamping <ulf.lamping@web.de>
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #ifndef __PACKET_RANGE_H__
27 #define __PACKET_RANGE_H__
31 #endif /* __cplusplus */
35 #include <epan/range.h>
40 extern guint32 curr_selected_frame;
44 range_process_selected,
46 range_process_marked_range,
47 range_process_user_range
50 typedef struct packet_range_tag {
51 /* values coming from the UI */
52 packet_range_e process; /* which range to process */
53 gboolean process_filtered; /* captured or filtered packets */
54 gboolean remove_ignored; /* remove ignored packets */
55 gboolean include_dependents; /* True if packets which are dependents of others should be processed */
57 /* user specified range(s) and, if null, error status */
59 convert_ret_t user_range_status;
61 /* calculated values */
62 guint32 selected_packet; /* the currently selected packet */
64 /* current packet counts (captured) */
65 capture_file *cf; /* Associated capture file. */
66 guint32 mark_range_cnt; /* packets in marked range */
67 guint32 user_range_cnt; /* packets in user specified range */
68 guint32 ignored_cnt; /* packets ignored */
69 guint32 ignored_marked_cnt; /* packets ignored and marked */
70 guint32 ignored_mark_range_cnt; /* packets ignored in marked range */
71 guint32 ignored_user_range_cnt; /* packets ignored in user specified range */
73 /* current packet counts (displayed) */
74 guint32 displayed_cnt;
75 guint32 displayed_plus_dependents_cnt;
76 guint32 displayed_marked_cnt;
77 guint32 displayed_mark_range_cnt;
78 guint32 displayed_user_range_cnt;
79 guint32 displayed_ignored_cnt;
80 guint32 displayed_ignored_marked_cnt;
81 guint32 displayed_ignored_mark_range_cnt;
82 guint32 displayed_ignored_user_range_cnt;
84 /* "enumeration" values */
85 gboolean marked_range_active; /* marked range is currently processed */
86 guint32 marked_range_left; /* marked range packets left to do */
87 gboolean selected_done; /* selected packet already processed */
91 range_process_this, /* process this packet */
92 range_process_next, /* skip this packet, process next */
93 range_processing_finished /* stop processing, required packets done */
96 /* init the range structure */
97 WS_DLL_PUBLIC void packet_range_init(packet_range_t *range, capture_file *cf);
99 /* check whether the packet range is OK */
100 WS_DLL_PUBLIC convert_ret_t packet_range_check(packet_range_t *range);
102 /* init the processing run */
103 WS_DLL_PUBLIC void packet_range_process_init(packet_range_t *range);
105 /* do we have to process all packets? */
106 WS_DLL_PUBLIC gboolean packet_range_process_all(packet_range_t *range);
108 /* do we have to process this packet? */
109 WS_DLL_PUBLIC range_process_e packet_range_process_packet(packet_range_t *range, frame_data *fdata);
111 /* convert user given string to the internal user specified range representation */
112 WS_DLL_PUBLIC void packet_range_convert_str(packet_range_t *range, const gchar *es);
116 #endif /* __cplusplus */
118 #endif /* __PACKET_RANGE_H__ */