Commit Graph

137 Commits

Author SHA1 Message Date
Jakub Zawadzki 5c79cbf152 Fix some trivial warnings.
svn path=/trunk/; revision=54085
2013-12-14 10:29:26 +00:00
Bill Meier 5a2dd0e9ac Use a consistent indentation: 4 spaces;
Use #if 0/#endif instead of '/* */' to comment out some code;

svn path=/trunk/; revision=53983
2013-12-12 20:39:11 +00:00
Guy Harris a2b9f02e59 Fix some cases where STR_UNICODE was used with FT_DOUBLE.
svn path=/trunk/; revision=53831
2013-12-07 19:43:59 +00:00
Jakub Zawadzki 7ab18667e5 Drop proto_tree_add_unicode_string() from IP, IPv6, JSON dissectors.
Set .display to STR_UNICODE (instead of STR_ASCII).

svn path=/trunk/; revision=53827
2013-12-07 15:48:35 +00:00
Michael Mann 55c6869980 Remove ip_ttl from packet_info structure.
Part of the fix includes having the IPv6 dissector populate as much of a ws_ip structure as possible to pass to subdissectors of the "ip.proto" table, so the ttl value can be picked up.

svn path=/trunk/; revision=53522
2013-11-23 19:16:05 +00:00
Michael Mann 76ab93ea94 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.

This patch includes just the dissector portion of the functionality (minus packet-dcerpc.[ch] because it has hooks to the current GUI)

svn path=/trunk/; revision=53445
2013-11-20 19:17:08 +00:00
Michael Mann 8c64c5da89 Remove iplen and iphdrlen from struct _packet_info.
Dissectors should just use (reported) tvb length and taps have other ways to get the data.

svn path=/trunk/; revision=52899
2013-10-27 20:38:42 +00:00
Gerald Combs 1701f42969 Fix warnings found by Clang 5.0 (-Wself-assign and -Wparentheses-equality).
Move code from ipv6-utils.h to packet-ipv6.c since that was the only
place it was used. Comment out unused code.

svn path=/trunk/; revision=52645
2013-10-16 17:19:59 +00:00
Michael Mann 346f803d42 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 all manual inspection and most cases were either:
1. Case sensitivity differences between hf_ field name and formatted string.
2. Unnecessary whitespace between hf_ field name and colon in formatted string

There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed.

svn path=/trunk/; revision=52098
2013-09-16 10:39:06 +00:00
Pascal Quantin 9486a3d974 More wmem conversion (leaving uat related functions aside)
svn path=/trunk/; revision=52055
2013-09-15 13:46: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
Chris Maynard 5cd898cd80 Rename frame relay NLPID dissector table from "fr.ietf" to "fr.nlpid".
svn path=/trunk/; revision=51960
2013-09-11 21:55:00 +00:00
Chris Maynard f2c276ec21 Change the name of the Cisco HDLC dissector table from chdlctype to chdlc.protocol and change the UI name to match. It is by far much more common to name the tables after the field than to pick another name.
svn path=/trunk/; revision=51958
2013-09-11 21:37:58 +00:00
Gerald Combs 6986eb4866 Move a lot of includes from follow_stream_dialog.h to
follow_stream_dialog.cpp. Remove the ones that we don't use. Use
QMessageBox in place of simple_dialog.

Move IP6OPT_HOME_ADDRESS and related definitions to packet-ipv6.c. It
looks like we only use it there and it conflicts with WinPcap.

Mark some items unused.

svn path=/trunk/; revision=51951
2013-09-11 17:39:49 +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
Michael Mann 7878e93cad expert_add_info_format_text + proto_tree_add_text = proto_tree_add_expert_format, where applicable.
svn path=/trunk/; revision=50377
2013-07-03 23:43:26 +00:00
Jeff Morriss df5c2548dd ip_proto.h now requires expert.h.
svn path=/trunk/; revision=50249
2013-06-30 11:06:32 +00:00
Michael Mann 0f0c111119 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49920
2013-06-14 01:02:11 +00:00
Michael Mann 6229ab6266 Batch of filterable expert infos.
svn path=/trunk/; revision=49845
2013-06-08 02:06: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 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
Jaap Keuter f5791fbd2d I'm pretty sure that reassembled IPv6 data does not fit in a uint32.
svn path=/trunk/; revision=47791
2013-02-21 07:37:10 +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 49466f95bc Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). They
are like the non-TVB versions except that they take a TVB and an offset
instead of (frequently) a pointer into the TVB.

Calling tvb_get_ptr() before modifying the rest of the fields should help fix
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't
reproduce that problem).


Replace a bunch of calls like:

SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length));

with:

TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length);

svn path=/trunk/; revision=46324
2012-12-02 04:49:13 +00:00
Bill Meier 303ce49ecd From Stephen Tarr: Fix 'misspelling (typo) in display filter field name'.
ipv6.framgent --> ipv6.fragment
#BACKPORT

