Exemplo n.º 1
0
 /// <summary>
 /// Adds an ARP scan task to this scanners task queue, where the scanner will start the scan as soon as possible
 /// </summary>
 /// <param name="ast">The scan task to do</param>
 public void AddARPScanTask(ARPScanTask ast)
 {
     lock (astScanTasks)
     {
         astScanTasks.Add(ast);
         areTasksAvailable.Set();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Removes a scan task. This only works if the scan task has not been done yet.
 /// </summary>
 /// <param name="ast">The ARP scan task to remove</param>
 public void RemoveARPScanTask(ARPScanTask ast)
 {
     lock (astScanTasks)
     {
         astScanTasks.Remove(ast);
         InvokeScanFinished(ast);
     }
 }
Exemplo n.º 3
0
 private void InvokeScanFinished(ARPScanTask args)
 {
     if (ARPScanFinished != null)
     {
         if (ARPScanFinished.Target != null &&
             ARPScanFinished.Target is System.ComponentModel.ISynchronizeInvoke &&
             ((System.ComponentModel.ISynchronizeInvoke)(ARPScanFinished.Target)).InvokeRequired)
         {
             ((System.ComponentModel.ISynchronizeInvoke)(ARPScanFinished.Target)).BeginInvoke(ARPScanFinished, new object[] { new ARPScanEventArgs(args), this });
         }
         else
         {
             ARPScanFinished(new ARPScanEventArgs(args), this);
         }
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of this class
 /// </summary>
 /// <param name="astTask">The ARP scan task associated with this event</param>
 public ARPScanEventArgs(ARPScanTask astTask)
 {
     this.astTask = astTask;
 }