Commit Graph

102 Commits

Author SHA1 Message Date
Pascal Quantin 929ad3805f DCERPC: save strings in wmem file scope
Bug: 13072
Change-Id: Ib5f3d91be822a3d7180d95e3299dec978941c1d5
Reviewed-on: https://code.wireshark.org/review/18564
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-30 00:29:31 +00:00
Michael Mann 9f4a294f22 Cleanup the final checkAPI g_warning complaints.
Change-Id: I7606ee55be4428909e255496c0344fffe5847f02
Reviewed-on: https://code.wireshark.org/review/16804
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-31 15:30:09 +00:00
Joerg Mayer 7e5dae90d6 Fix warnings/errors of type -Wused-but-marked-unused
Change-Id: I34c2d9953272822da0745d1b24c64d8466e43b37
Reviewed-on: https://code.wireshark.org/review/14668
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-28 13:27:52 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Peter Wu 126e02cd58 Call reassembly_table_destroy and move g_hash_table_destroy
This patch moves g_hash_table_destroy calls from the init routine to
the cleanup routine. Besides that, the conditional check for the hash
table has been removed, assuming that init is always paired with a
cleanup call.

If reassembly_table_init is found, a reassembly_table_destroy call is
prepended to the cleanup function as well.

Comments have been removed from the init function as well as these did
not seem to have additional value ("destroy hash table" is clear from
the context).

The changes were automatically generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=4d11f07180d9c115eb14bd860e9a47d82d3d1dcd
Manually edited files (for assignment auditing): dvbci, ositp, sccp,
tcp.

Other files that needed special attention due to the use of
register_postseq_cleanup_routine:

 - ipx: keep call, do not add another cleanup routine.
 - ncp: remove empty mncp_postseq_cleanup. mncp_hash_lookup is used
   even if a frame is visited before (see dissect_ncp_common), hence
   the hash table cannot be destroyed here. Do it in cleanup instead.
 - ndps: add cleanup routine to kill reassembly table, but do not
   destroy the hash table as it is already done in ndps_postseq_cleanup.

Change-Id: I95a72b3df2978b2c13fefff6bd6821442193d0ed
Reviewed-on: https://code.wireshark.org/review/9223
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:35:14 +00:00
Evan Huus 958cef5d68 Remove more deprecated tvb_length
Change-Id: Iac23a6c804ad3720d37186559477909b2ff33eb2
Reviewed-on: https://code.wireshark.org/review/9042
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-06-23 00:19:41 +00:00
Michael Mann aeb9827e4a Convert proto_tree_add_boolean to proto_tree_add_bitmask_[value|value_with_flags|list]
Part 1 of a few

Change-Id: I413f23dfa92da5488ca8a7f62ca0738b25004635
Reviewed-on: https://code.wireshark.org/review/8117
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-18 16:32:27 +00:00
Stefan Metzmacher b313c71102 packet-dcerpc-*: fix alignment of dissect_ndr_ctx_hnd()
Change-Id: I9685f37580d1def6c0956d786398e3e70e819cee
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/7714
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-17 09:03:27 +00:00
Guy Harris 050bc7d100 Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.

Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.

Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.

Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 21:02:40 +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
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 e899c3e262 Eliminate proto_tree_add_text from some dissectors.
Change-Id: Iadd80aab291e5de714891a9f3c79edeca19e9b93
Reviewed-on: https://code.wireshark.org/review/5458
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: Evan Huus <eapache@gmail.com>
2014-11-25 02:51:03 +00:00
Matthieu Patou 29afac24a5 Add support for NTTIME_hyper and NTTIME_1sec
It's hyper with 8 bytes alignment it can have 1/100000 sec resolution or 1sec resolution

Bug: 10541
Change-Id: Iecc4c6d1bd1695a4c02db72e1617134254810cd9
Reviewed-on: https://code.wireshark.org/review/4606
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-10-12 14:08:44 +00:00
Matthieu Patou e331083812 Add dissection of MIDL_NDRHEADERBLOB used in drsuapi and some other protocols
Bug: 10540
Change-Id: If4a8603a7cb62894cc46094056dd5313039884b2
Reviewed-on: https://code.wireshark.org/review/4604
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-10-11 04:04:36 +00:00
Michael Mann 6e42a72923 Dissection of sid28 needs null check.
Bug: 10542
Change-Id: I8fcfbbd96833af2c57754a4c8f96cf702972e22a
Reviewed-on: https://code.wireshark.org/review/4603
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-10 23:24:18 +00:00
Bill Meier 482e8e5651 Add editor modelines & adjust indentation/whitespace as needed.
Change-Id: Ice2d93632cd42dfcef3bfbf0e15f2a8a147278fc
Reviewed-on: https://code.wireshark.org/review/4433
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-02 22:30:52 +00:00
Michael Mann 06237e4878 proto_tree_add_text -> proto_tree_add_subtree[_format] for DCE/RPC dissectors.
Change-Id: I84755d059ef70ca98b0e7626b6425360daf0529d
Reviewed-on: https://code.wireshark.org/review/4199
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-20 11:59:25 +00:00
Bill Meier b14bf98c06 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6
Reviewed-on: https://code.wireshark.org/review/4124
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 13:51:51 +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
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Evan Huus 08ce84ebbe Grab-bag of dead initializers and two actual bugs.
All caught by cppcheck. The two (semi)-interesting bugs are:
- in asn1/atn-cpdlc/packet-atn-cpdlc-template.c where the break statement should
  have been inside the brace, causing potential control-flow weirdness with
  exceptions
