Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using CiscoSwitchTemplate.Utils;
- namespace CiscoSwitchTemplate
- {
- class Configuration
- {
- struct AgentHostName
- {
- public string AgentName;
- public int PortNumber;
- }
- static AgentHostName[] aHostName;
- static void Menu()
- {
- Console.WriteLine("\n============================");
- Console.WriteLine("\n[A] Routing ");
- // Console.WriteLine("\n[B] Non-Routing ");
- Console.WriteLine("\nQuit to Stop");
- Console.WriteLine("\n============================\n");
- }
- static void Run()
- {
- string Command;
- while (true)
- {
- Menu();
- Console.Write("\nSelection: ");
- Command = Console.ReadLine();
- if (Command.Equals("Quit"))
- break;
- else if (Command.Equals("A"))
- {
- Console.Write("\nRouting");
- Routing();
- }
- /* else if (Command.Equals("B"))
- {
- Console.Write("\nNon Routing");
- nRouting();
- }*/
- else if (Command.Equals("C"))
- {
- PrintTest();
- }
- else if (Command.Equals("D"))
- {
- VariablesTest();
- }
- else if (Command.Equals("E"))
- {
- APCTest();
- }
- }
- }
- static Array Routing()
- {
- Console.Write("\nHow many Ports will be configured? [1-47]: ");
- int MaxPorts = int.Parse(Console.ReadLine());
- aHostName = new AgentHostName[MaxPorts];
- for (int i = 0; i < MaxPorts; i++)
- {
- int PortNumber = i + 1;
- Console.Write("Please enter HostName for Port " + PortNumber + ":");
- aHostName[i].AgentName = Console.ReadLine();
- aHostName[i].PortNumber = PortNumber;
- }
- return aHostName;
- }
- static void PrintTest()
- {
- for (int i = 0; i < aHostName.Length; i++)
- Console.Write("\ninterface FastEthernet1/0/" + aHostName[i].PortNumber + "\ndescription " + aHostName[i].AgentName + "\nno shutdown\n");
- }
- static void nRouting()
- {
- }
- static void APCTest()
- {
- Console.Write("\nHow many APCs will be at this location? ");
- int MaxPorts = int.Parse(Console.ReadLine());
- string[] APC = new string[MaxPorts];
- for (int i = 0; i < MaxPorts; i++)
- {
- int APCNumber = i + 1;
- Console.Write("Please enter IP for APC " + APCNumber + ":");
- APC[i] = Console.ReadLine();
- Console.Write(APC[i] + "\n");
- }
- }
- static void VariablesTest()
- {
- string VTY;
- string Enable;
- string Con;
- string XOMA;
- string XOMB;
- string ILOA;
- string ILOB;
- string LDA;
- string DGC;
- string DNSA;
- string WANIP;
- string WAN_Gateway;
- string WAN_Subnet;
- string Switch_IP;
- string LAN_Gateway;
- string LAN_Subnet;
- string SwitchName;
- string LocationName;
- string AssetID;
- Console.Write("Switch HostName: "); SwitchName = Console.ReadLine();
- Console.Write("VTY Password: "); VTY = Console.ReadLine();
- Console.Write("Enable Password: "); Enable = Console.ReadLine();
- Console.Write("Console Password: "); Con = Console.ReadLine();
- Console.Write("XOM 00A Host IP: "); XOMA = Console.ReadLine();
- Console.Write("XOM 00B Host IP: "); XOMB = Console.ReadLine();
- Console.Write("XOM 00A iLO IP: "); ILOA = Console.ReadLine();
- Console.Write("XOM 00A iLO IP: "); ILOB = Console.ReadLine();
- Console.Write("LDA IP: "); LDA = Console.ReadLine();
- Console.Write("DGC IP: "); DGC = Console.ReadLine();
- Console.Write("DNS IP: "); DNSA = Console.ReadLine();
- Console.Write("WAN IP: "); WANIP = Console.ReadLine();
- Console.Write("WAN Gateway IP: "); WAN_Gateway = Console.ReadLine();
- Console.Write("WAN Subnet IP: "); WAN_Subnet = Console.ReadLine();
- Console.Write("LAN Gateway IP: "); LAN_Gateway = Console.ReadLine();
- Console.Write("LAN Subnet IP: "); LAN_Subnet = Console.ReadLine();
- Console.Write("Location Name IP: "); LocationName = Console.ReadLine();
- Console.Write("Asset ID IP: "); AssetID = Console.ReadLine();
- }
- static void Main(string[] args)
- {
- Configuration.Run();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement