Commit Graph

239 Commits

Author SHA1 Message Date
Hadriel Kaplan ceb8d954d2 Lua: Expose tcp_dissect_pdus() to Lua
Provide a way for Lua-based dissectors to invoke tcp_dissect_pdus()
to make TCP-based dissection easier.

Bug: 9851
Change-Id: I91630ebf1f1fc1964118b6750cc34238e18a8ad3
Reviewed-on: https://code.wireshark.org/review/6778
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
Tested-by: Hadriel Kaplan <hadrielk@yahoo.com>
2015-01-27 15:14:12 +00:00
Michael Mann 2209678149 ep_<protocol>_port_to_display -> <protocol>_port_to_display
Adjust any other ep_ related APIs related to the transition.

Change-Id: I961b371c2c4bda557e0f1817705c27eef0dae66c
Reviewed-on: https://code.wireshark.org/review/6388
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-08 05:32:32 +00:00
Alexis La Goutte 1d7da82938 DNS: fix no previous prototype for 'qname_labels_count' [-Wmissing-prototypes]
Change-Id: I2c5b662f6b46d60a97a491ca8ec01b3f0e41fa56
Reviewed-on: https://code.wireshark.org/review/6338
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-06 15:42:54 +00:00
Dario Lombardo 696fcdba21 Added DNS statistics support
This affects both the dissector (that has been added with a tap interface and a stats generator) and the UI (to recall the stats menu).

Change-Id: I90658f7aa6707aa39bdd787a51b20fed4dbddc53
Reviewed-on: https://code.wireshark.org/review/6236
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-05 09:06:32 +00:00
Pascal Quantin 22701adba1 DNS: ensure that suffix_addr structure is always initialized
Bug: 10816
Change-Id: Ifd036148f9f2e76516913bda11cf07fdb63def94
Reviewed-on: https://code.wireshark.org/review/6174
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-31 12:51:43 +00:00
Michael Mann 1d598bbff7 Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b
Reviewed-on: https://code.wireshark.org/review/6060
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-28 14:09:27 +00:00
Martin Mathieson 596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Bill Meier b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
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-12-21 05:46:22 +00:00
Bill Meier f412c9a01a Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...
(for some dissectors which fetch all other integral fields using
   ENC_BIG_ENDIAN).

Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56
Reviewed-on: https://code.wireshark.org/review/5748
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-13 18:45:56 +00:00
Alexis La Goutte b0cdee67da DNS: Remove whitespace on DNS Col info before type name
Change-Id: I33a9a54a318a1a3ea106f4531db4e79a6b6d42ac
Reviewed-on: https://code.wireshark.org/review/5716
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-13 00:16:22 +00:00
Bill Meier c28f280c1d Fix a number of dup hf[] filter-names probably resulting from cut/paste errs.
Change-Id: I9242300b2ace3155c1506b584a90f073100a305e
Reviewed-on: https://code.wireshark.org/review/5512
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-26 23:27:31 +00:00
Stephen Fisher e02c03bd42 Change capitalization of "DNS UDP [p]orts" to match "DNS TCP ports" in prefs
Change-Id: Ib0bffc6d5e4bd6b68f48a843b4b4cab7422aceb7
Reviewed-on: https://code.wireshark.org/review/5476
Reviewed-by: Stephen Fisher <sfisher@sdf.org>
2014-11-24 19:12:33 +00:00
Alexis La Goutte 3b8ed366dd DNS: NAPTR RR Replacement Length is incorrect
It seems the Replacement Length field calculated by Wireshark (which Wireshark calls "rReplacement Length"), is the length of the first label of the DNS name in the Replacement, instead of the entire DNS name length.

Issue found by Boaz

Bug:10700
Change-Id: I8b726f3a3bf316d688a40c3ade100d255ca3be42
Reviewed-on: https://code.wireshark.org/review/5300
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-16 11:03:58 +00:00
Alexis La Goutte aec5ffb535 DNS: WKS RR Protocol field is read as 4 bytes instead of 1
In the attached pcap file, there's a single DNS packet with WKS RR in the Prerequisites section.
The Protocol field of this RR is read as if it is 4 bytes long instead of 1, which actually reads part of the bytes of the following RR.

Found by boaz

