Commit Graph

105 Commits

Author SHA1 Message Date
Pascal Quantin 36ad3475d9 Remove non ASCII characters
svn path=/trunk/; revision=48695
2013-04-02 08:34:09 +00:00
Anders Broman 3d2ca39863 Dissect more of 3GPP2_OBJECT.
svn path=/trunk/; revision=48694
2013-04-02 05:54:47 +00:00
Anders Broman 2328de7bf8 Unused parameter.
svn path=/trunk/; revision=48681
2013-03-31 22:27:58 +00:00
Anders Broman 1f74d7a1b2 Initial decoding of 3GPP2_OBJECT.
svn path=/trunk/; revision=48679
2013-03-31 22:08:00 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Alexis La Goutte cc13aa780a Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=48501
2013-03-23 13:08:03 +00:00
Anders Broman ae747e4c4b From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48430
2013-03-19 22:03:00 +00:00
Chris Maynard 3478c66464 Fix Coverity CID 280396: Logically dead code.
svn path=/trunk/; revision=47973
2013-03-01 07:02:08 +00:00
Guy Harris 6b629c4d92 Move show_exception() and show_reported_bounds_error() to
epan/show_exception.c, as it's used outside
epan/dissectors/packet-frame.c.  Update their callers to include
<epan/show_exception.h> to get their declaration.

Add a CATCH_NONFATAL_ERRORS macro that catches all exceptions that, if
there's more stuff in the packet to dissect after the dissector call
that threw the exception, doesn't mean you shouldn't go ahead and
dissect that stuff.  Use it in all those cases, including ones where
BoundsError was inappropriately being caught (you want those passed up
to the top level, so that the packet is reported as having been cut
short in the capture process).

Add a CATCH_BOUNDS_ERRORS macro that catches all exceptions that
correspond to running past the end of the data for a tvbuff; use it
rather than explicitly catching those exceptions individually, and
rather than just catching all exceptions (the only place that
DissectorError should be caught, for example, is at the top level, so
dissector bugs show up in the protocol tree).

Don't catch and then immediately rethrow exceptions without doing
anything else; just let the exceptions go up to the final catcher.

Use show_exception() to report non-fatal errors, rather than doing it
yourself.
 
If a dissector is called from Lua, catch all non-fatal errors and use
show_exception() to report them rather than catching only
ReportedBoundsError and adding a proto_malformed item.

Don't catch exceptions when constructing a trailer tvbuff in
packet-ieee8023.c - just construct it after the payload has been
dissected, and let whatever exceptions that throws be handled at the top
level.

Avoid some TRY/CATCH/ENDTRY cases by using checks such as
tvb_bytes_exist() before even looking in the tvbuff.

svn path=/trunk/; revision=47924
2013-02-27 22:43:54 +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
Jeff Morriss 0266cceef3 Make all enum_val_t's const.
svn path=/trunk/; revision=46292
2012-11-29 20:15:37 +00:00
Anders Broman 7ac8c137d9 Fix Incorrect decoding of RSVP RECORD_ROUTE Object.
"in RSVP RESV message there incorrect
explanation of field "Flags" of Label subobject is appeared in Packet Details
section: value 0x01 of Flags field mistakenly defined as "Local Protection
Available" (I guess that this is borrowed from Flags field of IPv4 Address
subobject). Flags 0x01 in Label subobject means that particular label is global
(RFC 3209, Clause 4.4.1.3)."

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

svn path=/trunk/; revision=45835
2012-10-30 09:13:13 +00:00
Michael Mann 88ee7291cf replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45082
2012-09-24 01:59:34 +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
Bill Meier 5452b8a20c Extern (and use) extended value string instead of the associated value string array.
svn path=/trunk/; revision=44665
2012-08-25 01:20:32 +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 bdebbb9bdf Re-order 2 value_string arrays so that entries are in ascending order by value.
svn path=/trunk/; revision=43216
2012-06-11 20:35:00 +00:00
Bill Meier afab63c34c Fix another compiler warning
svn path=/trunk/; revision=43209
2012-06-11 16:53:49 +00:00
Bill Meier 332f743f6c Fix a compiler warning
svn path=/trunk/; revision=43208
2012-06-11 16:44:42 +00:00
Bill Meier 8469651f54 General cleanup:
- remove some redundant code;
- use ep_strdup_printf() instead of g_snprintf() to a static buffer;
- create and use extended-value-strings as appropriate;
- define a value_string array as static (not as an automatic);
- use val_to_str_const() instead of val_to_str() as appropriate;
- reformat hf[] array entries;
- do general formatting cleanup;
- do whitespace cleanup (e.g., indentation & 4-space tabs).

svn path=/trunk/; revision=43207
2012-06-11 16:33:56 +00:00
Bill Meier 7b94cadffd From Evan Huus: Missing breaks in packet-rsvp.c
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7353

svn path=/trunk/; revision=43194
2012-06-11 03:36:04 +00:00
Guy Harris d6bc0d246c Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls.

