Commit graph

263 commits

Author SHA1 Message Date
AndersBroman
dfc0689205 [BOOTP] Try to fix the build boot by casting a variable to 32bits while at
it replace tvb_length() with tvb_reported_length().

Change-Id: Ic2a0c99c20320ddd15d2f4ec173d73229dcf41f6
Reviewed-on: https://code.wireshark.org/review/7733
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-18 08:50:29 +00:00
Michael Mann
ae2d2447d8 Remove proto_tree_add_text from packet-bootp.c
Change-Id: I651211cbe7365409e6c42ef1840122a03460aa42
Reviewed-on: https://code.wireshark.org/review/7731
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-18 05:31:16 +00:00
Jérôme LAFORGE
1bc0c48e78 Minor fix of RFC's number into comment.
Change-Id: I51035034397aa9bc42ed5b4aadc6c7fca52b2d5d
Reviewed-on: https://code.wireshark.org/review/7638
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-03-11 10:11:36 +00:00
Alexis La Goutte
a3bdf140a5 Bootp: fix typo
Change-Id: I6f6ac0bcb7b1ddc124f161b5cacd046aeef5043f
Reviewed-on: https://code.wireshark.org/review/7630
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-03-10 22:06:38 +00:00
Michael Mann
1a54112c1d Add tvb_get_ether_name
This is mostly to reduce tvb_get_ptr calls that were used to pass into get_ether_name.

Some optimizations were made to packet-ieee80211.c in the process of conversion.

Change-Id: I81d3c65d4c09a15237fc287c2e989eb6e6936b1f
Reviewed-on: https://code.wireshark.org/review/7492
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-03 07:19:42 +00:00
Guy Harris
859511db14 Make UAT record update callbacks return a success/failure indication.
Have them return TRUE on success and FALSE on failure.  Check the return
value rather than whether the error string pointer is null or not.

Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c
Reviewed-on: https://code.wireshark.org/review/7222
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-18 00:41:09 +00:00
Alexis La Goutte
b2e172a238 DHCP/BOOTP: Option 125 Suboption: (5) fix display Modem Capabilities
Only display dissect of Modem Capabilites when sub option = 5
Actually, it is always display when ftype == special (like sub option = 0)

Change-Id: I5b75654b750bae5ae5022adcb5e8dd055ce6b291
Reviewed-on: https://code.wireshark.org/review/6519
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-20 07:29:59 +00:00
Alexis La Goutte
be113e8806 DHCP/BOOTP: Option 125 Suboption: (1) option-len always expects 1 but specification allows for more
We believe this is a bug in Wireshark with Option 125 Suboption: (1)  option-len where Wireshark always expects 1 but specification is more flexible.
Re: http://www.cablelabs.com/wp-content/uploads/specdocs/CL-SP-CANN-DHCP-Reg-I10-1308081.pdf page 15 part 4.2.2 'The DHCPv4 Option Request Option'

Issue reported by Steve Krebs

Bug:10784
Change-Id: I8eced7a70877d13d925b81c0f47885609baa7633
Reviewed-on: https://code.wireshark.org/review/6510
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 22:26:09 +00:00
Guy Harris
bc23f79729 UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or
g_strdup_printf(), and must ultimately be freed by the caller.

Make the pointer-to-error-string-pointer arguments to various functions
be "char **", not "const char **".

Fix cases that finds where a raw string was being used, as that won't
work if you try to free it; g_strdup() it instead.

Add a missing free of an error string.

Remove some no-longer-necessary casts.

Remove some unnecessary g_strdup()s (the string being handed to it was
already g_malloc()ated).

Change some variable declarations to match.

Put in XXX comments for some cases where the error string is just freed,
without being shown to the user.

Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0
Reviewed-on: https://code.wireshark.org/review/6525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 20:20:03 +00:00
Michael Mann
64a7bac641 tvb_bytes_to_ep_str -> tvb_bytes_to_str
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4
Reviewed-on: https://code.wireshark.org/review/6371
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-01-07 18:16:23 +00:00
Michael Mann
3d3f97320b Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71
Reviewed-on: https://code.wireshark.org/review/5934
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26 21:17:10 +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
Michael Mann
05516b0c92 Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.
Part 1 of many

