Commit Graph

96 Commits

Author SHA1 Message Date
Bill Meier 87cf82e056 Use tvb_new_subset_remaining() rather than tvb_new_subset();
#include <styring.h> not req'd (in a few cases);
Minor reformating & whitespace cleanup.

svn path=/trunk/; revision=41374
2012-03-06 16:58:09 +00:00
Guy Harris 1f971df298 Close parentheses in expert info.
svn path=/trunk/; revision=41002
2012-02-12 20:44:51 +00:00
Guy Harris f36fec7381 Don't trust the pointer value in a packet; it could be invalid, and this
could cause an unsigned length value to be reduced by more than its
value, turning it into a very large value.

I couldn't exactly reproduce bug 6833, but it was due to an attempt to
allocate 4294967110 bytes, and this bug caused remaining_len to equal
4294967110, and it would try to create a reassembled packet tvbuff of
that size, so I'm guessing this fixes 6833.

svn path=/trunk/; revision=41001
2012-02-12 20:03:37 +00:00
Jeff Morriss d51510c1a3 From Guy Martin via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6795 :
Remove some duplicate checks.

svn path=/trunk/; revision=40922
2012-02-07 19:14:45 +00:00
Jeff Morriss 76efc975bd Fix the fuzz failure reported in in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6799 :
Ensure that the payload length handed to the reassembly routines doesn't go
negative/very-large-positive.

svn path=/trunk/; revision=40919
2012-02-07 16:53:22 +00:00
Jörg Mayer dca8952441 Fix "variable set but not used" warnings turned error. In at least
one case this looks like a logic bug and should be investigated.

svn path=/trunk/; revision=40914
2012-02-07 09:03:14 +00:00
Anders Broman 3f27726353 From Guy Martin:
Updated MP2T (MPEG2-TS) dissector

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

svn path=/trunk/; revision=40885
2012-02-06 19:21:11 +00:00
Chris Maynard 1153ff7b56 Fix incorrect "pos=0" pdml values. Resolves the issue reported in comment 4 of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2432 and closes the bug.
svn path=/trunk/; revision=40161
2011-12-12 18:35:49 +00:00
Bill Meier 2103e7f38a tvb_[reported_]length_remaining can return -1
svn path=/trunk/; revision=39870
2011-11-15 21:22:01 +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 293049dfba Do some conversions of proto_tree_add_item() 'encoding' arg.
(previously missed).

    57   FT_BOOLEAN:       FALSE-->ENC_BIG_ENDIAN
    31   FT_BOOLEAN:       TRUE-->ENC_LITTLE_ENDIAN

    10   FT_BYTES:         ENC_BIG_ENDIAN-->ENC_NA
     1   FT_BYTES:         ENC_LITTLE_ENDIAN-->ENC_NA
    21   FT_BYTES:         FALSE-->ENC_NA
     2   FT_BYTES:         TRUE-->ENC_NA

     2   FT_IPXNET:        ENC_BIG_ENDIAN-->ENC_NA

     6   FT_IPv6:          ENC_BIG_ENDIAN-->ENC_NA
     1   FT_IPv6:          FALSE-->ENC_NA

     6   FT_NONE:          ENC_BIG_ENDIAN-->ENC_NA
    19   FT_NONE:          FALSE-->ENC_NA
     3   FT_NONE:          TRUE-->ENC_NA

     1   FT_STRING:        ENC_BIG_ENDIAN-->ENC_ASCII|ENC_NA
     1   FT_STRING:        ENC_LITTLE_ENDIAN-->ENC_ASCII|ENC_NA
     5   FT_STRING:        FALSE-->ENC_ASCII|ENC_NA
     1   FT_STRING:        TRUE-->ENC_ASCII|ENC_NA

     4   FT_STRINGZ:       ENC_NA-->ENC_ASCII|ENC_NA
     8   FT_STRINGZ:       FALSE-->ENC_ASCII|ENC_NA

     1   FT_INT32:         FALSE-->ENC_BIG_ENDIAN
     1   FT_INT32:         TRUE-->ENC_LITTLE_ENDIAN

    11   FT_UINT8:         0-->ENC_BIG_ENDIAN
   111   FT_UINT8:         FALSE-->ENC_BIG_ENDIAN
    17   FT_UINT8:         TRUE-->ENC_LITTLE_ENDIAN
     1   FT_UINT16:        0-->ENC_BIG_ENDIAN
    68   FT_UINT16:        FALSE-->ENC_BIG_ENDIAN
    18   FT_UINT16:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT24:        FALSE-->ENC_BIG_ENDIAN
    70   FT_UINT32:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT32:        TRUE-->ENC_LITTLE_ENDIAN
     4   FT_UINT64:        FALSE-->ENC_BIG_ENDIAN
     1   FT_UINT64:        TRUE-->ENC_LITTLE_ENDIAN

     1   FT_UINT_STRING:   FALSE-->ENC_ASCII|ENC_BIG_ENDIAN


