Inheritance: ITapInterface, IHasOwnLife, IDisposable
Example #1
0
        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;
        }
Example #2
0
        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);
        }
Example #3
0
 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;
 }
Example #4
0
        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);
        }