Commit Graph

63 Commits

Author SHA1 Message Date
jorge power ad3685690a add register_dissector call for name batadv
Change-Id: Idf92449e510a347ad44225f79e36a274123cd0da
Reviewed-on: https://code.wireshark.org/review/8186
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-24 20:17:45 +00:00
AndersBroman 05c0152370 Replcae deprecated API tvb_length with tvb_reported_length or tvb_captured
length.

Change-Id: Id42f3409a32e202528d350f7afde7376e411fc51
Reviewed-on: https://code.wireshark.org/review/8076
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-15 15:22:42 +00:00
Michael Mann 9c55903029 Use COPY_ADDRESS_SHALLOW instead of duplicating TVB_SET_ADDRESS and SET_ADDRESS calls for the same address.
Change-Id: I0c9cc5d574fdd73ecf1f8b32dbbf0ddb2b885116
Reviewed-on: https://code.wireshark.org/review/7437
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-03-01 12:54:33 +00:00
Michael Mann 0002424f97 Remove most of the tvb_get_ptr calls in the packet-batadv.c dissector.
These calls were all getting ether addresses which can be gotten by other means.

Change-Id: I9a3d564483c9ee9b8e5183bb9086da8a315c41fc
Reviewed-on: https://code.wireshark.org/review/7421
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-27 07:42:40 +00:00
Michael Mann 8d5da72ff9 Add tvb_address_with_resolution_to_str.
Convert dissectors to using the API where appropriate.

Change-Id: I059582f73a75635d4a0338d02d4c4b212162480b
Reviewed-on: https://code.wireshark.org/review/7296
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-22 02:53:48 +00:00
Michael Mann 13531d36fb Convert dissectors to use address_with_resolution_to_str instead of two separate calls for address string and name resolution.
Change-Id: I7c8cfbcf201b3b73afe731302572646ce7833d64
Reviewed-on: https://code.wireshark.org/review/7284
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-02-21 15:33:56 +00:00
Alexis La Goutte a3e934fa2a BATADV: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I3c33511389aa2f4b3eed73f1c712561b20e18bf7
Reviewed-on: https://code.wireshark.org/review/6395
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-08 13:00:23 +00:00
Michael Mann 4088a8286d SET_ADDRESS -> TVB_SET_ADDRESS to "hide" some of the tvb_get_ptr use.
Not all changes were able to remove their corresponding tvb_get_ptr, because there are other API dependent on the (tvb_get)pointer, but future iterations optimizing those other APIs will then be able to remove it.

Change-Id: Id7cefd440b81834de1d1aace7cd0789b1c871a22
Reviewed-on: https://code.wireshark.org/review/6358
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 12:37:52 +00:00
Michael Mann f002332d88 Replace ether_to_str with either address_to_str or tvb_ether_to_str.
Change-Id: I8cce9fddbfe950e27e96ea8a5a6d2e0921ff4260
Reviewed-on: https://code.wireshark.org/review/5933
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21 15:13:30 +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 f412c9a01a Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_BIG_ENDIAN).

Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56
Reviewed-on: https://code.wireshark.org/review/5748
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 18:45:56 +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
Alexis La Goutte e26e1dc543 BATMAN: fix indent and encoding args
use tabs for indent and use fix-encoding-args tools

Change-Id: I5e066c6cbc429021cf21a55d5ffd5b60718ad5f8
Reviewed-on: https://code.wireshark.org/review/5340
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-17 00:55:42 +00:00
Alexis La Goutte b867baf800 BATMAN: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: I6cfabc18921397002a2303f3511fa51bf5b41956
Reviewed-on: https://code.wireshark.org/review/5341
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-16 17:18:35 +00:00
Sven Eckelmann 4cc4315793 batadv: Add dissector support for batadv v15
The packet format for batman-adv v15 supports:

 * Complete reordered packet type ids
 * reordered flags
 * type-version-length-value data containers
 * new types for coding packets and unicast transfer of TVLVs
 * dropped packet types for vis, translation table query and roaming
 * reordered packet formats
 * transparent fragmentation of batadv packets

Change-Id: I9e6733f9dd6b54eeecda19cf570599161d28b46e
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Reviewed-on: https://code.wireshark.org/review/5175
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-14 01:40:29 +00:00
Sven Eckelmann 48885cc1bc batadv: Add missing padding to batadv_unicast_4addr_v14
The already frozen packet format of batman-adv for Linux 3.5 was rejected by
David S. Miller. The 4addr format v14 was therefore changed after the freeze
and published in his final form in Linux 3.8.

Change-Id: I519476c4c6d62b403e197fae6a853d9bbe61f9bc
Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Simon Wunderlich <simon@open-mesh.com>
Reviewed-on: https://code.wireshark.org/review/5174
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-08 00:20:07 +00:00
Bill Meier cd7a11c0d1 Add editor modelines; Adjust indentation as needed.
Change-Id: Ie8d4056ab706bbc85c8247682b1a64ea98bc89f2
Reviewed-on: https://code.wireshark.org/review/4185
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 02:01:58 +00:00
Bill Meier 18d72987cb Do encoding-arg changes (all benign)
For:
- FT_BYTES: Always use just ENC_NA
- integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN

