Commit Graph

146 Commits

Author SHA1 Message Date
Michael Mann 7df5fcdc51 Share use of conversation_hash_exact
It was duplicated in GTK, so just make it public (at least for now)

Change-Id: I89d985b2d42f0edb1c535a65a97b132920dedbcd
Reviewed-on: https://code.wireshark.org/review/24146
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 16:00:46 +00:00
Michael Mann 23afd9a184 Convert to using find_conversation_pinfo where appropriate
This makes it easier to identify the simpler/common conversations

Change-Id: I7094f23e49156ee27f5f72c8e130308470f3e462
Reviewed-on: https://code.wireshark.org/review/24145
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-28 14:33:11 +00:00
Michael Mann 3a6552744f Add find_conversation_pinfo
Convenience function to add the same parameters to find_conversation as
find_or_create_conversation.

Change-Id: I3a92541cb9c1e827a9de8248825636debbd989cd
Reviewed-on: https://code.wireshark.org/review/24118
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-27 21:51:49 +00:00
Michael Mann b54c438011 Convert conversation hash tables to use wmem.
Simplifies cleanup because wmem can handle the memory cleanup.

Change-Id: Idc6a9bfe5f23c83b59a5278a64b9fb706862342d
Reviewed-on: https://code.wireshark.org/review/20042
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10 13:26:14 +00:00
Michael Mann e0fafa5475 Convert conversation data_list from GSList to wmem_tree.
Change-Id: I7eac4b4da86d1ac1ce8753f424b698a9949df00b
Reviewed-on: https://code.wireshark.org/review/20041
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-02-10 03:42:16 +00:00
Parav Pandit 77f31c6e7d packet-infiniband: Fixed duplicate conversation entries
1. Fixed find_conversation for PT_IBQP to not lookup in reverse
direction when all searches fail.
This is required, because there could be valid different connection in
reverse direction which mistakenly gets updated for non template cases.

2. Added support for having MAD data for upper level dissectors to process
during RC packet processing.
This is required because connection options are negotiated out of band
using this CM exchanges (unlike in band TCP options).

3. Moved creating unidirectional connections when actually MAD packets
are processed.
Previously client-to-server unidirectional conversation was created when
CM_RSP stage, where MAD Data of CM_REQ packet is inaccessible.

4. Fixed creating multiple conversations with same address property by
eliminating create_conv_and_add_proto_data during RTU stage, which was
incorrect.
Now they are created during REQ and RSP frame processing. (Instead of
RSP and RTU processing).

5. Added support for creating bidirectional connection that ULP can
refer.
This is required to keep track of oustanding transactions on a
connection (requests and responses).

Bug: 11363
Change-Id: I32ea084a581a58efbc16dbb7a3e267c82622c50c
Tested-by: paravpandit@yahoo.com
Reviewed-on: https://code.wireshark.org/review/18982
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-03 13:24:16 +00:00
Dario Lombardo f8500f39e2 conversation: rename shadow variable
Change-Id: I8f738b2e01d7f448b21cdc1b488b16b7dd581911
Reviewed-on: https://code.wireshark.org/review/16104
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-26 06:03:14 +00:00
Anders Broman 56a41845e7 Revert "Create an extended converstaion hastable taking more address information into consideration. This makes it possible to differentiate between packets on different vlans and can be expanded to handle tunnels."
This reverts commit f80e9df793.

Change-Id: I7877b250d479c30209cfe74351069d54359757b5
Reviewed-on: https://code.wireshark.org/review/13825
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-08 16:32:57 +00:00
AndersBroman f80e9df793 Create an extended converstaion hastable taking more address information
into consideration.
This makes it possible to differentiate between packets on different
vlans and can be expanded to handle tunnels.

Change-Id: Id36e71028702d1ba4b6b3047e822e5a62056a1e2
Reviewed-on: https://code.wireshark.org/review/13637
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-02 05:15:55 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Evan Huus cda450ed59 Fix address hashing broken in g4f39c60
We actually have to *use* the return value of the method, which the macro did
for us.

Change-Id: I240ca7e526a18054fe39c6c4ded902998dc2fef0
Reviewed-on: https://code.wireshark.org/review/12389
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Jim Young <jim.young.ws@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-12-03 02:00:18 +00:00
Guy Harris 8e689a9d4a Remove some unnecessary includes.
Either remove them completely, or put them inside an #ifdef.

