2004-09-04 00:53:16 +00:00
|
|
|
/* packet-range.h
|
2003-12-29 20:05:59 +00:00
|
|
|
* Packet range routines (save, print, ...)
|
|
|
|
*
|
2004-07-18 00:24:25 +00:00
|
|
|
* $Id$
|
2003-12-29 20:40:44 +00:00
|
|
|
*
|
2003-12-29 20:05:59 +00:00
|
|
|
* Dick Gooris <gooris@lucent.com>
|
|
|
|
* Ulf Lamping <ulf.lamping@web.de>
|
|
|
|
*
|
2006-05-21 05:12:17 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
2003-12-29 20:05:59 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2003-12-29 20:05:59 +00:00
|
|
|
*/
|
|
|
|
|
2004-09-04 00:53:16 +00:00
|
|
|
#ifndef __PACKET_RANGE_H__
|
|
|
|
#define __PACKET_RANGE_H__
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2012-10-05 18:52:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2012-10-05 18:52:42 +00:00
|
|
|
#include <glib.h>
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2004-09-04 01:32:13 +00:00
|
|
|
#include <epan/range.h>
|
|
|
|
|
2012-10-05 18:52:42 +00:00
|
|
|
#include "cfile.h"
|
|
|
|
|
|
|
|
|
2003-12-29 20:05:59 +00:00
|
|
|
extern guint32 curr_selected_frame;
|
|
|
|
|
2004-01-05 22:21:53 +00:00
|
|
|
typedef enum {
|
|
|
|
range_process_all,
|
2004-01-09 14:05:20 +00:00
|
|
|
range_process_selected,
|
2004-01-05 22:21:53 +00:00
|
|
|
range_process_marked,
|
|
|
|
range_process_marked_range,
|
2004-01-08 10:40:33 +00:00
|
|
|
range_process_user_range
|
2004-01-05 22:21:53 +00:00
|
|
|
} packet_range_e;
|
|
|
|
|
2003-12-29 20:05:59 +00:00
|
|
|
typedef struct packet_range_tag {
|
|
|
|
/* values coming from the UI */
|
2004-01-08 10:40:33 +00:00
|
|
|
packet_range_e process; /* which range to process */
|
|
|
|
gboolean process_filtered; /* captured or filtered packets */
|
2010-01-26 13:08:22 +00:00
|
|
|
gboolean remove_ignored; /* remove ignored packets */
|
2012-02-28 03:19:49 +00:00
|
|
|
gboolean include_dependents; /* True if packets which are dependents of others should be processed */
|
2004-01-08 10:40:33 +00:00
|
|
|
|
2004-10-16 23:32:24 +00:00
|
|
|
/* user specified range(s) and, if null, error status */
|
|
|
|
range_t *user_range;
|
|
|
|
convert_ret_t user_range_status;
|
2003-12-29 20:05:59 +00:00
|
|
|
|
|
|
|
/* calculated values */
|
2004-01-09 14:05:20 +00:00
|
|
|
guint32 selected_packet; /* the currently selected packet */
|
2004-01-08 10:40:33 +00:00
|
|
|
|
|
|
|
/* current packet counts (captured) */
|
2012-10-05 18:52:42 +00:00
|
|
|
capture_file *cf; /* Associated capture file. */
|
|
|
|
guint32 mark_range_cnt; /* packets in marked range */
|
|
|
|
guint32 user_range_cnt; /* packets in user specified range */
|
|
|
|
guint32 ignored_cnt; /* packets ignored */
|
|
|
|
guint32 ignored_marked_cnt; /* packets ignored and marked */
|
|
|
|
guint32 ignored_mark_range_cnt; /* packets ignored in marked range */
|
|
|
|
guint32 ignored_user_range_cnt; /* packets ignored in user specified range */
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2004-01-08 10:40:33 +00:00
|
|
|
/* current packet counts (displayed) */
|
2004-01-07 00:10:52 +00:00
|
|
|
guint32 displayed_cnt;
|
2012-02-28 03:19:49 +00:00
|
|
|
guint32 displayed_plus_dependents_cnt;
|
2004-01-07 00:10:52 +00:00
|
|
|
guint32 displayed_marked_cnt;
|
2004-01-09 18:11:21 +00:00
|
|
|
guint32 displayed_mark_range_cnt;
|
|
|
|
guint32 displayed_user_range_cnt;
|
2010-01-26 13:08:22 +00:00
|
|
|
guint32 displayed_ignored_cnt;
|
|
|
|
guint32 displayed_ignored_marked_cnt;
|
|
|
|
guint32 displayed_ignored_mark_range_cnt;
|
|
|
|
guint32 displayed_ignored_user_range_cnt;
|
2004-01-07 00:10:52 +00:00
|
|
|
|
2003-12-29 20:05:59 +00:00
|
|
|
/* "enumeration" values */
|
2004-01-09 14:05:20 +00:00
|
|
|
gboolean marked_range_active; /* marked range is currently processed */
|
2004-01-09 18:11:21 +00:00
|
|
|
guint32 marked_range_left; /* marked range packets left to do */
|
2004-01-09 14:05:20 +00:00
|
|
|
gboolean selected_done; /* selected packet already processed */
|
2003-12-29 20:05:59 +00:00
|
|
|
} packet_range_t;
|
|
|
|
|
|
|
|
typedef enum {
|
2004-01-09 14:05:20 +00:00
|
|
|
range_process_this, /* process this packet */
|
|
|
|
range_process_next, /* skip this packet, process next */
|
|
|
|
range_processing_finished /* stop processing, required packets done */
|
2003-12-29 20:05:59 +00:00
|
|
|
} range_process_e;
|
|
|
|
|
|
|
|
/* init the range structure */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC void packet_range_init(packet_range_t *range, capture_file *cf);
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2004-10-16 23:32:24 +00:00
|
|
|
/* check whether the packet range is OK */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC convert_ret_t packet_range_check(packet_range_t *range);
|
2004-10-16 23:32:24 +00:00
|
|
|
|
2004-01-09 14:05:20 +00:00
|
|
|
/* init the processing run */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC void packet_range_process_init(packet_range_t *range);
|
2004-01-09 14:05:20 +00:00
|
|
|
|
2003-12-29 20:05:59 +00:00
|
|
|
/* do we have to process all packets? */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC gboolean packet_range_process_all(packet_range_t *range);
|
2003-12-29 20:05:59 +00:00
|
|
|
|
|
|
|
/* do we have to process this packet? */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC range_process_e packet_range_process_packet(packet_range_t *range, frame_data *fdata);
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2004-01-08 10:40:33 +00:00
|
|
|
/* convert user given string to the internal user specified range representation */
|
2013-07-11 23:57:11 +00:00
|
|
|
WS_DLL_PUBLIC void packet_range_convert_str(packet_range_t *range, const gchar *es);
|
2003-12-29 20:05:59 +00:00
|
|
|
|
2012-10-05 18:52:42 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2004-09-04 00:53:16 +00:00
|
|
|
#endif /* __PACKET_RANGE_H__ */
|