Bug:10675
Change-Id: Icf12c7f3864b629a242598373c06eee4de0ca098
Reviewed-on: https://code.wireshark.org/review/5170
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-07 15:43:52 +00:00
Pascal Quantin de37217933 DNS: fix name length and label count for a root server
Bug: 10674
Change-Id: I44297bfa64c31ab53d2aa61b6e54253b7a5a1e27
Reviewed-on: https://code.wireshark.org/review/5167
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-11-07 15:42:02 +00:00
Pascal Quantin aae48be5a5 DNS: replace hash map by red-black tree to fix request/response tracking when transaction id is reused
Bug: 10657
Change-Id: Id4356dcd6802da40b4a3e2e2095cc9d2932c2c68
Reviewed-on: https://code.wireshark.org/review/5100
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-05 02:40:07 +00:00
Pascal Quantin f19c70c952 DNS: fix Coverity CID 281285 and CID 1238867
Change-Id: Ia5747a5d0c8c63b7471de624c96e546c7bbfbf57
Reviewed-on: https://code.wireshark.org/review/5064
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-02 13:33:56 +00:00
Pascal Quantin 2d8d217953 DNS: fix dissection of ISDN RR Sub Address field
Bug: 10650
Change-Id: I3411d4e5ef534a663940974d98c351976005ee8e
Reviewed-on: https://code.wireshark.org/review/5057
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-01 21:47:33 +00:00
Pascal Quantin a162f5b208 DNS: fix display of A6 address suffix field
Bug: 10652
Change-Id: Ibd119177feecd27d0c6baba255e7e3da37b131bd
Reviewed-on: https://code.wireshark.org/review/5043
Tested-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-11-01 19:45:03 +00:00
Alexis La Goutte 09957ca418 DNS NXT RR is parsed incorrectly
The queries RRs and answers RRs are parsed fine.
However, only the first 2 authoritative RRs are parsed and none of the 3 additional RRs are parsed.
The second authoritative RR is of type NXT, and even though it has data length of 9, Wireshark reads all the bytes until the end of the packet as if they are part of bitmap in this RR (it reads 317 bytes too many).
This causes it to not parse the rest of the RRs correctly.

Found by boaz

Bug:10615
Change-Id: I22e5987c44a11399b07c3106fbb70c6e9e867afe
Reviewed-on: https://code.wireshark.org/review/4940
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>
2014-10-28 07:09:34 +00:00
Michael Mann 39b281461d Eliminate proto_tree_add_text from packet-nbns.c
Some other cleanup while in the neighborhood.  Not sure the all the proto_tree_add_expert calls are needed after each field (having implicit bounds error thrown should be sufficient), but left them in there.

Change-Id: I3ca75ec9f51ccbed6b6ca792789daa8e7cebf34a
Reviewed-on: https://code.wireshark.org/review/4574
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-10-09 17:13:39 +00:00
Bill Meier 18d72987cb Do encoding-arg changes (all benign)
For:
- FT_BYTES: Always use just ENC_NA
- integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN

Also:
- FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...)
- Change one case of incorrect '||' to '|'

Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0
Reviewed-on: https://code.wireshark.org/review/4184
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 01:38:08 +00:00
Alexis La Goutte 446125aa25 DNS: Add OpenPGP KEY (61) RRtype (draft-ietf-dane-openpgpkey-00)
Not yet tested on real dns traffic

Update also last updated DNS parameters (2014-08-12)

Change-Id: I6109d585584e5fca11c606a2230d8ef89cdbf7b6
Reviewed-on: https://code.wireshark.org/review/3870
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-31 17:44:32 +00:00
Alexis La Goutte c76e49697e DNS: Update CDS and add CDNSKEY (draft-ietf-dnsop-delegation-trust-maintainance-14)
Use DS dissector for CDS (see section 3.1) and DNSKEY dissector for CDNSKEY (see section 3.2)

Change-Id: I2ee11dc0eb2b5c74447b58604b1611ed249bc329
Reviewed-on: https://code.wireshark.org/review/3869
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-28 07:24:24 +00:00
Alexis La Goutte 7660da2b69 DNS: Update EUI48 and EUI64 to final draft (RFC7043)
Change-Id: I2b18ccb874a51e5e752462a34175df8d8a90ce41
Reviewed-on: https://code.wireshark.org/review/3868
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-28 07:22:30 +00:00
Michael Mann 9d5f9141af Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the area.