Change-Id: Iceff4909e250c17812f38d94e067f7c37ab72e1b
Reviewed-on: https://code.wireshark.org/review/11630
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-07 23:12:50 +00:00
João Valverde 3df2333155 Remaining ADDRESS macro to address function conversions
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788
Reviewed-on: https://code.wireshark.org/review/11463
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-03 12:20:34 +00:00
Pascal Quantin 9e54fcee52 STUN: register a new conversation dissector after receiving a ConnectionBind Success Response message
According to RFC 6062, once the connection is established, data is sent as-is
To stop the STUN dissector from interfering, add the ability to specify a starting
frame for a conversation dissector and use it

Bug: 11641
Change-Id: I65ca96bddacf70444009c0642ea22173fa68992e
Reviewed-on: https://code.wireshark.org/review/11372
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-10-30 18:08:06 +00:00
Gerald Combs 4f39c603c2 More ADDRESS macro to address function conversions.
Replace remaining calls to SET_ADDRESS, CMP_ADDRESS, ADDRESSES_EQUAL,
COPY_ADDRESS, and COPY_ADDRESS_SHALLOW with their lower-case
equivalents.

Replace all ADD_ADDRESS_TO_HASH calls with add_address_to_hash.

Change-Id: I4cff857d7a84085abe0bccd52d2605d2a468bf6f
Reviewed-on: https://code.wireshark.org/review/11229
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-24 01:44:24 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
Alexis La Goutte e482786ae8 conversation: fix indent (use tabs)
Change-Id: I256c364954e1b9edd479e5f25a1d742cc216ffff
Reviewed-on: https://code.wireshark.org/review/9809
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-30 11:05:22 +00:00
Guy Harris 050bc7d100 Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.

Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.

Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.

Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 21:02:40 +00:00
Guy Harris 233dc643a6 Remove some apparently-unnecessary includes of emem.h.
Change-Id: Id50ce3e707056cca8f30052f05c451ce431b39b5
Reviewed-on: https://code.wireshark.org/review/6632
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:36:36 +00:00
Guy Harris fa5478185c Update comment to reflect the current reality.
Change-Id: I7f8c66723efc9d21ec3abc08e57db1df5f772f04
Reviewed-on: https://code.wireshark.org/review/6576
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-16 19:26:50 +00:00
Michael Mann ada1eec702 SE_COPY_ADDRESS -> WMEM_COPY_ADDRESS
Copy addresses with wmem-scope instead of (forced) seasonal scope.  All existing instances were converted to wmem_file_scope, but the flexibility is there for other scopes.

Change-Id: I8e58837b9ef574ec7dd87e278470d7063ae8c1c2
Reviewed-on: https://code.wireshark.org/review/6564
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 15:25:18 +00:00
Michael Mann 260b19e98d Remove seasonal memory from everything except address resolutions
This includes circuits, conversations and streams as well as camel and h225 dissectors.

Change-Id: Ia5ee70a5e5c6bcb420f0f19df126595246a3c042
Reviewed-on: https://code.wireshark.org/review/6566
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-16 15:22:27 +00:00
Michael Mann 55de46f317 Replace ep_address_to_str with address_to_str.
Change-Id: I4f1078b20f41800f72a751612703ad0d4c2ae87b
Reviewed-on: https://code.wireshark.org/review/6323
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-06 07:38:18 +00:00
Martin Kaiser 378e8b71c0 we're matching against {any}/port_b, not address_b
Change-Id: Ief00f09225805c6c7488d92f8aa5b59c21575788
Reviewed-on: https://code.wireshark.org/review/3464
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-06 19:45:14 +00:00
Peter Wu 8fbc0db7d2 conversion: do not free conversation memory on updates
In commit 4afd70d ("Use g_hash_table_new_full to free some values"), the
hashtable gained a destroy handler which frees memory. This
inadvertently destroyed a conversation during key updates.

Fix this by not calling _remove (and thereby calling the destroy
handler), but use _steal instead. (Suggestion by Evan Huus).

Bug: 10263
Change-Id: I9fa7f5a697599f42894d38718b00b9c0c1b57004
Reviewed-on: https://code.wireshark.org/review/2924
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-08 03:46:04 +00:00
Evan Huus 4afd70d4e4 Use g_hash_table_new_full to free some values
Fixes a good 80-90KB of leaks in certain cases.