Change-Id: I77a5789ac23388e6a5f8098dc398592f39638124
Reviewed-on: https://code.wireshark.org/review/5532
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-29 22:42:56 +00:00
Bill Meier
24d50bc290 Adjust indentation to match editor modelines; Do other minor whitespace changes.
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353
Reviewed-on: https://code.wireshark.org/review/4502
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 17:12:33 +00:00
Michael Mann
8a580b3e28 Make all "padding" fields filterable
Change-Id: Ic4e4d9142a9b05ef3b628fac2e8766014c5fccec
Reviewed-on: https://code.wireshark.org/review/4073
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-11 01:57:02 +00:00
Evan Huus
a452d16f2c Optimize epan_new/init_dissection
As Anders correctly pointed out in I7d8f84b2e, constantly resetting state will
turn init_dissection into a bit of a hot path. Especially as we will already
bear the overhead of switching files, we don't want to fall any further behind
than we have to.

This change includes three unrelated optimizations that reduce the cost of
init_dissection by about 40% as measured by callgrind:
 - only initialize ares/ADNS if that preference is enabled (this of course only
   applies if you specify -n to tshark or otherwise disable the preference)
 - use memcpy instead of a loop in sigcomp UDVM init
 - use memcpy instead of a loop in bootp dissector

The only remaining obvious hot spot in this path is reassembly_table_init since
it is called by so many dissectors. Suggestions (perhaps to get rid of the
GPtrArray) welcome.

Oh, and one other change to use g_strerror instead of strerror as insisted
upon by the API pre-commit hook.

Change-Id: I18a74f2b64b25498116079bd4e7fc2b335c7703a
Reviewed-on: https://code.wireshark.org/review/2738
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-07-01 04:21:14 +00:00
Michael Mann
188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +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
Evan Huus
e0aabd97d8 Convert more time_to_str functions to wmem
Change-Id: Ibaae0e79935dc62f12f713f2df5b57d0f3f799b9
Reviewed-on: https://code.wireshark.org/review/2254
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 19:10:59 +00:00
Evan Huus
de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
Michael Mann
73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
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-06-07 15:41:07 +00:00
Michael Mann
800cd7b95e Improve dissection of RFC 6607. Bug 9960
Change-Id: Ibab13b0ab7b3f0ac1d9c2e305cb428bb17689313
Reviewed-on: https://code.wireshark.org/review/1039
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-09 22:38:01 +00:00
AndersBroman
8570f17510 Fix packet-bootp.c:5368:18: error: 'ti' may be used uninitialized in this
function

Change-Id: I15f32e7b5c9ce23e1ddc00792b2d5c37945ae081
Reviewed-on: https://code.wireshark.org/review/920
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-02 11:33:29 +00:00
AndersBroman
781a41a008 From Martin Mathieson:
Show the message type name in option 53, as well as in the bootp protocol root.

Change-Id: I5864a2024d3e64fa8eeee40b465dcd3459b8472e
Reviewed-on: https://code.wireshark.org/review/910
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-02 08:48:17 +00:00
Alexis La Goutte
03d982a7bb DHCP/BOOTP: Add specific 43 Option when Class is ArubaAP or ArubaInstantAP
Change-Id: I77d898af2b6b6f413f3698bb24f4c6280898da1a
Reviewed-on: https://code.wireshark.org/review/775
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-25 08:22:23 +00:00
Alexis La Goutte
04c96553d6 DHCP/bootp: Always display by default value of Option 43 (Vendor-Specfic)
Change-Id: I91b711a11865ce8d31d3585b93b11923e25a12d3
Reviewed-on: https://code.wireshark.org/review/774
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-23 17:53:05 +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
Gilbert Ramirez
4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Alexis La Goutte
a5e795812b Fix encoding arg (found by encoding arg tools)
svn path=/trunk/; revision=54901
2014-01-22 07:49:40 +00:00
Alexis La Goutte
923c5b3b86 Fix the second argument of some proto_item_add_subtree (function : dissect_vendor_tr111_suboption and dissect_vendor_cl_suboption)
It is a ett variable no hf variable

