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); }
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); }