Commit Graph

39 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
Michal Labedzki 7177cedc26 USB: Fix Conversation/Endpoint filters
There were not fields for that, so simple add them.

Change-Id: I489bae24ac96ea0baf395add731f4d62ccf19352
Reviewed-on: https://code.wireshark.org/review/6401
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-10 15:34:24 +00:00
Michael Mann ecaa1f8d21 convert variables that were static just because of SET_ADDRESS macro to use the proper pinfo->pool instead.
Change-Id: I914918d9629f654ead497dddac0f412b690e4409
Reviewed-on: https://code.wireshark.org/review/6430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-09 01:10:05 +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 d519617538 mausb: Rename expert filter names to fix dup filter names.
Change-Id: Id650c3aff6d073b05e844574ffbde8fec4368f49
Reviewed-on: https://code.wireshark.org/review/5608
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-04 03:43:32 +00:00
Martin Kaiser 47909d32fc remove parent parameter from dissect_usb_setup_response()
Change-Id: Ib4a5cc3b783d3a4a1477624678964a9627d582e6
Reviewed-on: https://code.wireshark.org/review/5191
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-11-08 14:19:22 +00:00
Martin Kaiser f82b2f2dd3 remove parent parameter from dissect_usb_setup_request()
Change-Id: I5a24de9a12e301d472e701140299304e2cb4fcfc
Reviewed-on: https://code.wireshark.org/review/5190
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-11-08 14:19:00 +00:00
Alexis La Goutte 0a5d6a1f90 MAUSB: fix warning: no previous prototype for 'proto_register_wfa_oui' [-Wmissing-prototypes]
Change-Id: I86cc9f6f9cd50a6e081aabc10bce077281eb2d76
Reviewed-on: https://code.wireshark.org/review/4959
Reviewed-by: Sean Stalley <seanstalley@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-28 05:12:47 +00:00
Sean O. Stalley 3ffd8c57d9 Use Wifi Alliance OUI for MA USB packets over SNAP
Change-Id: Icf4c995c8fbdb886e8b4e79a1fc7b62ac7137a07
Reviewed-on: https://code.wireshark.org/review/4667
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>
2014-10-26 00:55:50 +00:00
Sean O. Stalley 608207fcf6 Add Dissection of MA packets over UDP
Change-Id: Ic6e1cbb623f3e84b73ce7e4608f291baadc77bf6
Reviewed-on: https://code.wireshark.org/review/4576
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-09 19:41:19 +00:00
Sean O. Stalley d05a44c3ce Show endpoint direction based on EPHandle bit
Interpret the meaning of the endpoint handle direction bit,
instead of just saying if it is set.

Change-Id: I9fc0d6f95f6c3a94d6db90c8394fe3ca8fc83715
Reviewed-on: https://code.wireshark.org/review/4119
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-17 02:21:48 +00:00
Bill Meier f4b135c147 packet-mausb.c: proto-reg-handoff() fixes
- proto_reg_handoff...():
    Fix handling of tcp port pref change;
    Rename 'gPORT_PREF' to 'mausb_tcp_port_pref';
    Do 'dissector_add_uint("llc.mausb_pid",..)' only once;

Change-Id: Ic4498560f61d0ce95f8109c3a1bb3c407221269b
Reviewed-on: https://code.wireshark.org/review/3854
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-27 15:49:40 +00:00
Sean O. Stalley c612029774 Exclude MA USB TransferAck's from USB conversation
the usb_trans_info struct only understands Requests & Responses.
TransferAcks are currently treated as responses, which throws off
the Request/Response pairing & dissection.

This patch fixes tracking in the case when a TransferAck & TransferReq
are in the same TCP packet. It does not fix the case where there are
multiple TransferReq's or TransferResp's in 1 TCP packet.

Eventually I want to revamp usb_trans_info structure to support:
 -multiple requests/responses per transaction (IE: retries)
 -TransferAck tracking
 -handling of multiple requests/responses in 1 TCP packet