svn path=/trunk/; revision=54900
2014-01-22 07:49:31 +00:00
Anders Broman
5fc0904093 packet-bootp.c: In function 'dissect_vendor_generic_suboption':
packet-bootp.c:3293: warning: unused parameter 'pinfo'
packet-bootp.c:3293: warning: unused parameter 'v_ti'
packet-bootp.c:3294: warning: unused parameter 'optend'

svn path=/trunk/; revision=54861
2014-01-20 20:30:41 +00:00
Anders Broman
6402d8590e Add generic dissection of unknown vendor sub options.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9594

svn path=/trunk/; revision=54859
2014-01-20 20:03:49 +00:00
Evan Huus
2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Evan Huus
a6415ece0a Rename a couple of to_str functions to have ep_ in the name. This makes it
obvious that the returned string is ephemeral, and opens up the original names
in the API for versions that take a wmem pool (and thus can work in any scope).

svn path=/trunk/; revision=54249
2013-12-19 15:49:09 +00:00
Bill Meier
746e796e83 (Try to) fix VS Clang Analysis warning:
C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value

svn path=/trunk/; revision=54019
2013-12-13 03:24:08 +00:00
Jakub Zawadzki
ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Jakub Zawadzki
7b89063243 Don't include <epan/strutil.h> when not needed.
svn path=/trunk/; revision=53194
2013-11-09 14:58:28 +00:00
Evan Huus
95f484a91e Add a very small hack to make the UAT update callback error string freeable, and
convert all existing UAT update callbacks to use glib memory instead of
ephemeral memory for that string.

UAT code paths are entirely distinct from packet dissection, so using ephemeral
memory was the wrong choice, because there was no guarantees about when it would
be freed.

The move away from emem still needs to be propogated deeper into the UAT code
itself at some point.

Net effect: remove another bunch of emem calls from dissectors, where replacing
with wmem would have caused assertions.

svn path=/trunk/; revision=52854
2013-10-25 22:14:25 +00:00
Pascal Quantin
a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus
7584f77567 Only access val_other if tlv_len is sufficiently long. Fixes
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9150

Also add modelines.

svn path=/trunk/; revision=52037
2013-09-14 13:30:02 +00:00
Pascal Quantin
5635a1f8bb Revert to emem for uat
svn path=/trunk/; revision=52032
2013-09-14 11:56:45 +00:00
Pascal Quantin
6cedc2c336 Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
2013-09-12 22:03:31 +00:00
Michael Mann
9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Chris Maynard
543e05b1ec Group all "Seconds elapsed appears to be encoded as little-endian" expert info messages together, regardless of the computed value of the seconds field. This adds a single expandable entry instead of multiple entries (up to 255 potentially) and makes the expert info generally nicer to view (IMO).
svn path=/trunk/; revision=51383
2013-08-15 15:26:12 +00:00
Jakub Zawadzki
f4bcbeb9f2 Keep result of [new_]register_dissector in some dissectors. [2 of x]
(don't create new dissector handle if we can use already existing one)

svn path=/trunk/; revision=51159
2013-08-05 19:09:44 +00:00
Michael Mann
57fc882623 Simplify the "bad length" expert info into a single filterable item with formatting determining the particulars because the filter names just didn't make much sense to separate.
svn path=/trunk/; revision=49801
2013-06-06 02:10:22 +00:00
Michael Mann
b2027be0f8 Add filterable expert info.
svn path=/trunk/; revision=49573
2013-05-25 03:27:31 +00:00
Anders Broman
81e80f2c0b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48355
2013-03-17 16:48:47 +00:00