Commit Graph

130 Commits

Author SHA1 Message Date
João Valverde 3649993ded 6LoWPAN: Make UDP NHC port endianness code cleaner
Change-Id: I7abb29a8368a91d113038bc878aaf47ed58360bb
Reviewed-on: https://code.wireshark.org/review/19298
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-12-16 18:18:27 +00:00
João Valverde f923009c77 6LoWPAN: Display UDP NHC port encoding field as 2-bit
Reference: RFC 6282 Section 4.3.3

Change-Id: I8ff46452d80b1aba4545967bc05310c341f6e174
Reviewed-on: https://code.wireshark.org/review/19297
Reviewed-by: João Valverde <j@v6e.pt>
2016-12-16 17:45:38 +00:00
Yasuyuki Tanaka 0572fbb3cf 6LoWPAN: bugfix in extracting in-line UDP checksum of IPHC
Bug: 13233
Change-Id: Ie697d5a2d8a604bf3348f690d78ada4f9f0b1b89
Reviewed-on: https://code.wireshark.org/review/19208
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-12-16 16:24:11 +00:00
Stig Bjørlykke d7ef9461d3 6LoWPAN: Use correct full name
6LoWPAN is not only used over IEEE 802.15.4, so adjust the full name.

Change-Id: I56305baa74c0cc9337dfd5e813965035fd7dcec6
Reviewed-on: https://code.wireshark.org/review/18677
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-11-05 12:44:01 +00:00
Pascal Quantin 0b1fd7e8fb 6LowPAN: initialize interface identifier even when no data-link source is found
Bug: 12939
Change-Id: Ib4e8adbff3e335e602da5e6857bfc801601fd25e
Reviewed-on: https://code.wireshark.org/review/17871
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-09-22 21:38:56 +00:00
João Valverde e3d78be0b4 Move IPv6 inet definitions to wsutil/inet_ipv6.h
Change-Id: I880adf7fc1e131639f318cdecf7d8e59262d89fb
Reviewed-on: https://code.wireshark.org/review/16784
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-30 13:14:43 +00:00
Michael Mann ad6fc87d64 Add proto_tree_add_checksum.
This is an attempt to standardize display/handling of checksum fields for all dissectors.
The main target is for dissectors that do validation, but dissectors that just report the
checksum were also included just to make them easier to find in the future.

Bug: 10620
Bug: 12058
Ping-Bug: 8859
Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf
Reviewed-on: https://code.wireshark.org/review/16380
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-21 12:35:22 +00:00
João Valverde 1a3fc2e7af IPv6: Remove union from struct ip6_hdr
The field macros are a particularly obnoxious form of namespace pollution.

Change-Id: I9010a767625fd1c4b4a48c9d75481c577915fce6
Reviewed-on: https://code.wireshark.org/review/16520
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-07-18 01:32:04 +00:00
Michael Mann 8682f4b73c packet-6lowpan.c: fix uninitialized variable (ipv6_ext) warning
Change-Id: I8182bc9452cbd1201c81407041b6b522434f5ec0
Reviewed-on: https://code.wireshark.org/review/16394
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-12 18:30:03 +00:00
Michael Mann 5c08509b00 6lowpan - Eliminate tvb_get_ptr
Change-Id: I6a8ea98cf0f4a2172e73fc4dcad67f2dbf8d5be3
Reviewed-on: https://code.wireshark.org/review/15471
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-17 12:31:20 +00:00
Dario Lombardo 4d5caf316f 6lowpan: change malloc to wmem_alloc.
Change-Id: Iae9c52571457baccdce9ae0586ee223a08ec7597
Reviewed-on: https://code.wireshark.org/review/14890
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-04-13 02:19:39 +00:00
Kevin Bracey d81fe3907b Correct 6LoWPAN NHC datagram size calculations
Length calculations updating "remaining datagram size" for fragmented
6LoWPAN packets with NHC headers were incorrect if there was any elided
option padding.

