Skip to content

Commit

Permalink
Rework commandline arguments handling
Browse files Browse the repository at this point in the history
Use getopt implementation from MinGW runtime.

Tested against Wireshark 2.0.16 and 2.9.0-1285. Everything works fine in
the Wireshark Legacy (GTK+) interface in 2.0.16.

In Wireshark 2.9.0-1285, an empty --devices parameter immadietely before
--capture-from-all-devices can be triggered by doing:
  1. Open Wireshark, select USBPcap interface, open options
  2. Expand any parent USB device, click on child device name
  3. Start capture
  4. Click Stop capture button in the toolbar
  5. Click Start capture button in toolbar, continue without saving data
  6. Watch that no packets are being captured

In point 5 USBPcapCMD is executed with following parameters:
  USBPcapCMD.exe -d \\.\USBPcap3 -b 1048576
  -o \\.\pipe\wireshark_extcap_\\.\USBPcap3_20180728132117
  --devices --capture-from-all-devices --capture-from-new-devices

This makes getopt to consider --capture-from-all-devices as a parameter to
--devices and thus USBPcapCMD fails with the:
  "Malformed address list. Invalid character: -."

While it would be nice to implement extcap control message passing to
display this error in Wireshark status bar, it is not done yet.
  • Loading branch information
desowin committed Jul 28, 2018
1 parent ff01988 commit 78b2a39
Show file tree
Hide file tree
Showing 6 changed files with 895 additions and 563 deletions.
2 changes: 1 addition & 1 deletion USBPcapCMD/SOURCES
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SOURCES = USBPcapCMD.rc \
cmd.c \
enum.c \
filters.c \
gopt.c \
getopt.c \
iocontrol.c \
roothubs.c \
thread.c
Loading

0 comments on commit 78b2a39

Please sign in to comment.