svn path=/trunk/; revision=39442
2011-10-16 23:38:49 +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 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Bill Meier fd64c4ae5e Remove unused code: Fixes Coverity 972 [UNUSED].
svn path=/trunk/; revision=37335
2011-05-20 20:00:16 +00:00
Chris Maynard 261875b924 Allow both PPP and ISO/IEC 13818-1 over USB to be dissected using heuristics.
Resolves bug 4814.

svn path=/trunk/; revision=37039
2011-05-10 14:22:17 +00:00
Stig Bjørlykke 722dba0495 Check for valid docsis_handle, and use data_handle if not.
This fixes bug 5839.

svn path=/trunk/; revision=36681
2011-04-17 17:47:39 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +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 229587d32d Init fragment_table and reassembly table every "session" rather than just once in proto_register...()
svn path=/trunk/; revision=35151
2010-12-07 23:27:11 +00:00
Jeff Morriss 33f116a46d Restore pinfo->private_data after an exception was thrown by a subdissector.
This is necessary in case a subdissector had changed it but was unable to
restore it (due to the exception).

Remove check_col().

svn path=/trunk/; revision=34436
2010-10-08 17:48:22 +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 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Stig Bjørlykke 539b558f8c Renamed some reassembled data texts.
Removed some check_col().

svn path=/trunk/; revision=31809
2010-02-06 18:20:21 +00:00
Stig Bjørlykke 88b72356ad Introduce "Reassembled length" filter element for all protocols doing
reassembly.

svn path=/trunk/; revision=31767
2010-02-02 16:01:52 +00:00
Bill Meier c5614625ee Fix some gcc -Wshadow warnings ....
svn path=/trunk/; revision=31559
2010-01-18 23:16:10 +00:00
Jaap Keuter 71a48b6dbf From Alex Volinsky:
This enhancement implements dissector for Downstream DOCSIS (Data over Cable)
frames, embedded into MPEG packets and encapsulated into L2TPv3 over IP
(DEPI/D-MPT encapsulation). This type of encapsulation is used in Modular Cable
Modem Termination System (M-CMTS) architecture for head-end components that
comply with DOCSIS.

DEPI, the Downstream External PHY Interface, is the interface between the
M-CMTS Core and the EQAM. More specifically, it is an IP Tunnel between the MAC
and PHY in a Modular CMTS system.

L2TPv3 is described in RFC3931.
DOCSIS DEPI data packet transport mechanism is described CM-SP-DEPI-I03-060728
(Downstream External PHY Interface - CableLabs specification) 
The format of MPEG packet carrying DOCSIS data is described in 
CM-SP-DRFI-I07-081209 (Data-Over-Cable Service Interface Specifications -
CableLabs specification).

svn path=/trunk/; revision=30857
2009-11-07 19:41:58 +00:00
Jaap Keuter d1c54017f3 From Jesper Dangaard Brouer:
This patch set improves packet loss detection in for MPEG2 Transport Streams
(RFC 2250 / ISO/IEC 13818-1).
1. Improve loss detection by counting skipped TS frames (currently we only
detect a drop). (only store the info globally)
2. Introduce an analysis tree and record/count the info per TS frame.

svn path=/trunk/; revision=30789
2009-11-01 11:00:00 +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
Jörg Mayer af417beb8e Warningfix:
function() -> function(void)