The current header's unpadded length was subtracted from dgram_size,
when it should have been the padded length - the datagram size is
uncompressed IPv6.

This meant the final nhdr_list entry created to represent the remaining
payload would have its "reported" field too large. Most visible result
of this was that the IPv6 payload length written into the packet by
lowpan_reassemble_ipv6() was too large.

Error probably went unnoticed because the most typical 6LoWPAN options
don't need padding - the RPL option is 6 bytes, and the MPL option is 6
bytes if using 16-bit seeds, making the HbH extension header an aligned
8 bytes.

Bug: 12310
Change-Id: If94e9ca57f88c4ac41f002a689ce1da7097b5bd0
Reviewed-on: https://code.wireshark.org/review/14701
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-31 03:07:58 +00:00
Michael Mann 1e60d63c8c Create call_data_dissector() to call data dissector.
This saves many dissectors the need to find the data dissector and store a handle to it.

There were also some that were finding it, but not using it.
For others this was the only reason for their handoff function, so it could be eliminated.

Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b
Reviewed-on: https://code.wireshark.org/review/14530
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 17:38:03 +00:00
Michael Mann 9bcac48403 Manually add protocol dependencies derived from find_dissector.
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector.  Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector.
"data" dissector was not considered to be a dependency.

Change-Id: I15d0d77301306587ef8e7af5876e74231816890d
Reviewed-on: https://code.wireshark.org/review/14509
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20 12:48:48 +00:00
Martin Kaiser bf1c8b5617 6lowpan: proto_tree_add_item() can be used directly for an FT_UINT64
Change-Id: I3f43fc9b0951822dd2ec3aba85af993e20c549d3
Reviewed-on: https://code.wireshark.org/review/14515
Reviewed-by: João Valverde <j@v6e.pt>
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-03-18 22:04:18 +00:00
Martin Kaiser 7cb530a594 6lowpan: remove a ton of if (tree) checks
Change-Id: Idff3eda741e62bfe5b00f30760bcc8af0e8e5df5
Reviewed-on: https://code.wireshark.org/review/14514
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2016-03-18 16:45:27 +00:00
Michal Labedzki 08cf506988 Bluetooth/6lowpan: Add missing handle for L2CAP CID
Change-Id: I0a9e405069250cf37e38a0e4b1e9645997f80409
Reviewed-on: https://code.wireshark.org/review/13736
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-02-06 11:09:08 +00:00
Guy Harris 099698445b Move the proto data stuff out of frame_data.[ch].
It's not tied to the frame_data structure any more, so it belongs by
itself.

Clean up some #includes while we're at it; in particular, frame_data.h
doesn't use anything related to tvbuffs, so don't have it gratuitiously
include tvbuff.h.

Change-Id: Ic32922d4a3840bac47007c5d4c546b8842245e0c
Reviewed-on: https://code.wireshark.org/review/13518
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-25 02:24:34 +00:00
Kevin Bracey d1ab1590cf Clarify IPHC dissection of IPv6 ECN and DSCP
6LoWPAN IPHC dissection displayed ECN and DSCP as if they were an
IPv6-layout bitfield. Remove this extra abstraction layer, and output
them more simply as individual bit items, with a generated field
to indicate the IPv6 equivalent.

Change-Id: Iff1473ce181fb40ae07a773689a5fee7bd9e98c7
Reviewed-on: https://code.wireshark.org/review/13185
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-14 05:30:03 +00:00
Kevin Bracey d6ca6cbe74 6LoWPAN: correct IPHC traffic class decompression
Traffic class values from IPHC headers were shown correctly in the IPHC
dissection, but not correctly inserted into the expanded IPv6 packet.

Problem was only visible on little-endian systems - the previous
code did work if big-endian.

Error was not present in HC1 decompression, but both IPHC and HC1
IPv6 construction code clarified by avoiding writing overlapping union
members.

