Commit Graph

249 Commits

Author SHA1 Message Date
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
Anders Broman 54eb4a6cec [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48319
2013-03-15 16:39:30 +00:00
Anders Broman d0efafbcb1 From beroset:
remove C++ incompatibilities from UAT_VS_DEF macro and all uses

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48259
2013-03-12 06:40:13 +00:00
Pascal Quantin 2e05d7256c Fix typo error
svn path=/trunk/; revision=47318
2013-01-27 18:57:08 +00:00
Evan Huus 5eb312b04b From Hadar Shoham via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8262
Bootp updates, fixes and additional options.

svn path=/trunk/; revision=47317
2013-01-27 16:07:02 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
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-26 05:57:06 +00:00
Jeff Morriss dcd8c7151f Followup to r46565 and r46568: don't even create the composite TVB if we're
not going to put anything into it.  And don't try to finalize the composite
if we didn't create it or put anything in it.

svn path=/trunk/; revision=46569
2012-12-16 19:22:00 +00:00
Jeff Morriss 72f5595125 Apply r46565 to another spot.
svn path=/trunk/; revision=46568
2012-12-16 18:32:50 +00:00
Jeff Morriss 142aaa9c5b Another part of the fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8097 :
Don't try to add a zero-length TVB to a composite TVB.

svn path=/trunk/; revision=46565
2012-12-16 16:40:36 +00:00
Jeff Morriss 0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Bill Meier c230713b57 Fix several [-Wshadow] warnings;
Also: Do some minor whitespace and formatting changes.
-This line, and those below, will be ignored--

M    dissectors/packet-bootp.c
M    dissectors/packet-bssgp.c
M    dissectors/packet-babel.c

svn path=/trunk/; revision=46191
2012-11-25 23:16:30 +00:00
Anders Broman 22d1aa1f6c From Jérôme LAFORGE:
Improvement option 120 : RFC 3396 add split option & RFC 1035 full support compression pointer


https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7969

svn path=/trunk/; revision=46042
2012-11-16 13:58:51 +00:00
Anders Broman c2d6e54458 From Jérôme LAFORGE:
[BOOTP] Add control on option length and UC_Len for option 77

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7974

svn path=/trunk/; revision=46041
2012-11-16 11:39:46 +00:00
Pascal Quantin 5c30c4715b From Jérôme LAFORGE via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7966 :
[DHCPv4] Fix bad decoding on option 119 with more than 3 fqdn

svn path=/trunk/; revision=45993
2012-11-10 21:46:06 +00:00
Jaap Keuter 51d307df06 From Jérôme LAFORGE:
Please find this patch that adds option 117 (RFC 2937).

svn path=/trunk/; revision=45963
2012-11-07 21:54:32 +00:00