Commit Graph

120 Commits

Author SHA1 Message Date
Michael Mann d3ed64d8e3 Add ZigBee Green Power dissector. Bug 9424 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9424)
From DSR Corporation

svn path=/trunk/; revision=54478
2013-12-28 12:26:37 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Jakub Zawadzki 3d6fdc55d0 New functions: str_to_ip6(), str_to_ip()
This way we can avoid including lot of system header files in some dissectors
and it might fix bug #9581

svn path=/trunk/; revision=54330
2013-12-21 16:16:56 +00:00
Jakub Zawadzki c45475ab45 Fix [-Wmissing-prototypes]
svn path=/trunk/; revision=54135
2013-12-15 23:44:12 +00:00
Jakub Zawadzki f91eba752b Fix some warnings: cast discards `__attribute__((const))' qualifier from pointer target type
svn path=/trunk/; revision=53875
2013-12-08 23:16:06 +00:00
Michael Mann 9b7fb8a811 Create the ability to have packet scoped "proto" data. Bug 9470 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9470)
I'm not sold on the name or module the proto_data functions live in, but I believe the function arguments are solid and gives us the most flexibility for the future.  And search/replace of a function name is easy enough to do.

The big driving force for getting this in sooner rather than later is the saved memory on ethernet packets (and IP packets soon), that used to have file_scope() proto data when all it needed was packet_scope() data (technically packet_info->pool scoped), strictly for Decode As.

All dissectors that use p_add_proto_data() only for Decode As functionality have been converted to using packet_scope().  All other dissectors were converted to using file_scope() which was the original scope for "proto" data.

svn path=/trunk/; revision=53520
2013-11-23 02:20:13 +00:00
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Pascal Quantin efe18f199c Convert a few dissectors from emem to wmem API
svn path=/trunk/; revision=51983
2013-09-12 20:37:30 +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
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
Chris Maynard 91ecc2334f "man inet_pton" only says that it returns a negative value, zero or a postive value, and not specifically -1, 0, or 1, so even though we know that's what wsutil's inet_pton will return, we shouldn't test against those exact values.
svn path=/trunk/; revision=50670
2013-07-16 16:23:31 +00:00
Evan Huus bd52515b06 Use epan-scoped memory for 6lowpan preference names. Another ~300 bytes gone.
svn path=/trunk/; revision=50417
2013-07-06 18:40:56 +00:00
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Anders Broman 85a8e304dd Add the posibillity to use a key for per-packet-data.
svn path=/trunk/; revision=49259
2013-05-12 18:11:02 +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 6bde918078 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48426
2013-03-19 20:00:52 +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
Evan Huus 7577443c0f Use pinfo-scoped memory for 6LoWPAN addresses.
Fixes at least part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7885

svn path=/trunk/; revision=46582
2012-12-18 03:15:23 +00:00
Guy Harris 09e4e205c7 Some of the changes claimed to be in the previous checkin weren't there.
Label the data sources for reassembled fragments as "Reassembled
6LoWPAN". 

Fix the capitalization of "6LoWPAN".

Also, label the data sources for decompressed fragments as "Decompressed
6LoWPAN xxx".

svn path=/trunk/; revision=45529
2012-10-14 02:54:25 +00:00
Guy Harris 395dd4a88e *Always* create a new data source when we decompress an IPv6 header.
Label the data sources for them as "6LoWPAN xxx", where "xxx" is the
type of compression, and label the data sources for reassembled
fragments as "Reassembled 6LoWPAN".

Fix the capitalization of "6LoWPAN".

Note that if reassembly fails, continuing dissection is not the right
thing to do, at least not if it failed because we don't *yet* have all
the fragments.

svn path=/trunk/; revision=45527
2012-10-14 02:33:26 +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 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +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
Anders Broman e128334750 From Owen Kirby:
6LoWPAN: Automatic context detection and draft-ietf-6lowpan-nd-19 updates.

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

svn path=/trunk/; revision=44723
2012-09-01 11:54:16 +00:00
Bill Meier 638d74d43f Use val_to_str_const() where appropriate;
Also (for a few files):
- create/use some extended value strings;
- remove unneeded #include files;
- remove unneeded variable initialization;
- re-order fcns slightly so prefs_reg_handoff...() at end, etc

svn path=/trunk/; revision=44438
2012-08-10 22:55:02 +00:00
Jakub Zawadzki 40e809be57 6lowpan: cleanup dynamic configuration construction.
g_string_printf() -> g_strdup_printf()

svn path=/trunk/; revision=44065
2012-07-27 08:47:54 +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
pascal 95eb2e7288 From Martin Kaiser:
Fix some 'intermediate pointers must be const qualified' warnings
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7215

svn path=/trunk/; revision=42355
2012-04-30 19:14:14 +00:00
Bill Meier 594b358011 Use tvb_new_subset_remaining() instead of tvb_new_subset();
Reformat some long lines.

svn path=/trunk/; revision=41365
2012-03-06 02:28:04 +00:00
Alexis La Goutte eebaffcc5c Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=41306
2012-03-02 11:05:23 +00:00
Bill Meier 54b72021bb Fix encoding arg for various fcn calls:
- proto_tree_add_bits_item
 - proto_tree_add_bits_ret_val
 - proto_tree_add_bitmask
 - tvb_get_bits
 - tvb_get_bits16
 - tvb_get_bits24
 - tvb_get_bits32
 - tvb_get_bits64


svn path=/trunk/; revision=39539
2011-10-24 19:57:53 +00:00
Bill Meier ffde0a10bb Restore saved 'pinfo->fragmented' as appropriate;
Fixes gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.

svn path=/trunk/; revision=38297
2011-07-31 23:41:20 +00:00
Alexis La Goutte 12592dab19 From Owen Kirby via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6147
6LoWPAN: Support for IP-in-IP tunnelingy

svn path=/trunk/; revision=38258
2011-07-29 14:26:41 +00:00
Jaap Keuter 8e30d1990e From Colin O'Flynn:
Avoid processing tvb when fragment dissection didn't create one.

svn path=/trunk/; revision=37426
2011-05-27 07:02:26 +00:00
Bill Meier bf271ce2d0 From beth.tridium [At] gmail.com: 6LoWPAN dissector selects wrong byte for HC_UDP Encoding subtree
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5926

svn path=/trunk/; revision=37194
2011-05-16 23:15:08 +00:00
Bill Meier 1b9144beb8 From Yaniv Kaul: some 'set but not used' compilation fixes.
svn path=/trunk/; revision=36888
2011-04-27 04:27:38 +00:00
Bill Meier aec98c121a Don't assign to a proto_item * if the value won't be used: Coverity 820/821;
Also: #include <stdio.h> & <string.h> not required;


svn path=/trunk/; revision=36447
2011-04-04 15:38:19 +00:00
Gerald Combs 3de62b03c6 Forward port r36036 from trunk-1.4: Make sure we ep_allocate enough
memory.

svn path=/trunk/; revision=36037
2011-02-23 22:49:59 +00:00
Anders Broman ed66081a4d From Alexis La Goutte:
Cleanup packet-ipv6.h and dependency.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5713

svn path=/trunk/; revision=36031
2011-02-23 13:51:49 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +00:00
Anders Broman 26f0f7bc7a From Fred Fierling:
Multi-key Support and Extended Address Mapping for ZigBee Dissectors
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5331

svn path=/trunk/; revision=34647
2010-10-26 05:42:24 +00:00
Anders Broman b1e852cf70 Back out 34627 and friends again.
svn path=/trunk/; revision=34633
2010-10-24 15:22:44 +00:00
Anders Broman 43cb273d08 From Fred Fierling:
Multi-key Support and Extended Address Mapping for ZigBee Dissectors
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5331

svn path=/trunk/; revision=34627
2010-10-24 10:04:29 +00:00
Stig Bjørlykke 8d3bde0f49 Initialize length.
svn path=/trunk/; revision=34293
2010-09-30 19:41:44 +00:00
Jaap Keuter 733183a170 From Colin O'Flynn / Owen Kirby:
The 6LoWPAN dissector had as a TODO the 'stateful address compression' mode.
This patch fixes that TODO, up to HC-13.
This patch also updates to HC-08, where the PANID is no longer used in forming
the short address.

svn path=/trunk/; revision=34290
2010-09-30 19:23:31 +00:00
Anders Broman 1315fe5d29 From John Sucaet:
The committed changes in 33624 did not include all fixes of the previous patch
file - Please add the fix for the field description of the 8-bit Deep Hops Left
field
Attached file contains this fix (+as well as small correction to the field
descriptions of V and F flags, according to the terminology of RFC 4944)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5047

svn path=/trunk/; revision=33630
2010-07-26 13:04:10 +00:00
Jaap Keuter 7ca6e3a655 From John Sucaet:
packet-6lowpan.c dissects the non-compressed ipv6 fields in an order different
from the one specified in RFC 4944 §10.3.1. 
The patch fixes the wrong order and an additional problem with the dissection 
of the mesh header: support for the Deep Hops Left field (RFC 4944 §5.2)

svn path=/trunk/; revision=33624
2010-07-23 20:19:05 +00:00
Jaap Keuter afc25e015c From Jan van den Boom:
Correct the V and F flag interpretation in the Mesh Addressing Type and Header
for correct address interpretation.

svn path=/trunk/; revision=33623
2010-07-23 19:40:32 +00:00
Guy Harris 5c394ee15f Squelch some compiler warnings (including warnings about the last member
of a structure being an empty array; that is *not* supported by all the
compilers that can be used to build Wireshark).

svn path=/trunk/; revision=32412
2010-04-07 00:34:20 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Jaap Keuter e347a5f155 From Colin O'Flynn:
This is a minor change between the version in SVN which is hc-05, 
and the latest which is hc-06.

svn path=/trunk/; revision=32163
2010-03-10 19:21:17 +00:00
Guy Harris 2341d987a7 Add a sanity check in dissect_6lowpan_hc1() for the datagram length.
Fail, and add an expert item, for invalid lengths.

Having done that, add some casts to squelch compiler warnings.

svn path=/trunk/; revision=32160
2010-03-10 10:23:19 +00:00
Jaap Keuter 4732c51d52 From Owen Kirby:
I've come across a bug in the 6LoWPAN header decompression code that
incorrectly computes the length of IPv6 extension headers by adding the
protocol and length fields twice.

svn path=/trunk/; revision=32157
2010-03-10 07:15:07 +00:00
Jaap Keuter 103d684a3f From Owen Kirby:
This patch fixes 6LoWPAN fragmentation to comply with RFC4944.
I also happened across a problem with the derivations of 
interface identifiers from 16-bit IEEE 802.15.4 addresses, which 
should also be fixed in my patch.

svn path=/trunk/; revision=32155
2010-03-09 23:22:03 +00:00
Anders Broman 50f7fa97dc from Colin O'Flynn:
6lowpan dissector: copy/paste error results in 64-bit source & 16-bit dest failing
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4545

svn path=/trunk/; revision=32065
2010-03-01 11:13:54 +00:00
Jaap Keuter 3126f22a14 From Owen Kirby:
This patch fixes a bug in the 6LoWPAN dissectors that corrupts addresses when
multicast address compression is used. Testing this fix also uncovered a bug in
the computation of the length of the extension headers. And some typos.

svn path=/trunk/; revision=31870
2010-02-12 22:10:53 +00:00
Jaap Keuter 3c702d064b From Owen Kirby:
This patch fixes a bug in the 6LoWPAN dissector where link-local addresses
created from an EUI-64 address do not correctly invert the universal/local bit
as recommended by section 4 of RFC2464.

svn path=/trunk/; revision=31843
2010-02-09 08:40:40 +00:00
Stig Bjørlykke 539b558f8c Renamed some reassembled data texts.
Removed some check_col().

svn path=/trunk/; revision=31809
2010-02-06 18:20:21 +00:00
Stig Bjørlykke 88b72356ad Introduce "Reassembled length" filter element for all protocols doing
reassembly.

svn path=/trunk/; revision=31767
2010-02-02 16:01:52 +00:00
Anders Broman 0a5a3c1158 From Didier Gautheron:
Fix a memory leak.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3917

svn path=/trunk/; revision=31511
2010-01-13 07:42:42 +00:00
Jaap Keuter e1afd4d4f7 From Beth Tridium:
When a 6lowpan message has a compressed UDP length (i.e. the length must be
calculated, not read from the headers), the 6lowpan dissector correctly reports
that the UDP length is compressed, but it may try to read the length from the
headers anyway.

svn path=/trunk/; revision=31075
2009-11-25 19:46:08 +00:00
Stig Bjørlykke 68939c0d8d Removed an unused assignment.
svn path=/trunk/; revision=30895
2009-11-09 14:36:35 +00:00
Jaap Keuter a1d82636c1 Add parentheses to satisfy the compiler.
svn path=/trunk/; revision=30842
2009-11-06 07:08:40 +00:00
Jaap Keuter e2246d08cd From Owen Kirby:
We've discovered a number of bugs in the 6LoWPAN dissector, 
and have fixed them in the following patch. The fixed bugs include:
  - Incorrect UDP Checksum calculation.
  - Incorrect link-local prefix when decompressing IPHC headers.
  - Incorrect parsing of the UDP port numbers when not 8-byte aligned.
  - Overflow of the datagram offset field when reassembling fragmented packets.

svn path=/trunk/; revision=30840
2009-11-05 22:39:00 +00:00
Bill Meier 6645d6e47d Fix code so it actually pads a length to an 8 byte boundary.
svn path=/trunk/; revision=30406
2009-10-08 16:13:53 +00:00
Bill Meier bb8fc20cd3 1. There doesn't seem to be a need for a separate .h file;
2. Move prototype declarations to after the struct declarations
   used by the prototypes.
3. Fix some typos.

svn path=/trunk/; revision=30310
2009-10-04 17:50:39 +00:00
Kovarththanan Rajaratnam c7b5a98682 We don't use preferences so if (!init) not required
svn path=/trunk/; revision=30278
2009-10-04 06:53:05 +00:00
Jeff Morriss 50cec93579 Fix a couple (false) uninitialized variable warnings.
svn path=/trunk/; revision=30271
2009-10-03 22:47:41 +00:00
Michael Tüxen 923fbf0b98 Make gcc happy.
svn path=/trunk/; revision=30269
2009-10-03 10:52:15 +00:00
Jaap Keuter 07a1f3875e From Owen Kirby:
The attached patch adds a dissector for IPv6 over IEEE 802.15.4 (aka 6LoWPAN).
The protocol is specified in RFC 4944. This dissector also processes the
6LoWPAN draft header compression scheme in draft-ietf-6lowpan-hc-05.

svn path=/trunk/; revision=30268
2009-10-03 10:06:19 +00:00