Bug: 11971
Change-Id: I3515f18c892f1fc28ef7f8a0830a79d134e81f48
Reviewed-on: https://code.wireshark.org/review/13109
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: João Valverde <j@v6e.pt>
2016-01-12 13:44:41 +00:00
moshekaplan cd7026951b Fix a lot of typos and misspellings
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3
Reviewed-on: https://code.wireshark.org/review/13069
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-08 20:04:56 +00:00
João Valverde e8b8568b7c 6LowPAN: Check for NHC IPv6 No Next Header
Bug: 11728
Change-Id: I7b7cc72b4200e53856283e0716383d661a16fa77
Reviewed-on: https://code.wireshark.org/review/12512
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-11 05:30:07 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Jeff Morriss 7f591e4c07 Clean up more unnecessary use of the 'volatile' key word.
Change-Id: I3e72fddc6ed380780d7e2e1c8df87e580138188d
Reviewed-on: https://code.wireshark.org/review/11271
Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-26 11:28:41 +00:00
Gerald Combs 86fe2be4dc Use address functions instead of ADDRESS macros in asn1 and epan
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case
equivalents in the asn1 and epan directories.

Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4
Reviewed-on: https://code.wireshark.org/review/11200
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-22 11:45:56 +00:00
João Valverde a643d14187 Change proto_tree_add_ipv6() to take a struct e_in6_addr pointer
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too.

Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88
Reviewed-on: https://code.wireshark.org/review/10953
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: Balint Reczey <balint@balintreczey.hu>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-10-14 12:18:00 +00:00
Gerald Combs 62d901bf05 Scan into a guint32 using %u.
Change-Id: Ic0fa25f3ad78e2a1923610a17f764e1b0623eabc
Reviewed-on: https://code.wireshark.org/review/10919
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-10 01:49:08 +00:00
Pedro Jose Marron 911da8b9d5 Support in 6lowpan for RFC4944 address generation
For the conversion of a 16-bit short address in 6lowpan to an IID, there
are several RFCs that produce different results. RFC 4944 section 6
specifies that the conversion uses the given PAN ID and the 16-bit short
address. RFC 6282, on the other hand, specifies thta the conversion only
uses the 16-bit short address and no longer uses the PAN ID.

The current version of the 6lowpan dissector supports only the newer RFC
6282, but there are protocols out there that assume that the address
conversion still abides to RFC 4944.

In order to support these protocols and following the discussion from

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

this patch introduces a boolean preference in the 6lowpan dissector that
indicates whether or not the older RFC 4944 should be used for address
conversion. By default, it is set to FALSE, thus leaving the behavior of
the dissector unchanged.

Besides the boolean preference, another helper function
lowpan_addr16_with_panid_to_ifcid has been written that implements the
expected behavior from RFC 4944 using the same hint mechanism already in
place in the dissector for the support of RFC 6282.

Change-Id: I8d202c69a225d7b1212080a174e0111e5203553c
Reviewed-on: https://code.wireshark.org/review/10902
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-10 00:10:34 +00:00
Pedro Jose Marron 4a45bd5bf4 Display of reserved octet in 6lowpan IPHC header
The 6lowpan standard specifies a reserved octet in the extended header
of an IP_PROTO_FRAGMENT packet in the same place used for the header
length for other extension headers.

The current version of the 6lowpan dissector displays the reserved octet
and the rest of the header (6 more bytes) together as data, as opposed to
displaying the reserved octet by itself and then the data (using the
data dissector).

This patch does not change the functionality of the dissector in any
way, only how the 7 bytes are displayed. Instead of displaying the
header information and then 7 bytes of data, it displays the reserved
octet and then the data. This is also consistent with the way the ipv6
dissector displays it (showing the reserved octet and its value).

For this purpose, there is a new hf (hf_6lowpan_nhc_ext_reserved) and
the corresponding proto_tree calls. Also, depending on the type of
extension header, the octets sent to the general data dissector are
shifted by one.