svn path=/trunk/; revision=28302
2009-05-08 15:16:07 +00:00
Martin Mathieson 6cc0cf8456 Initialise a variable to prevent a warning (that looks invalid to me).
svn path=/trunk/; revision=27892
2009-03-30 09:34:15 +00:00
Bill Meier 808a4e2c3c Define certain fcns as static (if not used externally).
Also: whiule we're at it: 
 - fix hf[] blurbs as appropriate to use NULL;
 - fix some indentation

svn path=/trunk/; revision=27890
2009-03-29 22:16:26 +00:00
Bill Meier 90b9182895 From Peter <pva At gentoo.org>: Fix build err: "variable 'payload_len' might be clobbered by 'longjmp' or 'vfork'"
Fixes Bug #3353

svn path=/trunk/; revision=27856
2009-03-26 22:34:53 +00:00
Guy Harris c690a24816 Fix warning on Solaris/GCC about setjmp/longjmp.
svn path=/trunk/; revision=27486
2009-02-19 09:23:34 +00:00
Anders Broman df6d3da586 Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Reviewed-by: Martin Philip Topholm <mph@comx.dk>

Implement packet loss detection in for MPEG2 Transport Streams 
Second Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3227

svn path=/trunk/; revision=27381
2009-02-05 21:02:50 +00:00
Anders Broman 48bf9f396e Signed-off-by: Jesper Dangaard Brouer <hawk@comx.dk>
Reviewed-by: Martin Philip Topholm <mph@comx.dk>

Exception handling in packet-mp2t.c (MPEG2 Transport Stream)
Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3227

svn path=/trunk/; revision=27380
2009-02-05 19:12:44 +00:00
Bill Meier 734095db7a Use dissector_add_handle rather than registering to UDP port 0
svn path=/trunk/; revision=26911
2008-12-04 16:08:03 +00:00
Jaap Keuter 53708b2c85 Let the dissector call its subdissectors, even when tree==NULL.
svn path=/trunk/; revision=26409
2008-10-10 17:55:51 +00:00
Anders Broman 1742b395c1 From : Mike Kazmier:
Fixes for two bugs dealing with adaption fields in MPEG2 Transport Streams (packet-mp2t.c)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2946

svn path=/trunk/; revision=26398
2008-10-10 09:17:26 +00:00
Jaap Keuter 852d928901 Make mpeg2ts over UDP possible. Heuristic and Decode as.
svn path=/trunk/; revision=23743
2007-12-04 07:11:38 +00:00
Stig Bjørlykke fb082a9a3c From Shaun Jackman:
* asn1/mpeg/packet-mpeg-pes-template.c (proto_register_mpeg_pes):
	Register the dissectors mpeg and mpeg-pes.
	* epan/dissectors/packet-mp2t.c (dissect_tsp): Call the mpeg-pes
	dissector.
	(ett_mp2t_header, ett_mp2t_af): New subtree identifiers.

svn path=/trunk/; revision=22650
2007-08-25 00:50:20 +00:00
Guy Harris 5a43799a17 Use G_GINT64_MODIFIER, rather than the PRI[douxX]64 macros, for GLib
routines and routines using those routines.  GLib might use different
modifiers for 64-bit quantities than the platform's C library does.

svn path=/trunk/; revision=21990
2007-05-29 18:52:42 +00:00
Stephen Fisher fe0e340bff From Mark Lewis:
The current RTP/MPEG2 Transport Stream dissector has a bug. When both
Adaptation Field and Payload are present in a packet (AFC==3) the
payload is ignored and Wireshark marks the packet as malformed.
This patch to epan/dissectors/packet-mp2t.c fixes the problem.


svn path=/trunk/; revision=20910
2007-02-23 21:31:11 +00:00
Bill Meier 103bf29730 Continuing the tradition: squelch some compiler warnings ....
svn path=/trunk/; revision=20866
2007-02-19 22:29:23 +00:00
Guy Harris c0540294d7 Don't use %ld for guint64 - use PRIu64. (Also, don't use %d for guint32
- use %u.)

svn path=/trunk/; revision=19036
2006-08-26 00:03:59 +00:00
Anders Broman 2976f89507 From Erwin Rol:
this patch adds support for MPEG2 transport stream packets in RTP (type 
MP2T). It currently dissects the headers of the MPEG2 packets

svn path=/trunk/; revision=19023
2006-08-25 05:49:37 +00:00