Bug: 10261
Change-Id: I81d57ac67219e730b03649b9fdfc2306807bdb97
Reviewed-on: https://code.wireshark.org/review/2879
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-06 14:27:27 +00:00
Hadriel Kaplan a04f610989 Add debug printing functions for conversations, sip, sdp, rtp
There have been enough gnarly bus in sip/sdp/rtp that it needs
to have good debug printing. Using a debugger isn't good enough
because there's interaction across multiple frames and it's too
hard to follow what's going on without real printed data history.

Change-Id: Ifb5bb1fb580be81f988569ece79d238a9c030c34
Reviewed-on: https://code.wireshark.org/review/688
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-21 05:15:57 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier 11b5c15fdb Remove trailing whitespace
Change-Id: I8116f63ff88687c8db3fd6e8e23b22ab2f759af0
Reviewed-on: https://code.wireshark.org/review/385
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 20:46:49 +00:00
Bill Meier b26f50cbb1 (Trivial) explicitely --> explicitly
svn path=/trunk/; revision=54594
2014-01-04 17:29:20 +00:00
Anders Broman d0915cabb3 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54473
2013-12-27 10:49:35 +00:00
Michael Mann b6484432aa Allow try_conversation_dissector() to pass data to subdissectors.
svn path=/trunk/; revision=53035
2013-11-01 23:45:10 +00:00
Evan Huus 5d8143a6ab Our hash function is no longer commutative (yay!). However, this means that we
no longer get to check both conversation directions at once "for free" because
the two orderings actually result in different hashes. Do them one at a time.

Sorry Anders, this may or may not cancel out some of the performance gain you
were looking for. Either way, the new hash function is still an improvement.

Fixes bidirectional conversation lookup, which was conveniently showing up as
a DTLS decryption failure in the test suite. Go figure.

svn path=/trunk/; revision=52084
2013-09-15 20:47:45 +00:00
Evan Huus 82c63755ab Add the new hash algorithm to the macro we were already using. Create a
temporary address structure for the port-numbers so we can use the same macro,
reducing duplication further.

Add modelines.

svn path=/trunk/; revision=52081
2013-09-15 20:11:25 +00:00
Anders Broman 7f57fe3357 Use a better hash algorithm and add a dialouge to get hastable data.
svn path=/trunk/; revision=52078
2013-09-15 19:35:10 +00:00
Gerald Combs 59644b3899 New Qt feature: Show related packet list items in the frame number
column. Conversation spans (setup frame to last frame) are shown with a
square bracket. Linked frames are shown with a circle.

Use correct column justifications in Qt. Move common
justification-related packet list code to ui/packet_list_utils.[ch].

Add a last_frame element to conversation_t.

svn path=/trunk/; revision=50447
2013-07-08 16:54:18 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Jeff Morriss 3729335973 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45016
2012-09-20 01:48:30 +00:00
Jakub Zawadzki 9f92dc93c5 Add data parameter to call_dissector_only.
svn path=/trunk/; revision=44872
2012-09-11 08:28:07 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman d8d6de9561 Remove debug code left by mistake
svn path=/trunk/; revision=42959
2012-06-01 06:14:08 +00:00
Anders Broman fcfb9795d2 Fix a couple of warnings
svn path=/trunk/; revision=42958
2012-06-01 05:55:45 +00:00
Anders Broman 5007c399b9 From Evan Huus: Clean up conversation list iterator caching. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7149
svn path=/trunk/; revision=42150
2012-04-20 05:23:41 +00:00
Anders Broman 9a4a387e12 From Cristian Constantin:
while caching the last element from the conversation hash chain lists speeds-up
the operation when the hash/chain lists are actually built, it 
does NOT help a lot when a certain random conversation which is in the hash
table is looked-up.

I did some profiling and tracing and I saw that a lot of cpu time is spent in
the function conversation_lookup_hashtable() when wireshark
is asked to show the "Flow Graph", "TCP Conversations", "Voip Calls".  I used
two types of captures with over 500k packets:

- tcp packets having the _same_ src ip addr, src tcp port, dst ip addr, dst tcp 
  port