Change-Id: I4c7fb58a3364307e79517b979808f3e34a2e0b94
Reviewed-on: https://code.wireshark.org/review/10908
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-10-09 23:34:10 +00:00
João Valverde a35311d312 Fix comments in dissect_6lowpan_iphc_nhc()
Change-Id: I9c02b8f2a64127200c9cfe2f389f773ac198ed21
Reviewed-on: https://code.wireshark.org/review/10389
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-09-05 06:18:15 +00:00
Kevin Bracey 7c4f622d68 Insert correct padding in RFC 6282 IPHC headers
IPv6 Extension Headers compressed using IPHC should have a single Pad1
or PadN inserted at the end if necessary - the previous code just left
any padding zero-initialised (equivalent to multiple Pad1s).

This guarantees correctly-compressed packets are accurately
decompressed, including the specific option padding pattern. (The type of
padding could matter, eg for IPSec authentication - padding options are
authenticated.)

Print a warning note if a non-option header needs padding - this is
invalid.

Bug: 10523
Change-Id: I66c98370862800a8fccbe02ed6a851961e2f7d1d
Reviewed-on: https://code.wireshark.org/review/10230
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-04 11:04:07 +00:00
Kevin Bracey eacaa1aad8 6LoWPAN: IPv6 Fragment Headers don't have a Length field
RFC 6282 specifies special handling of the "Length" field in compressed
IPv6 extension headers. However, the Fragment Header does not have a
Length field, so this special handling does not apply - the second octet
should be treated as opaque data, and the header length is always 8
octets.

Bug: 11368
Change-Id: I28fcd66d96f58a5959bb669caf4244afaca9e67e
Reviewed-on: https://code.wireshark.org/review/10231
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>
2015-08-29 17:26:52 +00:00
Michael Mann 21e5a950ad Remove all preferences related to enabling/disabling heuristic dissectors.
The preferences are still supported for backwards compatibility, but the heuristic_protos file has final say on the "preference" to enable/disable a heuristic dissector.

Also add parameter to heur_dissector_add() for the "default" enable/disable of a heuristic dissector. With this parameter, a few more (presumably weak) heuristic dissectors have been "registered" but of course default to being disabled.

Change-Id: I51bebb2146ef3fbb8418d4f5c7f2cb2b58003a22
Reviewed-on: https://code.wireshark.org/review/9610
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17 17:12:22 +00:00
Michael Mann be7d295fbf Add "user presentable" and "unique string ids" to heuristic table entries.
This allows better presentation of heuristic dissectors to the end user.

Change-Id: I2ff3985ab914e83c2989880cc0c7b9904045b3f6
Reviewed-on: https://code.wireshark.org/review/9602
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-12 03:14:38 +00:00
Peter Wu ba9aa3015f Split more init routines into init/cleanup functions
This patch is partially automatically generated, but are modified
manually. In particular, assignments and function calls have been
audited.

Some debugging comments and ifdef'd prints have been removed. The
lookup tables of the dcm and sip dissectors are now cleared. It is only
called on reopening files anyway.

The isakmp dissector is modified to use g_hash_table_new_full for
destruction of its keys and values.

Fix a memleak in ipsec dissector when libgcrypt is not enabled.

Generated using
https://git.lekensteyn.nl/peter/wireshark-notes/diff/one-off/cleanup-rewrite.py?id=3c6128ee266024d164650955f93c7740484abd68
(with AUDIT = True).

Change-Id: I3fd910bdee663842ac0196334fe0189b67e251b0
Reviewed-on: https://code.wireshark.org/review/9225
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-03 23:37:40 +00:00
Robert Cragie fa6ebae939 Improved prefix display and comments for IID copying
Change-Id: I58f56dd5cfc212e53bd7e9d575d2cf9b4b4f2b27
Reviewed-on: https://code.wireshark.org/review/8886
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-24 00:13:05 +00:00
AndersBroman 870d223b69 Change deprecated API tvb_length -> tvb_reported_length
Change-Id: I14577dccaed5aa5ed85e94b6810a94b4c8b2e437
Reviewed-on: https://code.wireshark.org/review/8059
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-14 06:58:40 +00:00
Michal Labedzki 6aba675431 Bluetooth: GATT/L2CAP: Add support for 6LoWPAN
6LoWPAN is used by GATT level profile called IPSP.