Change-Id: Id8d957d3d68a2e3dd5089f490bd59d773e1be967
Reviewed-on: https://code.wireshark.org/review/3427
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>
2014-08-05 07:36:26 +00:00
Alexis La Goutte c540e556d5 DNS: Fix minor typo (Missing a space...)
Change-Id: Ie983ba3b88102c4f3749ab2f13d519eb78838bbc
Reviewed-on: https://code.wireshark.org/review/3410
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-04 19:17:26 +00:00
Alexis La Goutte 23f25714e9 DNS: Add new opcode EDNS EXPIRE (9) for EDNS options (RFC7314)
Change-Id: I2db7bf6a80a34540aa90a3362566ac399b1c3644
Reviewed-on: https://code.wireshark.org/review/3101
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-18 20:10:20 +00:00
Michael Mann 888f22de16 convert to proto_tree_add_subtree[_format]
Change-Id: I2ea1892b5963cc5578cbdd2b03029ca8424f2267
Reviewed-on: https://code.wireshark.org/review/2640
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-25 16:35:14 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +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
Alexis La Goutte c24ede3450 DNS: fix soft-deprecated APIs
tvb_length -> tvb_reported_length
tvb_get_string -> tvb_get_string_enc

Change-Id: Ia511f0e9d3f8ae3d7a1a965431016336ec47188d
Reviewed-on: https://code.wireshark.org/review/1660
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 06:58:53 +00:00
Alexis La Goutte 6989febd47 DNS: Use acronyms from RFC7218 for DANE / TLSA
http://tools.ietf.org/html/rfc7218

Change-Id: Icd276c6cb4680aa53b081c239cb8eb2d8fc109c6
Reviewed-on: https://code.wireshark.org/review/1659
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-16 06:57:09 +00:00
AndersBroman 371b17e857 Make id a guint to try to please OSX buildbot.
Change-Id: Ia97aa45ff0fc52fb21d2e864d1ca328646de547b
Reviewed-on: https://code.wireshark.org/review/1429
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 10:51:27 +00:00
Pascal Quantin b2af5b066a Convert a few dissectors with simple request/response tracking from red/black tree to hash map
Update the readme file accordingly

Change-Id: I056d1ab1f77df641b83fa9b3618b6c25d66e1a83
Reviewed-on: https://code.wireshark.org/review/1420
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-29 10:23:32 +00:00
Guy Harris 97869f2dec More name changes.
Add ep_ to routines that may return ephemeral strings.

Change "get_XXX" to "XXX_to_display" if the routine returns a formatted
string if it can't get a name.

Change-Id: Ia0e82784349752cf4285bf82788316c9588fdd88
Reviewed-on: https://code.wireshark.org/review/1217
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-04-19 19:30:17 +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
Alexis La Goutte fa02368c95 EDNS0 DO bit in Z field is decode incorrect
Z field of edns0 in Additinal records is decoded to text description incorrectly (wrong bitmask)

Found by  Jittinan Suwanrueangsri
Closed-Bug: 9767

Change-Id: I8171b211cce79cb096a0f354764992f5cb18617c
Reviewed-on: https://code.wireshark.org/review/226
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-16 14:08:43 +00:00
Bill Meier 64fd4c9c28 (Trivial) update a comment
svn path=/trunk/; revision=54962
2014-01-25 18:44:29 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Jakub Zawadzki 4d92f6079b Remove not needed ';'
svn path=/trunk/; revision=54088
2013-12-14 11:12:20 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +00:00
Jakub Zawadzki 5aa4b848ee g_snprintf() don't return -1 from glib-1.2.3 [1]
[1] https://developer.gnome.org/glib/2.28/glib-String-Utility-Functions.html#g-snprintf

svn path=/trunk/; revision=53186
2013-11-09 11:23:02 +00:00
Michael Mann 02a8391535 Require dissector_try_string to pass a data parameter to its subdissectors. There weren't that many calls, so might as well modify the function than create a need for dissector_try_string_new.
svn path=/trunk/; revision=53049
2013-11-02 15:52:25 +00:00
Michael Mann 4578df790d Use Z_tree for the subtree
svn path=/trunk/; revision=52670
2013-10-18 14:41:01 +00:00
Michael Mann 42c52d8612 Add more filterable fields around EDNS(0)
svn path=/trunk/; revision=52664
2013-10-18 01:53:32 +00:00
Michael Mann e746a62459 Bugfix an apparent typo in edns0 "Higher bits in extended RCODE". Bug 9199 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9199).
#BACKPORT(1.10)

svn path=/trunk/; revision=52662
2013-10-17 20:54:42 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +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