Commit Graph

83 Commits

Author SHA1 Message Date
Anders Broman 5dff85e84b Fix duplicated filter names. 2020-12-15 14:43:43 +00:00
Guy Harris e1d9a226a2 Fix the type of arrays of pointers to hf_ values for bitfield routines.
The static arrays are supposed to be arrays of const pointers to int,
not arrays of non-const pointers to const int.

Fixing that means some bugs (scribbling on what's *supposed* to be a
const array) will be caught (see packet-ieee80211-radiotap.c for
examples, the first of which inspired this change and the second of
which was discovered while testing compiles with this change), and
removes the need for some annoying casts.

Also make some of those arrays static while we're at it.

Update documentation and dissector-generator tools.

Change-Id: I789da5fc60aadc15797cefecfd9a9fbe9a130ccc
Reviewed-on: https://code.wireshark.org/review/37517
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-19 11:32:26 +00:00
Andre Luyer dbfb204f48 ber: display x509af.utcTime year in 4 digits
Because:
- the 2-digit year can only be in the range 1950..2049 according to
https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1
- to avoid confusion, interpreting the year/month/day in a different order may
still represent a valid date.
- now both utcTime and GeneralizedTime are displayed in exactly the same way.
- some tools, like Perl, apply a different date range when converting 2-digit years.

In packet-ber.c two parameters are added to the function dissect_ber_UTCTime:
datestrptr: if not NULL return datetime string instead of adding to tree
or NULL when packet is malformed
tvblen: if not NULL return consumed packet bytes
Also the memory allocation for outstr is now done using the recommended method
as described in the README.developer document.

The calling function in x509af/x509sat uses this to prepend the century.
Added generated files.

Change-Id: I714c2e8e7f899211caaa1f4136ca0d27cb1aba4a
Reviewed-on: https://code.wireshark.org/review/35414
Petri-Dish: Pascal Quantin <pascal@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-01-11 18:36:35 +00:00
Anders Broman 7edadf9ce3 asn2wrs: Improve filtername of named bits.
Change-Id: Ie22137e95c8752a0783e3e9ff99b45c0b79b0d4a
Reviewed-on: https://code.wireshark.org/review/32714
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 13:26:33 +00:00
Anders Broman c2ac157ac0 ASN.1: Use proto_tree_add_bitmask... () for named bits.
Change-Id: Ied0c91ea070ee76603e7ecb29d874e0c1a65892e
Reviewed-on: https://code.wireshark.org/review/32684
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-03 14:53:08 +00:00
Michael Mann 7a4e932571 Add tvb_ascii_isprint API
This allows dissectors to check if a portion of the tvb is an ascii string while hiding the use of tvb_get_ptr.

Change-Id: Iaec7559dcfdefb8a5ae23e099ced45e90e611f8f
Reviewed-on: https://code.wireshark.org/review/30291
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-10-21 07:55:40 +00:00
Pascal Quantin d9d6106044 ASN.1: update auto generated dissectors
Change-Id: Ic73e72b3d2e7590eaed07f6eb30f74f4303e7a65
Reviewed-on: https://code.wireshark.org/review/25880
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-02-18 17:47:40 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Michael Mann 3120536012 Have TPKT support a TCP port range preference instead of having "subdissectors?" register their own.
There are a number of dissectors who are subdissectors of TPKT (and OSITP) that are
not called by TCP dissector directly, yet can possibly register a TCP port "on the
behalf" of TPKT.  Just allow TPKT to support a range of ports to possibly include
these protocols.
Remove the preferences from these dissectors, but add backwards compatibility for
the preferences by hooking into set_prefs and have the preferences just hook into
Decode As functionality directly.

Change-Id: Ic1b4959d39607f2b6b20fa6508da8d87d04cf098
Reviewed-on: https://code.wireshark.org/review/17476
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-16 14:58:24 +00:00
João Valverde 54a520d4a1 Move /asn1 to /epan/dissectors
Change-Id: I1208fe3c2ba428995526f561e8f792b8d871e9a9
Reviewed-on: https://code.wireshark.org/review/14388
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: João Valverde <j@v6e.pt>
2016-03-13 21:30:24 +00:00
João Valverde 8d0455c910 Fix asn2wrs warnings [-Wredundant-decls]
Change-Id: Iced801f17c56618eaaf1bb7c85d68ecdebd633a1
Reviewed-on: https://code.wireshark.org/review/13705
Petri-Dish: João Valverde <j@v6e.pt>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-02-04 09:47:01 +00:00
Guy Harris ab784d60b3 Rename new_dissector_t to dissector_t.
There are no longer any "old" dissectors, so "new_" is redundant.

