Commit Graph

43 Commits

Author SHA1 Message Date
Guy Harris 97869f2dec More name changes.
Add ep_ to routines that may return ephemeral strings.

Change "get_XXX" to "XXX_to_display" if the routine returns a formatted
string if it can't get a name.

Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88
Reviewed-on: https://code.wireshark.org/review/1217
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19 19:30:17 +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
Michael Mann b6484432aa Allow try_conversation_dissector() to pass data to subdissectors.
svn path=/trunk/; revision=53035
2013-11-01 23:45:10 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Pascal Quantin 074349264e Convert some dissectors to wmem (leaving uat-like memory with emem for now)
svn path=/trunk/; revision=52031
2013-09-14 10:53:29 +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
Michael Mann 2d37ec3cb0 Batch of filterable expert infos.
svn path=/trunk/; revision=49853
2013-06-09 03:28:05 +00:00
Anders Broman 5a85b7fed2 [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48338
2013-03-16 08:52:09 +00:00
Guy Harris 0d4763b3e7 Dissect the DCCP header by stepping through it a field at a time and
adding the fields to the protocol tree as we fetch them, rather than
fetching a bunch of them up front.  That way, if the packet was cut
short by a snapshot length, we'll dissect what we have.

Create the top-level tree item at the beginning, with an unknown length,
and set the length when we're done.  If we're putting details into that
item, update the item as we process each field; also update the Info
column as we process each field.

Don't use tvb_bytes_exist() to do our own tvbuff bounds-checking; let
the tvbuffs themselves do that.  Do not use it to do header-length
checking; check the actual header length value instead.

Do not fail if the *captured* data in the tvbuff is too short; we're
selected by an IP protocol number, which we can expect to definitively
identify us, not by a transport-layer port number, which is often an
unreliable identifier.

Do header length checks as we go along, and bail as soon as we identify
the header length as wrong.  (We do the first check once we get the X
bit, so we know whether the generic header is 12 or 16 bytes long.) 
Treat a too-*large* header as a protocol violation, not a malformed
packet indication.

Use tvb_get_ntoh24() and tvb_get_ntoh48() to fetch the sequence number,
rather than fetching it in pieces and putting them together ourselves.

Correctly pluralize "byte".

Don't use tvb_length_remaining() to check whether we have a payload, use
tvb_reported_length_remaining(), so we base it on whether the packet
actually had the data, not on whether we actually captured it.

svn path=/trunk/; revision=48201
2013-03-08 19:56:41 +00:00
Michael Mann f473d9a3d7 General cleanup including:
1. Convert proto_tree_add_text to proto_tree_add_item/expert info
2. Change to "new style" dissector
3. Use standard malformed packet interface

Reviewed by Francesco Fondelli

svn path=/trunk/; revision=48009
2013-03-02 16:00:43 +00:00
Bill Meier c439b805e2 Comment out unused hf[] entries & etc.
(found by checkhf)

svn path=/trunk/; revision=47389
2013-01-31 17:55:31 +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 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 dee4443809 Add data parameter to dissector_try_heuristic
svn path=/trunk/; revision=44871
2012-09-11 08:26:48 +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 b18e880040 Update FSF address - part II.
svn path=/trunk/; revision=43538
2012-06-28 23:18:38 +00:00
Bill Meier d53320919a Remove unneeded #includes (stdlib, stdio, ctypes, time);
In a few cases: do some whitespace, indentation cleanup & reformatting.

svn path=/trunk/; revision=42632
2012-05-15 19:23:35 +00:00
Jakub Zawadzki 8a1dc57c03 Remove doubled semicolons and semicolons outside function.
svn path=/trunk/; revision=42053
2012-04-13 20:22:31 +00:00
Bill Meier ca3e8b5d8b 'tab-width/tabstop/tabSize' in editor modelines should really always be 8;
Also: In some cases do some whitespace cleanup and some minor reformatting.

svn path=/trunk/; revision=41724
2012-03-21 18:20:44 +00:00
Jeff Morriss 18f0ab61cb From Francesco Fondelli via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6946 :
Support for DCCP Simultaneous-Open for NAT Traversal, RFC 5596.  A new packet
format is supported.  I did a little code cleanup too.

svn path=/trunk/; revision=41543
2012-03-14 01:39:24 +00:00
Anders Broman 9a296bbb74 From Francesco Fondelli:
Fix indentation.
(I restored "lost code")

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

svn path=/trunk/; revision=40839
2012-02-04 14:01:46 +00:00
Chris Maynard 647c5c0b27 packet_info's in_error_pkt is now a bitfield like in_gre_pkt.
svn path=/trunk/; revision=39764
2011-11-08 18:39:11 +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 ab901be153 Get rid of check_col, while at it set ENC.
svn path=/trunk/; revision=39148
2011-09-26 11:33:10 +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
Bill Meier 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +00:00
Anders Broman 88bb44a51e From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

svn path=/trunk/; revision=30691
2009-10-25 11:43:30 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +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
Kovarththanan Rajaratnam 4b6090e576 Don't guard col_set_str (COL_INFO) with col_check
svn path=/trunk/; revision=29342
2009-08-09 07:01:26 +00:00
Kovarththanan Rajaratnam e971354a54 Don't guard col_set_str (COL_PROTOCOL) with col_check
svn path=/trunk/; revision=29340
2009-08-09 06:26:46 +00:00
Stig Bjørlykke b228488bc0 From Kovarththanan Rajaratnam via bug 3548:
(1) Trailing/leading spaces are removed from 'name's/'blurb's
(2) Duplicate 'blurb's are replaced with NULL
(3) Empty ("") 'blurb's are replaced with NULL
(4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields
    for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME,
    FT_PROTOCOL, FT_STRING and FT_STRINGZ field types
(5) Only allow non-zero value for 'display' if 'bitmask' is non-zero

svn path=/trunk/; revision=28770
2009-06-18 21:30:42 +00:00
Bill Meier 79a1441582 FT_BOOLEAN fields w/o bitmasks really should use BASE_NONE (not BASE_DEC,...).
svn path=/trunk/; revision=28317
2009-05-08 20:35:57 +00:00
Bill Meier c544c20956 Fix various typos and spelling errors (mostly in text strings)
svn path=/trunk/; revision=27050
2008-12-18 19:08:49 +00:00
Bill Meier 931cc922a1 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25305
2008-05-15 01:44:53 +00:00
Bill Meier 9ca142b160 Fix some of the Errors/warnings detected by checkapi.
svn path=/trunk/; revision=25282
2008-05-13 01:23:37 +00:00
Guy Harris a837356771 Fix name of file in comment to reflect current reality.
svn path=/trunk/; revision=24867
2008-04-09 18:29:29 +00:00
Guy Harris d589b0523b OK, now use DCCP rather than DCP for the Datagram Congestion Control
Protocol.  (Better late than never....)

svn path=/trunk/; revision=24646
2008-03-16 00:03:13 +00:00
Guy Harris bcd666a74f Rename Distributed Checksum Clearinghouse protocol from "DCCP" to just
"DCC".  Googling for

	DCCP "Distributed Checksum Clearinghouse Protocol"

finds only hits related to Ethereal/Wireshark, either on the Ethereal or
Wireshark Web site, or on discussions where Datagram Congestion Control
Protocol developers were griping that Ethereal/Wireshark already used
DCCP for the Distributed Checksum Clearinghouse protocol.

Next step: fix the Datagram Congestion Control Protocol dissector.

svn path=/trunk/; revision=24645
2008-03-15 23:49:26 +00:00
Anders Broman 6226035893 Apply yet another set of the optimization patches:
When offset parameter is 0 replace tvb_bytes_exist() with the faster tvb_length().

On the other hand 
	if (tvb_bytes_exist(tvb, 0, 20)
is more readable than
	if (tvb_length(tvb) >= 20

so only do it in heuristic function

svn path=/trunk/; revision=23412
2007-11-09 06:01:18 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00
Anders Broman 9269a3b4f2 From Jaap Keuter:
Bug 373 complains about a field type. Trivial fix attached.

svn path=/trunk/; revision=16821
2005-12-16 16:31:46 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00