Commit Graph

36 Commits

Author SHA1 Message Date
Gerald Combs 3f765b3ef9 Add a CF_FUNC macro for casting BASE_CUSTOM functions.
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid
the following warning:

    warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic]

We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be
more consistent with the other macros in proto.h. Update each instance
of BASE_CUSTOM to use CF_FUNC.

Adjust a dummy variable name generated by asn2wrs.py that was triggering
an invalid error in checkhf.pl.

Fix an encoding arguement in packet-elasticsearch.c found by
fix-encoding-args.pl.

Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22
Reviewed-on: https://code.wireshark.org/review/7150
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-18 00:05:38 +00:00
Bill Meier 94d7e8d838 Use ENC_LITTLE_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_LITTLE_ENDIAN).

Change-Id: Ica72a68ac560f2920d61e0769de83130557c46fd
Reviewed-on: https://code.wireshark.org/review/5752
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 21:58:59 +00:00
Alexis La Goutte 772a7ba45c Fix warning: no previous prototype for ... [-Wmissing-prototypes]
Change-Id: I6790a6c990bd531362171742b938c9f26cb2e1d5
Reviewed-on: https://code.wireshark.org/review/3636
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-16 15:59:29 +00:00
Michael Mann 3635d7bed7 Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the neighborhood.

Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f
Reviewed-on: https://code.wireshark.org/review/3537
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-10 21:39:20 +00:00
Michael Mann e8a8d62dc3 proto_tree_add_subtree[_format]
Change-Id: I7e016f10fcfdc0523bf2fe8c11295c0334f7c332
Reviewed-on: https://code.wireshark.org/review/2694
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-29 14:52:33 +00:00
Michael Mann a279fa7705 Have ipmi "dissectors" register through the build process instead of "manually"
Change-Id: I6d6d32e8a1bc21dee9bf52b502e1a02e9511ecb2
Reviewed-on: https://code.wireshark.org/review/2253
Reviewed-by: Dmitry Bazhenov <dima_b@pigeonpoint.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 20:38:54 +00:00
Stig Bjørlykke 1f47e2729f Use tfs_f1_3_override_state to avoid unused variable error
Change-Id: I211f1bd2dcf61f27034e1e42e00ab3c1dc0c4c89
Reviewed-on: https://code.wireshark.org/review/2236
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-16 06:49:28 +00:00
Joerg Mayer 237fa1cac2 Fix warnings turning errors (also fixes buildbot)
These fixes are superficial. Michael: Please review and either remove
the unneeded stuff or put in the correct use.

Change-Id: I15e0f8c746af5bd76f57965ddcbf06d9e4ac80ca
Reviewed-on: https://code.wireshark.org/review/2223
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-15 13:59:07 +00:00
Michael Mann dc4d3706a8 packet-ipmi-se.c : proto_tree_add_text -> something filterable.
Also did some minor cleanup noticed while doing the filter conversion

Change-Id: Iea61b395c0eeb6fbcaac4c09964da2cb3cdccda5
Reviewed-on: https://code.wireshark.org/review/2184
Reviewed-by: Dmitry Bazhenov <dima_b@pigeonpoint.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-15 12:18:54 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
U-beauty\bdn 977a811217 IPMI trace dissector (without PCAP-dependent part).
Added KCS and TMode protocol dissectors.
Request/response logic has been revised.
Saved request data logic has been revised.
Added Get Message command response dissector.
Added missing PICMG command dissectors.
Added new PICMG command dissectors.
Added new PPS OEM command entries.
Added VITA 46.11 command dissectors.

From: Bill Meier:
- refs to value_strings/range_strings in hf[] entries, by convention, should use VALS/RVALS macros;
- refs to true_false_strings should use TFS(&...) macro.
  also: true_false_string definitions should not be defined as arrays.
- remove some unneeded #includes (packet-ipmi.c).
- Do some re-indentation.
- Add editor-modelines as needed.

