Remove srcip and destip from packet_info since it is not safe to affect
authordeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 31 Jul 1999 11:21:06 +0000 (11:21 +0000)
committerdeniel <deniel@f5534014-38df-0310-8fa8-9805f1628bb7>
Sat, 31 Jul 1999 11:21:06 +0000 (11:21 +0000)
string pointer from the result of ip_to_str (statically allocated string).
Use the ip_src and the new field ip_dst in follow.c to build a correct
string display filter.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@408 f5534014-38df-0310-8fa8-9805f1628bb7

ethereal.c
follow.c
packet-ip.c
packet.h

index 98198d16e52c14cc93c42ba8676e78765dbe76a6..04f09758ed83b9ef12d307da3eb45dd88907f9b3 100644 (file)
@@ -1,6 +1,6 @@
 /* ethereal.c
  *
- * $Id: ethereal.c,v 1.67 1999/07/28 23:16:32 guy Exp $
+ * $Id: ethereal.c,v 1.68 1999/07/31 11:21:04 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -917,8 +917,8 @@ file_quit_cmd_cb (GtkWidget *widget, gpointer data) {
 }
 
 void blank_packetinfo() {
-  pi.srcip    = 0;
-  pi.destip   = 0;
+  pi.ip_src   = 0;
+  pi.ip_dst   = 0;
   pi.ipproto  = 0;
   pi.srcport  = 0;
   pi.destport = 0;
index 8cb7f5b05bf2771d69d4745bb52da308b958bc87..fd48457db3f07e576c487258c8942a9135e0fcab 100644 (file)
--- a/follow.c
+++ b/follow.c
@@ -1,6 +1,6 @@
 /* follow.c
  *
- * $Id: follow.c,v 1.12 1999/07/17 04:19:02 gram Exp $
+ * $Id: follow.c,v 1.13 1999/07/31 11:21:05 deniel Exp $
  *
  * Copyright 1998 Mike Hall <mlh@io.com>
  *
@@ -62,8 +62,11 @@ build_follow_filter( packet_info *pi ) {
   char* buf = malloc(1024);
   if( pi->ipproto == 6 ) {
     /* TCP */
-    sprintf( buf, "(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
-               pi->srcip, pi->destip, pi->srcport, pi->destport );
+    sprintf( buf, 
+            "(ip.addr eq %s and ip.addr eq %s) and (tcp.port eq %d and tcp.port eq %d)",
+            ip_to_str( (guint8 *) &pi->ip_src), 
+            ip_to_str( (guint8 *) &pi->ip_dst), 
+            pi->srcport, pi->destport );
   }
   else { 
     free( buf );
index ddf05cbe99c1a173a31553b8b58d53b82ec5230f..82a200fad57a0cc513b08f78abc08424b942f99c 100644 (file)
@@ -1,7 +1,7 @@
 /* packet-ip.c
  * Routines for IP and miscellaneous IP protocol packet disassembly
  *
- * $Id: packet-ip.c,v 1.31 1999/07/29 05:46:55 gram Exp $
+ * $Id: packet-ip.c,v 1.32 1999/07/31 11:21:05 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -734,12 +734,11 @@ dissect_ip(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) {
     }
   }
 
-  pi.srcip = ip_to_str( (guint8 *) &iph.ip_src);
-  pi.destip = ip_to_str( (guint8 *) &iph.ip_dst);
   pi.ipproto = iph.ip_p;
   pi.iplen = iph.ip_len;
   pi.iphdrlen = lo_nibble(iph.ip_v_hl);
   pi.ip_src = iph.ip_src;
+  pi.ip_dst = iph.ip_dst;
   pi.payload = pi.iplen - hlen;
 
   offset += hlen;
index 7b3fbb9d1bec2d80e3b7ddd70e073afb8e09b958..7153f2892c0b1392699032c071f0dd337458a553 100644 (file)
--- a/packet.h
+++ b/packet.h
@@ -1,7 +1,7 @@
 /* packet.h
  * Definitions for packet disassembly structures and routines
  *
- * $Id: packet.h,v 1.75 1999/07/28 23:16:33 guy Exp $
+ * $Id: packet.h,v 1.76 1999/07/31 11:21:06 deniel Exp $
  *
  * Ethereal - Network traffic analyzer
  * By Gerald Combs <gerald@zing.org>
@@ -117,9 +117,8 @@ typedef struct _frame_data {
 } frame_data;
 
 typedef struct _packet_info {
-  char *srcip;
   int ip_src;
-  char *destip;
+  int ip_dst;
   int ipproto;
   int srcport;
   int destport;