- (mostly) sip packets containing sdp payloads which advertise the _same_ ip
  addr, udp port for media

these types of captures lead to _huge_ chain lists behind the same hash bucket 
(to which the conversation is actually mapped)

the solution would be to cache the last found conversation into the head of the 
chain list and to use it whenever it is possible; most of the time the look-up
will be in O(1) instead of O(n) (n - number
of elements in the list).

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7149

svn path=/trunk/; revision=42141
2012-04-19 13:59:14 +00:00
Anders Broman 61cda0a6c4 From Evan Huus: Convert a few instances in conversation.c to use the new macro. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7142
svn path=/trunk/; revision=42138
2012-04-19 05:49:38 +00:00
Anders Broman 26bc6e72d7 From Evan Huus:
Do the right thing with conversation hash chains.

Adds two new functions: conversation_insert_into_hashtable() and
conversation_remove_from_hashtable() that do the right thing with conversation
hash table chains and ordering and all that. Converts conversation_new(),
conversation_set_addr2() and conversation_set_port2() to use the new functions.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7085

svn path=/trunk/; revision=42104
2012-04-17 07:17:37 +00:00
Anders Broman b2f9b5614a From Cristian Constantin:
There was something really wrong in conversation_lookup_hashtable().


https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7066

svn path=/trunk/; revision=42044
2012-04-13 12:53:47 +00:00
Jakub Zawadzki ac5c40e6c5 Mark some function static.
svn path=/trunk/; revision=41999
2012-04-09 19:43:19 +00:00
Anders Broman 37dec6fcad From Cristian Constantin:
Slow loading/processing of conversations with over 500k frames.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6755

svn path=/trunk/; revision=40837
2012-02-04 12:23:51 +00:00
Jeff Morriss ab7ec88be5 Delay freeing of seasonal memory until after the conversation cleanup routine
has been called.

In the conversation cleanup routine, free the GSlist for any proto_data which
may have been hanging off the (se_allocated) conversation.

svn path=/trunk/; revision=39484
2011-10-20 02:29:13 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Bill Meier 6812b68eb1 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

 From me: Fix a number of instances where the function prototype or
  the function definition wasn't changed so there was a mismatch 
  thus causing Windows (but not gcc) compilation errors.

svn path=/trunk/; revision=32365
2010-04-03 18:18:50 +00:00
Bill Meier d32b4c0758 Revert SVN #32360 until Windows compilation errors corrected.
svn path=/trunk/; revision=32361
2010-04-02 15:18:03 +00:00
Bill Meier 049f9eac85 From Yaniv Kaul: constify parameters
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422

svn path=/trunk/; revision=32360
2010-04-02 14:37:49 +00:00
Kovarththanan Rajaratnam 0e5cef61be Split a bunch of init routines into init() and cleanup(). This allows us to free memory properly on shutdown.
This is an initial step. There's still some work to do.

svn path=/trunk/; revision=29754
2009-09-06 18:25:23 +00:00
Jaap Keuter 2462cc82c3 Don't skip ahead in time when looking for a conversation.
svn path=/trunk/; revision=25158
2008-04-23 21:31:50 +00:00
Jeff Morriss 98522a39a9 Move the conversation addresses to the se_ allocator. This does not solve a memory leak but it does save a 12 line comment explaining why the const-ness of the pointers was being cast away and (more importantly) fixes the conversation part of the crashes detailed in http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1113 . In particular the conversation keys themselves are se_ alloc'd so by the time we get to conversation_init() (again) the keys have already been freed by the se_ allocator so traversing them isn't such a good idea.
svn path=/trunk/; revision=24661
2008-03-17 02:20:26 +00:00
Sake Blok 3cdaed35ea When there are multiple conversations with the same key, conversation_lookup_hashtable() did not return the correct conversation for the first packet of a conversation (ie when frame_num == conversation->setup_frame).
svn path=/trunk/; revision=23303
2007-10-29 06:54:25 +00:00
Guy Harris f16cd039c9 Make ADD_ADDRESS_TO_HASH() take a pointer to an address as an argument,
as the other address macros do.

svn path=/trunk/; revision=21588
2007-04-26 04:30:41 +00:00
Guy Harris bba0b00392 Rename HASH_ADDRESS to ADD_ADDRESS_TO_HASH, to make it clearer what it
does (i.e., it will add the address bytes to the value that's already
there - it will not initialize the value, so you have to clear it before
doing any hashing).