bug: 10004
Change-Id: Ib269b35784c0b70892d1e0111bcfb483ea64092c
Reviewed-on: https://code.wireshark.org/review/1185
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-06 06:43:45 +00:00
Bill Meier fae9726067 packet-ipmi...: Various cleanups:
- refs to value_strings in hf[] entries, by convention, should use VALS macro;
- add editor-modelines as needed; Fix some indentation.

Change-Id: Iaa0196bab6de066ed68a2755b69b07fadd33e498
Reviewed-on: https://code.wireshark.org/review/1927
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-06-03 01:35:40 +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 b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Michael Mann b542526248 Remove global packet_info* current_pinfo
svn path=/trunk/; revision=49143
2013-05-03 02:43: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
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
Bill Meier d12d5a606c AFAICT sys/types.h & netinet/in.h #includes are not needed for these files.
(Let's see if any of the buildbots give any errors).
Also: remove trailing whitespace on lines.

svn path=/trunk/; revision=42429
2012-05-04 21:29:00 +00:00
Chris Maynard c4f4087a9a Use ENC_LITTLE_ENDIAN instead of TRUE as endian argument to proto_tree_add_bitmask_text().
svn path=/trunk/; revision=40271
2011-12-22 02:17:11 +00:00
Bill Meier 97e1e5bc85 Fix a few proto_tree_add_item() encoding args.
svn path=/trunk/; revision=39514
2011-10-23 17:11:39 +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 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 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
Bill Meier 26c721b7c9 Fix gcc 4.6 "set but not used [-Wunused-but-set-variable]" warnings;
Also: whitespace cleanup.

svn path=/trunk/; revision=37718
2011-06-19 19:13:26 +00:00
Bill Meier 33fe1d803a Use correct subtree in several 'proto_tree_add_text(...)' statements: Fixes Coverity 938 [UNUSED].
svn path=/trunk/; revision=37360
2011-05-23 14:17:30 +00:00
Stig Bjørlykke 0437f102c3 From Kovarththanan Rajaratnam:
More FT_XXX cleanup.

svn path=/trunk/; revision=28971
2009-07-07 09:02:59 +00:00
Jaap Keuter 8eee6e4cd8 Fix for bug 3559:
Don't let the index run over the size of the array.

svn path=/trunk/; revision=28801
2009-06-22 05:57:44 +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 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 a8f30cbca1 Fix some typos and spelling (mostly in text strings)
svn path=/trunk/; revision=27037
2008-12-17 17:23:37 +00:00
Jörg Mayer 4149a23cc5 Trivial warning fixes
svn path=/trunk/; revision=26899
2008-12-02 08:11:23 +00:00
Stig Bjørlykke 58e2d7a0d6 Fix some "format not a string literal and no format arguments" warnings.
svn path=/trunk/; revision=26649
2008-10-31 15:47:47 +00:00
Anders Broman 46a26582ec From Alexey Neyman :
(Note just checking in the new files not yet added to the build process on purpose
the changes to packet-ipmi.c is also not done yet - Anders).

Generic changes:

- IPMI session wrapper dissection has been separated from the dissection of
  IPMI itself. This will allow for possible dissection of captures directly
  from IPMB (as the IPMB messages lack the IPMI session wrapper).
IPMI changes:

- Implemented request-response matching for IPMI sessions. This makes easy
  serves two purposes: first, it allows for easy location of response to a
  certain request and vice versa. Second, it allows for dissection of
  responses where response format depends on the request data.

- IPMI dissector can now dissect much broader set of commands.

- Command-specific completion codes are now handled.

- The dissector is able to parse IPMI commands embedded into other IPMI
  commands (for now, only Send Message; Get Message and Forward Message
  can be implemented later). Such embedded commands also matched with
  responses to them.

svn path=/trunk/; revision=25948
2008-08-06 20:51:02 +00:00