summaryrefslogtreecommitdiff
path: root/epan/proto.h
AgeCommit message (Collapse)AuthorFilesLines
2017-06-26Parse enterprise-numbers at run timeJoão Valverde1-0/+2
"enterprise-numbers" is converted to tab-separated values and renamed "enterprises". Unused fields are stripped. PENs are stored in a hash table loaded at run-time. User "enterprises" file is loaded from the personal config dir. Misc make-sminmpec.pl improvements and fixes. Note: names of type "Entity (formerly ...)" have the formerly part commented out for a cleaner output. Change-Id: I60c533afbe3e399077fbf432088064471ad3e1e2 Reviewed-on: https://code.wireshark.org/review/22246 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: João Valverde <j@v6e.pt>
2017-04-28Add proto_tree_add_item_ret_boolean().Guy Harris1-1/+8
It does what it says on the label. You get back TRUE or FALSE in a gboolean. While we're at it, remove a copied-and-pasted comment that doesn't apply, and update another comment. Change-Id: I117391d2ffe44124a614a7f64dad1b389c1ebc6a Reviewed-on: https://code.wireshark.org/review/21394 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-26Add proto_tree_add_item_ret_uint64Michael Mann1-0/+4
Just like proto_tree_add_item_ret_uint, but with 64-bit support Change-Id: Ie0cbfda9e63bf21e85df2d674e391a6c0abe92f7 Reviewed-on: https://code.wireshark.org/review/21355 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-18Rename BASE_VALS_NO_UNKNOWN to BASE_SPECIAL_VALS.Guy Harris1-1/+1
It makes it a bit clearer what its purpose is - to allow a value_string to be used for numeric rather than enumerated fields, giving certain values of the field a special meaning. Change the explanation in the documentation to match as well. Change-Id: Id07b22eee996b79ea5f3473928d29adcabe09bf3 Reviewed-on: https://code.wireshark.org/review/21209 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-12No need to include <epan/packet.h> in <epan/ftypes/ftypes-int.h>.Guy Harris1-1/+1
It's sufficient to include <epan/proto.h>... ...as long as <epan/proto.h> includes <epan/tfs.h>, just as it includes <epan/value_string.h>. And, since it's already including <epan/value_string.h>, it doesn't need to have a definition of struct _value_string as an incomplete type, given that <epan/value_string.h> gives a definition of it as a complete type. Change-Id: Ic296bc0b0d68277ba7e0569412b780fd847ecca2 Reviewed-on: https://code.wireshark.org/review/21033 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-10Add support for BASE_VALS_NO_UNKNOWNAlexis La Goutte1-0/+1
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single (maybe 2) numerical value(s). If a field has the numerical value that doesn't match anything in the value_string, just the number is supplied for the field (no "Unknown") Dissectors that had this use case have been converted in the patch. Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9 Reviewed-on: https://code.wireshark.org/review/20736 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-08Clean up handling of enabled/disabled protocols/heuristic dissectors.Guy Harris1-4/+5
Add a "report a warning message" routine to the "report_err" code in libwsutil, and rename files and routines appropriately, as they don't only handle errors any more. Have a routine read_enabled_and_disabled_protos() that reads all the files that enable or disable protocols or heuristic dissectors, enables and disables them based on the contents of those files, and reports errors itself (as warnings) using the new "report a warning message" routine. Fix that error reporting to report separately on the disabled protocols, enabled protocols, and heuristic dissectors files. Have a routine to set up the enabled and disabled protocols and heuristic dissectors from the command-line arguments, so it's done the same way in all programs. If we try to enable or disable an unknown heuristic dissector via a command-line argument, report an error. Update a bunch of comments. Update the name of disabled_protos_cleanup(), as it cleans up information for disabled *and* enabled protocols and for heuristic dissectors. Support the command-line flags to enable and disable protocols and heuristic dissectors in tfshark. Change-Id: I9b8bd29947cccdf6dc34a0540b5509ef941391df Reviewed-on: https://code.wireshark.org/review/20966 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-01FT_CHAR is an integral type, so list it in the diagnostic message.Guy Harris1-1/+1
Change-Id: I8d095a2424033bee5b3569c906327ac15de33890 Reviewed-on: https://code.wireshark.org/review/20823 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-31Fix typo.Guy Harris1-1/+1
Change-Id: I55137590280024dd383c0d005a2d9d79f9b7d38a Reviewed-on: https://code.wireshark.org/review/20804 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-29Add ENC_TIME_MSEC_NTP and use it in packet-gtpv2.cAndersBroman1-0/+4
While at it fix expert info a typo and an calculation. Change-Id: I071a36edb7eed5f58708b98aebcb24bc6c34f2a8 Reviewed-on: https://code.wireshark.org/review/20766 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-28Fix up time encodings.Guy Harris1-20/+35
Add some new encodings for absolute time stamps, and use them as appropriate; this fixes some cases where the time stamps in question were being dissected incorrectly. For the encodings with seconds and 1/2^32s of a second, don't arbitrarily give only microsecond resolution; 2^32 is greater than 1 million, and, in fact, at least some NTP RFCs explicitly talk about time resolution greater than 1 microsecond. Update references in the RELOAD dissector to reflect the documents in question having been updated and published as RFCs. Change-Id: Icbe0b696d65eb622978eb71e99ddf699b84e4fca Reviewed-on: https://code.wireshark.org/review/20759 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-26Don't speak of RTPS time_t as an "NTP" time.Guy Harris1-9/+12
It's some weird hybrid of UN*X time and NTP time stamps, using UN*X's epoch and NTP's seconds/fractions split. I'm sure they had their reasons for not using something like struct timespec or regular NTP time, and instead inventing something that's halfway in between them. Change-Id: I1f39ec1368af52b82adfa2a22677dfa6e9341309 Reviewed-on: https://code.wireshark.org/review/20711 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-26Add ENC_TIME_TIMEVAL and use it for gsmtap.Guy Harris1-5/+33
From a look at the libosmocom code, time stamps in GSMTAP_TYPE_OSMOCORE_LOG messages appear to be UN*X struct timevals with a 4-byte tv_sec, not anything NTP-like with the fraction-of-a-second part in units of 1/2^32s of a second. Add ENC_TIME_TIMEVAL to handle time stamps like that, and use it rather than ENC_TIME_NTP_BASE_ZERO. Change-Id: Ia1511527ee292fb7725b2a64c0af16d23ff10a6d Reviewed-on: https://code.wireshark.org/review/20710 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-03-17[proto.h] Make proto_tree_add_split_bits_item_ret_val() usable fromAndersBroman1-3/+3
plugins. Change-Id: Ibcfdb9a3a33b0f12bf1f4752654bde279776768a Reviewed-on: https://code.wireshark.org/review/20579 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-15Lua: Merge sep and str tables into baseStig Bjørlykke1-1/+0
Also add documentation strings to the base values. Change-Id: I00ac8f154fdd0382106ed27d740e16956520be97 Reviewed-on: https://code.wireshark.org/review/20554 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-12-31Add interface for "pinos" (Protocols in name only)Michael Mann1-1/+23
This is for dissectors that need distinguishing names either for registering multiple dissection functions in a single dissector table or for "internal" dissectors whose just need a name associated with the dissection function. Features like enable/disable are handled by the "parent" protocol. This avoids clutter in the "official" protocol list. Change-Id: I69e7d27d332ae85286f254e95e8d79920da7a9e2 Reviewed-on: https://code.wireshark.org/review/19464 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-30Add BASE_NO_DISPLAY_VALUE to allow field value to not be shown.Michael Mann1-5/+7
There are times when byte arrays don't want to show their value in the packet tree or there is a field that is the "header" of a subtree where showing the field value distracts from the tree display. For these cases, BASE_NO_DISPLAY_VALUE can be used to not display the value. Change-Id: I8c9f1f57cd2e663dbee07e2289e7f5e1f22d1e32 Reviewed-on: https://code.wireshark.org/review/19479 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-24Add enabled protocol list for dissectors who are disabled by defaultMichael Mann1-0/+4
We save a list of dissectors that are disabled through the Enabled Protocols dialog. This is because we assume dissectors are enabled by default. For dissectors that are disabled by default, we have no way to keep them enabled through the Enabled Protocols dialog. A dissector that defaults to being disabled has to be reset to enabled each time Wireshark is launched. Add a list similar to the disabled list for enabling dissectors that are disabled by default. This mostly applies to post-dissectors. Change-Id: I31a8d97a9fdbc472fe2a8666384e0f8786bb8e9f Reviewed-on: https://code.wireshark.org/review/19405 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-20Lua: Add string types and byte seperators support.Stig Bjørlykke1-2/+3
Add handling of STR_ASCII and STR_UNICODE as base types for string and stringz. Add handling of SEP_DOT, SEP_DASH, SEP_COLON and SEP_SPACE for bytes and uint_bytes. Add SEP_NONE for completeness. Change-Id: Ida46c215fee7ec7132ec91ab5dd6cb3de4628920 Reviewed-on: https://code.wireshark.org/review/19337 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-12-19Lua: Include all BASE_PT_* to base table.Stig Bjørlykke1-0/+4
Also added a note above field_display_e enum to indicate that this values are parsed in make-init-lua.pl to build init.lua. Change-Id: Ibd125684f9a68e1b8116fae0ccbc72147825d75d Reviewed-on: https://code.wireshark.org/review/19336 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-12-13Adjust proto_tree_add_[float|double]_format_value calls to use unit stringMichael Mann1-0/+3
Several calls to proto_tree_add_[float|double]_xxx could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Id0da7b579403898d20c2667d6c4abcd59d5a48d4 Reviewed-on: https://code.wireshark.org/review/19241 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-13Add support for adding unit names to hf_ fields.Michael Mann1-0/+1
This was inspired by the https://www.wireshark.org/lists/wireshark-dev/201505/msg00029.html thread. Used TCP and NTP dissectors as the guinea pig with sample use. Documentation updates includes some unrelated cleanup just because it was noticed. Change-Id: I59b26e1ca3b95e3473e4757f1759d7ad82976965 Reviewed-on: https://code.wireshark.org/review/19211 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-12-12Fix handling of EBCDIC string fields.Guy Harris1-0/+1
Have a routine that takes a 256-element translation table and uses it to map various flavors of EBCDIC to Unicode. Have separate translation tables for "common" EBCDIC (everything that's the same in all EBCDIC code pages that include the original EBCDIC characters) and EBCDIC code page 037. Add ENC_EBCDIC_CP037 for code page 037. Change-Id: Ia882b3c0abef9e30eb54cd47396e6fa0d6342044 Reviewed-on: https://code.wireshark.org/review/19212 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-10-24Parenthesize HFILL_INIT macro properlyJoão Valverde1-5/+5
Change-Id: Ib1c347a290f57a1173c876de6e3c6cb6f5a1ca19 Reviewed-on: https://code.wireshark.org/review/18436 Reviewed-by: João Valverde <j@v6e.pt>
2016-10-22Add T.61 character set supportPascal Quantin1-0/+1
Bug: 13032 Change-Id: I6bf2cc2c43a6262d899a304df6576d9831115966 Reviewed-on: https://code.wireshark.org/review/18350 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-28proto_tree_add_item_ret_(u)int/proto_tree_add_bitmask_with_flags_ret_uint64: ↵Pascal Quantin1-3/+3
return real value Apply mask and bit shift on the returned value. Change-Id: I00aebc854756f01a25199a259d6d5252abea4349 Reviewed-on: https://code.wireshark.org/review/17958 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-27[proto.c] Add proto_find_first_finfo() to find first occurance of a field.AndersBroman1-0/+8
Change-Id: I11f50d7b00851880f77067260e2496175d227e76 Reviewed-on: https://code.wireshark.org/review/17937 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-13Fix indentation.Guy Harris1-1/+1
Change-Id: I2b2d1cd584eb1ec56ec5cdcd33fb789843c8192c Reviewed-on: https://code.wireshark.org/review/17680 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-01uat: clarify documentationPeter Wu1-1/+1
No functional change, fixes typos, adds some meaningful function parameters and tries to clarify the memory management concerns. Also fix a -Wdocumentation issue in epan/proto.h Change-Id: I59d1fcd2ce96178e0a64a0709409a9a7a447c7c6 Reviewed-on: https://code.wireshark.org/review/17431 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-05Add PI_DEPRECATED expert info groupJoão Valverde1-0/+2
Change-Id: Ibc43b1976d5827e8c40252a5200852fbcd00b70c Reviewed-on: https://code.wireshark.org/review/16763 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: João Valverde <j@v6e.pt>
2016-07-21Add proto_tree_add_checksum.Michael Mann1-0/+43
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-23Fix "disable this protocol by default".Guy Harris1-0/+4
Allow a dissector to mark its protocol as "disabled by default", which means that the "enable all protocols" routine won't enable it. This is necessary in order to allow the disabling of protocols not to be unintentionally changed due to profile changes; see bug 9826. Change-Id: I3947f794c21350b70a8de06899cfc7715b77f90f Ping-Bug: 9826 Reviewed-on: https://code.wireshark.org/review/16109 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-06-15Change how dissectors do late-field-registration to avoid a double-registrationJeff Morriss1-1/+2
assertion. If a dissector forces registration of fields during dissection it needs to do so in a way that clears the prefix registration. Otherwise epan will call the registration routine a 2nd time (which will cause us to assert out) if a user types a display filter (with the dissector's prefix) that doesn't exist. Update the proto_register_prefix() comments to reflect this. Change-Id: I3ce29243395fb55192bb5dfd950baa88410ac136 Reviewed-on: https://code.wireshark.org/review/15881 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-14proto(.h): fix '@return' command used in a comment that is attached to a ↵Alexis La Goutte1-2/+1
function returning void [-Wdocumentation] Change-Id: Ie0e502adcc8eb00f65ffa6c018d5b9d79655ddb7 Reviewed-on: https://code.wireshark.org/review/15907 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-06-13Add proto_tree_add_bitmask_list_value.Michael Mann1-0/+18
Ran across enough situations that proto_tree_add_bitmask_list couldn't solve that it seemed necessary. Change-Id: I6a540ac6efca76cae7c4571a84bb400538652784 Reviewed-on: https://code.wireshark.org/review/15880 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-05Clean up white space.Guy Harris1-17/+17
Change-Id: I9b1310a153f6a9831a9040c17a5fcc2270a9dc17 Reviewed-on: https://code.wireshark.org/review/15740 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-31Remove proto_item_append_string.Michael Mann1-20/+0
It requires some "extra work" to get it to work properly. Despite documenting it, some previous use cases didn't do the extra work. Let's just see how we get by without it. Change-Id: I31dba1d5038d793085f6c9e4b4a6eda574e86872 Reviewed-on: https://code.wireshark.org/review/15610 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-26Update the comments/warnings about using proto_tree_append_string().Jeff Morriss1-5/+5
packet-wsp.c hasn't used proto_tree_append_string() since Ic5467289aae7d54e78c1fd65f93358387d6139aa. Use packet-frame as the example instead. Change-Id: I69fb10679ec1685a61aac182414e596b345153fd Reviewed-on: https://code.wireshark.org/review/15563 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-10rawshark: Get "field string values" from existing functionality.Michael Mann1-0/+4
rawshark shouldn't be converting FT_ and BASE_ values into strings on its own, there's a function for that. Change-Id: Ib4ce1651ee130a03644b5de3ab471333444e19a9 Reviewed-on: https://code.wireshark.org/review/15341 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-08Handle the encoding when displaying the string table.Guy Harris1-8/+43
Don't just treate the strings as piles of ASCII characters. Add a proto_tree_add_item_ret_string_and_length() routine to help do this. Clean up some of the documentation of the proto_tree_add_item_ret routines while we're at it. Change-Id: Ib4c52bd8a8331eac97312583326f5be9175889d9 Reviewed-on: https://code.wireshark.org/review/15291 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-08Use a single WS_NORETURN macroPeter Wu1-1/+1
Having to define two macros for marking a function as never returning seems a bit redundant. Merge the MSVC and GCC-like attributes into a single WS_NORETURN. Tested with Clang 3.7.1, GCC 4.4.7 and even GCC 4.1.2 using this small program (-Wall -Wextra, the first two generate warnings for uninitialized variables, the last one compiles without warnings): #include <stdlib.h> __attribute__((noreturn)) void foo() { exit(1); } __attribute__((noreturn)) void bar(); void bar() { exit(1); } int main() { int j, i; if (i) { bar(); return j; } foo(); return j; } Change-Id: I7d19c15e61b8f8fa4936864407199c4109f8cc82 Reviewed-on: https://code.wireshark.org/review/14822 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-03-31Ensure our fields are registered before starting dissection--even when !tree.Jeff Morriss1-0/+3
(The check to ensure the delayed field registration had been done was still wrapped inside an if(tree) but a bunch of proto_add_*()'s had been pulled out from under if(tree)'s thus causing some hf's to be used before registered.) Also simplify the code to ensure the fields are registered since we're doing it potentially many times per frame: do an integer comparison rather than looking up an hf by name. Add a note to the docs for proto_register_prefix() to make it clear that the initializer routine may not be called before the dissector is asked to dissect something. Change-Id: I5dc1154638a290c3a94149184d56570c3abb836a Reviewed-on: https://code.wireshark.org/review/14711 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-03Adds calculation of preamble length and frame duration.Simon Barber1-0/+2
Change-Id: Ie7077b675a242a60ee859098a504707cc61345db Reviewed-on: https://code.wireshark.org/review/13090 Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-02-02Add proto_tree_add_item_ret_string() routine.Guy Harris1-3/+34
It adds string-type fields to the protocol tree and returns the value of the string. Add the new bitmask-adding routines to the Debian symbol list while we're at it. Change-Id: Idaeec44c9cd373588cadce85010f3eaf1f3febb5 Reviewed-on: https://code.wireshark.org/review/13657 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-02-01Add heuristic dissectors for the variable part of COTP CR and CC PDUs.Guy Harris1-13/+75
Add tables for heuristic dissectors, and add dissectors for the stuff Microsoft puts there for RDP; they're violating the COTP spec, but I guess they're stuck because they're using TP0, which doesn't support user data. While we're at it, add variants of proto_tree_add_bitmask() and proto_tree_add_bitmask_flags() that return the bitmask, for use by callers. A side-effect of the change is that the proto_tree_add_bitmask routines no longer treat the encoding as a Boolean, so we have to pass ENC_LITTLE_ENDIAN or ENC_BIG_ENDIAN, not just some non-zero or zero value. Do so. Rename ositp_decode_CC() to ositp_decode_CR_CC(), to note that it decodes both CR and CC PDUs. Bug: 2626 Change-Id: If5fa2a6dfecd9eb99c1cb8104f2ebceccf1e57c2 Reviewed-on: https://code.wireshark.org/review/13648 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24Set width of hex output according to bitmaskKevin Bracey1-6/+0
Output from BASE_HEX et al has always been zero-padded to according to the field type - 8 digits for FT_UINT32, etc. When the field has a bitmask, this is definitely not appropriate - the field type is used to indicate the size of the bitfield container, and tells us nothing about the size of this field. Instead, determine the actual size of the field by inspecting the bitmask, and output the corresponding number of hex digits. Change-Id: I10ec4e93e1e40e8b1354d5368cc8945cf671a617 Reviewed-on: https://code.wireshark.org/review/13225 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-12proto.h comment spelling fix: sentinal->sentinelKevin Bracey1-1/+1
Change-Id: I72f09eda89adc231a6c97d3abde9ca6cebe4b24d Reviewed-on: https://code.wireshark.org/review/13234 Reviewed-by: João Valverde <j@v6e.pt>
2016-01-09Add routines to add an item and return the item's real length.Guy Harris1-1/+25
proto_item_get_len() is *not* guaranteed to return a correct value. Even if there's a non-null tree item, it might be pointing to a "faked" item; it really shouldn't be used. So add proto_tree_add_item_ret_length() and proto_tree_add_item_new_ret_length(), which calculate the real length themselves and return it through a pointer. Fix as many places as we straightforwardly can to use them rather than to use proto_item_get_len(). (There's a Lua API for proto_item_get_len(), so we keep it around, but we should add Lua APIs for the new routines, and deprecate the old API.) Fix ptvcursor_add() to do the same thing that proto_tree_add_item_ret_length() and proto_tree_add_item_new_ret_length() do. Split the TRY_TO_FAKE_THIS_ITEM macros into a macro to check for the tree being null and to try to fake the item. We don't always use the former macro, as we might need to do more than just return NULL if the incoming tree is null (for example, calculating the item's real length and using it...). new_field_info() never returns NULL; remove checks for it. The check for a null tree is done before the calls to new_field_info(). Change-Id: I002a218d1f810c73e0de837e0ac6ebcde21bacec Reviewed-on: https://code.wireshark.org/review/13139 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-04Don't walk the entire protocol tree to extract the value of one field.Guy Harris1-1/+1
Instead, prime the epan_dissect_t's tree to look for rtp.ssrc, and extract that value with proto_get_finfo_ptr_array(). Also, have the filter used to check whether the packet is a candidate for RTP analysis to check for RTPv2 (and add a check for IPv4 or IPv6 back to the Qt version), and get rid of an unnecessary extra level of indirection for that string. In the Qt version, if findStreams() set the error string, don't overwrite it with a "No streams found." indication, and fix error handling for the "filter didn't compile" case. Change-Id: I09d0ea37ccd4806d99e3b6394f2a8a376e974705 Reviewed-on: https://code.wireshark.org/review/13045 Reviewed-by: Guy Harris <guy@alum.mit.edu>