diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-10-21 05:52:28 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-10-21 05:52:28 +0000 |
commit | 563f86ee5eab280006171dbd7fdb411715594355 (patch) | |
tree | 616003167e713e2f88482dfdd46c1869d68eb308 | |
parent | 183e9cbf25933dcd9abc8db485f5308459f192b2 (diff) | |
download | wireshark-563f86ee5eab280006171dbd7fdb411715594355.tar.gz wireshark-563f86ee5eab280006171dbd7fdb411715594355.tar.bz2 wireshark-563f86ee5eab280006171dbd7fdb411715594355.zip |
Support for conversations with "wildcard" destination addresses, from
Jeff Foster.
svn path=/trunk/; revision=2523
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | epan/conversation.c | 147 | ||||
-rw-r--r-- | epan/conversation.h | 32 | ||||
-rw-r--r-- | packet-afs.c | 6 | ||||
-rw-r--r-- | packet-bxxp.c | 7 | ||||
-rw-r--r-- | packet-msproxy.c | 13 | ||||
-rw-r--r-- | packet-ncp2222.inc | 8 | ||||
-rw-r--r-- | packet-quake.c | 5 | ||||
-rw-r--r-- | packet-rlogin.c | 6 | ||||
-rw-r--r-- | packet-rpc.c | 8 | ||||
-rw-r--r-- | packet-rtcp.c | 14 | ||||
-rw-r--r-- | packet-rtp.c | 11 | ||||
-rw-r--r-- | packet-rtsp.c | 6 | ||||
-rw-r--r-- | packet-smb.c | 10 | ||||
-rw-r--r-- | packet-smtp.c | 7 | ||||
-rw-r--r-- | packet-socks.c | 10 |
16 files changed, 210 insertions, 82 deletions
@@ -156,6 +156,8 @@ Jeff Foster <jfoste@woodward.com> { use of that dissector by TCP and UDP SOCKS support Microsoft Proxy protocol support + Support for conversations with "wildcard" destination addresses + and/or ports } Peter Torvals <petertv@xoommail.com> { diff --git a/epan/conversation.c b/epan/conversation.c index 144f27b993..4ae117c9d2 100644 --- a/epan/conversation.c +++ b/epan/conversation.c @@ -1,7 +1,7 @@ /* conversation.c * Routines for building lists of packets that are part of a "conversation" * - * $Id: conversation.c,v 1.1 2000/09/27 04:54:47 gram Exp $ + * $Id: conversation.c,v 1.2 2000/10/21 05:52:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -46,6 +46,7 @@ static GHashTable *conversation_hashtable = NULL; static GMemChunk *conversation_key_chunk = NULL; static GMemChunk *conversation_chunk = NULL; +#ifdef __NOT_USED__ typedef struct conversation_key { struct conversation_key *next; address src; @@ -53,8 +54,9 @@ typedef struct conversation_key { port_type ptype; guint32 port_src; guint32 port_dst; + guint options; } conversation_key; - +#endif /* * Linked list of conversation keys, so we can, before freeing them all, * free the address data allocations associated with them. @@ -79,18 +81,21 @@ conversation_equal(gconstpointer v, gconstpointer w) /* * Are the first and second source ports the same, the first and - * second destination ports the same, the first and second source - * addresses the same, and the first and second destination - * addresses the same? + * second destination ports the same or not used (NO_DST_PORT), + * the first and second source addresses the same, and the first + * and second destination addresses the same or not used (NO_DST_ADDR)? */ if (v1->port_src == v2->port_src && - v1->port_dst == v2->port_dst && + (((v1->options & NO_DST_PORT) && (v2->options & NO_DST_PORT)) || + v1->port_dst == v2->port_dst) && v1->src.type == v2->src.type && v1->src.len == v2->src.len && memcmp(v1->src.data, v2->src.data, v1->src.len) == 0 && - v1->dst.type == v2->dst.type && - v1->dst.len == v2->dst.len && - memcmp(v1->dst.data, v2->dst.data, v1->dst.len) == 0) { + (((v1->ptype & NO_DST_ADDR) && (v2->ptype & NO_DST_ADDR)) || + (v1->dst.type == v2->dst.type && + v1->dst.type == v2->dst.type && + v1->dst.len == v2->dst.len && + memcmp(v1->dst.data, v2->dst.data, v1->dst.len) == 0))) { /* * Yes. It's the same conversation, and the two * address/port pairs are going in the same direction. @@ -99,20 +104,23 @@ conversation_equal(gconstpointer v, gconstpointer w) } /* - * Is the first source port the same as the second destination - * port, the first destination port the same as the first - * source port, the first source address the same as the second - * destination address, and the first destination address the - * same as the second source address? + * Is the first destination port the same as the second source + * port, the first source port the same as the second destination + * port or not used (NO_DEST_PORT), the first destination address + * the same as the second source address, and the first source + * address the same as the second destination address or not used + * (NO_DEST_ADDR). */ - if (v1->port_src == v2->port_dst && - v1->port_dst == v2->port_src && - v1->src.type == v2->dst.type && - v1->src.len == v2->dst.len && - memcmp(v1->src.data, v2->dst.data, v1->src.len) == 0 && + if (v1->port_dst == v2->port_src && + (((v1->options & NO_DST_PORT) &&(v2->options & NO_DST_PORT)) || + v1->port_src == v2->port_dst) && v1->dst.type == v2->src.type && v1->dst.len == v2->src.len && - memcmp(v1->dst.data, v2->src.data, v1->dst.len) == 0) { + memcmp(v1->dst.data, v2->src.data, v1->dst.len) == 0 && + (((v1->options & NO_DST_ADDR) && (v2->options & NO_DST_ADDR)) || + (v1->src.type == v2->dst.type && + v1->src.len == v2->dst.len && + memcmp(v1->src.data, v2->dst.data, v1->src.len) == 0))) { /* * Yes. It's the same conversation, and the two * address/port pairs are going in opposite directions. @@ -133,6 +141,7 @@ conversation_equal(gconstpointer v, gconstpointer w) static guint conversation_hash(gconstpointer v) { + conversation_key *key = (conversation_key *)v; guint hash_val; int i; @@ -140,9 +149,16 @@ conversation_hash(gconstpointer v) hash_val = 0; for (i = 0; i < key->src.len; i++) hash_val += key->src.data[i]; - for (i = 0; i < key->dst.len; i++) - hash_val += key->dst.data[i]; - hash_val += key->port_src + key->port_dst; + + hash_val += key->port_src; + +/* Only hash the destination information if the value is needed. */ + if ( ! ( key->options & NO_DST_ADDR)) + for (i = 0; i < key->dst.len; i++) + hash_val += key->dst.data[i]; + + if ( ! (key->options & NO_DST_PORT)) + hash_val += key->port_dst; return hash_val; } @@ -222,11 +238,13 @@ copy_address(address *to, address *from) /* * Given source and destination addresses and ports for a packet, * create a new conversation to contain packets between those address/port - * pairs. + * pairs. The options field is used to flag the destination address/port + * are not given and any value is acceptable. + */ conversation_t * conversation_new(address *src, address *dst, port_type ptype, - guint32 src_port, guint32 dst_port, void *data) + guint32 src_port, guint32 dst_port, void *data, guint options) { conversation_t *conversation; conversation_key *new_key; @@ -239,6 +257,7 @@ conversation_new(address *src, address *dst, port_type ptype, new_key->ptype = ptype; new_key->port_src = src_port; new_key->port_dst = dst_port; + new_key->options = options; conversation = g_mem_chunk_alloc(conversation_chunk); conversation->index = new_index; @@ -247,20 +266,49 @@ conversation_new(address *src, address *dst, port_type ptype, /* clear dissector pointer */ conversation->dissector.new_d = NULL; +/* set the key pointer */ + conversation->key_ptr = new_key; + new_index++; g_hash_table_insert(conversation_hashtable, new_key, conversation); return conversation; } +/* Set the destination port in a key. Remove the original from table, + update the options and port values, insert the updated key. +*/ +void conversation_set_port( conversation_t *conv, guint32 port){ + + g_hash_table_remove(conversation_hashtable, conv->key_ptr); + conv->key_ptr->options &= ~NO_DST_PORT; + conv->key_ptr->port_dst = port; + g_hash_table_insert(conversation_hashtable, conv->key_ptr, conv); + +} + +/* Set the destination address in a key. Remove the original from + table, update the options and port values, insert the updated key. +*/ +void conversation_set_addr( conversation_t *conv, address *addr){ + + + g_hash_table_remove(conversation_hashtable, conv->key_ptr); + conv->key_ptr->options &= ~NO_DST_ADDR; + copy_address(&conv->key_ptr->dst, addr); + g_hash_table_insert(conversation_hashtable, conv->key_ptr, conv); +} + /* * Given source and destination addresses and ports for a packet, * search for a conversation containing packets between those address/port - * pairs. Returns NULL if not found. + * pairs. Returns NULL if not found. If the NO_DEST_ADDR and/or NO_DEST_PORT + * flags are set in the conversation options field, that value will not + * be used. */ conversation_t * find_conversation(address *src, address *dst, port_type ptype, - guint32 src_port, guint32 dst_port) + guint32 src_port, guint32 dst_port, uint options) { conversation_key key; @@ -271,6 +319,7 @@ find_conversation(address *src, address *dst, port_type ptype, key.src = *src; key.dst = *dst; key.ptype = ptype; + key.options = options; key.port_src = src_port; key.port_dst = dst_port; return g_hash_table_lookup(conversation_hashtable, &key); @@ -299,7 +348,14 @@ conversation_set_dissector(conversation_t *conversation, * Given source and destination addresses and ports for a packet, * search for a conversational dissector. * If found, call it and return TRUE, otherwise return FALSE. + * + * Will search for a exact match (src & dst), then search for wild + * card matches: try to match any port on the destination address first, + * then try to match any address on the port, then try to match any + * address and any port. + * */ + gboolean old_try_conversation_dissector(address *src, address *dst, port_type ptype, guint32 src_port, guint32 dst_port, const u_char *pd, int offset, @@ -308,7 +364,18 @@ old_try_conversation_dissector(address *src, address *dst, port_type ptype, conversation_t *conversation; tvbuff_t *tvb; - conversation = find_conversation(src, dst, ptype, src_port, dst_port); + conversation = find_conversation(src, dst, ptype, src_port, dst_port, 0); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, NO_DST_ADDR); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, NO_DST_PORT); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, + NO_DST_PORT | NO_DST_ADDR); + if (conversation != NULL) { if (conversation->is_old_dissector) { if (conversation->dissector.old_d == NULL) @@ -335,6 +402,17 @@ old_try_conversation_dissector(address *src, address *dst, port_type ptype, return FALSE; } +/* + * Given source and destination addresses and ports for a packet, + * search for a conversational dissector. + * If found, call it and return TRUE, otherwise return FALSE. + * + * Will search for a exact match (src & dst), then search for wild + * card matches: try to match any port on the destination address first, + * then try to match any address on the port, then try to match any + * address and any port. +*/ + gboolean try_conversation_dissector(address *src, address *dst, port_type ptype, guint32 src_port, guint32 dst_port, tvbuff_t *tvb, packet_info *pinfo, @@ -344,7 +422,18 @@ try_conversation_dissector(address *src, address *dst, port_type ptype, const guint8 *pd; int offset; - conversation = find_conversation(src, dst, ptype, src_port, dst_port); + conversation = find_conversation(src, dst, ptype, src_port, dst_port, 0); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, NO_DST_ADDR); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, NO_DST_PORT); + + if (conversation == NULL) + conversation = find_conversation(src, dst, ptype, src_port, dst_port, + NO_DST_PORT | NO_DST_ADDR); + if (conversation != NULL) { if (conversation->is_old_dissector) { /* diff --git a/epan/conversation.h b/epan/conversation.h index b8c066d0a5..35b18f69d6 100644 --- a/epan/conversation.h +++ b/epan/conversation.h @@ -1,7 +1,7 @@ /* conversation.h * Routines for building lists of packets that are part of a "conversation" * - * $Id: conversation.h,v 1.1 2000/09/27 04:54:47 gram Exp $ + * $Id: conversation.h,v 1.2 2000/10/21 05:52:28 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -26,10 +26,26 @@ #ifndef __CONVERSATION_H__ #define __CONVERSATION_H__ +/* +* Conversation options values +*/ +#define NO_DST_ADDR 0x01 +#define NO_DST_PORT 0x02 + #include "packet.h" /* for conversation dissector type */ /* * Data structure representing a conversation. */ +typedef struct conversation_key { + struct conversation_key *next; + address src; + address dst; + port_type ptype; + guint32 port_src; + guint32 port_dst; + guint options; +} conversation_key; + typedef struct conversation { struct conversation *next; /* pointer to next conversation on hash chain */ guint32 index; /* unique ID for conversation */ @@ -39,13 +55,17 @@ typedef struct conversation { old_dissector_t old_d; dissector_t new_d; } dissector; /* protocol dissector client can associate with conversation */ + + conversation_key *key_ptr; /* pointer to the key for this conversation */ } conversation_t; extern void conversation_init(void); + conversation_t *conversation_new(address *src, address *dst, port_type ptype, - guint32 src_port, guint32 dst_port, void *data); + guint32 src_port, guint32 dst_port, void *data, guint options); + conversation_t *find_conversation(address *src, address *dst, port_type ptype, - guint32 src_port, guint32 dst_port); + guint32 src_port, guint32 dst_port, guint options); void old_conversation_set_dissector(conversation_t *conversation, old_dissector_t dissector); @@ -60,4 +80,10 @@ try_conversation_dissector(address *src, address *dst, port_type ptype, guint32 src_port, guint32 dst_port, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); +/* These routines are used to set undefined values for a conversation */ + +void conversation_set_port( conversation_t *conv, guint32 port); +void conversation_set_address( conversation_t *conv, address *addr); + + #endif /* conversation.h */ diff --git a/packet-afs.c b/packet-afs.c index 0c616e0e8c..f4a4b978a3 100644 --- a/packet-afs.c +++ b/packet-afs.c @@ -6,7 +6,7 @@ * Portions based on information retrieved from the RX definitions * in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/ * - * $Id: packet-afs.c,v 1.13 2000/08/13 14:07:56 deniel Exp $ + * $Id: packet-afs.c,v 1.14 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -758,11 +758,11 @@ dissect_afs(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) * packets from B:Y to A:X. */ conversation = find_conversation(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, NULL); + pi.srcport, pi.destport, NULL, 0); } request_key.conversation = conversation->index; diff --git a/packet-bxxp.c b/packet-bxxp.c index f7abbd174a..681d9d325a 100644 --- a/packet-bxxp.c +++ b/packet-bxxp.c @@ -1,7 +1,7 @@ /* packet-bxxp.c * Routines for BXXP packet disassembly * - * $Id: packet-bxxp.c,v 1.8 2000/10/09 03:36:15 sharpe Exp $ + * $Id: packet-bxxp.c,v 1.9 2000/10/21 05:52:21 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -1017,10 +1017,11 @@ dissect_bxxp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) if (!frame_data) { conversation = find_conversation(&pinfo->src, &pinfo->dst, pi.ptype, - pinfo->srcport, pinfo->destport); + pinfo->srcport, pinfo->destport, 0); if (conversation == NULL) { /* No conversation, create one */ conversation = conversation_new(&pinfo->src, &pinfo->dst, pinfo->ptype, - pinfo->srcport, pinfo->destport, NULL); + pinfo->srcport, pinfo->destport, NULL, + 0); } diff --git a/packet-msproxy.c b/packet-msproxy.c index 58484fca74..1f4506919b 100644 --- a/packet-msproxy.c +++ b/packet-msproxy.c @@ -2,7 +2,7 @@ * Routines for Microsoft Proxy packet dissection * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-msproxy.c,v 1.11 2000/08/21 18:36:34 guy Exp $ + * $Id: packet-msproxy.c,v 1.12 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -222,7 +222,7 @@ static void msproxy_sub_dissector( const u_char *pd, int offset, frame_data *fd, proto_item *ti; conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); g_assert( conversation); /* should always find a conversation */ @@ -286,14 +286,15 @@ static void add_msproxy_conversation( hash_entry_t *hash_info){ conversation_t *conversation = find_conversation( &pi.src, &pi.dst, hash_info->proto, hash_info->server_int_port, - hash_info->clnt_port); + hash_info->clnt_port, 0); if ( conversation) return; new_conv_info = g_mem_chunk_alloc(redirect_vals); conversation = conversation_new( &pi.src, &pi.dst, hash_info->proto, - hash_info->server_int_port, hash_info->clnt_port, new_conv_info); + hash_info->server_int_port, hash_info->clnt_port, + new_conv_info, 0); g_assert( new_conv_info); g_assert( conversation); @@ -1166,7 +1167,7 @@ static void dissect_msproxy(const u_char *pd, int offset, frame_data *fd, proto_ OLD_CHECK_DISPLAY_AS_DATA(proto_msproxy, pd, offset, fd, tree); conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if ( conversation) /* conversation found */ hash_info = conversation->data; @@ -1176,7 +1177,7 @@ static void dissect_msproxy(const u_char *pd, int offset, frame_data *fd, proto_ hash_info = g_mem_chunk_alloc(vals); conversation_new( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, hash_info); + pi.srcport, pi.destport, hash_info, 0); } if (check_col(fd, COL_PROTOCOL)) diff --git a/packet-ncp2222.inc b/packet-ncp2222.inc index 7300dcc2a1..96a95bf62e 100644 --- a/packet-ncp2222.inc +++ b/packet-ncp2222.inc @@ -7,7 +7,7 @@ * * Gilbert Ramirez <gram@xiexie.org> * - * $Id: packet-ncp2222.inc,v 1.1 2000/09/22 16:37:50 gram Exp $ + * $Id: packet-ncp2222.inc,v 1.2 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -135,11 +135,11 @@ dissect_ncp_request(tvbuff_t *tvb, packet_info *pinfo, as being part of a single conversation so that we can let the user select that conversation to be displayed.) */ conversation = find_conversation(&pi.src, &pi.dst, - PT_NCP, nw_connection, nw_connection); + PT_NCP, nw_connection, nw_connection, 0); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(&pi.src, &pi.dst, - PT_NCP, nw_connection, nw_connection, NULL); + PT_NCP, nw_connection, nw_connection, NULL, 0); } ncp_hash_insert(conversation, sequence, 0x2222, ncp_rec); } @@ -191,7 +191,7 @@ dissect_ncp_reply(tvbuff_t *tvb, packet_info *pinfo, /* Find the conversation whence the request would have come. */ conversation = find_conversation(&pi.src, &pi.dst, - PT_NCP, nw_connection, nw_connection); + PT_NCP, nw_connection, nw_connection, 0); if (conversation != NULL) { /* find the record telling us the request made that caused this reply */ diff --git a/packet-quake.c b/packet-quake.c index 4bacc020a1..39f5de363a 100644 --- a/packet-quake.c +++ b/packet-quake.c @@ -4,7 +4,7 @@ * Uwe Girlich <uwe@planetquake.com> * http://www.idsoftware.com/q1source/q1source.zip * - * $Id: packet-quake.c,v 1.6 2000/08/30 02:50:01 gram Exp $ + * $Id: packet-quake.c,v 1.7 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -238,7 +238,8 @@ dissect_quake_CCREP_ACCEPT conversation_t *c; port = tvb_get_letohl(tvb, 0); - c = conversation_new( &pi.src, &pi.dst, PT_UDP, port, pi.destport, NULL); + c = conversation_new( &pi.src, &pi.dst, PT_UDP, port, pi.destport, + NULL, 0); if (c) { conversation_set_dissector(c, dissect_quake); } diff --git a/packet-rlogin.c b/packet-rlogin.c index 99878045d2..26cc030a80 100644 --- a/packet-rlogin.c +++ b/packet-rlogin.c @@ -2,7 +2,7 @@ * Routines for unix rlogin packet dissection * Copyright 2000, Jeffrey C. Foster <jfoste@woodward.com> * - * $Id: packet-rlogin.c,v 1.9 2000/08/13 14:08:37 deniel Exp $ + * $Id: packet-rlogin.c,v 1.10 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -369,7 +369,7 @@ dissect_rlogin(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { /* Lookup this connection*/ conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if ( conversation) /* conversation found */ hash_info = conversation->data; @@ -382,7 +382,7 @@ dissect_rlogin(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { hash_info->name[ 0] = 0; conversation_new( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, hash_info); + pi.srcport, pi.destport, hash_info, 0); } if (check_col(fd, COL_PROTOCOL)) /* update protocol */ diff --git a/packet-rpc.c b/packet-rpc.c index 6fed92b32d..e279cb42b3 100644 --- a/packet-rpc.c +++ b/packet-rpc.c @@ -2,7 +2,7 @@ * Routines for rpc dissection * Copyright 1999, Uwe Girlich <Uwe.Girlich@philosys.de> * - * $Id: packet-rpc.c,v 1.41 2000/08/24 23:09:37 guy Exp $ + * $Id: packet-rpc.c,v 1.42 2000/10/21 05:52:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -1133,7 +1133,7 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) no guarantee that the reply will come from the address to which the call was sent.) */ conversation = find_conversation(&null_address, &pi.dst, - pi.ptype, pi.srcport, pi.destport); + pi.ptype, pi.srcport, pi.destport, 0); if (conversation == NULL) { /* We haven't seen an RPC call for that conversation, so we can't check for a reply to that call. */ @@ -1273,11 +1273,11 @@ dissect_rpc( const u_char *pd, int offset, frame_data *fd, proto_tree *tree) guarantee that the reply will come from the address to which the call was sent.) */ conversation = find_conversation(&pi.src, &null_address, - pi.ptype, pi.srcport, pi.destport); + pi.ptype, pi.srcport, pi.destport, 0); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(&pi.src, &null_address, - pi.ptype, pi.srcport, pi.destport, NULL); + pi.ptype, pi.srcport, pi.destport, NULL, 0); } /* prepare the key data */ diff --git a/packet-rtcp.c b/packet-rtcp.c index dfa5c73f50..5096caa3d6 100644 --- a/packet-rtcp.c +++ b/packet-rtcp.c @@ -201,13 +201,14 @@ void rtcp_add_address( const unsigned char* ip_addr, int prt ) * Check if the ip address and port combination is not * already registered */ - pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0 ); + pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0, 0 ); /* * If not, add */ if ( ! pconv ) { - conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt, (guint32) 0, (void*) rtcp_proto ); + conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt, + (guint32) 0, (void*) rtcp_proto, 0 ); } } @@ -239,11 +240,14 @@ dissect_rtcp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * So we first check if the frame is really meant for us. */ conversation_t* pconv; - if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype, pi.srcport, 0 ) ) == NULL ) { + if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype, + pi.srcport, 0, 0 ) ) == NULL ) { /* - * The source ip:port combination was not what we were looking for, check the destination + * The source ip:port combination was not what we were + * looking for, check the destination */ - if ( ( pconv = find_conversation( &pi.dst, &fake_addr, pi.ptype, pi.destport, 0 ) ) == NULL ) { + if ( ( pconv = find_conversation( &pi.dst, &fake_addr, + pi.ptype, pi.destport, 0, 0 ) ) == NULL ) { return FALSE; } } diff --git a/packet-rtp.c b/packet-rtp.c index 6f6008b6ac..a4a564684f 100644 --- a/packet-rtp.c +++ b/packet-rtp.c @@ -172,13 +172,14 @@ void rtp_add_address( const unsigned char* ip_addr, int prt ) * Check if the ip address an dport combination is not * already registered */ - pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0 ); + pconv = find_conversation( &src_addr, &fake_addr, PT_UDP, prt, 0, 0 ); /* * If not, add */ if ( ! pconv ) { - conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt, (guint32) 0, ( void * ) rtp_proto ); + conversation_new( &src_addr, &fake_addr, PT_UDP, (guint32) prt, + (guint32) 0, ( void * ) rtp_proto, 0 ); } } @@ -209,11 +210,13 @@ dissect_rtp_heur( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree ) * So we first check if the frame is really meant for us. */ conversation_t* pconv; - if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype, pi.srcport, 0 ) ) == NULL ) { + if ( ( pconv = find_conversation( &pi.src, &fake_addr, pi.ptype, + pi.srcport, 0, 0 ) ) == NULL ) { /* * The source ip:port combination was not what we were looking for, check the destination */ - if ( ( pconv = find_conversation( &pi.dst, &fake_addr, pi.ptype, pi.destport, 0 ) ) == NULL ) { + if ( ( pconv = find_conversation( &pi.dst, &fake_addr, + pi.ptype, pi.destport, 0, 0 ) ) == NULL ) { return FALSE; } } diff --git a/packet-rtsp.c b/packet-rtsp.c index da9e88087a..4f64ac2e9d 100644 --- a/packet-rtsp.c +++ b/packet-rtsp.c @@ -4,7 +4,7 @@ * Jason Lango <jal@netapp.com> * Liberally copied from packet-http.c, by Guy Harris <guy@alum.mit.edu> * - * $Id: packet-rtsp.c,v 1.20 2000/10/19 06:45:11 guy Exp $ + * $Id: packet-rtsp.c,v 1.21 2000/10/21 05:52:22 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -125,14 +125,14 @@ rtsp_create_conversation(const u_char *trans_begin, const u_char *trans_end) return; conv = conversation_new(&pi.src, &pi.dst, PT_UDP, s_data_port, - c_data_port, 0); + c_data_port, 0, 0); conversation_set_dissector(conv, dissect_rtp); if (!c_mon_port || !s_mon_port) return; conv = conversation_new(&pi.src, &pi.dst, PT_UDP, s_mon_port, - c_mon_port, 0); + c_mon_port, 0, 0); conversation_set_dissector(conv, dissect_rtcp); } diff --git a/packet-smb.c b/packet-smb.c index 68edea73d8..930e5d3f8b 100644 --- a/packet-smb.c +++ b/packet-smb.c @@ -2,7 +2,7 @@ * Routines for smb packet dissection * Copyright 1999, Richard Sharpe <rsharpe@ns.aus.com> * - * $Id: packet-smb.c,v 1.72 2000/09/11 16:16:04 gram Exp $ + * $Id: packet-smb.c,v 1.73 2000/10/21 05:52:22 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -8892,11 +8892,11 @@ dissect_transact2_smb(const u_char *pd, int offset, frame_data *fd, proto_tree * * packets from B:Y to A:X. */ conversation = find_conversation(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if (conversation == NULL) { /* It's not part of any conversation - create a new one. */ conversation = conversation_new(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, NULL); + pi.srcport, pi.destport, NULL, 0); } si.conversation = conversation; /* Save this for later */ @@ -9620,12 +9620,12 @@ dissect_transact_smb(const u_char *pd, int offset, frame_data *fd, proto_tree *p */ conversation = find_conversation(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if (conversation == NULL) { /* Create a new conversation */ conversation = conversation_new(&pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, NULL); + pi.srcport, pi.destport, NULL, 0); } diff --git a/packet-smtp.c b/packet-smtp.c index 7e2c0152e6..7a6092642c 100644 --- a/packet-smtp.c +++ b/packet-smtp.c @@ -1,7 +1,7 @@ /* packet-smtp.c * Routines for SMTP packet disassembly * - * $Id: packet-smtp.c,v 1.6 2000/09/11 16:16:07 gram Exp $ + * $Id: packet-smtp.c,v 1.7 2000/10/21 05:52:23 guy Exp $ * * Copyright (c) 2000 by Richard Sharpe <rsharpe@ns.aus.com> * @@ -231,10 +231,11 @@ dissect_smtp(const u_char *pd, int offset, frame_data *fd, if (!frame_data) { conversation = find_conversation(&pinfo->src, &pinfo->dst, pi.ptype, - pinfo->srcport, pinfo->destport); + pinfo->srcport, pinfo->destport, 0); if (conversation == NULL) { /* No conversation, create one */ conversation = conversation_new(&pinfo->src, &pinfo->dst, pinfo->ptype, - pinfo->srcport, pinfo->destport, NULL); + pinfo->srcport, pinfo->destport, NULL, + 0); } diff --git a/packet-socks.c b/packet-socks.c index d7510362af..add97af74f 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 <jfoste@woodward.com> * - * $Id: packet-socks.c,v 1.12 2000/09/11 16:16:07 gram Exp $ + * $Id: packet-socks.c,v 1.13 2000/10/21 05:52:23 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -368,7 +368,7 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, proto_item *ti; conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); g_assert( conversation); /* should always find a conversation */ @@ -430,7 +430,7 @@ static void socks_udp_dissector( const u_char *pd, int offset, frame_data *fd, void new_udp_conversation( socks_hash_entry_t *hash_info){ conversation_t *conversation = conversation_new( &pi.src, &pi.dst, PT_UDP, - hash_info->udp_port, hash_info->port, hash_info); + hash_info->udp_port, hash_info->port, hash_info, 0); g_assert( conversation); @@ -957,7 +957,7 @@ dissect_socks(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { OLD_CHECK_DISPLAY_AS_DATA(proto_socks, pd, offset, fd, tree); conversation = find_conversation( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport); + pi.srcport, pi.destport, 0); if ( conversation) /* conversation found */ hash_info = conversation->data; @@ -975,7 +975,7 @@ dissect_socks(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { hash_info->state = Done; conversation_new( &pi.src, &pi.dst, pi.ptype, - pi.srcport, pi.destport, hash_info); + pi.srcport, pi.destport, hash_info, 0); } /* display summary window information */ |