This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How can we bypass the network interface card detection in Interface list in wireshark source code

0

Hi,

I want to bypass the interface list in Capture option in wireshark gui,where can i do that in wireshark source code 1.12.6 release.ie i didn't keep any ethernet cable to my pc even i uninstalled the network adapter and i tried to open wireshark Capture and then by clicking on Interfaces.. icon i am getting "There are no interfaces on which a capture can be done" message is popping.where i can bypass this thing so that i can start capturing and see my own packet which was already hardcoded in winpcap driver(which was working fine even though ethernet cable is not connected).

Thanks, Karun.

asked 08 Jul '15, 22:29

karun256's gravatar image

karun256
6557
accept rate: 0%

edited 09 Jul '15, 06:36

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572

Hello All, Can any one tell me the functions in wireshark 1.12.6 source code which will detect out network interface card and capture packets.

Thanks, Karun.

(16 Jul '15, 21:51) karun256

One Answer:

0

Simply grep for that string in the source. For current dev master I came up with:

capture_opts.c(475): cmdarg_err("There are no interfaces on which a capture can be done");
dumpcap.c(1540): cmdarg_err("There are no interfaces on which a capture can be done");
dumpcap.c(1577): cmdarg_err("There are no interfaces on which a capture can be done");
dumpcap.c(4904): cmdarg_err("There are no interfaces on which a capture can be done");
tshark.c(1428): cmdarg_err("There are no interfaces on which a capture can be done");
wireshark-qt.cpp(636): cmdarg_err("There are no interfaces on which a capture can be done");
ui\gtk\capture_if_dlg.c(637): simple_error_message_box("There are no interfaces on which a capture can be done.");
ui\gtk\main.c(2355): cmdarg_err("There are no interfaces on which a capture can be done");

but 1.12.6 is likely to be a little different in the number of places. Basically the code calls capture_interface_list() and if that returns NULL without an error then the error message is displayed.

answered 17 Jul '15, 02:25

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%