Пример #1
0
        private static bool removeVlan(int vlanID)
        {
            Console.WriteLine("REMOVE VLAN:" + vlanID);
            VLANConfig vlc = new VLANConfig();

            return(vlc.rem("eth0." + vlanID));

            ProcessStartInfo psi = new ProcessStartInfo();

            psi.FileName  = "/opt/vlan/vconfig";
            psi.Arguments = "rem " + networkInterface + "." + vlanID;

            Process p = CreateProcAndWait(psi, 1);

            if (p.HasExited)
            {
                return(true);
            }
            return(false);
        }
Пример #2
0
        private static bool createVlan(int vlanID)
        {
            Console.WriteLine("CREATE VLAN:" + vlanID);
            VLANConfig vlc = new VLANConfig();

            return(vlc.add("eth0", vlanID.ToString()));


            ProcessStartInfo psi = new ProcessStartInfo();

            psi.FileName  = "/opt/vlan/vconfig";
            psi.Arguments = "add " + networkInterface + " " + vlanID;

            Process p = CreateProcAndWait(psi, 1);

            Console.WriteLine(p.StandardOutput.ReadToEnd());

            if (p.HasExited)
            {
                return(true);
            }
            return(false);
        }