Example #1
0
 public SoftRouter()
 {
     macAddress       = new Dictionary <IPAddress, PhysicalAddress>();
     deviceList       = Device.GetDeviceList();
     hadHandledIpList = new List <ushort>();
     staticRouting    = new RouteTableList();
     packets          = new List <Packet>();
 }
Example #2
0
        private void AddRoute_Load(object sender, EventArgs e)
        {
            numericUpDown1.Value = 60;
            foreach (Device dev in Device.GetDeviceList())
            {
                comboBox1.Items.Add(dev.Interface.Description);
            }
            comboBox1.SelectedIndex = 0;

            RouteTableList list  = MainForm.softRoute.StaticRouting;
            int            index = 1;

            foreach (RouteTable route in list.RouteTable)
            {
                ListViewItem item = new ListViewItem(index.ToString());
                item.SubItems.AddRange(new string[] { route.NetAddress.ToString(), route.MaskAddress.ToString(),
                                                      route.NextHop.ToString(), route.Level.ToString(), route.OutInterface.Description });
                listView1.Items.Add(item);
                index++;
            }
        }