Change-Id: I09be6fecf55a40b4ea2a4f27bd753f3991ccabbd
Reviewed-on: https://code.wireshark.org/review/3866
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-08-26 19:37:40 +00:00
Sean O. Stalley 64cd8270c6 Have dissect_usb_setup_request handle non-standard requests
Moved code for parsing non-standard setup requests from
dissect_usb_common() to dissect_usb_setup_request().

Also added header_info flag USB_HEADER_IS_MAUSB & updated mausb
dissector.

Change-Id: Ifa8abccbd57bf4dd3965f582872952383e6f737d
Reviewed-on: https://code.wireshark.org/review/3851
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-26 06:10:20 +00:00
Martin Kaiser b737e2e8ef remove trans_info parameter from dissect_usb_endpoint_descriptor()
(remove it in the call from mausb as well)

add NULL checks for usb_conv_info, usb_trans_info

Change-Id: I95d52b85e3fa0d42b6a20047053259aaca8754fe
Reviewed-on: https://code.wireshark.org/review/3784
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-25 13:59:28 +00:00
Martin Kaiser c284e12112 remove trans_info parameter from dissect_usb_unknown_descriptor()
remove now unused trans_info variable in mausb

Change-Id: I99df8a1ed039134c9448546d0f1a738f203f9610
Reviewed-on: https://code.wireshark.org/review/3785
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Martin Kaiser <wireshark@kaiser.cx>
2014-08-25 13:48:12 +00:00
Sean O. Stalley d67e40e501 Added dissection of Device Capability Descriptors in CapResp Packets
CapResp Packets may contain Device Capability Descriptors.
This patch allows wireshark to show what descriptors are present,
& checks that their length fields are valid.

See section 6.3.3 of the MA USB spec for more information.

Change-Id: Ia120435bdffcced091b67e66e0ba8f1a750358db
Reviewed-on: https://code.wireshark.org/review/3330
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-08-06 09:14:09 +00:00
Sean O. Stalley 3b91474af5 Dissection of CapResp Packets
Added dissection of MAUSB Capability Response (CapResp) fields.

Change-Id: I41044a25c72b72ef9c8ef5640a609eb6448b054d
Reviewed-on: https://code.wireshark.org/review/3329
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-05 07:47:03 +00:00
Sean O. Stalley 2fbd9e128b Fix variable-length managment packet dissection
Before, several managment packets were dissected incorrectly as
EPHandleDeleteReq's. Now they are dissected with the generic managment
packet dissector.

Change-Id: Id2f0951b91b99ba2340ff77c6285f382436788ef
Reviewed-on: https://code.wireshark.org/review/3328
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-01 19:37:07 +00:00
Sean O. Stalley 91f627b7e7 MAUSB dissection of control transfer responses
The MAUSB dissector can now dissect transfer responses for control
endpoints.

Change-Id: Ic488ccb308365d072bbbf0eaf128b198caf74eca
Reviewed-on: https://code.wireshark.org/review/2960
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-15 22:55:19 +00:00
Sean O. Stalley bbb3e2f7af Add Bus ID to USB Address Column
USB Addresses are now in the format of: bus_id.device_address.endpoint
This makes it much easier to read traces that captured traffic on
more than one bus.

Change-Id: I264db2ceea712d94632d5d08d05d3af22a4a03fe
Reviewed-on: https://code.wireshark.org/review/2833
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-04 02:20:38 +00:00
Sean O. Stalley 3c37630c77 Dissection of USB setup data in MA USB data packets
This patch adds support for dissection of USB setup data contained
inside of MA USB data packets. The MAUSB Dissector calls the same
function used by the USB dissector to dissect the setup data.

