summaryrefslogtreecommitdiff
path: root/plugins/gryphon/packet-gryphon.c
AgeCommit message (Collapse)AuthorFilesLines
2016-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann1-1/+1
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-27gryphon (plugins): fix spelling typo found by lintianAlexis La Goutte1-2/+2
Change-Id: I82f87f809ff0a261dacf38a2fb52aa4788403490 Reviewed-on: https://code.wireshark.org/review/18500 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-19Drop redundant SIZEOF() macroBalint Reczey1-10/+10
Change-Id: I6db2033746f5f22dd0229c96727bb352bdb1e866 Reviewed-on: https://code.wireshark.org/review/18298 Reviewed-by: Balint Reczey <balint@balintreczey.hu> Petri-Dish: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+3
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-28gryphon: fix 'gryphon.reserved' exists multiple times with NOT compatible ↵Alexis La Goutte1-44/+28
types: FT_BYTES and FT_UINT32 Change-Id: Ia2ef8c4211ca717d6e99f596cd7f2de92d5aa7ca Reviewed-on: https://code.wireshark.org/review/14202 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-11new_create_dissector_handle -> create_dissector_handle for plugins.Michael Mann1-1/+1
Change-Id: I0d485b1337c669291ad58b6c096657ce2db353c8 Reviewed-on: https://code.wireshark.org/review/12516 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-12Gryphon: do not use col_set_str with non constant stringsPascal Quantin1-1/+1
Fixes an ASAN failure reported by Alexis Change-Id: I68e5c55ec4090766ef5f003f44093ce3c268a82a Reviewed-on: https://code.wireshark.org/review/7082 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-01-27Lua: Expose tcp_dissect_pdus() to LuaHadriel Kaplan1-1/+1
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus() to make TCP-based dissection easier. Bug: 9851 Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3 Reviewed-on: https://code.wireshark.org/review/6778 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2014-12-22plugins: Cleanup #includesBill Meier1-2/+1
Change-Id: Ic839f2995532d68308f8b5908c185acc7acaaa9c Mostly: remove '#include <glib/glib.h>' and certain other #includes already included in packet.h Reviewed-on: https://code.wireshark.org/review/5971 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06plugins: Add editor modelines; Adjust whitespace as needed.Bill Meier1-16/+29
Change-Id: I36124f6021d46a228721bdc976f6b9fef1c8c088 Reviewed-on: https://code.wireshark.org/review/4488 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-18Add missing parameter to proto_tree_add_bytes_format_value()AndersBroman1-3/+3
tvb_lenght -> tvb_reported_length Change-Id: Ibcb4a7caceaa8207877bdec0f770ad77f84dbe56 Reviewed-on: https://code.wireshark.org/review/3701 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-18Remove proto_tree_add_text from gryphon dissector.Michael Mann1-78/+164
Change-Id: If9f85a6cda483c5b89f9bee3524502b888ccb1d1 Reviewed-on: https://code.wireshark.org/review/3676 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-10convert to proto_tree_add_subtree[_format] for plugin dissectorsMichael Mann1-55/+26
Change-Id: I13924c5a2f056688a42cdee25654d82c056b5f97 Reviewed-on: https://code.wireshark.org/review/2974 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-12Thou shalt not put newlines in the strings in value_string tables.Guy Harris1-1/+1
That just breaks too many things. This catches the examples of that found in bug 9878. There might be others that my grepping didn't find. We should also have the checkAPIs.pl script check for this, so this isn't a full fix for bug 9878. Change-Id: I3bf6f1fc0fe8654d0f54a995e72f1966ae012f5e Reviewed-on: https://code.wireshark.org/review/623 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-27Fix [-Wmissing-prototypes]Anders Broman1-0/+3
svn path=/trunk/; revision=54473
2013-11-09Add data parameter to tcp_dissect_pdus() as well as convert it to using ↵Michael Mann1-6/+8
"new" style dissectors. Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that? Should tcp_dissect_pdus return length (bytes consumed)? There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb). Seems like that could all be rolled into one. svn path=/trunk/; revision=53198
2013-09-22More emem -> wmem conversion:Pascal Quantin1-1/+1
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz() - tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc() - tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz() - tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str() - update docs accordingly svn path=/trunk/; revision=52180
2013-07-01Define certain 'const char *...' arrays as static.Bill Meier1-1/+1
(That is: Don't create the array on the stack each time the function is called). Reduces code memory usage and execution time. (See SVN #50271) svn path=/trunk/; revision=50296
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-1/+1
was done using textual search+replace, not anything syntax-aware, so presumably it got most comments as well (except where there were typos). Use a consistent coding style, and make proper use of the WS_DLL_* defines. Group the functions appropriately in the header. I ended up getting rid of most of the explanatory comments since many of them duplicated what was in the value_string.c file (and were out of sync with the recent updates I made to those in r48633). Presumably most of the comments should be in the .h file not the .c file, but there's enough churn ahead that it's not worth fixing yet. Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467 svn path=/trunk/; revision=48634
2012-12-26Another 64-bit-to-32-bit warning on 32-bit platforms.Guy Harris1-1/+1
svn path=/trunk/; revision=46781
2012-12-26Fix a bunch of warnings.Guy Harris1-2/+4
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-12-05Fix numerous instances of a variable/parameter name "shadowing" a library ↵Bill Meier1-7/+7
function name; (At least some (gcc ?) compilers give a "shadow" warning for these). svn path=/trunk/; revision=46402
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=45015
2012-07-30Fix Coverity CID's 712344-712345: Unused pointer value.Chris Maynard1-2/+2
svn path=/trunk/; revision=44135
2012-07-27Fix two "set but unused variable" warnings turning errors:Jörg Mayer1-1/+2
- Comment out hdrbits, it's retrieved but not used (slightly different approach to overwritten patch) - Change two instances of pt to tree as this *may* have been the intention svn path=/trunk/; revision=44061
2012-07-27Remove unused variable, use the created subtree. Found by buildbot.Anders Broman1-4/+3
svn path=/trunk/; revision=44059
2012-07-26You can't (well, shouldn't) reference and modify a given variable multipleJeff Morriss1-27/+22
times in one C statement: the order of references and modifications is undefined. Anyway I don't think the modification is intentional: just divide instead of divide-and-assign. Also remove what looks to be some test code (only executed for frame number 11). svn path=/trunk/; revision=44056
2012-07-26Converted many proto_tree_add_text -> proto_tree_add_item (or at least ↵Michael Mann1-833/+1355
something that's filterable). since Gryphon is used as the flagship example for plugins, I don't want developers to get the impression proto_tree_add_text is the way to add fields in Wireshark. Hopefully this will reduce the number of dissectors submitted with too many proto_tree_add_text()s. svn path=/trunk/; revision=44055
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-04-30The message length isn't needed in cmd_sched_rep() - it's just theGuy Harris1-8/+0
containing packet length, so if we go past it, we'll get an exception thrown. Get rid of it. The answer to "Should msglen be returned instead of offset?" is "no" - the command dissectors return the new offset. Get rid of an unused - and unnecessary - variable. svn path=/trunk/; revision=42367
2012-04-30Fix a couple of clang warnings and adjust capitalization.Gerald Combs1-3/+3
svn path=/trunk/; revision=42358
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-07-21Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.Bill Meier1-6/+4
svn path=/trunk/; revision=38150
2011-04-12Rework whitespace.Bill Meier1-971/+973
svn path=/trunk/; revision=36583
2011-04-12Don't assign to a proto_item * if the value won't be used: Coverity 1158 & 1159.Bill Meier1-5/+4
svn path=/trunk/; revision=36581
2011-04-12localtime() can return a NULL ptr.Bill Meier1-9/+15
svn path=/trunk/; revision=36580
2011-01-21There's no need to pass the result of tvb_get_ptr() as the 'value' inJeff Morriss1-17/+17
proto_tree_add_*(): just use proto_tree_add_item(). Replace some tvb_get_ptr()s with tvb_get_ephemeral_string(). svn path=/trunk/; revision=35603
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-1/+1
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-11-05Simply use %c for printing char.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=34789
2010-11-05Fixed a printf modifier to remove a warning from clang.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=34784
2010-04-05Get rid of a bunch of check_col().Anders Broman1-9/+7
svn path=/trunk/; revision=32388
2010-01-28Fix some gcc -Wshadow warnings.Bill Meier1-2/+2
svn path=/trunk/; revision=31722
2009-09-20Use tvb_get_ephemeral_stringz() instead of tvb_get_stringz()Kovarththanan Rajaratnam1-8/+7
svn path=/trunk/; revision=30002
2009-08-21(Minor) Remove unneeded #includes.Bill Meier1-4/+0
svn path=/trunk/; revision=29492
2009-08-09Don't guard col_clear with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29344
2009-08-09Don't guard col_set_str (COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29340
2009-06-18From Kovarththanan Rajaratnam via bug 3548:Stig Bjørlykke1-6/+6
Cleanup header_field_info in plugins. svn path=/trunk/; revision=28771
2009-02-18Correct copyright statements.Jaap Keuter1-1/+1
svn path=/trunk/; revision=27480