Ethereal-dev: Re: [ethereal-dev] Popup packet window

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Wed, 16 Feb 2000 08:10:16 -0600
On Tue, Feb 15, 2000 at 01:28:18PM -0600, Jeff Foster wrote:
> 
> 
> 
> OK. Here are the files; a diff file fore gtk/menu.c and a new file
> gtk/new-win.c.  Of course you will have to add new-win.c into the make
> files.
> 
> Jeff Foster.
> jfoste@xxxxxxxxxxxx

That's pretty cool; it's a much-needed feature. I like how you
put the packet summary in the title bar. But there appears to
be bug in the title bar creation.

If I create a "New Window" for one packet, the title bar gets created
incorrectly. I get this title bar:

Ethereal row=1,100 6.525604 146.84.27.44 osmosis.dev.tivoli.com 368 TCP ...

But the packet is:

No   Time      Source        Destination             Length  Protocol  Info
1    0.00000   146.84.28.221 IGRP-ROUTERS.MCAST.NET  74      EIGRP


If I open a second "new window", while keeping the first one open,
again, the title bar is incorrect. In fact, the title bar is the exact
same as the first title bar, except for "row=%d", which is correct.

The contents of the proto_tree and hex dump are correct.


Okay, I did a bit of investigating. The packet whose information
is being printed on the title bar is the last packet in my trace file.

--gilbert


void new_window_cb(GtkWidget *w){

  	gint	tv_size = 95, bv_size = 75;
	struct _column_info *info_ptr = &cf.cinfo;
	int i;
	char Title[ 1000] = "";
	

					/* build title of window */
	sprintf( Title, "Ethereal row=%d,", cf.current_frame->row + 1);
	
	for( i = 0; i < info_ptr->num_cols; ++i){
		if (( strlen( Title) + strlen( info_ptr->col_data[i]))
				< (1000 - 1)){

			strcat( Title,  info_ptr->col_data[i]);
			strcat( Title,  " ");
		}		
	}	
	
 create_new_window ( Title, tv_size, bv_size);
}