svn path=/trunk/; revision=21578
2007-04-26 01:01:27 +00:00
Guy Harris 1ed26d317c Add a macro for hashing the bytes of an address into a hash value.
Use it in the IAX2 dissector and in the conversation code.

svn path=/trunk/; revision=21577
2007-04-26 00:51:33 +00:00
Anders Broman 6bdffa496e From Peter Johansson:
the supplied patch fixes a problem where the options value should really be used from the conversation found (using
conversation_lookup_hashtable(...) to create a new conversation based on the already stored conversation template (the CONVERSATION_TEMPLATE bit is set in the stored conversation) rather from the options argument passed to the function(s).

This solves a problem that otherwise shows itself where "DISSECTOR_ASSERT(!(conv->options & CONVERSATION_TEMPLATE) && "Use the conversation_create_from_template function when the CONVERSATION_TEMPLATE bit is set in the options mask");" fails sometimes.

svn path=/trunk/; revision=18825
2006-08-02 19:50:04 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Ronnie Sahlberg b189a67fc9 start converting gmemchunk into se_alloc() in /epan
svn path=/trunk/; revision=15329
2005-08-13 02:19:03 +00:00
Jörg Mayer efdd4601ce Fix more "no previous declaration" warnings
svn path=/trunk/; revision=15171
2005-08-02 04:34:35 +00:00
Ronnie Sahlberg 2facda00c0 from Kashyap Desai
fix bug in conversation_delete_proto_data
second argument to g_slist_remove() is a pointer to the data, not a GSlist containing a list of such pointers.


svn path=/trunk/; revision=14755
2005-06-25 22:15:51 +00:00
Ronnie Sahlberg fcab322ada Some applications do very naughty things like reusing a port for a different protocol during different stages of an application cycle.
This is very naughty and will cause problems when we have assigned a dissector to a dynamic port using conversation_set_dissector().


To make ethereal handle this case I have changed the try_conversation_dissector() to allow it to fail and return 0,   meaning   yes there is indeed a protocol registered for this conversation but that protocol rejected this packet.
(which only happens for "new" style dissectors, "old" style dissectors will never reject a packet that way)

When this happens  the decode_udp_port() helper will still allow other dissectors to be tried, in the hope that the conversation is now used for some other protocol and thus someone else might be able to decode the packet.


Update SNMP and TFTP dissectors to  check that even if there already is a conversation but that conversation does NOT have snmp/tftp registered as the dissector for it, then create a new conversation anyway and attach the proper dissector.

Since ethereal keeps track of which frame number a conversation started in, this actually works really well.



svn path=/trunk/; revision=14345
2005-05-11 10:40:53 +00:00
Ulf Lamping 79daa1e80e use DISSECTOR_ASSERT instead of g_assert
svn path=/trunk/; revision=13871
2005-03-23 00:09:12 +00:00
Guy Harris 191465dc43 Check in the missing part of Jon Ringle's patch (the part that actually
changed the conversation code).

svn path=/trunk/; revision=13250
2005-02-03 01:08:39 +00:00
Guy Harris d061f606b9 From Peter Johansson: "template" conversations - if one is recognized,
the template is left around, and a new conversation is created with
the wildcards in the template un-wildcarded.

svn path=/trunk/; revision=12757
2004-12-15 09:25:48 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Gerald Combs 2b53a88bf8 From Dinesh Dutt:
- conversation.[ch] - To support not setting port2 on matching a
      conversation. This is used by protocols such as iSNS in which the client
      registers a TCP/UDP port with the server for notifications and the server
      sends notifications to this port from different source ports.
    - packet-isns.c - Added support for handling zero-length TLVs and ESI & SCN
      frames (when registering an SCN/ESI port, a conversation dissector is
      setup).

svn path=/trunk/; revision=11320
2004-07-06 19:01:32 +00:00
Guy Harris 32a44690cd Fix a comment.
svn path=/trunk/; revision=9605
2004-01-09 00:57:48 +00:00
Gerald Combs b60b1414c3 From Dinesh Dutt: Add Fibre Channel support, including FCIP, Basic FC
header, Extended Link Service, Interswitch Link Service, FCP, and IPFC.