svn path=/trunk/; revision=46098
2012-11-21 00:41:32 +00:00
Alexis La Goutte c07227bef3 From report of VinsWorldcom via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7938 IPv6 Option Pad1 Incorrect dissection
Wireshark 1.8.3 does not decode the IPv6 Option Pad1 (RFC 2460 Section 4.2)

RFC say : NOTE! the format of the Pad1 option is a special case -- it does not have length and value fields.

#BACKPORT(1.8)

svn path=/trunk/; revision=45843
2012-10-31 08:35:20 +00:00
Jakub Zawadzki da00b4089e Continuation of r43335
- ipv6.traffic_class.dscp use ext string so and need BASE_EXT_STRING flag (fix SIGSEGV)
- dscp_vals was removed from .h file, so make it static
- export dscp_vals_ext

svn path=/trunk/; revision=45380
2012-10-08 09:50:47 +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
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
Evan Huus a234b68ff0 Fix some system header files that were #included with "" instead of <>.
They made cppcheck unhappy.

svn path=/trunk/; revision=43779
2012-07-18 02:47:56 +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
Jeff Morriss 030a76319c Correct the IPv6 fragment offset shown in COL_INFO.
Make some Fragment header fields filterable (add_text() -> add_item()).
Display (and make filterable) the reserved octet and bits.

svn path=/trunk/; revision=43389
2012-06-19 20:20:18 +00:00
Jakub Zawadzki 85aad38347 Add proto_tree_add_unicode_string() to add UTF-8 string to tree.
Convert some proto_tree_add_string_format_value(..., val, "%s", val); to use new function.

svn path=/trunk/; revision=43363
2012-06-19 14:32:24 +00:00
Gerald Combs 0bf0ece483 Integrate r43221 and 43222 with 43211. (Revert back to having only
dscp_vals_ext.)

svn path=/trunk/; revision=43335
2012-06-18 17:23:10 +00:00
Jörg Mayer f679b89649 Revert r41952
BACKPORT to 1.8

svn path=/trunk/; revision=43222
2012-06-12 10:44:57 +00:00
Jörg Mayer 9228ece476 Manually revert r41953
BACKPORT to 1.8

svn path=/trunk/; revision=43221
2012-06-12 10:38:22 +00:00
Bill Meier 70cc6362fe Don't define value_string arrays in a .h file (included in multiple places).
Also:
 - don't use val_to_str_const() with a "format" default string;
 - rename 'opt_len_type' enumeration  identifiers to be less generic.

svn path=/trunk/; revision=43210
2012-06-11 18:47:42 +00:00
Anders Broman 867de6145e From Sheetal Kshirsagar and Andrew Williams:
Updating the RPL SRH dissector and implementing RPL Options header dissection.

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

svn path=/trunk/; revision=42937
2012-05-31 07:25:11 +00:00
Jakub Zawadzki 4c3735771a Fix bug #5077 in IPv6.
svn path=/trunk/; revision=42909
2012-05-30 05:39:39 +00:00
Jakub Zawadzki a2dac52152 Cleanup geoip support in ipv6.
svn path=/trunk/; revision=42908
2012-05-30 05:33:37 +00:00
Gerald Combs 691ea690c8 Fix a few scan-build warnings along with some whitespace.
svn path=/trunk/; revision=42630
2012-05-15 19:11:08 +00:00
Alexis La Goutte f5a1787a06 Enhance Unknown IPv6 Extension Header
svn path=/trunk/; revision=42511
2012-05-08 17:34:46 +00:00
Anders Broman 3f4d248357 Use common code to have the same hf field for DSCP in IPv4 and IPv6.
svn path=/trunk/; revision=41953
2012-04-05 10:35:39 +00:00
Anders Broman 60c4bd3eeb Use common code to add ip version to the tree.
svn path=/trunk/; revision=41952
2012-04-05 08:38:26 +00:00
Anders Broman 3472f44238 Use common value string for DSCP.
svn path=/trunk/; revision=41951
2012-04-05 08:02:32 +00:00
Alexis La Goutte 2ddb826f55 Add IPv6 Option : RPL Option RFC-ietf-6man-rpl-option-06
svn path=/trunk/; revision=41797
2012-03-27 13:50:50 +00:00
Alexis La Goutte 22e69ad398 Add IPv6 Option :
* Tunnel Encapsulation Limit (RFC 2473)
* CALIPSO (RFC 5570)
* Experimental Option (RFC 4727)

svn path=/trunk/; revision=41796
2012-03-27 13:42:54 +00:00
Alexis La Goutte fa68273f40 Add Quick Start IPv6 Option ( And shared Quick Start option between IPv4/IPv6/TCP )
svn path=/trunk/; revision=41681
2012-03-20 08:51:05 +00:00