- in epan/dissectors/packet-ieee80211.c where the bounds check for tag_len did
  not match the expert info given

Change-Id: Ie173fb8d917aabb9b4571435d671d6f16e1c7569
Reviewed-on: https://code.wireshark.org/review/1793
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-25 18:12:00 +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
Stefan Metzmacher 04bd19d3c2 packet-dcerpc-nt.c: fix a crash bug
Change-Id: Ia8d167afc79c4fa1b2fa05b78152120203462b67
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/362
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:56:09 +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
Guy Harris 068008f04f Use proto_tree_add_item() in preference to fetching the string and
adding it with proto_tree_add_string().  Use tvb_get_string_enc() rather
than tvb_get_unicode_string() to fetch strings.

We assume a UTF-16 encoding for all "Unicode" strings.

Use tvb_strsize() and tvb_unicode_strsize() to get the lengths of
null-terminated strings.

Get rid of unused ett_nt_unicode_string variable.

svn path=/trunk/; revision=54158
2013-12-16 22:39:41 +00:00
Bill Meier 04cdccdb83 - Create/use several extended value_strings
(sort associated value_string arrays as needed);

- Use new VALUE_STRING_LIST mechanism/macros to
  create enums and value_string arrays for:
    WERR_errors, DOS_errors, SRV_errors, and HRD_errors;

- Declare certain global value_string arrays as static (local)
  and use global extended value_strings to reference same;
    (e.g., ms_coiuntry_codes value_string_array)

- Rename SMBE_... defs used in several different value_string arrays
  to prevent potential name collisions:
   ( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...)
   Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors;

- WERR_errors value_string array:
    Note that WERR associated defs no longer exist in the latest samba doserr.h.
    (The WERR_errors defs were originally generated from the samba doserr.h).
    For now: WERR_errors kept as is.

- ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext
        and WERR_errors_ext extended value_strings.

- Add editor modelines to a few files.

- Make whitespace changes.


svn path=/trunk/; revision=53614
2013-11-27 16:30:20 +00:00
Michael Mann e2df7c83cb Move dceprc_procedure_name from packet_info to dcerpc_info. Doesn't appear to be "used" by dissectors, just stored (for help in debugging?).
svn path=/trunk/; revision=53552
2013-11-24 20:55:55 +00:00
Evan Huus 5efc340771 Mark more unused parameters.
svn path=/trunk/; revision=53109
2013-11-06 17:52:11 +00:00
Michael Mann c278a0ac0a SID28 is special kind of SID where no matter what it uses 28 bytes it's used in the DRS protocol. Bug 9337 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9337)
From Matthieu Patou

svn path=/trunk/; revision=53106
2013-11-06 16:30:14 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +00:00
Michael Mann 651b858892 Fix compile errors introduced in r52734.
svn path=/trunk/; revision=52735
2013-10-21 15:58:52 +00:00
Michael Mann 598726be02 Datablob size is NDR64/32 dependant. Bug 9301 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9301).
From Matthieu Patou

svn path=/trunk/; revision=52734
2013-10-21 15:50:23 +00:00
Michael Mann 55371ca87d Remove check_col for all non-generated DCE/RPC dissectors.
svn path=/trunk/; revision=52310
2013-10-01 13:02:12 +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 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +00:00
Pascal Quantin 0a17799d61 From Ed Beroset via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from most of the dcerpc code

svn path=/trunk/; revision=48023
2013-03-02 22:54:39 +00:00
Bill Meier 329f6e8cc0 Initialize some hf_... vars to -1;
(Reduces the number of checkhf false positives)

svn path=/trunk/; revision=47310
2013-01-26 21:42:36 +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 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
Jakub Zawadzki 835a1a1b9c Fix memleaks (tvb_get_unicode_string())
svn path=/trunk/; revision=44053
2012-07-26 17:26:05 +00:00
Bill Meier 9e7c7e7d10 From Evan Huus: Fix "Useless null checks in packet-dcerpc*"
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7448

svn path=/trunk/; revision=43599
2012-07-07 14:21:20 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier f0c3ee5c4a Whitespace cleanup: Indentation, trailing, ...
svn path=/trunk/; revision=42266
2012-04-26 16:05:05 +00:00
Ronnie Sahlberg bd83ae6dbb DCE/RPC: When printing counted strings to the tree, we divided the number of bytes by 2 and thus truncating the string in half for the presentation.
svn path=/trunk/; revision=40226
2011-12-16 03:44:43 +00:00
Bill Meier d7a1840204 Replace use of tvb_get_ephemeral_faked_unicode() by use of tvb_get_ephemeral_unicode_string();
Fix encoding arg as needed.

svn path=/trunk/; revision=39530
2011-10-23 22:58:45 +00:00
Chris Maynard e672fdc60f Since the call to expert_add_info_format() was commented out, 'ti' isn't needed, so get rid of it. Fixes Coverity CID's 1260 and 1261.
svn path=/trunk/; revision=39057
2011-09-19 20:49:28 +00:00
Ronnie Sahlberg 7ec441d440 DCE/RPC: FRSRPC: updates to the FRS dissector
From: Matthieu Patou <mat@matws.net>


svn path=/trunk/; revision=38958
2011-09-10 11:15:20 +00:00