svn path=/trunk/; revision=6757
2002-12-08 02:32:36 +00:00
Guy Harris acaf3c90b3 Cast various "const gpointer" arguments to const pointers rather than
non-const pointers.

svn path=/trunk/; revision=6683
2002-11-27 22:44:41 +00:00
Guy Harris 663bc2174e Move the stuff to save, recompute, and restore "can_desegment" out of
"try_circuit_dissector()" and "try_conversation_dissector()", as both fo
them call "call_dissector()" and "call_dissector()" now does that stuff
itself.

svn path=/trunk/; revision=6520
2002-10-29 07:22:55 +00:00
Jörg Mayer 48be4e530d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6116
2002-08-28 20:41:00 +00:00
Jörg Mayer 3105ee542f Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the epan/ directory but leave winsock2.h in inet_pton.c
and inet_ntop.c for now (can't estimate the consequences).

svn path=/trunk/; revision=5928
2002-08-02 21:29:45 +00:00
Ronnie Sahlberg 9625720a39 Added parsing of PORTMAP GETPORT functions.
When we see PRTOMAP GETPORT calls for UDP, make sure all further UDP packets to  or from
this port goes to the ONC-RPC dissector regardless of the port on the other side.

We need this because if there is ONC-RPC traffic going between the ONC-RPC Program port to a port which has a normal ethereal dissector, ethereal would dissect the traffic as the protocol associated with the other port instead.

svn path=/trunk/; revision=5430
2002-05-09 12:10:06 +00:00
Guy Harris 3396fb2777 Update from Ronnie Sahlberg:
1.  Changes how can_desegment works so that can_desegment is
	    only != 0 for whichever dissector is running immediately on
	    top of whoever offers the can_desegment service.

	    Thus DCERPC needs no special handling to see if it can trust
	    can_desegment (which is currently only available ontop of TCP
	    and not ontop of tcp->nbss->smb).

	2.  Changes fragment reassembly of transaction smb to only show
	    the defragmented packet for the transaction smb holding the
	    first fragment.

	    To see why, test it with a transaction SMB containing a ~60kb
	    PDU or larger.  The old behaviour had approximately quadratic
	    behaviour regarding runtime for dissecting such PDUs.

	    (example: NetShareEnum is a command which can grow really really
	    large if the number of shares and comments are large)

svn path=/trunk/; revision=4296
2001-11-29 09:05:25 +00:00
Guy Harris 07b2709f8a Change "conversation_set_dissector()" to take a dissector handle, rather
than a pointer to a dissector function, as an argument.

This means that the conversation dissector is called through
"call_dissector()", so the dissector itself doesn't have to worry about
checking whether the protocol is enabled or setting
"pinfo->current_proto", so get rid of the code that does that in
conversation dissectors.  Also, make the conversation dissectors static.

Get rid of some direct calls to dissectors; replace them with calls
through handles, and, again, get rid of code to check whether a protocol
is enabled and set "pinfo->current_proto" where that code isn't needed.
Make those dissectors static if they aren't already static.

Add a routine "create_dissector_handle()" to create a dissector handle
without registering it by name, if the dissector isn't used outside the
module in which it's defined.

svn path=/trunk/; revision=4281
2001-11-27 07:13:32 +00:00
Guy Harris 6f776aa40d Get rid of some unused variables.
svn path=/trunk/; revision=4239
2001-11-21 01:02:03 +00:00
Guy Harris dffa2a989a Get rid of a bunch of stuff that was there to support non-tvbuffified
dissectors and that's no longer needed.

svn path=/trunk/; revision=4112
2001-10-31 05:59:20 +00:00
Guy Harris 3388bde488 Instead of having a single datum attached to a conversation, have a list
of protocol-id-plus-datum pairs, so that multiple protocols can attach
information to the same conversation.

Dissectors that attach information to a conversation should not assume
that if they find a conversation it has one of its data attached to it;
the conversation might've been created by another dissector.

svn path=/trunk/; revision=3901
2001-09-03 10:33:12 +00:00
Guy Harris f6c33914fe Don't pass wildcarded arguments to "find_conversation()" to routines
that look up conversations in hash tables, unless they are arguments
that will be ignored; if they're not being ignored, then if the argument
is a null pointer you may get a crash if it's dereferenced, and if it's
not a null pointer you'll only get a match if the conversation has
whatever stuff the arguments points to as its first address or port.

If you match a conversation with a wildcarded address and/or port, and
the address and/or port matched a non-wildcarded search argument, and
the conversation is for a connection-oriented transport protocol, set
the wildcarded address and/or port for the conversation to the value
that matched it.

svn path=/trunk/; revision=3897
2001-09-03 07:31:20 +00:00
Guy Harris 2c9de0038c In "find_conversation()", do the same type of matching that
"try_conversation_dissector()" does - start with as exact matches as
possible, and then start doing wildcarding - so that it can find
conversations with wildcard addresses or ports even if both address and
port arguments are supplied to it.

svn path=/trunk/; revision=3893
2001-09-03 00:26:31 +00:00
Guy Harris 3c7b6471e3 Rename the arguments and flags for the conversation routines, so as not
to imply that

	1) conversations have source and destination addresses and ports
	   - they don't (if they did, they'd be monologues, not
	   conversations), they just have two address/port pairs for the
	   two endpoints, with one or more of the address or port in the
	   second pair possibly being wildcarded;

	2) the first and second address or port argument to
	   "find_conversation()" or "try_conversation_dissector()" have
	   anything to do with the first or second address/port pair in
	   a conversation - they don't, the two arguments to those
	   routines are matched against *both* address/port pairs for a
	   conversation;

