aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-osi.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-44/+25
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-2/+2
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-07-21Add proto_tree_add_checksum.Michael Mann1-48/+23
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-03-20Create call_data_dissector() to call data dissector.Michael Mann1-5/+4
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-4/+5
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-3/+3
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-27Remove manual setting of pinfo->current_proto.Michael Mann1-2/+0
Calling a protocol dissection function will properly set/restore pinfo->current_proto, so there's no need to duplicate it. Change-Id: Ic2ec0b35fa4d46a98f3410bf238056425076e4a9 Reviewed-on: https://code.wireshark.org/review/12205 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-10/+13
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-2/+2
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-23Remove more deprecated tvb_length callsEvan Huus1-2/+2
Change-Id: Ie137e6f4e20fe26b1a4d9510e267896219c1c631 Reviewed-on: https://code.wireshark.org/review/9075 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+0
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-16Make sure the NLPID appears in the protocol tree.Guy Harris1-2/+23
For protocols for which the NLPID is not considered part of the PDU, put the NLPID into the protocol tree ourselves. Bug: 10706 Change-Id: I2676d1934dd468ec755a6f94d95a23f025ba0f25 Reviewed-on: https://code.wireshark.org/review/5358 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-16Fix a comment to reflect reality.Guy Harris1-1/+1
Change-Id: I812b0246368266c76f7fe9ef355619603c5d37b0 Reviewed-on: https://code.wireshark.org/review/5357 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-09Create a subdissector table for juniper payload protocols.Michael Mann1-1/+21
Change-Id: I60fd9c6c486b9b3b90e32fb9ccce3973569cc2ee Reviewed-on: https://code.wireshark.org/review/5204 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: Evan Huus <eapache@gmail.com>
2014-09-29Add editor modelines; fix indentation as needed.Bill Meier1-0/+12
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263 Reviewed-on: https://code.wireshark.org/review/4363 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-17Remove unnecessary includesMichael Mann1-2/+0
Change-Id: Ib1a90a07b2d467a81927c53917e05a1af6ba4ee6 Reviewed-on: https://code.wireshark.org/review/3666 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-15An NLPID of 0xc0 refers to TRILL.Guy Harris1-0/+1
This will, at least, make it show up as the meaning of a field containing an NLPID; whether it's actually used to say "a TRILL packet follows" is another matter. At least partially addresses bug 10382, and fully addresses it if it's never actually used to say "a TRILL packet follows". Change-Id: Ic9dc8ec432532bde692fad3aa9cc97a3109aa634 Reviewed-on: https://code.wireshark.org/review/3602 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-1/+1
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-2/+2
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-2/+2
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-05Fix some code remove by 296591399f90a9d89be958d91047aa724a77ee6dAlexis La Goutte1-0/+1
(Copyright or info about file...) Change-Id: I90ba8b1c3ec8406b0c3365a69a8555837fc4bbb1 Reviewed-on: https://code.wireshark.org/review/515 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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>
2013-12-23Make (most) fields within packet-osi-options.c filterable.Michael Mann1-1/+1
Not sure how to handle the filter names. Even though OSI isn't a "protocol", there's enough commonality to justify a "dissector". Also not sure if packet-osi-options.c should just be merged with packet-osi.c to make the relationship more obvious (both files aren't that big) svn path=/trunk/; revision=54373
2013-12-14Fix warningsJakub Zawadzki1-0/+3
svn path=/trunk/; revision=54089
2013-09-12More dissector table name related changes (a continuation of r51904).Chris Maynard1-4/+4
svn path=/trunk/; revision=51982
2013-09-11Change the name of the Cisco HDLC dissector table from chdlctype to ↵Chris Maynard1-51/+51
chdlc.protocol and change the UI name to match. It is by far much more common to name the tables after the field than to pick another name. svn path=/trunk/; revision=51958
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-3/+2
svn path=/trunk/; revision=49921
2012-11-17Handle the pseudo-trailer for the ATN extended checksums by passing inGuy Harris1-81/+147
the source and destination address lengths and data, and adding them in, rather than by copying those fields to a fixed-size static buffer - that gets rid of a global variable (global variables considered harmful), and also means that we don't try to copy 24 bytes of length+address from packets that don't *have* 24 bytes of length+address (which caused exceptions to be thrown on some OSI captures I have). Construct some LI #defines out of other LI #defines, to make it a bit clearer why they have the values they do. Support the "additional information related to the clearing of the connection" variable part parameter of the COTP DR packet (which just means giving it a name, as its contents are user-defined - some HP-UX OSI stack appears to just stick in a string saying that it's said stack). Make the code that decodes the variable part of a DR packet look like the code that decodes the variable part of most other packets. For COTP CR packets, determine the class up front by checking whether the length is > 2. (At some point we might want to associate a class indication with the COTP connection, if we see the connection setup, and, if we have that indication, use it in preference to the heuristics.) Make the code to handle various length indicator values in the ATN case more like the code in the non-ATN case. Dissect the variable part of COTP ER packets. Fix tpyos (TDPU->TPDU, tdpu->tpdu) and typpoes (accross->across). Clean up white space. svn path=/trunk/; revision=46060
2012-11-16From guettler:Anders Broman1-0/+150
ATN decoding fixes for CLNP and COTP dissectors (configurable by option). ATN decoding fixes for CLNP and COTP dissectors (configurable by option). ATN specifics may be selected/deseleted per CLNP/COTP dissector configuration (as requested). CLNP dissector 1) configurable decoding of "ATN security label" COTP dissector 1) configurable decoding of ATN TPDU's 2) checksum calculation (none,OSI,ATN 16-bit, ATN 32-bit) 3) VP decoding for DR TPDU's https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5622 svn path=/trunk/; revision=46043
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-05-15Remove unneeded includes (ctype.h, stdio.h);Bill Meier1-43/+43
In one case, define our own size for a string buffer (instead of using a magic constant 'BUFSIZ'); In a few cases: do some whitespace, indentation & reformatting cleanup. svn path=/trunk/; revision=42634
2012-02-02From guettler:Anders Broman1-0/+4
Apply part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5622 to see OSI over IP. svn path=/trunk/; revision=40818
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-13/+13
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-04-06#include <string.h> not needed.Bill Meier1-1/+0
svn path=/trunk/; revision=32410
2010-04-03Remove unneeded #include <stdio.h>Bill Meier1-1/+0
svn path=/trunk/; revision=32367
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29446
2009-08-09Don't guard col_set_str (COL_INFO/COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-9/+3
svn path=/trunk/; revision=29345
2008-09-15Fix some indentation; 'static int' --> 'static guint'Bill Meier1-63/+63
svn path=/trunk/; revision=26198
2008-09-15proto_reg-handoff: Use dissector_add_handle instead of registering to port 0;Bill Meier1-9/+16
Also: minor cleanup related to proto_reg_handoff svn path=/trunk/; revision=26197
2006-09-12Set default port to zero.Anders Broman1-2/+2
svn path=/trunk/; revision=19220
2006-09-08Move the code to handle ISO protocols over TCP/TPKT to packet-osi.c where it ↵Anders Broman1-21/+63
belongs. svn path=/trunk/; revision=19180
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18196
2005-09-17Move a pile of protocol-related headers from the top-level sourceGuy Harris1-5/+5
directory to the epan directory. Some of them should perhaps ultimately be moved to epan/dissectors, if they pertain only to stuff exported by a particular dissector. Fix Gerald's e-mail address in files we're moving. svn path=/trunk/; revision=15844
2005-01-20From Hannes Gredler: support for Juniper's DLT_JUNIPER_ATM{1,2} values.Guy Harris1-11/+17
svn path=/trunk/; revision=13130
2004-07-18Move dissectors to epan/dissectors directory.Gilbert Ramirez1-0/+305
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. svn path=/trunk/; revision=11410