Change-Id: I5fee51228c2a8562166f5991e1f30c2c697e45c8
Reviewed-on: https://code.wireshark.org/review/13273
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-14 01:03:10 +00:00
AndersBroman c2a1d8feed Replace deprecated API tvb_length -> tvb_reported_length
Change-Id: I9c8bf6beec47afb901e492723b335a28a24f455e
Reviewed-on: https://code.wireshark.org/review/8004
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-09 12:38:04 +00:00
Bill Meier dd859eada4 asn1 generated dissectors: cleanup #include usage
Change-Id: I36b2731d67f9345d2fd0c23800bba7d2be94c387
Reviewed-on: https://code.wireshark.org/review/6008
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-23 05:39:00 +00:00
Bill Meier 93cc6f004f Fix some spelling & grammar.
Change-Id: Iedeaa411caa0823922dd79c27897a2349d4e6907
Reviewed-on: https://code.wireshark.org/review/4054
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-09 19:43:27 +00:00
Michael Mann cd02af56a1 Eliminate (almost all) proto_tree_add_text calls from ASN.1 dissectors.
This mostly involved adding expert info capabilities to many of the dissectors so that they could correctly flag error conditions.

Only remaining proto_tree_add_text calls are in H248.cnf, which has a convoluted way of using hf_ data to make its tree.

Change-Id: I6412150c2ec1977d7fa38f3f0ed416680bdfb141
Reviewed-on: https://code.wireshark.org/review/3500
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-09 01:57:08 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Pascal Quantin d6548f9301 Remove unused const variables errors seen with recent Clang version
Fixes bug 9886

Change-Id: I8624ef1c5874aea5521d21c998510fc29c838936
Reviewed-on: https://code.wireshark.org/review/657
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-15 17:52:16 +00:00
Jeff Morriss 8c608e6e82 Remove $Id$ from the ASN.1 dissectors and regenerate them.
Change-Id: Ie476c6f82f318188b41ed922b92c6fec119ea954
Reviewed-on: https://code.wireshark.org/review/244
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
Tested-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-02-18 03:05:28 +00:00
Anders Broman b693f74b89 - Forward declaration of register functions.
svn path=/trunk/; revision=53877
2013-12-09 06:50:09 +00:00
Jörg Mayer 0017e999f4 Forgot to check in regenerated dissector for dap.
svn path=/trunk/; revision=52111
2013-09-16 21:38:42 +00:00
Pascal Quantin 3307acc35f Regenerate DAP dissector that was changed in r50073 for some reason
svn path=/trunk/; revision=50093
2013-06-20 23:14:38 +00:00
Evan Huus d63bd5330f Back out some of the wmem conversions (r50063 and r50057).
These dissectors allocate ephemeral or seasonal memory in UAT callbacks, which
really makes no sense because UAT callbacks can occur when there is no packet or
file in scope, making this effectively a leak if the user is fiddling with their
UAT and never opens a capture.

Emem let you get away with this, wmem forces an assertion. Back out the changes
so that the UATs are usable until the code can be properly fixed to not use
out-of-scope allocators.

svn path=/trunk/; revision=50073
2013-06-20 06:26:03 +00:00
Pascal Quantin 0ee4d0a00a Postfix FT_NONE fields with "_element" string to reduce number of incompatible filters in ASN.1 dissectors
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2402

svn path=/trunk/; revision=49599
2013-05-27 20:26:49 +00:00
Pascal Quantin a37c044203 Update the ASN.1 based dissectors following the changes done in r48812
svn path=/trunk/; revision=48820
2013-04-11 18:14:53 +00:00
Jakub Zawadzki 7a9d27c33f Regenerate asn.1 dissectors.
svn path=/trunk/; revision=45110
2012-09-24 19:38:46 +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 9d6e413be7 Regenerate all asn.1 dissectors.
svn path=/trunk/; revision=44861
2012-09-10 21:42:36 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Bill Meier 24cf0aad06 Update generated ASN1 *.[hc] files after recent work done by Jeff Morriss;
The only change in each file is in a comment showing the asn2wrs cmd used to build that file.

