示例#1
0
        //Initialization
        private void init()
        {
            InitializeComponent();
            Show();
            threadList = new List <Thread>();
            routeList  = new List <Route>();
            allDevices = LivePacketDevice.AllLocalMachine;
            hashARP    = new Hashtable();
            listMAC    = new List <String>();
            enableARP1 = false;
            enableRIP1 = false;

            timerRefresh           = new System.Timers.Timer(TIME);
            timerRefresh.AutoReset = true;
            this.timerRefresh.Start();
            timerRefresh.Elapsed += Refresh;

            timerARP           = new System.Timers.Timer(TIME);
            timerARP.AutoReset = true;
            this.timerARP.Start();
            timerRefresh.Elapsed += periodARP;

            myMAC1 = PcapDotNet.Core.Extensions.LivePacketDeviceExtensions.GetMacAddress(allDevices[DEV0]);

            gui  = new GUI(this, tableRoutes);
            rip  = new RIPv2(gui, routeList);
            ping = new Ping();

            //testing
            textboxIP1.Text       = "169.254.212.220";
            textboxMask1.Text     = "255.255.0.0";
            textboxARPtarget.Text = "169.254.212.209";
        }
示例#2
0
        private void button10_Click(object sender, EventArgs e)
        {
            List <MacAddress> addresses = MacAddress.GetMacAddresses();

            foreach (MacAddress address in addresses)
            {
                listBox1.Items.Add(address);
            }
        }