Commit Graph

10 Commits

Author SHA1 Message Date
Michael Mann f2f7f7e557 Add wmem alloc parameter to ws_find_media_type_parameter.
All current uses of ws_find_media_type_parameter need wmem_packet_scope(), but there
is no sense in limiting what other dissectors may want to do.

Change-Id: I35b0dd2a024a0ae0a8345577dd92a1a21ddd2cc4
Reviewed-on: https://code.wireshark.org/review/26427
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-03-11 15:07:24 +00:00
Dario Lombardo 55c68ee69c epan: use SPDX indentifiers.
Skipping dissectors dir for now.

Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa
Reviewed-on: https://code.wireshark.org/review/25694
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 19:29:45 +00:00
Guy Harris bee0cd7762 See if *this* convinces the compiler that valuelen and value will be set.
Change-Id: I2a7715ac3255502f244a0d0a7e588b3a44c34f11
Reviewed-on: https://code.wireshark.org/review/17258
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-23 03:36:55 +00:00
Guy Harris ff00166a96 Fix handling of parameters with no value.
Return a value length of 0 if there's no parameter value.

(And don't return anything if the pointers through which we return them
are null.)

If no value is present, return NULL from ws_find_media_type_parameter().

Change-Id: I32b57623d7651bcf065af5b81f2390a600988b21
Reviewed-on: https://code.wireshark.org/review/17255
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-23 02:28:56 +00:00
Guy Harris 4458c48cf4 Add cast to squelch "building with a C++ compiler" warnings.
Change-Id: Ia95c40096018479aec99fafd93d7b95d31ba4723
Reviewed-on: https://code.wireshark.org/review/17253
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-23 01:26:04 +00:00
Guy Harris 0b3a96222b Handle quoted-pairs in quoted-strings correctly.
Backslash, in a quoted-string, escapes quotes (and any other characters,
although the only ones that *need* escaping are a double-quote and a
backslash).

This means that the value of a parameter isn't just the raw characters
from the parameters string; for a quoted string, it needs to be
un-escaped, and for a *non*-quoted string, it has to stop at the first
non-token character (you can put comments in).  So
ws_find_media_type_parameter() must return an allocated string with the
actual value.

Get rid of index_of_char(); it doesn't do anything that strchr() does.

Change-Id: I36328ea71c28fe6ac4918a8e73c281a25f6be844
Reviewed-on: https://code.wireshark.org/review/17251
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-23 00:53:46 +00:00
Balint Reczey ee0f94aaae Make index_of_char() static again
Change-Id: I1c0d344c50ee5d78dd8247ccfe795ce0cd94aaa2
Reviewed-on: https://code.wireshark.org/review/17230
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2016-08-22 13:28:24 +00:00
Balint Reczey c43b8b5ef9 Rename find_parameter() to ws_find_media_type_parameter()
The symbols exported from libs should use less generic. preferably
prefixed names to avoid name collisions with other shared library
symbols.

Change-Id: I8323b3e194a7ee4d61baec0c007342fab6cbde84
Reviewed-on: https://code.wireshark.org/review/17229
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-22 13:01:25 +00:00
Guy Harris e1f11c9734 Get rid of trailing blank line.
Change-Id: I409a843b48983355c242708f6c9972bd8f337bf6
Reviewed-on: https://code.wireshark.org/review/17218
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-22 06:37:27 +00:00
Guy Harris 5825f59ddc Pass an HTTP message type to all HTTP subdissectors.
This gets complicated, because those subdissectors might be called by
other dissectors as well.  We need a better way of passing that sort of
out-of-bound information.

Pull some routines used for processing Content-Type parameters into
common code; we can't guarantee that the media parameters passed in
would be writable (passing it as *the* data hid that; passing a
structure with that *and* the HTTP message type revealed it), so don't
convert it to lower-case in place.

Use that information, if available, to determine whether an IPP message
is a requet or a response.

Change-Id: I4bccc9f05cd0b14ad445be7ab37b3d884d841325
Reviewed-on: https://code.wireshark.org/review/17216
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-22 06:34:06 +00:00