summaryrefslogtreecommitdiff
path: root/epan/epan.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-10Fix epan building with undefined HAVE_PLUGINSJakub Zawadzki1-0/+2
+ guard prototypes with HAVE_PLUGINS in .h files to get errors before linking. svn path=/trunk/; revision=53909
2013-12-05Initialize the error-reporting routines before scanning for plugins, asGuy Harris1-9/+1
the code to scan for them uses those routines. This means epan_init() no longer takes those routines as arguments - which is just as well, given that the mechanism in question is no longer part of libwireshark, but is part of libwsutil. This should fix bug 9508. svn path=/trunk/; revision=53796
2013-12-03Dissectors should not use dfilter.h, don't include it.Jakub Zawadzki1-0/+2
XXX ncp2222 dissector is using dfilter_compile(), why? svn path=/trunk/; revision=53766
2013-12-02Move most of the plugin code from epan to wsutil and remove allGuy Harris1-0/+14
knowledge of particular types of plugins. Instead, let particular types of plugins register with the common plugin code, giving a name and a routine to recognize that type of plugin. In particular applications, only process the relevant plugin types. Add a Makefile.common to the codecs directory. svn path=/trunk/; revision=53710
2013-11-23Create the ability to have packet scoped "proto" data. Bug 9470 ↵Michael Mann1-0/+2
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470) I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future. And search/replace of a function name is easy enough to do. The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As. All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope(). All other dissectors were converted to using file_scope() which was the original scope for "proto" data. svn path=/trunk/; revision=53520
2013-11-04Effectively remove the tree memory pool and port some of its behaviour to theEvan Huus1-4/+18
pinfo memory pool, they have exactly the same scope. Simplification and minor performance win (one GHashTable we longer have to create/destroy on every packet). svn path=/trunk/; revision=53076
2013-10-23Add Lua cleanup on shutdown, to help with memory leak detection. Bug 5575 ↵Michael Mann1-0/+3
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5575) From Robert G. Jakabosky From me: cleanup so that it applies to trunk. svn path=/trunk/; revision=52798
2013-10-202nd try to fix recent test failures.Jakub Zawadzki1-0/+2
After recent changes it's possible that epan_dissect_cleanup() can be called if there were no dissection run on it (epan_dissect_run()) In such case ->tvb will have random value, just initialize it to NULL in _init() and see if it's working. Thanks goes to Evan for backtrace. svn path=/trunk/; revision=52722
2013-10-20Reintroduce back epan_dissect_reset(), proto_tree_reset()Jakub Zawadzki1-2/+33
This time it makes more sense, cause for each dissection we need two wmem allocators. Reseting wmem allocator is much faster than destroy & create. svn path=/trunk/; revision=52706
2013-10-20Move resetting packet_info structure from dissect_packet() to ↵Jakub Zawadzki1-2/+2
epan_dissect_init() It'd be actually good idea to seperate packet_info data (packet.c) from epan_dissect_t (epan.c), but this rule is already violated. Strict seperation could allow for example allow multiple dissection on the same epan_dissect_t (I think it was idea behind it), but it's not working. svn path=/trunk/; revision=52705
2013-10-19From beroset@mindspring.com:Anders Broman1-1/+0
remove unnecessary and unused oid_resolv_cleanup() https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9295 svn path=/trunk/; revision=52697
2013-08-13As suggested in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9033Evan Huus1-4/+5
Make epan_free a no-op if the pointer is NULL. This fixes 99% of the cases causing problems for wmem_leave_file_scope() - remove that XXX comment and add back the assertion. Remove the cleanup_dissection call from epan_cleanup, it doesn't make sense there. init_dissection is only called from epan_new, so cleanup_dissection should only be called from epan_free. Add one missing epan_free call to tshark revealed by the above changes. svn path=/trunk/; revision=51342
2013-08-13Create the dissector hash table in only one place, and specify that its valuesEvan Huus1-1/+2
should be freed when it is destroyed. This requires splitting packet_init in two: the hash table which must be created before protocol registration, and the caching of common protocol handles, which must happen after registration. svn path=/trunk/; revision=51329
2013-08-07Ensure we have both _initialize() and a corresponding _cleanup() routines forJeff Morriss1-4/+4
the various name resolvers; put those two routines next to each other. Add generic addr_resolv_init() and addr_resolv_cleanup() routines which call all of those internal routines. Call the generic init/cleanup routine from epan_init() and epan_cleanup(). Create the hash tables for each name resolver in those initialization routines in order to avoid having to repeatedly check if the table is already created or not (and to avoid glib warnings if we neglected to perform that check): http://www.wireshark.org/lists/wireshark-dev/201308/msg00012.html Don't clean up hostnames in init_dissection(): it's done already in cleanup_dissection(). Don't initialize hostnames in cleanup_dissection(): it's done already in init_dissection(). svn path=/trunk/; revision=51191
2013-08-01Remove fdata->opt_comment, add pkt_comment to pinfoJakub Zawadzki1-0/+9
Original (read from file) comments can be accessed by pkthdr->opt_comment Keep user comments in seperated BST, add new method for epan session to get it. svn path=/trunk/; revision=51090
2013-08-01Use glibs hastables rather than home grown variants for manuf an wka(well ↵Anders Broman1-0/+2
known addresses). https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9000 svn path=/trunk/; revision=51084
2013-07-22Abuse epan_t more: add callback to get interface name.Jakub Zawadzki1-0/+9
svn path=/trunk/; revision=50794
2013-07-21Fix: epan.c:155: warning: assignment discards qualifiers from pointer target ↵Jakub Zawadzki1-1/+1
type svn path=/trunk/; revision=50767
2013-07-21Add helper function to epan_session which can be used to get absolute ↵Jakub Zawadzki1-0/+14
timestamp of given frame. Remove ->prev_cap, for testing purpose also replace ->prev_dis with number of previously displayed frame number. This patch reduce size of frame_data by 8B (amd64) This is what (I think) was suggested by Guy in comment 13 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5821#c13) svn path=/trunk/; revision=50765
2013-07-21try to fix: epan.c:141: error: invalid application of 'sizeof' to incomplete ↵Jakub Zawadzki1-1/+1
type 'epan_t' svn path=/trunk/; revision=50763
2013-07-21Some work on multi file dissectionJakub Zawadzki1-3/+25
- make init_dissection/cleanup_dissection private for libwireshark - implement epan_new(), epan_free() - pass epan_t to epan_dissect* svn path=/trunk/; revision=50761
2013-07-15Move report_err.{h,c} from epan into wsutil: there's nothing epan-specific ↵Jeff Morriss1-1/+1
there and moving it avoids having to recompile the file for use in editcap and capinfos (which don't link against libwireshark). svn path=/trunk/; revision=50598
2013-07-11packet dissection now takes pointer to tvb instead of guint8 dataJakub Zawadzki1-4/+4
implement frame_tvbuff, right now almost a copy of 'real' tvb. svn path=/trunk/; revision=50497
2013-05-24Add expert info configuration framework. Bug 2412 ↵Michael Mann1-1/+3
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2412). Expert info "fields" can now be registered/addressed by name. Right now, the basic framework allows expert info fields to become "display filters". However more could be done, like user preferences overriding default severity level, speeding up expert info dialog load time by not needing to redissect a file, etc. Long term goal is to have all expert_info filterable and have the functionality of expert_add_info_format() include the "registered index". expert_add_info_format_text() is the workaround until all current calls to expert_add_info_format() have been updated with either expert_add_info() or expert_add_info_format_text(). Then the remaining expert_add_info_format_text() will be renamed to expert_add_info_format(). svn path=/trunk/; revision=49559
2013-05-22Turn "packet_is_ssl()" into a general "does the packet whose dissectionGuy Harris1-0/+19
is in this epan_dissect_t contain the field whose name is passed as an argument" routine in libwireshark, and use it where we used packet_is_ssl(). (We should check to see if anything *else* could use it.) svn path=/trunk/; revision=49530
2013-03-24Don't load the hosts file in epan_init, it's loaded when opening a fileAnders Broman1-1/+1
in cf_open(). svn path=/trunk/; revision=48526
2013-02-25Bugfix Lua pinfo.cols.protocol not holding value in postdissectorMichael Mann1-0/+3
From Hadriel Kaplan, bug 6020 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6020) svn path=/trunk/; revision=47877
2013-02-21include the wsutil/wsgcrypt.h instead of including gcrypt.h directlyMartin Kaiser1-1/+1
svn path=/trunk/; revision=47802
2012-12-19Dispatch all allocator creations through a single function using an enum toEvan Huus1-2/+1
determine the desired type. This has two advantages over the old way: - just one environment variable for valgrind to override in order to guarantee that ALL allocators use memory it can track, and just one place to check that variable - allocator owners no longer have to include headers specific to their allocator, allowing them to change allocators without adjusting all their #includes svn path=/trunk/; revision=46604
2012-12-18Rename allocator_glib to allocator_simple, since the block allocator alsoEvan Huus1-2/+2
uses glib and 'simple' describes the intention far better. svn path=/trunk/; revision=46603
2012-12-18Use 'new' instead of 'create' a consistent manner.Evan Huus1-1/+1
svn path=/trunk/; revision=46601
2012-12-02Actually destroy the pool in epan_dissect_cleanup. There are many casesEvan Huus1-2/+1
where the edt is on the stack, in which case epan_dissect_free never gets called and we were leaking the pool (although not any of the memory in it). svn path=/trunk/; revision=46333
2012-12-02Create a wmem pool in pinfo and use it for some address allocations.Evan Huus1-0/+6
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-03Manually revert r45669Jakub Zawadzki1-14/+0
svn path=/trunk/; revision=45884
2012-11-03Add wmem scopes for packet and file lifetimes. The file lifetime scope isn'tEvan Huus1-0/+4
yet initialized because I can't figure out where the enter() and leave() calls should go - the obvious place in packet.c causes a lot of assertion errors. svn path=/trunk/; revision=45879
2012-10-27Create init and cleanup functions for wmem as a whole.Evan Huus1-1/+4
Call them from epan_init() and epan_cleanup(). Expose a permanent wmem scope for allocations that should only be freed when epan is done (which is *not* necessarily when the program finishes). svn path=/trunk/; revision=45805
2012-10-20Move ep_free_all() *AFTER* packet dissection.Jakub Zawadzki1-6/+6
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-20Introduce epan_dissect_run_with_taps() which run dissection with taps.Jakub Zawadzki1-0/+12
unexport tap_queue_init, tap_push_tapped_queue svn path=/trunk/; revision=45670
2012-10-20- Allow reseting edt with new function epan_dissect_reset(),Jakub Zawadzki1-0/+14
- initialize edt once in few places, and later reset it after dissecting (add_packet_to_packet_list), - revert r45667, probably no longer needed. svn path=/trunk/; revision=45669
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-2/+2
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-11From Bartosz Brachaczek:Anders Broman1-2/+6
Make the SSL dissector work with GnuTLS compiled with nettle. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6869 #BACKPORT svn path=/trunk/; revision=45465
2012-10-10Revert changes to ep_ allocator, revert edt ref-counting.Jakub Zawadzki1-4/+3
svn path=/trunk/; revision=45451
2012-10-08EDT structures now own their ep_ memory pools. This should finally cleanEvan Huus1-12/+15
up the last little bits of: - https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284 - https://www.wireshark.org/lists/wireshark-dev/201208/msg00128.html and possibly part of: - https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775 This is a fairly invasive change that required some funky work with linked lists to avoid changing any of the public ep_* APIs, so if something breaks blame me :) svn path=/trunk/; revision=45389
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45016
2012-08-28Remove useless include (GeoIP initialization was removed from epan_init() in ↵Pascal Quantin1-4/+0
r43604) svn path=/trunk/; revision=44692
2012-08-10Make the corresponding packet_info available to each tree item. ThisGerald Combs1-1/+1
lets us pass a NULL pinfo to expert_add_info_format() and expert_add_undecoded_item(), which makes it possible to use those routines deep in the bowels of many dissectors. As a proof of concept remove the recent pinfo additions to packet-afp.c. This should also make it easier to fix bug 3884. svn path=/trunk/; revision=44435
2012-07-08From Evan Huus:Guy Harris1-4/+0
Don't initialize GeoIP from epan_init(), as we probably haven't loaded the preferences for it yet (thanks to it's new use of the UAT framework). Instead, register a post_update callback with UAT and load it there. As a bonus, this also means that applying GeoIP preferences no longer requires restarting Wireshark - everything should Just Work with the new databases right away. Fixes bug 7446. svn path=/trunk/; revision=43604
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-25From Tony Trinh:Anders Broman1-4/+4
Update Lua from 5.1 to 5.2 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7400 svn path=/trunk/; revision=43482
2012-04-26Refcount edt.s as we may have atleast two "active" edt:s in certainAnders Broman1-3/+14
circumstances see bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5284 patch by Evan Huus svn path=/trunk/; revision=42254