From: Gilbert Ramirez Date: Wed, 21 Nov 2001 23:16:26 +0000 (-0000) Subject: Remove the global packet_info called "pi". Dissectors now only X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=8743a4a8a7613095d833e380744a358b7074b0c8;p=metze%2Fwireshark%2Fwip.git Remove the global packet_info called "pi". Dissectors now only access their own "pinfo". A packet_info is stored in epan_dissect_t, which is created for the dissection of a single packet. GUI functions which need to access the packet_info of the currently selected packet used to use "pi"; now they use cfile.edt->pi. cfile's "edt" member is the epan_dissect_t of the currently-selected packet. The functionality of blank_packetinfo() was moved into dissect_packet(), as that's the only place that called blank_packetinfo(), after a spurious call to blank_packetinfo() was removed from packet_list_select_cb(). svn path=/trunk/; revision=4246 --- diff --git a/epan/Makefile.am b/epan/Makefile.am index d4cd476c77..edd67b335b 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -2,7 +2,7 @@ # Automake file for the EPAN library # (Ethereal Protocol ANalyzer Library) # -# $Id: Makefile.am,v 1.27 2001/09/14 07:33:04 guy Exp $ +# $Id: Makefile.am,v 1.28 2001/11/21 23:16:23 gram Exp $ # # Ethereal - Network traffic analyzer # By Gerald Combs @@ -62,7 +62,6 @@ libethereal_a_SOURCES = \ osi-utils.h \ packet.c \ packet.h \ - packet_info.c \ packet_info.h \ pint.h \ plugins.c \ diff --git a/epan/Makefile.nmake b/epan/Makefile.nmake index 73ca861b77..517b346040 100644 --- a/epan/Makefile.nmake +++ b/epan/Makefile.nmake @@ -32,7 +32,6 @@ OBJECTS=atalk-utils.obj \ ipv4.obj \ osi-utils.obj \ packet.obj \ - packet_info.obj \ plugins.obj \ proto.obj \ resolv.obj \ diff --git a/epan/column-utils.c b/epan/column-utils.c index f496451c4c..31baabe866 100644 --- a/epan/column-utils.c +++ b/epan/column-utils.c @@ -1,7 +1,7 @@ /* column-utils.c * Routines for column utilities. * - * $Id: column-utils.c,v 1.6 2001/09/14 07:23:33 guy Exp $ + * $Id: column-utils.c,v 1.7 2001/11/21 23:16:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -457,7 +457,7 @@ col_set_port(frame_data *fd, int col, port_type ptype, guint32 port, } void -fill_in_columns(frame_data *fd) +fill_in_columns(frame_data *fd, packet_info *pinfo) { int i; @@ -491,74 +491,74 @@ fill_in_columns(frame_data *fd) case COL_DEF_SRC: case COL_RES_SRC: /* COL_DEF_SRC is currently just like COL_RES_SRC */ - col_set_addr(fd, i, &pi.src, TRUE); + col_set_addr(fd, i, &pinfo->src, TRUE); break; case COL_UNRES_SRC: - col_set_addr(fd, i, &pi.src, FALSE); + col_set_addr(fd, i, &pinfo->src, FALSE); break; case COL_DEF_DL_SRC: case COL_RES_DL_SRC: - col_set_addr(fd, i, &pi.dl_src, TRUE); + col_set_addr(fd, i, &pinfo->dl_src, TRUE); break; case COL_UNRES_DL_SRC: - col_set_addr(fd, i, &pi.dl_src, FALSE); + col_set_addr(fd, i, &pinfo->dl_src, FALSE); break; case COL_DEF_NET_SRC: case COL_RES_NET_SRC: - col_set_addr(fd, i, &pi.net_src, TRUE); + col_set_addr(fd, i, &pinfo->net_src, TRUE); break; case COL_UNRES_NET_SRC: - col_set_addr(fd, i, &pi.net_src, FALSE); + col_set_addr(fd, i, &pinfo->net_src, FALSE); break; case COL_DEF_DST: case COL_RES_DST: /* COL_DEF_DST is currently just like COL_RES_DST */ - col_set_addr(fd, i, &pi.dst, TRUE); + col_set_addr(fd, i, &pinfo->dst, TRUE); break; case COL_UNRES_DST: - col_set_addr(fd, i, &pi.dst, FALSE); + col_set_addr(fd, i, &pinfo->dst, FALSE); break; case COL_DEF_DL_DST: case COL_RES_DL_DST: - col_set_addr(fd, i, &pi.dl_dst, TRUE); + col_set_addr(fd, i, &pinfo->dl_dst, TRUE); break; case COL_UNRES_DL_DST: - col_set_addr(fd, i, &pi.dl_dst, FALSE); + col_set_addr(fd, i, &pinfo->dl_dst, FALSE); break; case COL_DEF_NET_DST: case COL_RES_NET_DST: - col_set_addr(fd, i, &pi.net_dst, TRUE); + col_set_addr(fd, i, &pinfo->net_dst, TRUE); break; case COL_UNRES_NET_DST: - col_set_addr(fd, i, &pi.net_dst, FALSE); + col_set_addr(fd, i, &pinfo->net_dst, FALSE); break; case COL_DEF_SRC_PORT: case COL_RES_SRC_PORT: /* COL_DEF_SRC_PORT is currently just like COL_RES_SRC_PORT */ - col_set_port(fd, i, pi.ptype, pi.srcport, TRUE); + col_set_port(fd, i, pinfo->ptype, pinfo->srcport, TRUE); break; case COL_UNRES_SRC_PORT: - col_set_port(fd, i, pi.ptype, pi.srcport, FALSE); + col_set_port(fd, i, pinfo->ptype, pinfo->srcport, FALSE); break; case COL_DEF_DST_PORT: case COL_RES_DST_PORT: /* COL_DEF_DST_PORT is currently just like COL_RES_DST_PORT */ - col_set_port(fd, i, pi.ptype, pi.destport, TRUE); + col_set_port(fd, i, pinfo->ptype, pinfo->destport, TRUE); break; case COL_UNRES_DST_PORT: - col_set_port(fd, i, pi.ptype, pi.destport, FALSE); + col_set_port(fd, i, pinfo->ptype, pinfo->destport, FALSE); break; case COL_PROTOCOL: /* currently done by dissectors */ diff --git a/epan/column-utils.h b/epan/column-utils.h index cafe5622e1..e16cc926f1 100644 --- a/epan/column-utils.h +++ b/epan/column-utils.h @@ -1,7 +1,7 @@ /* column-utils.h * Definitions for column utility structures and routines * - * $Id: column-utils.h,v 1.3 2001/10/31 07:47:26 guy Exp $ + * $Id: column-utils.h,v 1.4 2001/11/21 23:16:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -32,6 +32,7 @@ #include "column_info.h" #include "frame_data.h" +#include "packet_info.h" /* Allocate all the data structures for constructing column data, given the number of columns. */ @@ -55,7 +56,7 @@ extern void col_append_fstr(frame_data *, gint, gchar *, ...); extern void col_add_str(frame_data *, gint, const gchar *); extern void col_append_str(frame_data *, gint, gchar *); extern void col_set_cls_time(frame_data *, int); -extern void fill_in_columns(frame_data *); +extern void fill_in_columns(frame_data *, packet_info *); #endif /* __COLUMN_UTILS_H__ */ diff --git a/epan/epan.c b/epan/epan.c index 407f6aa11b..a60c67e92c 100644 --- a/epan/epan.c +++ b/epan/epan.c @@ -1,6 +1,6 @@ /* epan.h * - * $Id: epan.c,v 1.10 2001/04/02 00:38:34 hagbard Exp $ + * $Id: epan.c,v 1.11 2001/11/21 23:16:23 gram Exp $ * * Ethereal Protocol Analyzer Library * @@ -88,7 +88,7 @@ epan_dissect_new(void* pseudo_header, const guint8* data, frame_data *fd, proto_ /* XXX - init tree */ edt->tree = tree; - dissect_packet(&edt->tvb, pseudo_header, data, fd, tree); + dissect_packet(edt, pseudo_header, data, fd); return edt; } diff --git a/epan/epan.h b/epan/epan.h index a45387ffc5..263f3a806c 100644 --- a/epan/epan.h +++ b/epan/epan.h @@ -1,6 +1,6 @@ /* epan.h * - * $Id: epan.h,v 1.7 2001/10/21 21:47:58 guy Exp $ + * $Id: epan.h,v 1.8 2001/11/21 23:16:23 gram Exp $ * * Ethereal Protocol Analyzer Library * @@ -11,8 +11,11 @@ #include +struct _epan_dissect_t; + /* XXX - for now */ #include "packet.h" +#include "packet_info.h" void epan_init(const char * plugindir, void (register_all_protocols)(void), void (register_all_handoffs)(void)); @@ -45,9 +48,10 @@ epan_free(epan_t*); * as the structures that the epan_dissect_t contains might have pointers * to addresses in your byte array. */ -typedef struct { +typedef struct _epan_dissect_t { tvbuff_t *tvb; proto_tree *tree; + packet_info pi; } epan_dissect_t; epan_dissect_t* diff --git a/epan/packet.c b/epan/packet.c index 60dbb9264d..3c5fcd7ff9 100644 --- a/epan/packet.c +++ b/epan/packet.c @@ -1,7 +1,7 @@ /* packet.c * Routines for packet disassembly * - * $Id: packet.c,v 1.40 2001/11/21 01:00:37 guy Exp $ + * $Id: packet.c,v 1.41 2001/11/21 23:16:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -149,27 +149,42 @@ init_all_protocols(void) /* Creates the top-most tvbuff and calls dissect_frame() */ void -dissect_packet(tvbuff_t **p_tvb, union wtap_pseudo_header *pseudo_header, - const u_char *pd, frame_data *fd, proto_tree *tree) -{ - blank_packetinfo(); - - pi.fd = fd; - pi.pseudo_header = pseudo_header; +dissect_packet(epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, + const u_char *pd, frame_data *fd) +{ + edt->pi.dl_src.type = AT_NONE; + edt->pi.dl_dst.type = AT_NONE; + edt->pi.net_src.type = AT_NONE; + edt->pi.net_dst.type = AT_NONE; + edt->pi.src.type = AT_NONE; + edt->pi.dst.type = AT_NONE; + edt->pi.ethertype = 0; + edt->pi.ipproto = 0; + edt->pi.ipxptype = 0; + edt->pi.in_error_pkt = FALSE; + edt->pi.ptype = PT_NONE; + edt->pi.srcport = 0; + edt->pi.destport = 0; + edt->pi.current_proto = ""; + edt->pi.p2p_dir = P2P_DIR_UNKNOWN; + edt->pi.private_data = NULL; + + edt->pi.fd = fd; + edt->pi.pseudo_header = pseudo_header; col_set_writable(fd, TRUE); TRY { - *p_tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len, "Frame"); + edt->tvb = tvb_new_real_data(pd, fd->cap_len, fd->pkt_len, "Frame"); /* Add this tvbuffer into the data_src list */ - fd->data_src = g_slist_append( fd->data_src, *p_tvb); + fd->data_src = g_slist_append( fd->data_src, edt->tvb); } CATCH(BoundsError) { g_assert_not_reached(); } CATCH(ReportedBoundsError) { if(proto_malformed != -1){ - proto_tree_add_protocol_format(tree, proto_malformed, *p_tvb, 0, 0, + proto_tree_add_protocol_format(edt->tree, proto_malformed, edt->tvb, 0, 0, "[Malformed Frame: Packet Length]" ); } else { @@ -179,7 +194,7 @@ dissect_packet(tvbuff_t **p_tvb, union wtap_pseudo_header *pseudo_header, ENDTRY; if(frame_handle != NULL) - call_dissector(frame_handle, *p_tvb, &pi, tree); + call_dissector(frame_handle, edt->tvb, &edt->pi, edt->tree); fd->flags.visited = 1; } diff --git a/epan/packet.h b/epan/packet.h index 52e5acfeba..ce27cbc4a8 100644 --- a/epan/packet.h +++ b/epan/packet.h @@ -1,7 +1,7 @@ /* packet.h * Definitions for packet disassembly structures and routines * - * $Id: packet.h,v 1.39 2001/11/20 21:59:18 guy Exp $ + * $Id: packet.h,v 1.40 2001/11/21 23:16:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -35,6 +35,7 @@ #include "frame_data.h" #include "packet_info.h" #include "column-utils.h" +#include "epan.h" #define hi_nibble(b) (((b) & 0xf0) >> 4) #define lo_nibble(b) ((b) & 0x0f) @@ -223,9 +224,9 @@ extern void init_all_protocols(void); /* * Dissectors should never modify the packet data. */ -extern void dissect_packet(tvbuff_t **p_tvb, +extern void dissect_packet(struct _epan_dissect_t *edt, union wtap_pseudo_header *pseudo_header, const u_char *pd, - frame_data *fd, proto_tree *tree); + frame_data *fd); extern void dissect_data(tvbuff_t *tvb, int, packet_info *pinfo, proto_tree *tree); diff --git a/epan/packet_info.c b/epan/packet_info.c deleted file mode 100644 index 68d6aae5eb..0000000000 --- a/epan/packet_info.c +++ /dev/null @@ -1,53 +0,0 @@ -/* packet_info.c - * Routines for handling packet information - * - * $Id: packet_info.c,v 1.4 2001/11/03 00:58:52 guy Exp $ - * - * Ethereal - Network traffic analyzer - * By Gerald Combs - * 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 - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include - -#include "packet_info.h" - -void blank_packetinfo(void) -{ - pi.dl_src.type = AT_NONE; - pi.dl_dst.type = AT_NONE; - pi.net_src.type = AT_NONE; - pi.net_dst.type = AT_NONE; - pi.src.type = AT_NONE; - pi.dst.type = AT_NONE; - pi.ethertype = 0; - pi.ipproto = 0; - pi.ipxptype = 0; - pi.in_error_pkt = FALSE; - pi.ptype = PT_NONE; - pi.srcport = 0; - pi.destport = 0; - pi.current_proto = ""; - pi.p2p_dir = P2P_DIR_UNKNOWN; - pi.private_data = NULL; -} - - diff --git a/epan/packet_info.h b/epan/packet_info.h index c91cb9dc57..9bc939c9f3 100644 --- a/epan/packet_info.h +++ b/epan/packet_info.h @@ -1,7 +1,7 @@ /* packet_info.h * Definitions for packet info structures and routines * - * $Id: packet_info.h,v 1.10 2001/11/20 22:29:07 guy Exp $ + * $Id: packet_info.h,v 1.11 2001/11/21 23:16:23 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -115,8 +115,4 @@ typedef struct _packet_info { void *private_data; /* pointer to data passed from one dissector to another */ } packet_info; -void blank_packetinfo(void); - -extern packet_info pi; - #endif /* __PACKET_INFO_H__ */ diff --git a/file.c b/file.c index 3616753529..f30d97d7cb 100644 --- a/file.c +++ b/file.c @@ -1,7 +1,7 @@ /* file.c * File I/O routines * - * $Id: file.c,v 1.247 2001/11/20 10:37:14 guy Exp $ + * $Id: file.c,v 1.248 2001/11/21 23:16:21 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -678,7 +678,6 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, if (protocol_tree != NULL) proto_tree_free(protocol_tree); - epan_dissect_free(edt); if (fdata->flags.passed_dfilter) { /* This frame passed the display filter, so add it to the clist. */ @@ -712,7 +711,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, prevsec = fdata->abs_secs; prevusec = fdata->abs_usecs; - fill_in_columns(fdata); + fill_in_columns(fdata, &edt->pi); /* If we haven't yet seen the first frame, this is it. @@ -753,6 +752,7 @@ add_packet_to_packet_list(frame_data *fdata, capture_file *cf, to the clist, and thus has no row. */ row = -1; } + epan_dissect_free(edt); fdata->cinfo = NULL; return row; } @@ -1197,7 +1197,7 @@ print_packets(capture_file *cf, print_args_t *print_args) fdata->cinfo->col_data[i] = fdata->cinfo->col_buf[i]; } edt = epan_dissect_new(&cf->pseudo_header, cf->pd, fdata, NULL); - fill_in_columns(fdata); + fill_in_columns(fdata, &edt->pi); cp = &line_buf[0]; line_len = 0; for (i = 0; i < cf->cinfo.num_cols; i++) { diff --git a/gtk/decode_as_dlg.c b/gtk/decode_as_dlg.c index 2aae996af8..7f778579a4 100644 --- a/gtk/decode_as_dlg.c +++ b/gtk/decode_as_dlg.c @@ -1,6 +1,6 @@ /* decode_as_dlg.c * - * $Id: decode_as_dlg.c,v 1.12 2001/11/04 04:12:03 guy Exp $ + * $Id: decode_as_dlg.c,v 1.13 2001/11/21 23:16:25 gram Exp $ * * Routines to modify dissector tables on the fly. * @@ -676,15 +676,15 @@ decode_transport (GtkObject *notebook_pg) if (requested_tcpudp != E_DECODE_UDP) { if (requested_srcdst != E_DECODE_DPORT) - decode_change_one_dissector("tcp.port", pi.srcport, clist); + decode_change_one_dissector("tcp.port", cfile.edt->pi.srcport, clist); if (requested_srcdst != E_DECODE_SPORT) - decode_change_one_dissector("tcp.port", pi.destport, clist); + decode_change_one_dissector("tcp.port", cfile.edt->pi.destport, clist); } if (requested_tcpudp != E_DECODE_TCP) { if (requested_srcdst != E_DECODE_DPORT) - decode_change_one_dissector("udp.port", pi.srcport, clist); + decode_change_one_dissector("udp.port", cfile.edt->pi.srcport, clist); if (requested_srcdst != E_DECODE_SPORT) - decode_change_one_dissector("udp.port", pi.destport, clist); + decode_change_one_dissector("udp.port", cfile.edt->pi.destport, clist); } } @@ -907,7 +907,7 @@ decode_add_tcpudp_menu (GtkWidget *page) gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); /* gtk_widget_show_all() doesn't show this */ - requested_tcpudp = (pi.ipproto == IP_PROTO_TCP) ? E_DECODE_TCP : E_DECODE_UDP; + requested_tcpudp = (cfile.edt->pi.ipproto == IP_PROTO_TCP) ? E_DECODE_TCP : E_DECODE_UDP; gtk_menu_set_active(GTK_MENU(menu), requested_tcpudp == E_DECODE_UDP); gtk_object_set_data(GTK_OBJECT(page), E_MENU_TCPUDP, menu); gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); @@ -938,14 +938,14 @@ decode_add_srcdst_menu (GtkWidget *page) optmenu = gtk_option_menu_new(); menu = gtk_menu_new(); - sprintf(tmp, "source (%u)", pi.srcport); + sprintf(tmp, "source (%u)", cfile.edt->pi.srcport); menuitem = gtk_menu_item_new_with_label(tmp); gtk_object_set_user_data(GTK_OBJECT(menuitem), GINT_TO_POINTER(E_DECODE_SPORT)); gtk_menu_append(GTK_MENU(menu), menuitem); gtk_widget_show(menuitem); /* gtk_widget_show_all() doesn't show this */ - sprintf(tmp, "destination (%u)", pi.destport); + sprintf(tmp, "destination (%u)", cfile.edt->pi.destport); menuitem = gtk_menu_item_new_with_label(tmp); gtk_object_set_user_data(GTK_OBJECT(menuitem), GINT_TO_POINTER(E_DECODE_DPORT)); @@ -1312,24 +1312,24 @@ decode_add_notebook (GtkWidget *format_hb) gtk_object_set_data(GTK_OBJECT(decode_w), E_NOTEBOOK, notebook); /* Add link level selection page */ - if (pi.ethertype) { - sprintf(buffer, "Ethertype 0x%04x", pi.ethertype); - page = decode_add_simple_page(buffer, "Link", "ethertype", pi.ethertype); + if (cfile.edt->pi.ethertype) { + sprintf(buffer, "Ethertype 0x%04x", cfile.edt->pi.ethertype); + page = decode_add_simple_page(buffer, "Link", "ethertype", cfile.edt->pi.ethertype); label = gtk_label_new("Link"); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); } /* Add network selection page */ - if (pi.ipproto) { - sprintf(buffer, "IP protocol %u", pi.ipproto); - page = decode_add_simple_page(buffer, "Network", "ip.proto", pi.ipproto); + if (cfile.edt->pi.ipproto) { + sprintf(buffer, "IP protocol %u", cfile.edt->pi.ipproto); + page = decode_add_simple_page(buffer, "Network", "ip.proto", cfile.edt->pi.ipproto); gtk_object_set_data(GTK_OBJECT(page), E_PAGE_ACTION, decode_network); label = gtk_label_new("Network"); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); } /* Add transport selection page */ - if (decode_as_transport_ok(pi.ipproto)) { + if (decode_as_transport_ok(cfile.edt->pi.ipproto)) { page = decode_add_tcpudp_page(); label = gtk_label_new("Transport"); gtk_notebook_append_page(GTK_NOTEBOOK(notebook), page, label); @@ -1437,7 +1437,7 @@ decode_as_cb (GtkWidget * w, gpointer data) gboolean decode_as_ok(void) { - return pi.ethertype || pi.ipproto || decode_as_transport_ok(pi.ipproto); + return cfile.edt->pi.ethertype || cfile.edt->pi.ipproto || decode_as_transport_ok(cfile.edt->pi.ipproto); } diff --git a/gtk/follow_dlg.c b/gtk/follow_dlg.c index cc4a8ccfd8..4751cac421 100644 --- a/gtk/follow_dlg.c +++ b/gtk/follow_dlg.c @@ -1,6 +1,6 @@ /* follow_dlg.c * - * $Id: follow_dlg.c,v 1.13 2001/04/10 12:07:39 gram Exp $ + * $Id: follow_dlg.c,v 1.14 2001/11/21 23:16:26 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -163,7 +163,7 @@ follow_stream_cb(GtkWidget * w, gpointer data) follow_info_t *follow_info; /* we got tcp so we can follow */ - if (pi.ipproto != 6) { + if (cfile.edt->pi.ipproto != 6) { simple_dialog(ESD_TYPE_CRIT, NULL, "Error following stream. Please make\n" "sure you have a TCP packet selected."); @@ -205,7 +205,7 @@ follow_stream_cb(GtkWidget * w, gpointer data) /* Create a new filter that matches all packets in the TCP stream, and set the display filter entry accordingly */ reset_tcp_reassembly(); - follow_filter = build_follow_filter(&pi); + follow_filter = build_follow_filter(&cfile.edt->pi); /* Set the display filter entry accordingly */ filter_te = gtk_object_get_data(GTK_OBJECT(w), E_DFILTER_TE_KEY); diff --git a/gtk/main.c b/gtk/main.c index 47ab88c3cc..5aae224b85 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1,6 +1,6 @@ /* main.c * - * $Id: main.c,v 1.211 2001/11/20 09:07:33 guy Exp $ + * $Id: main.c,v 1.212 2001/11/21 23:16:26 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -157,7 +157,6 @@ typedef struct column_arrows { GtkWidget *descend_pm; } column_arrows; -packet_info pi; capture_file cfile; GtkWidget *top_level, *packet_list, *tree_view, *byte_nb_ptr, *tv_scrollw, *pkt_scrollw; @@ -444,8 +443,6 @@ void unmark_all_frames_cb(GtkWidget *w, gpointer data) { static void packet_list_select_cb(GtkWidget *w, gint row, gint col, gpointer evt) { - blank_packetinfo(); - /* Remove the hex display tabbed pages */ while( (gtk_notebook_get_nth_page( GTK_NOTEBOOK(byte_nb_ptr), 0))) gtk_notebook_remove_page( GTK_NOTEBOOK(byte_nb_ptr), 0); diff --git a/gtk/main.h b/gtk/main.h index f3e5aa8dbd..ef884a11f0 100644 --- a/gtk/main.h +++ b/gtk/main.h @@ -1,7 +1,7 @@ /* main.h * Global defines, etc. * - * $Id: main.h,v 1.23 2001/10/22 22:59:26 guy Exp $ + * $Id: main.h,v 1.24 2001/11/21 23:16:26 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -53,7 +53,6 @@ typedef struct _selection_info { extern GtkStyle *item_style; void about_ethereal( GtkWidget *, gpointer); -void blank_packetinfo(); void match_selected_cb( GtkWidget *, gpointer); void file_quit_cmd_cb(GtkWidget *, gpointer); void file_print_cmd_cb(GtkWidget *, gpointer); diff --git a/gtk/menu.c b/gtk/menu.c index bf2d9cd19a..b24a6857bf 100644 --- a/gtk/menu.c +++ b/gtk/menu.c @@ -1,7 +1,7 @@ /* menu.c * Menu routines * - * $Id: menu.c,v 1.55 2001/07/17 05:44:58 hagbard Exp $ + * $Id: menu.c,v 1.56 2001/11/21 23:16:26 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -398,7 +398,7 @@ set_menus_for_selected_packet(gboolean have_selected_packet) set_menu_sensitivity("/Display/Expand All", have_selected_packet); set_menu_sensitivity("/Display/Show Packet In New Window", have_selected_packet); set_menu_sensitivity("/Tools/Follow TCP Stream", - have_selected_packet ? (pi.ipproto == 6) : FALSE); + have_selected_packet ? (cfile.edt->pi.ipproto == 6) : FALSE); set_menu_sensitivity("/Tools/Decode As...", have_selected_packet && decode_as_ok()); set_menu_sensitivity("/Resolve Name", diff --git a/packet-socks.c b/packet-socks.c index 60b4bbf78f..0509708f72 100644 --- a/packet-socks.c +++ b/packet-socks.c @@ -2,7 +2,7 @@ * Routines for socks versions 4 &5 packet dissection * Copyright 2000, Jeffrey C. Foster * - * $Id: packet-socks.c,v 1.27 2001/10/31 05:59:18 guy Exp $ + * $Id: packet-socks.c,v 1.28 2001/11/21 23:16:21 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -404,7 +404,7 @@ socks_udp_dissector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { *ptr = hash_info->udp_remote_port; - decode_udp_ports( tvb, offset, &pi, tree, pinfo->srcport, pinfo->destport); + decode_udp_ports( tvb, offset, pinfo, tree, pinfo->srcport, pinfo->destport); *ptr = hash_info->udp_port; diff --git a/tethereal.c b/tethereal.c index 26e6a3453c..66dbe5c8bb 100644 --- a/tethereal.c +++ b/tethereal.c @@ -1,6 +1,6 @@ /* tethereal.c * - * $Id: tethereal.c,v 1.98 2001/11/13 23:55:30 gram Exp $ + * $Id: tethereal.c,v 1.99 2001/11/21 23:16:21 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -143,7 +143,6 @@ static void show_capture_file_io_error(const char *, int, gboolean); static void wtap_dispatch_cb_print(u_char *, const struct wtap_pkthdr *, long, union wtap_pseudo_header *, const u_char *); -packet_info pi; capture_file cfile; FILE *data_out_file = NULL; ts_type timestamp_type = RELATIVE; @@ -1213,7 +1212,7 @@ wtap_dispatch_cb_print(u_char *user, const struct wtap_pkthdr *phdr, } } else { /* Just fill in the columns. */ - fill_in_columns(&fdata); + fill_in_columns(&fdata, &edt->pi); /* Now print them. */ for (i = 0; i < cf->cinfo.num_cols; i++) {