as otherwise people might think that they need to add flags to wildcard
the first arguments "conversation_new()" or "find_conversation()" (they
don't, they just have to pass the non-wildcarded address/port first and
then pass the wildcarded one, even if that means passing the destination
first and source second).

svn path=/trunk/; revision=3537
2001-06-10 09:50:20 +00:00
Guy Harris b311794270 Fix a comment.
Split some lines differently.

svn path=/trunk/; revision=3519
2001-06-06 01:29:17 +00:00
Guy Harris 671992baab Define a "COPY_ADDRESS()" macro, which copies the data in one address to
another (copying the data to a mallocated array) in
"epan/packet_info.h", and use it in the conversation code.

svn path=/trunk/; revision=3510
2001-06-04 07:27:50 +00:00
Guy Harris a5a36589f8 Add an "ADDRESSES_EQUAL()" macro, taking pointers to two "address"
structures as arguments, that evaluates to "true" if the two addresses
are equal and "false" if they're not equal.  Use that macro in the
conversation code.

svn path=/trunk/; revision=3509
2001-06-04 06:46:07 +00:00
Guy Harris ea00ad9f58 Nobody calls "old_try_conversation_dissector()" or
"old_dissector_try_heuristic()" any more, as their users have all been
tvbuffified - get rid of them.

svn path=/trunk/; revision=2660
2000-11-18 11:47:21 +00:00
Guy Harris 67f0e0b41b Do the checks for the presence of a conversation dissector the same way
in "try_conversation_dissector()" that they're done in
"old_try_conversation_dissector()".

svn path=/trunk/; revision=2656
2000-11-18 07:00:31 +00:00
Guy Harris 69ebb146e8 Don't attempt to call the dissector for a conversation if the
conversation doesn't have a dissector.

svn path=/trunk/; revision=2655
2000-11-18 06:51:42 +00:00
Guy Harris 86ceeff7db Wildcard matching is tricky - you have to try wildcarding both the
source *and* destination port and/or both the source *and* destination
address passed to "find_conversation()", because the packet for which
you're trying to find the conversation may be going in the opposite
direction to the packet for which the conversation was originally
created.

Create different hash tables for wildcarded conversations, to reduce the
number of "is this a wildcard?" tests done when doing hash lookups.

This is sufficient to allow the TFTP dissector to use conversations
rather than being special-cased in the UDP dissector, and may also be
sufficient to handle a similar problem with SMTP (request goes from
client IP X port Y to server IP Z's well-known port, reply comes back
from some other port on server Z to client IP X port Y), but further use
may reveal other changes that should be made.

svn path=/trunk/; revision=2525
2000-10-21 09:54:12 +00:00
Guy Harris 563f86ee5e Support for conversations with "wildcard" destination addresses, from
Jeff Foster.

svn path=/trunk/; revision=2523
2000-10-21 05:52:28 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00