svn path=/trunk/; revision=39427
2011-10-15 19:27:27 +00:00
Stig Bjørlykke ba2aae0f8e Use ENC_NA as encoding for FT_PROTOCOL, FT_NONE and FT_BYTES.
svn path=/trunk/; revision=38122
2011-07-19 18:48:31 +00:00
Stig Bjørlykke a7c5d642d5 Regenerate ASN.1 dissectors to update the #line directive.
svn path=/trunk/; revision=37118
2011-05-13 08:12:27 +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
Jeff Morriss f2fc5d42fd Make some prefs callback functions static. (These modules don't use proto_reg_handoff_*() as their prefs callback.)
svn path=/trunk/; revision=35138
2010-12-06 22:08:48 +00:00
Graeme Lunt 1b1ee3ca3e Support for X.519 (section 9) Internet Directly Mapped Protocol (IDMP).
IDMP provides a mapping of request-response service elements directly onto the Internet TCP/IP protocol, bypassing the ACSE, Presentation, Session and Transport layers of the OSI model. It also supports the use of TLS services.

The DAP dissector has been updated to use the IDMP protocol.



svn path=/trunk/; revision=33177
2010-06-09 14:17:51 +00:00
Jeff Morriss a0c858efcd Add a little more code to avoid not-very-useful blurbs:
- Change spaces in the name to underscores before comparing it to the blurb.
  - Check if the type simply as T_ prepended to the name.
  - Don't put in a blurb of "NULL".

and regenerate the dissectors.

svn path=/trunk/; revision=32748
2010-05-11 03:53:31 +00:00
Jeff Morriss 8f210cf4e0 Regenerate a few of the ASN.1 dissectors
svn path=/trunk/; revision=32742
2010-05-11 02:13:26 +00:00
Bill Meier 9ade30a7b1 #include <string.h> and/or #include <stdio.h> not needed.
svn path=/trunk/; revision=32417
2010-04-07 16:54:29 +00:00
Bill Meier f8b92f8d0b #include <stdio.h> not needed.
svn path=/trunk/; revision=32405
2010-04-06 17:01:14 +00:00
Anders Broman f25e74c524 Dissect error code.
svn path=/trunk/; revision=32060
2010-03-01 07:27:35 +00:00
Anders Broman ba8d7bd919 Get rid of check_col();
svn path=/trunk/; revision=31544
2010-01-17 12:19:02 +00:00
Stig Bjørlykke 7b9b38018f Update to X.511:08/2005.
svn path=/trunk/; revision=31494
2010-01-11 13:37:36 +00:00
Stig Bjørlykke b9524c35d1 SearchArgumentData filter and EntryInformationSelection attributes are
OPTIONAL as they are defined with a DEFAULT.

svn path=/trunk/; revision=31128
2009-11-30 12:54:47 +00:00
Stig Bjørlykke 6d1dae6f28 Make all proto_* values static.
svn path=/trunk/; revision=30516
2009-10-11 16:24:29 +00:00
Kovarththanan Rajaratnam 00810ff199 * Prefer col_append_str instead of col_append_fstr for constant strings
* Remove check_col guards

svn path=/trunk/; revision=30127
2009-09-24 20:21:23 +00:00
Stig Bjørlykke 9733aadcfe Re-generate asn1 dissectors after hf_register_info cleanup.
svn path=/trunk/; revision=28848
2009-06-26 03:59:01 +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
Stig Bjørlykke c47e788c94 Regenerate all asn2wrs generated dissectors.
svn path=/trunk/; revision=28379
2009-05-16 22:07:03 +00:00
Stig Bjørlykke 1511ef5a88 From Chris Ridd (bug 3329):
There are two additional fields in PartialOutcomeQualifiers in X.500(2005) -
the entryCount CHOICE now has an "exact" option, and there's a "streamedResult"
flag.

svn path=/trunk/; revision=27713
2009-03-12 20:51:34 +00:00