This patch also (and a bit unintentionally) adds transfer following.
TransferReq & TransferAck packets now show a link & a time delta
to their TransferReq (ie [Request in: XXX] & [Time from request: XXX].

TransferReq packets have a [Response in: XXX] tag, but it erronously
points to the TransferAck, not the TransferResponse.

Change-Id: I01041de3c38ea6248e9d34506b0b012518a1e6d8
Reviewed-on: https://code.wireshark.org/review/1548
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-09 20:08:49 +00:00
Sean O. Stalley 09f53d802a Per Spec update, SetUSBDevAddrReq now contains data
Per MAUSB Spec (1.0), the SetDevAddrReq packet now contains data
in addition to the packet header.

Change-Id: I4d2c6bb2530edf5de33ef69c0e6af0441e197fa4
Reviewed-on: https://code.wireshark.org/review/2014
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 17:43:06 +00:00
Sean O. Stalley 78bc006082 Removed MAUSB DWORD-Aligned Length Check
Removed a check to see if the Packet is in DWORDs.
I misread section 6.2 of the spec, which states that all _headers_
mausb be DWORD-aligned, not all _packets_.

Change-Id: I11e320e6e2592930024ffa8143e4d8f470de13ba
Reviewed-on: https://code.wireshark.org/review/2013
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 17:42:03 +00:00
Sean O. Stalley 97f0fb0e53 Fixed Fencing for Multiple MAUSB Packets in 1 TCP Packet.
Packet info for all MAUSB packets in a single TCP packet is now displayed
in the info column. Before, only info on the last packet was displayed.

See conversation for change Ib20e5e30474d93270dd24e203ab96f64f5cc77ad.
Patch 3 had fencing, I messed up and left it out of patches 4-6. This
patch adds it back in.

Change-Id: I37f0e028a8f9b5a8500700f03ac36f8bf1c4f63c
Reviewed-on: https://code.wireshark.org/review/1958
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-06 14:47:35 +00:00
ruengeler 4b9b29b627 Clang complained about non initialized variable.
Change-Id: Idc4c1a8db4d5f1b6f2b01428ea283c4a975723f2
Reviewed-on: https://code.wireshark.org/review/1947
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04 12:25:04 +00:00
Sean O. Stalley c94d2e6848 MAUSB dissector uses USB addresses
The MAUSB dissector now prints the USB address for MAUSB data packets
in the Source & Destination columns. Before, the IP address was
printed.

All MAUSB data packets are now part of USB Conversations. Like the
USB dissector, all data to & from one endpoint are part of the same
conversation.

Issues that need to be resolved:
- In the case where multiple MAUSB packets exist in one TCP packet,
  only one USB address can be printed.
- The USB conversations do not appear in the conversations window.
  They should appear under the USB conversations tab.

Change-Id: I042daf7889cf70b3bbc450f9ccd974a0f93f4798
Reviewed-on: https://code.wireshark.org/review/1943
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-04 00:56:24 +00:00
Sean O. Stalley 918212667a Detect multiple MAUSB Packets in a single TCP packet
Puts a tag in the info column when multiple MAUSB packets are in a
single TCP packet.

Change-Id: Ib20e5e30474d93270dd24e203ab96f64f5cc77ad
Reviewed-on: https://code.wireshark.org/review/1658
Reviewed-by: Sean Onufer Stalley <sean.stalley@intel.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-30 13:14:06 +00:00
Sean O. Stalley 33ae4cb024 Fixed mausb valid bit & added invalid_valid TFS
Fixed valid bit check for MAUSB EPHandleResp packet. the valid bit
is active low (ie: valid = 0, invalid = 1).

I noticed Some other dissectors also defined an tfs_invalid_valid,
so got rid of their local definitions & added it to epan/tfs.c.

Change-Id: Ifd78325f9c7c046224073fc9b29e0cc60dc5c286
Reviewed-on: https://code.wireshark.org/review/1766
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-24 06:51:17 +00:00
Sean O. Stalley 868fa65b01 Remove incorrect _U_ flag in dissect_mausb signature
Removes _U_ flag for data field in dissect_mausb(),
since tcp_dissect_pdus(), uses the data field.

Change-Id: Iccb5aae1aa203f98484666763410c4a555413ac0
Reviewed-on: https://code.wireshark.org/review/1696
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-19 20:13:06 +00:00
Sean O. Stalley a22b91250f Added dissection of EPHandleDelete Req & Resp packets
Added support for dissecting Media Agnostic USB EPHandleDelete
Req & Resp packets.

Change-Id: I225a38291c3f47065755c01b336ef75c719e5d58
Reviewed-on: https://code.wireshark.org/review/1546
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-12 20:15:40 +00:00
Jeff Morriss 6011d2e531 "Reserved" is not a valid 'fieldconvert' value for an hf.
Fixes (for real this time, I swear!) the fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10079

Bug: 10079
Change-Id: I2a73ef32d704fc9ecc71fd983fc09cf4f9194b2e
Reviewed-on: https://code.wireshark.org/review/1542
Reviewed-by: Sean Onufer Stalley <sean.stalley@intel.com>
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-05-06 22:21:41 +00:00
Jeff Morriss ef24d48552 VALS() doesn't take the address of a (pointer to a) value_string, it takes
a pointer to a value_string.

Fixes the fuzz failure reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10079

Bug: 10079
Change-Id: Ifc8d6895cc33ad1f00386a3e59926322bd501125
Reviewed-on: https://code.wireshark.org/review/1538
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-06 19:56:58 +00:00
Sean O. Stalley 9a51c1e530 Added check for MAUSB length being multiple of a DWORD.
MAUSB Packets should always be sent in DWORDs. This means that the
only valid values for the length field are multiples of 4.
This patch adds an expert info check to flag length fields that are
multiples of 4.

Change-Id: Ifb793f82aed4c9fb09a12f6ea97087733b58d14a
Reviewed-on: https://code.wireshark.org/review/1536
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 19:51:56 +00:00
Evan Huus 3851e09a0b Fix macro parens to avoid unexpected behaviour
Based on Icfe1e5477043dd695fd9b02b677ef29ac3fa8866 but rebased and simplified.

Change-Id: I9b7266e2fdcb58f38115250d785637cd585c69e0
Reviewed-on: https://code.wireshark.org/review/1532
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-06 16:05:15 +00:00
Sean O. Stalley eecc1353a2 Added parentheses to macros to prevent unexpected behavior
Masks for padding now have an additional parenthesis to ensure
proper operator precedence.

Per the request of Evan Huus; See comment in Change-Id:
I3ad4e1beb891f9c2835adff320095e7e738241eb, Patch Set 10.

Change-Id: Ic8878f870b58cd272675b4d6c3658a029bb67984
Reviewed-on: https://code.wireshark.org/review/1519
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-05 20:46:36 +00:00
Evan Huus 326202f016 Solaris doesn't like anonymous unions
so give it a name

Change-Id: Iaf9a6f8cb58a565673f53696f7e5d1698e6eae0f
Reviewed-on: https://code.wireshark.org/review/1509
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 15:26:15 +00:00
Evan Huus 0523c2d0d7 Fix build with older compilers
The struct literal syntax {0} does not appear to be universally supported - use
memset instead.

Change-Id: If70d475cf3d7a582c43dcc879cefebc9aef0a99e
Reviewed-on: https://code.wireshark.org/review/1508
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-05 14:50:09 +00:00
Sean O. Stalley ac99cfd0d2 Media Agnostic USB Packet Dissector
This dissector dissects MA USB Packets. It is capable of dissecting
Media Agnostic packets both in a TCP stream as well as packets sent
over SNAP (referred to in spec as "Raw Ethernet" mode).

Change-Id: I3ad4e1beb891f9c2835adff320095e7e738241eb
Signed-off-by: Sean O. Stalley <sean.stalley@intel.com>
Reviewed-on: https://code.wireshark.org/review/1252
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-05-05 13:49:56 +00:00