/* cfile.c
- * capture_file GUI-independent manipulation
+ * capture_file GUI-independent manipulation
* Vassilii Khachaturov <vassilii@tarunz.org>
*
* $Id$
init_cap_file(capture_file *cf)
{
/* Initialize the capture file struct */
- cf->plist = NULL;
- cf->plist_end = NULL;
- cf->wth = NULL;
- cf->filename = NULL;
- cf->user_saved = FALSE;
- cf->is_tempfile = FALSE;
- cf->rfcode = NULL;
- cf->dfilter = NULL;
- cf->has_snap = FALSE;
- cf->snap = WTAP_MAX_PACKET_SIZE;
- cf->count = 0;
- cf->pstats = NULL;
- cf->redissecting = FALSE;
+ cf->plist_start = NULL;
+ cf->plist_end = NULL;
+ cf->wth = NULL;
+ cf->filename = NULL;
+ cf->user_saved = FALSE;
+ cf->is_tempfile = FALSE;
+ cf->rfcode = NULL;
+ cf->dfilter = NULL;
+ cf->has_snap = FALSE;
+ cf->snap = WTAP_MAX_PACKET_SIZE;
+ cf->count = 0;
+ cf->pstats = NULL;
+ cf->redissecting = FALSE;
}
/* packet data */
union wtap_pseudo_header pseudo_header; /* Packet pseudo_header */
guint8 pd[WTAP_MAX_PACKET_SIZE]; /* Packet data */
- /* memory chunks have been deprecated in favor of the slice allocator,
+ /* memory chunks have been deprecated in favor of the slice allocator,
* which has been added in 2.10
*/
#if GLIB_CHECK_VERSION(2,10,0)
#else
GMemChunk *plist_chunk; /* Memory chunk for frame_data structures */
#endif
- frame_data *plist; /* Packet list */
+ frame_data *plist_start; /* Packet list */
frame_data *plist_end; /* Last packet in list */
frame_data *first_displayed; /* First frame displayed */
frame_data *last_displayed; /* Last frame displayed */
cf->user_saved = FALSE;
#if GLIB_CHECK_VERSION(2,10,0)
- if (cf->plist != NULL)
- g_slice_free_chain(frame_data, cf->plist, next);
+ if (cf->plist_start != NULL)
+ g_slice_free_chain(frame_data, cf->plist_start, next);
#else
/* memory chunks have been deprecated in favor of the slice allocator,
* which has been added in 2.10
dfilter_free(cf->rfcode);
cf->rfcode = NULL;
}
- cf->plist = NULL;
+ cf->plist_start = NULL;
cf->plist_end = NULL;
cf_unselect_packet(cf); /* nothing to select */
cf->first_displayed = NULL;
if (plist_end != NULL)
plist_end->next = fdata;
else
- cf->plist = fdata;
+ cf->plist_start = fdata;
cf->plist_end = fdata;
cf->f_datalen = offset + phdr->caplen;
selected_frame_seen = FALSE;
- for (fdata = cf->plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cf->plist_start; fdata != NULL; fdata = fdata->next) {
/* Create the progress bar if necessary.
We check on every iteration of the loop, so that it takes no
longer than the standard time to create it (otherwise, for a
nstime_set_unset(&prev_dis_ts);
cum_bytes = 0;
- for (fdata = cf->plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cf->plist_start; fdata != NULL; fdata = fdata->next) {
/* just add some value here until we know if it is being displayed or not */
fdata->cum_bytes = cum_bytes + fdata->pkt_len;
/* Iterate through the list of packets, printing the packets that
were selected by the current display filter. */
- for (fdata = cf->plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cf->plist_start; fdata != NULL; fdata = fdata->next) {
/* Create the progress bar if necessary.
We check on every iteration of the loop, so that it takes no
longer than the standard time to create it (otherwise, for a
"%sEnd of capture exceeded!%s\n\n"
"Search is continued from the start of the capture.",
simple_dialog_primary_start(), simple_dialog_primary_end());
- fdata = cf->plist; /* wrap around */
+ fdata = cf->plist_start; /* wrap around */
}
else
{
frame_data *fdata;
int row;
- for (fdata = cf->plist; fdata != NULL && fdata->num < fnumber; fdata = fdata->next)
+ for (fdata = cf->plist_start; fdata != NULL && fdata->num < fnumber; fdata = fdata->next)
;
if (fdata == NULL) {
frame_data *fdata;
/* XXX: we might need a progressbar here */
- for (fdata = cfile.plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cfile.plist_start; fdata != NULL; fdata = fdata->next) {
set_frame_mark(set,
fdata,
gtk_clist_find_row_from_data(GTK_CLIST(packet_list), fdata));
{
frame_data *fdata;
- if (cfile.plist == NULL) return;
+ if (cfile.plist_start == NULL) return;
/* XXX: we might need a progressbar here */
- for (fdata = cfile.plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cfile.plist_start; fdata != NULL; fdata = fdata->next) {
if (fdata->flags.marked)
set_frame_mark(TRUE, fdata,
gtk_clist_find_row_from_data(GTK_CLIST(packet_list),
long_str = get_column_width_string(fmt, i);
layout = gtk_widget_create_pango_layout(packetlist->view, long_str);
/* the logical width and height of a PangoLayout in device units */
- pango_layout_get_pixel_size(layout,
- &col_width, /* width */
+ pango_layout_get_pixel_size(layout,
+ &col_width, /* width */
NULL); /* height */
if (col_width < 1){
g_warning("*** Error: A column width of %u passed to gtk_tree_view_column_set_fixed_width()\n"
GtkTreeSelection *selection;
GtkTreeIter iter;
GtkTreeModel *model;
- GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(top_level));
+ GtkWidget *focus = gtk_window_get_focus(GTK_WINDOW(top_level));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(packetlist->view));
/* model is filled with the current model as a convenience. */
frame_data *fdata;
/* XXX: we might need a progressbar here */
- for (fdata = cfile.plist; fdata != NULL; fdata = fdata->next) {
+ for (fdata = cfile.plist_start; fdata != NULL; fdata = fdata->next) {
set_frame_mark(set, fdata);
}
mark_frames_ready();
/* The next for-loop is used to obtain the amount of packets to be processed
* and is used to present the information in the Save/Print As widget.
* We have different types of ranges: All the packets, the number
- * of packets of a marked range, a single packet, and a user specified
+ * of packets of a marked range, a single packet, and a user specified
* packet range. The last one is not calculated here since this
* data must be entered in the widget by the user.
*/
current_count = 0;
- for(packet = cfile.plist; packet != NULL; packet = packet->next) {
+ for(packet = cfile.plist_start; packet != NULL; packet = packet->next) {
current_count++;
if (cfile.current_frame == packet) {
range->selected_packet = current_count;
}
}
}
-
+
current_count = 0;
- for(packet = cfile.plist; packet != NULL; packet = packet->next) {
+ for(packet = cfile.plist_start; packet != NULL; packet = packet->next) {
current_count++;
- if (current_count >= mark_low &&
+ if (current_count >= mark_low &&
current_count <= mark_high)
{
range->mark_range_cnt++;
}
- if (current_count >= displayed_mark_low &&
+ if (current_count >= displayed_mark_low &&
current_count <= displayed_mark_high)
{
if (packet->flags.passed_dfilter) {
/*if (cfile.marked_count != 0) {
range->mark_range = mark_high - mark_low + 1;
}*/
-
+
/* in case we marked just one packet, we add 1. */
/*if (range->displayed_marked_cnt != 0) {
range->displayed_mark_range = displayed_mark_high - displayed_mark_low + 1;
range->displayed_user_range_cnt = 0L;
current_count = 0;
- for(packet = cfile.plist; packet != NULL; packet = packet->next) {
+ for(packet = cfile.plist_start; packet != NULL; packet = packet->next) {
current_count++;
if (value_is_in_range(range->user_range, current_count)) {
tot_packets = 0;
tot_bytes = 0;
- for (frame = cfile.plist; frame != NULL; frame = frame->next) {
+ for (frame = cfile.plist_start; frame != NULL; frame = frame->next) {
/* Create the progress bar if necessary.
We check on every iteration of the loop, so that
it takes no longer than the standard time to create
to get to the next progress bar step). */
if (progbar == NULL)
progbar = delayed_create_progress_dlg(
- "Computing", "protocol hierarchy statistics",
+ "Computing", "protocol hierarchy statistics",
TRUE, &stop_flag, &start_time, progbar_val);
/* Update the progress bar, but do it only N_PROGBAR_UPDATES
ps->first_time = cur_time;
ps->last_time = cur_time;
}
-
+
/* we don't care about colinfo */
if (!process_frame(frame, NULL, ps)) {
/*
st->marked_bytes = 0;
/* initialize the tally */
- if (cf->plist != NULL) {
- first_frame = cf->plist;
+ if (cf->plist_start != NULL) {
+ first_frame = cf->plist_start;
st->start_time = nstime_to_sec(&first_frame->abs_ts);
st->stop_time = nstime_to_sec(&first_frame->abs_ts);
- cur_glist = cf->plist;
+ cur_glist = cf->plist_start;
for (i = 0; i < cf->count; i++) {
cur_frame = cur_glist;