aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
AgeCommit message (Collapse)AuthorFilesLines
2012-12-02Create a wmem pool in pinfo and use it for some address allocations.Evan Huus1-0/+4
A (better?) fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8030 See also thread starting at: http://www.wireshark.org/lists/wireshark-dev/201212/msg00001.html svn path=/trunk/; revision=46331
2012-11-09Enter and leave wmem's file scope appropriately.Evan Huus1-0/+5
svn path=/trunk/; revision=45977
2012-10-20Move ep_free_all() *AFTER* packet dissection.Jakub Zawadzki1-3/+11
Use glib allocator for data_source. Thread on wireshark-dev: http://www.wireshark.org/lists/wireshark-dev/201210/msg00116.html svn path=/trunk/; revision=45673
2012-10-20Make data_source opqaue, add getter for tvb.Jakub Zawadzki1-9/+18
svn path=/trunk/; revision=45672
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-2/+3
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-12Use seasonal allocation for name resolution. This effectively scrubs ourGerald Combs1-2/+16
resolution information between capture files so that we don't leak host entries from one file to another (e.g. embarassing-host-name.example.com from file1.pcapng into a name resolution block in file2.pcapng). host_name_lookup_cleanup and host_name_lookup_init must now be called after each call to se_free_all. As a result we now end up reading our various name resolution files much more than we should. svn path=/trunk/; revision=45511
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45016
2012-09-18Revert r44978: dissector_add_uint: Legalize formerly improper use of the API ↵Jakub Zawadzki1-46/+39
when calling it with pattern value of 0 dissector_add_uint() is *not only* used by tcp.port/udp.port dissector tables where 0 is not valid port number, in some dissector tables 0 is valid protocol number, packet type, etc.. Sample dissectors using dissector_add_uint(.pattern = 0): packet-ansi_637.c:2348: dissector_add_uint("ansi_a.sms", 0, ansi_637_trans_handle); packet-cip.c:6017: dissector_add_uint("cip.class.iface", 0, cip_class_generic_handle ); packet-lon.c:723: dissector_add_uint("cnip.protocol", 0, lon_handle); packet-q931.c:3599: dissector_add_uint("lapd.sapi", LAPD_SAPI_Q931 /* 0 */, q931_handle); svn path=/trunk/; revision=44980
2012-09-18dissector_add_uint:Jörg Mayer1-39/+46
Legalize formerly improper use of the API when calling it with pattern value of 0 svn path=/trunk/; revision=44978
2012-09-11Add data parameter to dissector_try_uint_newJakub Zawadzki1-3/+4
svn path=/trunk/; revision=44874
2012-09-11Add new function: call_dissector_with_dataJakub Zawadzki1-3/+10
svn path=/trunk/; revision=44873
2012-09-11Add data parameter to call_dissector_only.Jakub Zawadzki1-16/+16
svn path=/trunk/; revision=44872
2012-09-11Add data parameter to dissector_try_heuristicJakub Zawadzki1-3/+3
svn path=/trunk/; revision=44871
2012-09-10Initial commit to support yet another method of passing data between dissectors.Jakub Zawadzki1-2/+2
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL svn path=/trunk/; revision=44860
2012-09-08Use g_hash_table_new_full() instead of g_hash_table_new() for subdissectorEvan Huus1-16/+8
registration tables, and use g_free as the value_destroy_func. This saves us from manually freeing the value when we remove an item, and prevents us from leaking memory when we accidentally overwrite an existing item. svn path=/trunk/; revision=44814
2012-08-29Add casts to fix compilation with GCC.Evan Huus1-6/+18
Remove * from gconstpointers, they are already pointer types. Add modelines to packet.c and clean up indentation a bit. svn path=/trunk/; revision=44698
2012-08-29Fix memleak.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=44697
2012-08-29Fix Bug 7348 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7348)Michael Mann1-3/+51
svn path=/trunk/; revision=44696
2012-02-28Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3315 -Jeff Morriss1-0/+9
make Save-As/Displayed/All-Packets save not only the displayed packets but also any other packets needed (e.g., for reassembly) to fully dissect the displayed packets. This works only for the "All packets" case; choosing only the Selected packet, the Marked packets, or a range of packets would require actually storing which packets depend on which (too much memory) or going through the packet list many times (too slow). Also, this behavior is always the case: you can't save the displayed packets without their dependencies (I don't see why this would be desirable). So far this is done for SCTP and things using the reassembly routines (TCP has been tested). The Win32 dialog was modified but hasn't been tested yet. One confusing aspect of the UI is that the Displayed count in the Save-As dialog does not match the number of displayed packets. (I tried renaming the button "Displayed + Dependencies" but it looked too big.) The tooltip tries to explain this and the fact that this works only in the All-Packets case; suggestions for improvement are welcome. Implementation details: Dissectors (or the reassembly code) can list frames which were needed to build the current frame's tree. If the current frame passes the display filter then each listed frame is marked as "depended upon" (this takes up the last free frame_data flag). When performing a Save-As/Displayed/All-Packets then choose packets which passed the dfilter _or_ are depended upon. svn path=/trunk/; revision=41216
2012-01-20Add 'heur_dissector_set_enabled()' to allow a dissector to enable/disable ↵Bill Meier1-153/+178
heuristic dissection; Rename some vars; Do some minor re-indentation and whitespace changes. svn path=/trunk/; revision=40601
2011-12-28Add tshark option '-G heuristic-decodes' to dump heuristic dissector tables.Bill Meier1-1/+31
svn path=/trunk/; revision=40309
2011-12-15Preparation to make it possible to dissable heuristic protocolsAnders Broman1-1/+2
trough the proto dialouge. svn path=/trunk/; revision=40215
2011-12-13Clamp the reported length of a packet at G_MAXINT for now, to avoidGuy Harris1-1/+25
crashes due to having no tvbuffs for an epan_dissect_t. Fixes bug 6663 and its soon-to-be-duplicates. svn path=/trunk/; revision=40164
2011-11-08packet_info's in_error_pkt is now a bitfield like in_gre_pkt.Chris Maynard1-1/+1
svn path=/trunk/; revision=39764
2011-10-20Delay freeing of seasonal memory until after the conversation cleanup routineJeff Morriss1-3/+5
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-09-06Whitespace cleanup.Stig Bjørlykke1-10/+10
svn path=/trunk/; revision=38893
2011-09-05List heuristic tables in Internals->Disscetor tables menu.Anders Broman1-4/+32
svn path=/trunk/; revision=38881
2011-08-08Make sure our root tvb is initialized in case its creation fails.Gerald Combs1-0/+1
Untested fix for bug 6135. svn path=/trunk/; revision=38410
2011-07-11More GLIB_CHECK_VERSION cleanups. Update the minimum GLib/GTK+ versionsGerald Combs1-12/+0
in README.devloper. Remove g_gnuc.h since it's no longer needed. Remove tvbuff_init(), tvbuff_cleanup(), reassemble_init(), and reassemble_cleanup() since they were only used for older GLib versions which didn't support GSlices. Assume we always support the "matches" operator. svn path=/trunk/; revision=37978
2011-06-01If a dissector table doesn't exist, print a more useful message, andGuy Harris1-7/+56
only abort if WIRESHARK_ABORT_ON_DISSECTOR_BUG is set. svn path=/trunk/; revision=37510
2011-05-17More eradication of old-style function definitions.Guy Harris1-2/+2
svn path=/trunk/; revision=37216
2011-04-20Fix a typo in a text string; use consistent indentation.Bill Meier1-11/+11
svn path=/trunk/; revision=36735
2011-03-31Added dissector_handle_get_long_name().Stig Bjørlykke1-0/+11
svn path=/trunk/; revision=36412
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-30/+33
keys to have _uint in their names, to match the routines that handle dissector tables with string keys. (Using _port can confuse people into thinking they're intended solely for use with TCP/UDP/etc. ports when, in fact, they work better for things such as Ethernet types, where the binding of particular values to particular protocols are a lot stronger.) svn path=/trunk/; revision=35224
2010-10-30Rev 29427 added packet_add_new_data_source() with a comment indicating thatJeff Morriss1-15/+1
the data source does not need to be allocated if (!tree). Rev 30158 took the if (!tree) check out indicating that the check was invalid. So: (since packet_add_new_data_source() now only calls add_new_data_source()), remove packet_add_new_data_source(). svn path=/trunk/; revision=34717
2010-05-08Enable "Decode As..." for ethertype 0x0000 (fix for bug 4721)Sake Blok1-0/+3
svn path=/trunk/; revision=32723
2010-04-03 From Yaniv Kaul: constify parametersBill Meier1-24/+24
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-02Revert SVN #32360 until Windows compilation errors corrected.Bill Meier1-21/+21
svn path=/trunk/; revision=32361
2010-04-02From Yaniv Kaul: constify parametersBill Meier1-21/+21
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4422 svn path=/trunk/; revision=32360
2010-02-23Squelch a bunch of compiler warnings.Guy Harris1-2/+2
svn path=/trunk/; revision=31961
2009-11-04Make sure we have a handle for the dissector.Anders Broman1-1/+2
svn path=/trunk/; revision=30824
2009-10-12Fix some indentation.Bill Meier1-90/+90
svn path=/trunk/; revision=30527
2009-10-05Move dissector add sanity check to separate functionKovarththanan Rajaratnam1-13/+24
svn path=/trunk/; revision=30346
2009-09-25The data sources can be used even if the protocol tree isn't being builtGuy Harris1-4/+11
or isn't visible. Clean up some indentation. svn path=/trunk/; revision=30158
2009-09-06Split a bunch of init routines into init() and cleanup(). This allows us to ↵Kovarththanan Rajaratnam1-2/+25
free memory properly on shutdown. This is an initial step. There's still some work to do. svn path=/trunk/; revision=29754
2009-09-06We track all protocols that appear in each packet in the frame dissector. ↵Kovarththanan Rajaratnam1-11/+9
This is an expensive operation because we: * Disable the TRY_TO_FAKE_THIS_ITEM optimization * Use GString to store the protocols We should only do this if the 'hf_frame_protocols' is referenced (unlikely) svn path=/trunk/; revision=29733
2009-08-15This patch introduces packet_add_new_data_source() which effectively ↵Kovarththanan Rajaratnam1-3/+12
deprecates add_new_data_source(). This is based on the following observation: 1) The tvb + name (aka. data_source) is only used when the protocol tree is visible The current implementation of add_new_data_source() doesn't take this into account and simply allocates a data_source regardless. This is what packet_add_new_data_source() tries to rectify. A couple of dissectors have already been switched over to the new packet_add_new_data_source(). Many are still missing. Help appreciated! svn path=/trunk/; revision=29427
2009-08-03Remove 1 commented-out #include inadvertantly committed.Bill Meier1-1/+0
svn path=/trunk/; revision=29276
2009-08-03Add some debug code (commented out) to check for duplicate dissector port ↵Bill Meier1-0/+14
registrations, svn path=/trunk/; revision=29275
2009-07-16Zero out the packet_info struct for each packet instead of trying toGerald Combs1-47/+1
initialize everything by hand. Fixes a Valgrind warning. svn path=/trunk/; revision=29122