Commit Graph

68 Commits

Author SHA1 Message Date
Bill Meier d3a7f4b817 Use '#if 0 ... #endif' rather than /** ... **/ to comment out
unused hf[] entries (which I should have done in the first place).

svn path=/trunk/; revision=47390
2013-01-31 18:31:28 +00:00
Bill Meier 0960e508e4 Comment out cases of unused hf array entries found by checkhf.
svn path=/trunk/; revision=47302
2013-01-26 18:54:53 +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
Guy Harris f569edbcef The sFlow specification says there's an address type "unknown", with an
address type value of 0, and with zero bytes of address; handle it
explicitly, and don't treat it as an error.

In the sFlow dissectors, do all the checks for "is this an sFlow
packet?" *before* we do anything to the columns and the protocol tree.

svn path=/trunk/; revision=45329
2012-10-05 01:17:33 +00:00
Martin Kaiser 6afaa3ed63 fix fuzz test failures in sflow
in dissect_sflow_245_address_type(), don't reset the offset to 0 when
the address family is unkown
bring up an expert info instead and increment offset by the number of
bytes processed

svn path=/trunk/; revision=45324
2012-10-04 19:51:00 +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 5a8783f5b1 Initial commit to support yet another method of passing data between dissectors.
Add new parameter 'data' to heur_dissector_t and new_dissector_t, for now it's always NULL