svn path=/trunk/; revision=42539
2012-05-10 02:36:50 +00:00
Anders Broman a8ea39d6aa Typo
svn path=/trunk/; revision=39979
2011-11-21 20:06:26 +00:00
Anders Broman 7a6c01224d Get rid of Warnings.
svn path=/trunk/; revision=39978
2011-11-21 20:04:45 +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
Bill Meier f1b784b474 More conversions of proto_tree_add_item() 'encoding' arg
svn path=/trunk/; revision=39467
2011-10-19 15:04:44 +00:00
Bill Meier 2bf572bc41 Remove unneeded #includes: proto.h,tvbuff.h,value_string.h,stdlib.h,...
svn path=/trunk/; revision=38413
2011-08-08 17:59:32 +00:00
Bill Meier 3f7e7672c9 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings.
svn path=/trunk/; revision=38095
2011-07-18 19:11:32 +00:00
Jeff Morriss b1d4ef8851 Use tvb_ip_to_str() and tvb_ether_to_str().
svn path=/trunk/; revision=35905
2011-02-10 22:14:05 +00:00
Bill Meier 88d53d925f #include <stdio.h>, #include <stdlib.h> not req'd;
Make a global variable static (since it's apparently not used elsewhere);
Whitespace changes (indentation, trailing, etc).

svn path=/trunk/; revision=35725
2011-01-31 17:09:58 +00:00
Bill Meier 767cdc69fd From Roberto Morro: Fix for Bug #5628
This patch (against revision 35716) resolves the following bug:
[introduced in patch attached to Bug #5518]
"Dissector bug, protocol RSVP, in packet 78:
More than 1000000 items in the tree -- possible infinite loop"

Actually the bug is resolved by the "return" statement that was erased by
mistake. The patch fixes another issue: the code didn't take care of the fact
that TLVs must be padded to a length multiple of 4.

See:
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5518
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5628

From me:
 Change two bytestring_to_str(tvb_get_ptr(...),...) to tvb_bytes_to_str(tvb,...)

svn path=/trunk/; revision=35722
2011-01-31 15:27:26 +00:00
Bill Meier cca0038358 From Roberto Morro: RSVP dissector enhancements
- add new PROTECTION obj c-type 2 (RFC4872)
- add new TLVs for IF_ID (RFC4920)
- add Path Key subobj in ERO (RFC5520)
- add new ASSOCIATION obj c-type 4 (oif2008.389)
- add new LSP_ATTRIBUTES and LSP_REQUIRED_ATTRIBUTES objects (RFC5420)
- improved ERROR object dissection and new error values added
- ADMIN_STATUS transformed to filter and new flags added
- minor fix to conversation (not applied to ACK, SREFRESH and HELLO messages)
to resolv displaying of "Unknown session type" string in such messages

Moreover, I've deleted some "enum" statements for error values that I thought
they were useless since they were used only once throughout the RSVP dissector
code.

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

From me: fix two typos.


svn path=/trunk/; revision=35681
2011-01-27 16:08:41 +00:00
Jeff Morriss e11921d192 Replace ip_to_str((tvb_get_ptr(...)) with tvb_ip_to_str().
Replace ip6_to_str((tvb_get_ptr(...)) with tvb_ip6_to_str().

svn path=/trunk/; revision=35540
2011-01-15 03:25:43 +00:00
Anders Broman 53cc4d7ea9 From Francesco Fondelli:
RSVP: support for Vendor Private objects, RFC 3936
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5468

svn path=/trunk/; revision=35370
2011-01-05 07:16:09 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Bill Meier 10ffd14b8f Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
2010-05-10 15:54:57 +00:00
Jeff Morriss 08045a2392 Revert rev 32519 for now: it is making the dissector bug a little too obvious. It may make sense to put the check back in once the bug (tracked via 4698) is fixed.
svn path=/trunk/; revision=32620
2010-04-30 22:00:05 +00:00
Guy Harris c10087d7f4 If that should truly "never happen", use DISSECTOR_ASSERT_NOT_REACHED()
so it's more clearly marked as a dissector bug.

(It apparently *does* happen - see bug 4698.)

svn path=/trunk/; revision=32519
2010-04-19 23:38:55 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Guy Harris 7e7ced5c30 Make some constants float, as they're used to compute a value assigned
to a float, rather than a double, variable.

svn path=/trunk/; revision=32140
2010-03-07 21:09:14 +00:00
Jaap Keuter 4c6c2ffbe7 From Francesco Fondelli:
add support for ERROR_STRING IF_ID TLV (see RFC 4783)

add support for generalized label interpretation: SUKLM
format for SONET/SDH label (RFC 4606), t3t2t1 format for G.709 ODUk label
(RFC 4328), G.694 format for lambda label (draft-ietf-ccamp-gmpls-g-694-lamb
da-labels-05).  Add related user preference option.

svn path=/trunk/; revision=32127
2010-03-06 12:48:30 +00:00
Bill Meier 1a4283ccf8 Fixes for gcc -Wshadow warnings; Fix indentation and do other minor cleanup in a few cases.
svn path=/trunk/; revision=31617
2010-01-22 13:56:19 +00:00
Stig Bjørlykke 05ec983b05 Corrected abbrev for message-id ack.
svn path=/trunk/; revision=31434
2010-01-03 15:42:53 +00:00
Anders Broman 26658ed017 From Francesco Fondelli:
RSVP extensions for G.709 Optical Transport Networks Control, RFC 4328
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4148

With some changes from me:
-(readme.developer:" Furthermore, 'display' field must be ORed with 'BASE_RANGE_STRING' (e.g. BASE_DEC|BASE_RANGE_STRING)."
- Prefix headerfields with hf_
- Remove check_col

svn path=/trunk/; revision=30727
2009-10-27 06:05:02 +00:00
Bill Meier 6c545e0d79 Save some memory: Don't statically allocate ett[] arrays used "dynamically".
svn path=/trunk/; revision=29929
2009-09-15 17:37:54 +00:00
Kovarththanan Rajaratnam 0a5b014cec Don't guard col_clear with col_check
svn path=/trunk/; revision=29344
2009-08-09 07:36:13 +00:00
Bill Meier 90e865cc54 Init ett_... variables to -1
svn path=/trunk/; revision=29294
2009-08-04 18:48:45 +00:00
Gerald Combs b0aa9d9696 Use SE_COPY_ADDRESS instead of trying to attach ep_alloced data to an
se_alloced struct.

svn path=/trunk/; revision=29126
2009-07-16 21:35:54 +00:00