Change-Id: Iff2e1a8d531072d9bba03e7d84b56db59110cb35
Reviewed-on: https://code.wireshark.org/review/8045
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-04-14 05:43:20 +00:00
Bill Meier c0a403abf3 6lowpan: Fix a few minor bugs; Also: Misc
(Bugs were introduced in gf5e2b42);
Misc:
    Localize a few variables;
    Remove some dead initializers.

Change-Id: Ib7493740ecf29ed9f753475f721b47a64f54a278
Reviewed-on: https://code.wireshark.org/review/6687
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-01-20 20:49:18 +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
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
Alexis La Goutte def4313380 6lowpan : fix warning: no previous prototype for 'lowpan_context_free' [-Wmissing-prototypes]
Change-Id: I3fa66aa0713a0455639b04ecf129f48baa8c096f
Reviewed-on: https://code.wireshark.org/review/5718
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-12-11 12:09:05 +00:00
Pascal Quantin 987383da49 6LoWPAN: use manually managed memory for the stateful address decompression preferences
Bug: 10747
Change-Id: I9d1b7ce2782f7cd133ab3ba02b0dd43afab3e145
Reviewed-on: https://code.wireshark.org/review/5560
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-02 09:43:46 +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
Pascal Quantin 1e47e050dc 6LoWPAN: fix encapsulating address decoding when a Mesh header is present
Bug: 10462
Change-Id: I37d532edc41193123b1a7bb380d48cb76c118bf4
Reviewed-on: https://code.wireshark.org/review/4161
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-20 11:52:34 +00:00
Evan Huus c1bc1b6a83 Convert some deprecated tvb_length calls
Change-Id: I6337f8e02a41106a363b9bf767bc4b3697442d41
Reviewed-on: https://code.wireshark.org/review/4027
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-09-08 14:11:44 +00:00
Pascal Quantin 2eced3689d 6LoWPAN: fix dissection when using multicast address compression
Also update the value_string arrays with the various SAM/DAM combinations

Bug: 10426
Change-Id: I87f13c29f42770ec655d85e2247b847bfe28e3ba
Reviewed-on: https://code.wireshark.org/review/3915
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-30 09:55:27 +00:00
Guy Harris ebff85fdbb Clean up Internet checksum handling.
Add macros to set entries of a vec_t, one for use when you have a
pointer to private data, and one for use when you have data in a tvbuff.
The latter wraps the use of tvb_get_ptr(), so that you're not directly
calling it in a dissector.

Move ip_checksum() to epan/in_cksum.c, and add an ip_checksum_tvb() that
wraps the use of tvb_get_ptr().

In the CARP dissector, give the length variable an unsigned type -
there's no benefit to it being signed, and that requires some casts to
be thrown around.

In the DCCP dissector, check only against the coverage length to see if
we have enough data, combine the "should we check the checksum?" check
with the "*can* we check the checksum?" check in a single if, and throw
a dissector assertion if the source network address type isn't IPv4 or
IPv6.

Get rid of inclues of <epan/in_cksum.h> in dissectors that don't use any
of the Internet checksum routines.

In the HIP dissector, make sure we have the data to calculate the
checksum before doing so.

Change-Id: I2f9674775dbb54c533d33082632809f7d32ec8ae
Reviewed-on: https://code.wireshark.org/review/3517
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-09 01:09:34 +00:00
Michael Mann f5e2b4293d convert to proto_tree_add_subtree[_format]
Change-Id: I358bfaa4e5d40cd01b766f614f8bd0dbaf611dd0
Reviewed-on: https://code.wireshark.org/review/2508
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 14:34:17 +00:00