svn path=/trunk/; revision=44860
2012-09-10 21:40:21 +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 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
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 c4b63360dc Fix proto_tree_add_item( encoding args;
Do whitespace cleanup (for a few files).

svn path=/trunk/; revision=39640
2011-10-27 20:30:38 +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 67ee5049d4 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_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +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
Chris Maynard 5d2ba02113 From Andrew Feren via bug 6219: Offset calculated incorrectly for sFlow extended data.
svn path=/trunk/; revision=38419
2011-08-08 20:34:18 +00:00
Stephen Fisher a8a7de17ea Improve r36177 per Guy's suggestion at bug #5746 to always call the
PPP-over-HDLC dissector since it will do the check for us to see if
the HDLC framing is present or not.


svn path=/trunk/; revision=36178
2011-03-12 02:06:25 +00:00
Chris Maynard ebe492525f Handle PPP in HDLC framing. Fixes bug 5746.
svn path=/trunk/; revision=36177
2011-03-12 01:32:35 +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 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Stig Bjørlykke 775daf50ce Getting wrong addr_type from the packet is not a dissector bug.
svn path=/trunk/; revision=34847
2010-11-12 07:54:39 +00:00
Anders Broman ec42f515db From Andrew Feren:
sflow decode error for some extended formats.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5379

svn path=/trunk/; revision=34840
2010-11-11 07:34:07 +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 cca3ba3ce2 (Refining the regexp...) Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34230
2010-09-24 02:51:40 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +00:00
Bill Meier 5b9cba54e3 Various relatively small changes:
- #include stdio, stdlib, string not req'd.
- Use less generic macro names for a few defines.
- Fix some gcc -Wshadow warnings.
- Use the "standard idiom" for handling port preferences;
  (Doing port add/delete via a registered_init routine is not req'd).
- fix a typo.


svn path=/trunk/; revision=31900
2010-02-16 21:17:26 +00:00
Jeff Morriss 8634f52025 Add SVN Id tag
svn path=/trunk/; revision=31855
2010-02-10 16:08:16 +00:00
Guy Harris 161c33aadb Don't trust the length field in a V5 sample to be valid.
This appears to fix bug 4473.

svn path=/trunk/; revision=31846
2010-02-09 10:17:53 +00:00
Guy Harris 07922081ff Do all the missing dissectors the same way.
Oh, and there's no dissector registered as "atm" - and, if there were,
it probably wouldn't be able to handle AAL5 packets by themselves, as
you'd probably have to supply pseudo-header information (where does the
VPI/VCI come from, for example?).

This fixes bug 4471.

svn path=/trunk/; revision=31845
2010-02-09 09:52:10 +00:00
Anders Broman c2f165f2e0 Another BASE_NONE.
svn path=/trunk/; revision=31839
2010-02-09 05:55:39 +00:00
Guy Harris f329e32f09 Terminate a value_string, and get rid of a non-ASCII character.
(No ligatures, please.)

svn path=/trunk/; revision=31837
2010-02-08 22:40:27 +00:00
Ronnie Sahlberg 118377ca6b flag two unusued arguments with _U_ to prevent a compiler warning
svn path=/trunk/; revision=31836
2010-02-08 22:35:49 +00:00
Anders Broman b18d2bc900 Fix field base.
svn path=/trunk/; revision=31833
2010-02-08 21:15:54 +00:00
Anders Broman fde5ff4c56 From Yi Yu:
Enhanced sFlow dissector.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3543

svn path=/trunk/; revision=31832
2010-02-08 21:01:21 +00:00
Stig Bjørlykke 31201a01cb Use different abbrev for IPv4 and IPv6 address.
svn path=/trunk/; revision=31433
2010-01-03 15:41:29 +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
Gerald Combs 4f19e431b7 Add some length checks. Fixes bug 3567.
svn path=/trunk/; revision=28897
2009-06-30 20:59:51 +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 edb3d4cc5d From Reinhard Speyerer:
This patch fixes several misspellings/typos in Wireshark SVN revision 28201.

svn path=/trunk/; revision=28225
2009-05-01 07:19:51 +00:00
Bill Meier 6f92b028aa Use some default true_false_string's.
svn path=/trunk/; revision=27983
2009-04-07 12:20:41 +00:00
Stig Bjørlykke e39edbb176 From Peter (bug 3314):
Fixed some 'longjmp' issues.

svn path=/trunk/; revision=27654
2009-03-08 14:00:09 +00:00
Bill Meier 2f8bc6f65e Minor changes related to reg_handoff_ & proto_register_
svn path=/trunk/; revision=27225
2009-01-13 21:09:03 +00:00
Stig Bjørlykke 64f26048de From Jim Young (bug 3092):
The attached patch changes the label for the sflow.fs.seqno from "Sequence
number:" to "Sample sequence number:".   This change helps differentiate this
particular item from the sflow.sequence_number which also uses the label of
"Sequence number:".

svn path=/trunk/; revision=26902
2008-12-02 09:48:51 +00:00
Jörg Mayer 49026d3ec0 - Make sure we hanlde arrays with length 0 correctly.
- Trivial warning (shadowed variable) fix.

svn path=/trunk/; revision=26900
2008-12-02 08:13:20 +00:00
Stig Bjørlykke 0d51f029bf Initialize sample_enterprise.
svn path=/trunk/; revision=26895
2008-12-01 20:26:11 +00:00
Jörg Mayer 8eafdc0663 - Add some detail infos to the parent trees
- Improve decoding of the enterprise/type field
- Remove some unused code


svn path=/trunk/; revision=26894
2008-12-01 20:04:07 +00:00
Stig Bjørlykke 861a0ac58c Attempt to fix build errors.
svn path=/trunk/; revision=26892
2008-12-01 11:03:28 +00:00
Jörg Mayer 50de995bbc The good:
- Implement the beginnings of sflow5 support.
- Get rid if the inconsistencies regarding return values: Always return
  the offset.
- Make more elements filterable
- Make the naming of elements more consistent (not finished)
- To see what's missing have a look at the TODO section at the beginning
  of the file and search for XXX in the code.

The not so good:
- Only tested with a single sample trace. No extended/expanded data in
  that trace.
- This patch hopefully doesn't break sflow4 support, but I didn't have
  any traces to test with, so please test.
- The names of many filters have changed to make things more consistent.

svn path=/trunk/; revision=26891
2008-12-01 10:03:33 +00:00