private static Wireshark CreateWireshark(this Emulation emulation, string name, LinkLayer layer) { Wireshark result; var wiresharkPath = ConfigurationManager.Instance.Get("wireshark", "wireshark-path", WiresharkPath); if (File.Exists(wiresharkPath)) { result = new Wireshark(name, layer, wiresharkPath); } else { throw new RecoverableException("Wireshark is not installed or is not available in the default path. Please adjust the path in Renode configuration."); } emulation.HostMachine.AddHostMachineElement(result, name); return(result); }
private static Wireshark CreateWireshark(this Emulation emulation, string name, LinkLayer layer) { #if EMUL8_PLATFORM_WINDOWS throw new RecoverableException("Wireshark is not available on Windows"); #elif EMUL8_PLATFORM_OSX throw new RecoverableException("Wireshark is not available on OS X."); #else Wireshark result; if (File.Exists(ConfigurationManager.Instance.Get("wireshark", "wireshark-path", "/usr/bin/wireshark"))) { result = new Wireshark(name, layer); } else { throw new RecoverableException("Wireshark is not installed or is not available in the default path. Please adjust the path in Renode configuration."); } emulation.HostMachine.AddHostMachineElement(result, name); return(result); #endif }