/* ethereal.c
*
- * $Id: ethereal.c,v 1.69 1999/07/31 13:10:18 deniel Exp $
+ * $Id: ethereal.c,v 1.70 1999/07/31 13:55:15 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
g_free( cf.dfilter );
cf.dfilter = NULL;
}
+ reset_tcp_reassembly();
/* create a new one and set the display filter entry accordingly */
cf.dfilter = build_follow_filter( &pi );
if (filter_te)
if( data_out_file == NULL ) {
fprintf( stderr, "Could not open tmp file %s\n", filename1 );
}
- reset_tcp_reassembly();
/* Compile the filter */
if (dfilter_compile(cf.dfilter, &cf.dfcode) != 0) {
simple_dialog(ESD_TYPE_WARN, NULL,
/* follow.c
*
- * $Id: follow.c,v 1.13 1999/07/31 11:21:05 deniel Exp $
+ * $Id: follow.c,v 1.14 1999/07/31 13:55:16 deniel Exp $
*
* Copyright 1998 Mike Hall <mlh@io.com>
*
gboolean incomplete_tcp_stream = FALSE;
+static u_long ip_address[2];
+static u_int tcp_port[2];
+
static int check_fragments( int );
static void write_packet_data( const u_char *, int );
free( buf );
return NULL;
}
+ ip_address[0] = pi->ip_src;
+ ip_address[1] = pi->ip_dst;
+ tcp_port[0] = pi->srcport;
+ tcp_port[1] = pi->destport;
return buf;
}
static u_long src[2] = { 0, 0 };
void
-reassemble_tcp( u_long sequence, u_long length, const char* data, u_long data_length, int synflag, u_long srcx ) {
+reassemble_tcp( u_long sequence, u_long length, const char* data, u_long data_length, int synflag, u_long srcx, u_long dstx, u_int srcport, u_int dstport ) {
int src_index, j, first = 0;
u_long newseq;
tcp_frag *tmp_frag;
src_index = -1;
+
+ /* first check if this packet should be processed */
+ if ((srcx != ip_address[0] && srcx != ip_address[1]) ||
+ (dstx != ip_address[0] && dstx != ip_address[1]) ||
+ (srcport != tcp_port[0] && srcport != tcp_port[1]) ||
+ (dstport != tcp_port[0] && dstport != tcp_port[1]))
+ return;
+
/* first we check to see if we have seen this src ip before. */
for( j=0; j<2; j++ ) {
if( src[j] == srcx ) {
for( i=0; i<2; i++ ) {
seq[i] = 0;
src[i] = 0;
+ ip_address[i] = 0;
+ tcp_port[i] = 0;
current = frags[i];
while( current ) {
next = current->next;
/* follow.h
*
- * $Id: follow.h,v 1.4 1999/07/07 01:41:15 guy Exp $
+ * $Id: follow.h,v 1.5 1999/07/31 13:55:16 deniel Exp $
*
* Copyright 1998 Mike Hall <mlh@io.com>
*
} tcp_frag;
char* build_follow_filter( packet_info * );
-void reassemble_tcp( u_long, u_long, const char*, u_long, int, u_long );
+void reassemble_tcp( u_long, u_long, const char*, u_long, int,
+ u_long, u_long, u_int, u_int );
void reset_tcp_reassembly( void );
#endif
/* packet-tcp.c
* Routines for TCP packet disassembly
*
- * $Id: packet-tcp.c,v 1.28 1999/07/31 02:18:35 guy Exp $
+ * $Id: packet-tcp.c,v 1.29 1999/07/31 13:55:16 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
( pd+offset ), /* data */
( fd->cap_len - offset ), /* captured data length */
( th.th_flags & 0x02 ), /* is syn set? */
- pi.ip_src ); /* src ip */
+ pi.ip_src,
+ pi.ip_dst,
+ pi.srcport,
+ pi.destport);
}
}