aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
AgeCommit message (Collapse)AuthorFilesLines
2008-08-05Add a debug helper for EP memory corruptionlego1-2/+17
if compiled in and the env var WIRESHARK_DEBUG_EP_CANARY is set: will check for canary integrity at every call to EP_CHECK_CANARY() if corruption is found it exits pronting the prior location and the location in which corruption was found. Hopefully it stops running while the corruptor is still in the stack. see EP_CHECK_CANARY() calls in packet.c as an example. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25927 f5534014-38df-0310-8fa8-9805f1628bb7
2008-07-13From Francesco Fondelli:jake1-0/+1
Attached is a patch for: - PW Associated Channel Header dissection as per RFC 4385 - PW MPLS Control Word dissection as per RFC 4385 - mpls subdissector table indexed by label value - enhanced "what's past last mpls label?" heuristic - Ethernet PW (w/o CW) support as per RFC 4448 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25730 f5534014-38df-0310-8fa8-9805f1628bb7
2008-05-21A slightly more complicated have_postdissector() (missed in my previous ↵morriss1-10/+28
checkin--thanks Bill) which also checks if the postdissectors are enabled. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25347 f5534014-38df-0310-8fa8-9805f1628bb7
2008-05-21boolean -> gbooleanwmeier1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25344 f5534014-38df-0310-8fa8-9805f1628bb7
2008-05-21Add missing have_postdissector(); (Hopefully what was intended).wmeier1-0/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25342 f5534014-38df-0310-8fa8-9805f1628bb7
2008-01-15Call post dissectors with call_dissector_only() to avoid an extra Data entrystig1-1/+1
if post dissectors are disabled, as pointed out by LEGO. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24109 f5534014-38df-0310-8fa8-9805f1628bb7
2007-12-15Cleanup call_dissector / call_dissector_onlyjake1-16/+16
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23871 f5534014-38df-0310-8fa8-9805f1628bb7
2007-11-09Apply yet another set of the optimization patches:etxrab1-99/+119
move the case where pinfo->in_error_pkt is true in its own function: - it's not the common case. - it needs a TRY block. ==> slow volatile and big stack footprint. - call_dissector_work is called a lot and recursively. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23413 f5534014-38df-0310-8fa8-9805f1628bb7
2007-10-27From Andrew Feren:etxrab1-0/+2
return FALSE if dissector_try_string(...) is passed a NULL string pointer arguably this should assert instead. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23287 f5534014-38df-0310-8fa8-9805f1628bb7
2007-10-02be a bit more verbose, if the name given to register_dissector_table() is ↵ulfl1-1/+3
not unique (e.g. because of a buggy/duplicated plugin) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23042 f5534014-38df-0310-8fa8-9805f1628bb7
2007-09-19call_dissector() provides generic 'data' handler for unrecognized data ↵bondolo1-1/+1
types. call_dissector_only() fails gracefully for unrecognized types. The handler for generic 'data' should avoid the variant that potentially could result in recursively calling itself. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22907 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-08don't use NULL to initialise an integerulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22474 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-08add pinfo fields clnp_srcref and clnp_dstref to the clnp dissector, similar ↵ulfl1-0/+2
to the srcport / destport already existing. As simply using srcport / destport for this will confuse mixed protocol usage (like RFC1006 ISOonTCP), I've added explicit clnp fields. This way, protocols on top of COTP / CLNP have at least a chance to do reassembling correct. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22473 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-07from: Mike Duigoulego1-0/+31
Adds a heur_dissector_delete() function to allow heuristic dissectors to be dynamically disabled based upon, for example, preference settings. http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1697 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22463 f5534014-38df-0310-8fa8-9805f1628bb7
2007-08-03- add PDInterfaceFSUDataAdjust blockulfl1-0/+1
- start to implement an AR conversation handler git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@22444 f5534014-38df-0310-8fa8-9805f1628bb7
2007-05-29From David Howells :standel1-1/+1
Fix compilation failures when building wireshark-0.99.6-SVN-21916 on an x86_64-unknown-linux-gnu target with gcc version 4.1.2 20070403 (Red Hat 4.1.2-8). The failures fall into two categories: (1) Casts between pointers and 32-bit integers without an intermediary cast via 'long' or 'unsigned long'. This results in a compiler warning complaining about casts between a pointer and an integer of a different size. (2) Passing values to "%lld" or similar printf-style format options that the compiler thinks are a different size. Such values need to be cast to 'long long' or 'unsigned long long'. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21975 f5534014-38df-0310-8fa8-9805f1628bb7
2007-04-23Dissector table names should be pointed to by const pointers.guy1-2/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21533 f5534014-38df-0310-8fa8-9805f1628bb7
2007-04-23Add some GCC warnings to the standard set, and add some others to theguy1-3/+3
--enable-extra-gcc-checks set. If we turn on -pedantic, try turning on -Wno-long-long as well, so that it's not *so* pedantic that it rejects the 64-bit integral data types that we explicitly require. Constify a bunch of stuff, and make some other changes, to get rid of warnings. Clean up some indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21526 f5534014-38df-0310-8fa8-9805f1628bb7
2007-04-03epan/dissectors/Makefile is now building four libraries :standel1-2/+3
- asn dissectors : libasndissectors.la - pidl dissectors : libpidldissectors.la - normal dissectors : libdissectors.la *and* libcleandissectors.la. I separated it in two libraries temporarily. The source files used to build libcleandissectors.la do not generate warning anymore and the -Werror is used to compile them. If we patch a dissector and it doesn't generate warning anymore, we have to move the filename dissector from DISSECTOR_SRC to CLEAN_DISSECTOR_SRC in epan/dissectors/Makefile.common. If you want to define specific cflags for one library type, let's say pidl, you may define libpidldissectors_la_CFLAGS. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21324 f5534014-38df-0310-8fa8-9805f1628bb7
2007-03-21packet_info.c and packet.clego1-3/+4
add sccp_info to struct _packet_info (Sorry but the way private_data works and the fact that TCAP uses it and BSSAP/RANAP can be tunnelled on GSMMAP over TCAP makes it impossible to avoid) SCCP - Have SCCP to have a TAP, - Fix associations so that every message belongs to the association. - Export message type values so that they can be used by a tap listener RANAP - Have RANAP information attached to the sccp_info BSSAP + GSM_A - Have DTAP, BSSMAP and BSSAP info attached to the sccp_info git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@21076 f5534014-38df-0310-8fa8-9805f1628bb7
2007-02-21add a field in pinfo where dcerpc/pidl can store the name of the current ↵sahlberg1-0/+1
dcerpc procedure use this field in the policy handle helper to indicate not only which frames the handle was opened/close in but also the name of the function that opened it. eventually, when other pidl support infrastructure is developed it would be nice if this could be expanded to also contain the name of the object/handle opened. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20895 f5534014-38df-0310-8fa8-9805f1628bb7
2007-01-15instead of simply doing an assert when running out of memory in emem, throw ↵ulfl1-0/+6
a new OutOfMemoryError Exception, so file.c can show at least a better explanation to the user before Wireshark terminates XXX - to prevent a busy wait, I need a portable way to wait for a short time period, like Sleep() for Windows git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20437 f5534014-38df-0310-8fa8-9805f1628bb7
2007-01-10Extending true_false_string supportjake1-6/+1
- Separate tfs.[ch] - Add larger sample collection - Properly export DATA git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@20373 f5534014-38df-0310-8fa8-9805f1628bb7
2006-10-22add a tcp_tree field to packet_info so that we can access the tree from ↵sahlberg1-0/+1
tcp_dissect_pdus() (and others if need be) in tcp_dissect_pdus() add a field ( tcp.pdu.size ) to the tree that displays the pdu size. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19655 f5534014-38df-0310-8fa8-9805f1628bb7
2006-10-17we need a new pinfo member field so that we can pass data from the core usb ↵sahlberg1-0/+1
dissector to future class dissectors git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19576 f5534014-38df-0310-8fa8-9805f1628bb7
2006-08-31move value_strings from expert_dialogs into expert.c to remove duplicatesulfl1-1/+5
keep the highest severity level of the current file (experimental) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19104 f5534014-38df-0310-8fa8-9805f1628bb7
2006-08-10Neil Piercy:jmayer1-0/+1
I've just had a bug in one of our private dissectors which meant that the handle passed to call_dissector was null. This seemed to give varying behavior - on some Windows installations it hit wireshark's in-built exception handling, and displayed that the dissector had an error (correct), but on some installations it just crashed wireshark (not helpful). I _think_ the difference was whether MSVC was installed or not, but on a sample of only 3 machines. Should call_dissector include explicit null handle checks, and if so, should it:- a) g_assert - the simple patch attached b) fallback to doing a data decode (as disabled protocols do) c) try to invoke the wireshark exception handling for the packet Or is the correct answer none of the above - the exception handler should already cope ? git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18869 f5534014-38df-0310-8fa8-9805f1628bb7
2006-06-29add various enhancements to the CBA-ACCO dissector, including an added ↵ulfl1-0/+1
profinet_type field to the packet_info struct git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18615 f5534014-38df-0310-8fa8-9805f1628bb7
2006-05-21name changesahlberg1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@18197 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-16fix some typos in a commentulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17653 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-07Initialize a return value. Found by Coverity.gerald1-4/+4
Fix up whitespace. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17499 f5534014-38df-0310-8fa8-9805f1628bb7
2006-03-07Fix a possible NULL pointer dereference discovered by coverity.lroland1-10/+10
I'm not sure, if it is possible to get a NULL pointer here, but it is safer to fix it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17494 f5534014-38df-0310-8fa8-9805f1628bb7
2006-01-24fix a typolego1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17090 f5534014-38df-0310-8fa8-9805f1628bb7
2006-01-24Add register_postdissector() to the API.lego1-0/+20
Dissectors registered with register_postdissector() will be called after all other dissectors have been called. Use it to register mate. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@17089 f5534014-38df-0310-8fa8-9805f1628bb7
2005-10-03From Jeff Snyder:etxrab1-0/+4
04-stream.diff A simplified packet reassembly API built on top of fragment_add_seq_next for reassembling fragments that are delivered in-order, where fragments are identified by a framenum and an offset into that frame. Streams are attached to a conversation or a circuit and are unidirectional. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16082 f5534014-38df-0310-8fa8-9805f1628bb7
2005-09-11Replace tvb_memcpy() calls that extract IPv4 addresses into a guint32,guy1-1/+0
and that extract IPv6 addresses into a "struct e_in6_addr", with tvb_get_ipv4() and tvb_get_ipv6() calls - except for some that we remove, by using proto_tree_add_item(), rather than replacing. Have epan/tvbuff.h include epan/ipv6-utils.h, to define "struct e_in6_addr" (not necessary to declare the tvbuff routines, but including it there means "struct e_in6_addr" is guaranteed to be defined before those declarations, so we don't get compiler complaints if we define it *after* those declarations). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15758 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-16For "-G decodes", print the selector values as unsigned ints.gerald1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15377 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-14Data sources have a lifetime spanning a single packet sahlberg1-18/+2
so instead for g-alloc and g_free data just use ep_alloc() that is automatically freed instead. this also gets rid of one more GMemChunk git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15346 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-12Add beginning of seasonal allocation in addition to the existing ephemeral ↵sahlberg1-0/+4
ones. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15301 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-05More char -> const char warning fixes.jmayer1-1/+1
Removed (very few) casts that only change the warning message but don't remove it (with gcc-4). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15227 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-02Fix more "no previous declaration" warningsjmayer1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15171 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-24Constify to remove a bunch of warnings. Add some casts to squelchguy1-4/+4
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst warnings. In the TACACS dissector, clean up the variables used in option parsing to avoid some const-to-nonconst warnings. Clean up some white space. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15043 f5534014-38df-0310-8fa8-9805f1628bb7
2005-07-23More 'char*' -> 'const char*' changes to fix warnings.jmayer1-4/+4
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15015 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-11Some applications do very naughty things like reusing a port for a different ↵sahlberg1-3/+28
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14345 f5534014-38df-0310-8fa8-9805f1628bb7
2005-05-02- Add support for libpcap files for MTP2 with a per packet headertuexen1-16/+17
indicating the direction, narrowband/broadband, and interface number. - Add support to display the direction and interface number. - Add support to packet-mtp2.c to use the broadband/narrowband indication. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14265 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-23Add a "cleanup_dissection()" routine, intended to free up dataguy1-0/+14
structures allocated by a dissection. Currently, it's the same as "init_dissection()", but they should be split with "init_dissection()" allocating the initial data structures and "cleanup_dissection()" freeing them and *not* reallocating the initial data structures. Use "cleanup_dissection()" in "cf_close()" to make it easier to find leaks. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13881 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-11Add a "-G decodes" option to ethereal and tethereal which shows thegerald1-0/+55
filter/selector/protocol associations for each dissector. This will be used to improve our automated tests, but someone with time on their hands could probably use it to generate a protocol poster using Graphviz. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13721 f5534014-38df-0310-8fa8-9805f1628bb7
2005-03-08gssapi decryption nees a few new fields to pass the blobs from application ↵sahlberg1-0/+4
layer dissector all the way down to spnego or friends and back. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13658 f5534014-38df-0310-8fa8-9805f1628bb7
2005-02-09Move the following files from /trunk to /trunk/epan:lroland1-1/+1
asn1.[ch] follow.[ch] ptvcursor.[ch] reassemble.[ch] xmlstub.[ch] fix #include statements accordingly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13366 f5534014-38df-0310-8fa8-9805f1628bb7
2005-01-20Squelch a compiler warning.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@13136 f5534014-38df-0310-8fa8-9805f1628bb7