Commit Graph

115 Commits

Author SHA1 Message Date
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

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


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Bill Meier 9874da2fcb #if 0 numerous "unused const variables" (mostly value-string-arrays);
Also; fix a few "set but not used" warnings.

svn path=/trunk/; revision=52780
2013-10-23 06:29:11 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Evan Huus 2a1175c963 Tiny indentation fix.
svn path=/trunk/; revision=52188
2013-09-23 12:09:58 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Pascal Quantin 7623232f25 Convert a few more dissectors to wmem
svn path=/trunk/; revision=52013
2013-09-13 17:25:54 +00:00
Evan Huus 4fb4b2f1a2 Fix a bug (caught by Pascal) where a tree was being explicitly cast to emem_tree
for some reason, and thus the compiler hadn't flagged a type mismatch when the
tree was converted to wmem.

svn path=/trunk/; revision=52010
2013-09-13 17:21:12 +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
Alexis La Goutte b920999031 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=51653
2013-09-02 23:10:41 +00:00
Michael Mann 6614f284b3 From Simon Zhong: Convert several proto_tree_add_text into filterable expert info.
From me: Make "Reserved" fields filterable.  This was enough to pacify checkAPIs.pl, but part of the reason it was complaining in the first place is that many hf items are passed into info_to_display, which will end up calling a proto_tree_add_xxx function, rather than calling a proto_tree_add_xxx function directly.  Cursory glance says info_to_display could probably just be replaced with direct proto_tree_add_xxx calls.

svn path=/trunk/; revision=51504
2013-08-24 01:25:14 +00:00
Michael Mann bf2b413ac7 Add request/response tracking to COPS dissector. Bug 8947 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8947).
From Simon Zhong

svn path=/trunk/; revision=51026
2013-07-30 13:15:25 +00:00
Michael Mann 7e8e5b347e Batch of filterable expert_infos.
svn path=/trunk/; revision=49581
2013-05-25 17:06:40 +00:00
Anders Broman 54eb4a6cec [-Wmissing-prototypes]
Use explicit casts.

svn path=/trunk/; revision=48319
2013-03-15 16:39:30 +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
Evan Huus a9bb9186dd Fix some unused variable warnings from GCC.
svn path=/trunk/; revision=45064
2012-09-23 12:45:03 +00:00
Michael Mann b89a06a3e1 replaced decode_boolean_bitfield calls with itemized filters
svn path=/trunk/; revision=45059
2012-09-23 00:12:14 +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 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
Chris Maynard e173f01c5c Be sure to assign the return value of tvb_length_remaining() to a signed integer and not an unsigned integer, and then check that value is > 0.
svn path=/trunk/; revision=43720
2012-07-15 14:31:40 +00:00
Bill Meier 38e9ae2805 Don't call col_...() and expert...() functions under 'if (tree)'
svn path=/trunk/; revision=43672
2012-07-11 20:44:22 +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
Guy Harris f42de82580 Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_bitmask() calls.

svn path=/trunk/; revision=42577
2012-05-11 16:38:08 +00:00
Guy Harris 843f041270 Get rid of one remaining Booleans-as-encoding-argument in a
proto_tree_add_item() call.

svn path=/trunk/; revision=42527
2012-05-09 22:14:03 +00:00
Alexis La Goutte 1f0cbf3baa Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=42362
2012-04-30 21:15:17 +00:00
Bill Meier 75c64294fa Fix a typo.
svn path=/trunk/; revision=39632
2011-10-27 14:50:20 +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 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +00:00
Bill Meier 73ddb85c9a Remove some unneeded #includes;
Correct some typos;
Use consistent indentation & do some whitespace cleanup.

svn path=/trunk/; revision=36781
2011-04-21 22:13:56 +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
Jeff Morriss f36e2be287 Use tvb_memeql() and tvb_memcpy().
Use tvb_ip_to_str() and tvb_ip6_to_str().

There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string()s to ensure the
return string is NULL terminated.

svn path=/trunk/; revision=35546
2011-01-16 03:35:29 +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
Stig Bjørlykke 187bd52890 Corrected length check for I05 Downstream Service.
svn path=/trunk/; revision=33615
2010-07-22 10:07:25 +00:00
Stig Bjørlykke ba6c5161ba Use correct length for I04/I05 Envelope headers.
svn path=/trunk/; revision=33606
2010-07-21 14:43:02 +00:00
Stig Bjørlykke 77ee2eac8d Added "Attribute Aggregation Rule Mask" from PKT-SP-MM-I05-091029.
svn path=/trunk/; revision=33605
2010-07-21 14:17:00 +00:00
Stig Bjørlykke 22fed2a3c6 Removed call to check_col().
svn path=/trunk/; revision=33581
2010-07-19 13:55:12 +00:00
Stig Bjørlykke f790332923 Added SharedResourceID.
svn path=/trunk/; revision=33580
2010-07-19 13:31:02 +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 d200c2b75e From Jared Renzullo:
The Cops dissector does not support the IPv6 Classifier object which was added
to PCMM in the I04 spec. The object is identified by Snum = 6, Stype = 3.

svn path=/trunk/; revision=30250
2009-10-02 17:17:20 +00:00
Jaap Keuter 64d1ab68bc From Jared Renzullo:
The IPv6 SubscriberId object, which was added in the I04 spec, is not supported
in the cops dissector for PCMM. It was already supported for DQOS, however. The
object is identified by S-num = 3, S-type = 2.

svn path=/trunk/; revision=30224
2009-09-30 21:07:55 +00:00
Kovarththanan Rajaratnam 4d0d37ed6f Use tvb_get_ephemeral_string() to avoid memleak.
svn path=/trunk/; revision=29990
2009-09-20 07:44:34 +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 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 fd9d18bbe9 From Julián Lastiri via bug 3656:
ClassifierID should be before Priority field in the Extended Classifier of
PacketCable Multimedia Protocol. Also the reference to PacketCable Multimedia
document PKT-SP-MM-I02-040930 is wrong because there is no definition about
Extended Classifier. My fix is based on PacketCable Multimedia
PKT-SP-MM-I04-080522 document.

svn path=/trunk/; revision=28969
2009-07-07 08:27:15 +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
Jaap Keuter 2a35626270 From Jared Renzullo:
The Gate Usage Info field was not displaying properly because the dissector code was 
looking for a 32 bit integer, when the PCMM spec says the field is a 64 bit integer. 
The UserID field was assuming the string was null terminated, but the string is only null 
terminated if the original string's length was not a multiple of four. I fixed this by getting 
the string based on the expected length instead of the null terminator.

svn path=/trunk/; revision=28197
2009-04-30 08:29:16 +00:00
Guy Harris 54c159cb41 Turn on -Wshorten-64-to-32 by default, and fix some issues that turned
up (99 44/100% of which were assignments of double-precision
floating-point constants to floats).  Hopefully this will catch at least
some P64 issues on UN*X.

svn path=/trunk/; revision=28108
2009-04-21 16:57:52 +00:00
Jaap Keuter a7fd8c01f2 From Jared Renzullo:
The existing Wireshark Cops PCMM dissector does not support the new I04 fields fof PCMM.
I've added the new fields which are relevant to the policy server to the dissector.

svn path=/trunk/; revision=28066
2009-04-16 17:24:56 +00:00