public static IMACInterface CreateAndGetTap(this Emulation emulation, string hostInterfaceName, string name, bool persistent = false) { ITapInterface result; #if EMUL8_PLATFORM_WINDOWS throw new RecoverableException("TAP is not available on Windows"); #elif EMUL8_PLATFORM_OSX if(persistent) { throw new RecoverableException("Persitent TAP is not available on OS X."); } result = new OsXTapInterface(hostInterfaceName); #else result = new LinuxTapInterface(hostInterfaceName, persistent); #endif emulation.HostMachine.AddHostMachineElement(result, name); return result; }
public static IMACInterface CreateAndGetTap(this Emulation emulation, string hostInterfaceName, string name, bool persistent = false) { ITapInterface result; #if EMUL8_PLATFORM_WINDOWS throw new RecoverableException("TAP is not available on Windows"); #elif EMUL8_PLATFORM_OSX if (persistent) { throw new RecoverableException("Persitent TAP is not available on OS X."); } result = new OsXTapInterface(hostInterfaceName); #else result = new LinuxTapInterface(hostInterfaceName, persistent); #endif emulation.HostMachine.AddHostMachineElement(result, name); return(result); }
public static IMACInterface CreateAndGetTap(this Emulation emulation, string hostInterfaceName, string name, bool persistent = false) { ITapInterface result; if(Misc.IsOnOsX) { if(persistent) { throw new RecoverableException("Persitent TAP is not available on OS X."); } result = new OsXTapInterface(hostInterfaceName); } else { result = new LinuxTapInterface(hostInterfaceName, persistent); } emulation.HostMachine.AddHostMachineElement(result, name); return result; }
public static IMACInterface CreateAndGetTap(this Emulation emulation, string hostInterfaceName, string name, bool persistent = false) { ITapInterface result; if (Misc.IsOnOsX) { if (persistent) { throw new RecoverableException("Persitent TAP is not available on OS X."); } result = new OsXTapInterface(hostInterfaceName); } else { result = new LinuxTapInterface(hostInterfaceName, persistent); } emulation.HostMachine.AddHostMachineElement(result, name); return(result); }