Commit Graph

73 Commits

Author SHA1 Message Date
Guy Harris 569a768ccd ajp13: fix the type of elements of an array of pointers to hf_ values.
"int * const a[]" means "array of const pointers to (non-const) int". so
the array elements are all const; "const int *a[]" means "array of
(non-const) pointrs to const int".

Change-Id: I8f1a0fd7b0f3d06ebf4cf6b993c74cfd47a0db26
Reviewed-on: https://code.wireshark.org/review/37702
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-04 22:53:21 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Michael Mann 96d483764a Create temporary variables for some proto_tree_add_<datatype> calculations.
checkAPIs.pl doesn't like tvb_get_* parameters because it thinks
proto_tree_add_item should be used.  This is just to pacify the check.

Change-Id: I2df1233fe8c7976c257197079c06d24e472303b5
Reviewed-on: https://code.wireshark.org/review/21735
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-05-22 15:28:10 +00:00
Dario Lombardo f347af277c ajp13: remove unused variable.
Also add expert info for failing conversion.

Change-Id: I75bb385c430527e41775822ab0495684ab660c08
Reviewed-on: https://code.wireshark.org/review/18431
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-10-27 15:10:20 +00:00
Dario Lombardo 8be90aa960 ajp13: use ws_strtoi function.
Change-Id: Ibe85cbb993eba8e76ed6c645609e9cea114a6c9d
Reviewed-on: https://code.wireshark.org/review/18399
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-24 12:43:02 +00:00
Michael Mann 268841f3e0 Combine Decode As and port preferences for tcp.port dissector table.
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-10-08 02:44:53 +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
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.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>
2016-01-08 20:04:56 +00:00
Michael Mann 443a7ed259 new_create_dissector_handle -> create_dissector_handle for dissector directory.
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now.

Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f
Reviewed-on: https://code.wireshark.org/review/12484
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:37:36 +00:00
AndersBroman 870d223b69 Change deprecated API tvb_length -> tvb_reported_length
Change-Id: I14577dccaed5aa5ed85e94b6810a94b4c8b2e437
Reviewed-on: https://code.wireshark.org/review/8059
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-14 06:58:40 +00:00
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
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>
2015-01-27 15:14:12 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Bill Meier 01b093c24d Add editor modelines; Adjust whitespace as needed.
Change-Id: I434da226c842298f4fb2a4335d06d51e164af2af
Reviewed-on: https://code.wireshark.org/review/4394
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-30 23:17:01 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +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
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (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-23 02:20:13 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "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-11-09 17:46:28 +00:00
Michael Mann cf80442912 Convert some proto_tree_add_string_format calls to something more appropriate.
There seem to be several cases of proto_tree_add_string_format where a "string" value/filter doesn't really make sense because it's always empty, and is just being used as a "filterable subtree header (placeholder)".  They appear to be more for "presense" than "value" and should probably be FT_NONE, although I'd almost argue for removing the filter in favor of  proto_tree_add_text.

svn path=/trunk/; revision=52296
2013-09-30 15:21:09 +00:00
Evan Huus 343772cbcf Convert a few more dissectors to wmem.
svn path=/trunk/; revision=51967
2013-09-12 12:25:17 +00:00
Pascal Quantin d8e31edd88 Fix compilation
svn path=/trunk/; revision=49261
2013-05-12 19:18:35 +00:00
Anders Broman 85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +00:00
Anders Broman 221b249acd svn path=/trunk/; revision=48272 2013-03-12 21:58:04 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Michael Mann 4108285179 fix subtle g_strdup_printf() memory leaks with ephemeral memory
svn path=/trunk/; revision=44491
2012-08-14 16:29:38 +00:00
Jakub Zawadzki b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Anders Broman b69547925f Get rid of a couple of warnings.
svn path=/trunk/; revision=43066
2012-06-04 13:52:46 +00:00
Alexis La Goutte 1f0cbf3baa Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=42362
2012-04-30 21:15:17 +00:00
Bill Meier 2103e7f38a tvb_[reported_]length_remaining can return -1
svn path=/trunk/; revision=39870
2011-11-15 21:22:01 +00:00
Alexis La Goutte 5fe097a8c3 From Iain Arnell via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6546
packet-ajp13 fails to detect end of request body

AJP13 may use two different packets to signify end of request body;
either zero length packet, or packet with zero length content. The ajp13
dissector already recognizes the former; this patch adds support for the
latter.

svn path=/trunk/; revision=39752
2011-11-08 12:50:13 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Guy Harris 180a4725d2 From Iain Arnell:
Adds additional header fields for AJP13 request attributes.

svn path=/trunk/; revision=39418
2011-10-14 08:00:21 +00:00
Guy Harris e191aae350 From Iain Arnell:
The existing code adds all ajp13 header names to the protocol tree as
ajp13.hval; header values aren't added at all. The original intention
appears to have been to add header names as ajp13.hname and their values
as ajp13.hval. Even if implemented properly, this doesn't allow
filtering properly (unless there's some funky syntax I'm not aware of).

This patch uses dedicated header fields for those request/response
headers that are explicitly defined in AJP13 protocol. Undefined headers
names and their values are added as a single ajp13.additional_header in
easily matched "Header-Name: Value" string format.

svn path=/trunk/; revision=39417
2011-10-14 07:52:11 +00:00
Guy Harris 4b8267116e From Iain Arnell:
AJP13 uses a string size of 0xFFFF to indicate a null string;
ajp13_get_nstring function would incorrectly return invalid data.

In disaply_req_body function, the content_length really is the length of
the data; there is no trailing null.

svn path=/trunk/; revision=39416
2011-10-14 07:45:22 +00:00
Chris Maynard c55d00576e Delete unused hf_ entries found by checkhf.pl.
svn path=/trunk/; revision=39404
2011-10-13 15:49:45 +00:00
Guy Harris 4e579d9f60 From Iain Arnell:
A missing value_ptr parameter in the handling of ajp13 response headers
led to them being displayed differently than the request headers.

This patch also simplifies the offset/length calculation for header
values, and skips the size for consistency with handling of other ajp13
string values.

svn path=/trunk/; revision=39390
2011-10-12 17:55:49 +00:00
Guy Harris 9177afaf0c From Iain Arnell:
Revision 35984 introduced a regression in ajp13_get_nstring. According
to the comments here, the returned length _includes_ the trailing null.
The encoded length, however, does _not_ including the trailing null.
This patch resolves the problem by simply adding 1 to the returned
length.

svn path=/trunk/; revision=39388
2011-10-12 17:53:58 +00:00
Anders Broman fc63c35843 Get rid of check_col() and use ENC_BIG_ENDIAN.
svn path=/trunk/; revision=39144
2011-09-26 05:52:58 +00:00
Guy Harris fd2f818353 Use ENC_ values in proto_tree_add_item() calls.
In the AgentX dissector, make the "flags" arguments guint8, to match
what's passed in.

In the AIM dissector, use val_to_str() in col_add_str() calls - it gives
the same result if there's a match, and puts a note in the Info column
if there isn't, and is less complicated.

In the AJP13 dissector:

	update the URL for the protocol documentation;

	add #defines for message types, and use them;

	for "enumerated data type" fields, make the fields numerical
	rather than strings and give them the value_string tables;

	get rid of col_check() calls;

	make a Boolean item an FT_BOOLEAN.

svn path=/trunk/; revision=39085
2011-09-22 03:10:30 +00:00
Bill Meier a2b58f051d Add #include <stdlib.h> to files which reference fcns declared in stdlib.h;
(In many cases I previously incorrectly removed the #include <stdlib.h>).

svn path=/trunk/; revision=37334
2011-05-20 19:00:09 +00:00
Bill Meier 3db5412ee7 From Yaniv Kaul:
Some fixes for 'set but not used' errors that GCC 4.6 emits.

svn path=/trunk/; revision=36901
2011-04-27 16:25:05 +00:00
Bill Meier e2ee0e52d8 Don't assign to a variable if the value won't be used: Coverity 826;
Also: Remove some uneeded #includes & use consistent indentation.

svn path=/trunk/; revision=36451
2011-04-04 16:54:02 +00:00
Gerald Combs 51e5e75373 Don't allocate a bunch of memory on the stack for strings that will be
fed to col_append_fstr; columns have a maximum length of 240 characters
(ITEM_LABEL_LENGTH). Make sure our column text is properly formatted.

svn path=/trunk/; revision=35984
2011-02-17 19:28:30 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
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-12-20 05:35:29 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +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 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00