Also:
- FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...)
- Change one case of incorrect '||' to '|'

Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0
Reviewed-on: https://code.wireshark.org/review/4184
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 01:38:08 +00:00
Michael Mann 5db1352526 Eliminate proto_tree_add_text from some dissectors.
Change-Id: I398e9cf4f6882e76644aa758e12c39a39159e95f
Reviewed-on: https://code.wireshark.org/review/3319
Petri-Dish: Michael Mann <mmann78@netscape.net>
Petri-Dish: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-03 16:30:10 +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
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
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
Bill Meier 4fbcfc1289 (Benign) Don't use "address-of" operator on arg of VALS() (not that it makes any actual difference)..
Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3
Reviewed-on: https://code.wireshark.org/review/545
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-03-07 05:03:41 +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
Pascal Quantin 6cedc2c336 Convert a few more dissectors to wmem
svn path=/trunk/; revision=51991
2013-09-12 22:03:31 +00:00
Jakub Zawadzki a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Guy Harris a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman f2266d87f5 [-Wmissing-prototypes]
explicit casts.

svn path=/trunk/; revision=48302
2013-03-14 19:01: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
Jeff Morriss aa5d9d78dd From Robert Bullen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7683 :
The reassembled fragments tree in the Packet Details view is awesome, but it
lacks one thing: a field that exposes the reassembled data.

tcp.data already exists for exposing a single TCP segment's payload as a byte
array. It would be handy to have something similar for a single application
layer PDU when TCP segment reassembly is involved. I propose
tcp.reassembled.data, named and placed after the already existing field
tcp.reassembled.length.

My primary use case for this feature is outputting tcp.reassembled.data with
tshark for further processing with a script.

The attached patch implements this very feature. Because the reassembled
fragment tree code is general purpose, i.e. not specific to just TCP, any
dissector that relies upon it can add a similar field very cheaply. In that
vein I've also implemented ip.reassembled.data and ipv6.reassembled.data, which
expose reassembled fragment data as a single byte stream for IPv4 and IPv6,
respectively. All other protocols that use the reassembly code have been left
alone, other than inserting NULL into their initializer lists for the newly
introduced struct field reassemble.h:fragment_items.hf_reassembled_data.

svn path=/trunk/; revision=44802
2012-09-07 02:09:59 +00:00
Chris Maynard f8d42e6f61 tvb_length_remaining() can return -1, so don't assign its return value to an unsigned integer and don't check it against non-zero but greater than zero.
svn path=/trunk/; revision=43699
2012-07-13 21:14:43 +00:00
Pascal Quantin 7351065ccd From Sven Eckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7375 :
Add support for not_best_next_hop flag in B.A.T.M.A.N. Advanced v14 

svn path=/trunk/; revision=43332
2012-06-18 09:17:58 +00:00
Alexis La Goutte df14b18fdf From Sven Eckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7009
Add support for 4addr unicast packets 

Add support for 4addr unicast packets packets that will be supported in
linux 3.5.

svn path=/trunk/; revision=41826
2012-03-29 17:40:49 +00:00
Bill Meier 4f8e416fdc Fix benign issue: For FT_BOOLEAN fields with a zero bitmask, use BASE_NONE for 'display'
svn path=/trunk/; revision=41385
2012-03-06 22:12:42 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Anders Broman 4b952c1324 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39146
2011-09-26 08:25:18 +00:00
Guy Harris eedafe0a92 %u suffices, as varargs are widened. (It aslso doesn't cause Clang to
complain.)

svn path=/trunk/; revision=37933
2011-07-08 01:58:30 +00:00
Anders Broman 9e5a06a2ef From Sven Eckelmann:
Add support for v14

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

svn path=/trunk/; revision=37901
2011-07-05 08:20:23 +00:00
Anders Broman 99d0148b99 From Sven Eckelmann:
Rename HNA to TT to use the same names as upstream.

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

svn path=/trunk/; revision=37900
2011-07-05 08:17:46 +00:00
Anders Broman 78d22ed8ee From Sven Eckelmann:
Fix size of unicast fragment packet in v12.

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

svn path=/trunk/; revision=37897
2011-07-04 21:20:18 +00:00
Anders Broman b00a34230c From Sven Eckelmann:
Remove unused length_remaining.

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

svn path=/trunk/; revision=37896
2011-07-04 21:16:51 +00:00
Anders Broman e85447a30f From Sven Eckelmann:
Unify handling of NULL-tree in dissection routines.

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

svn path=/trunk/; revision=37894
2011-07-04 21:14:02 +00:00
Chris Maynard f6a11de61f Delete unused header field entries found by running checkhf.pl.
svn path=/trunk/; revision=37353
2011-05-23 00:32:40 +00:00
Chris Maynard 609c3dd0d4 From Micheal Mann via bug 2794: Fix some display filter field names.
svn path=/trunk/; revision=37351
2011-05-23 00:00:53 +00:00
Jeff Morriss a8b851ceab From Sven Eckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5658 :
Add support for v12 fragmented unicast.

svn path=/trunk/; revision=37143
2011-05-14 14:31:51 +00:00
Jeff Morriss 393f2467e4 From Sven Eckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5658 :
Read unchanged packets of v12 as v10 packets
Read unchanged packets of v13 as v11 packets
Use version in packet type definitions

svn path=/trunk/; revision=37142
2011-05-14 14:05:30 +00:00
Jeff Morriss fb99707fa5 Use tvb_ether_to_str() when it can eliminate a tvb_get_ptr() call.
svn path=/trunk/; revision=35960
2011-02-16 03:05:13 +00:00
Stephen Fisher 68b0cd7030 Fix bug #5657: Update my mail address
svn path=/trunk/; revision=35868
2011-02-07 23:14:54 +00:00