File: arpmethod.pas

package info (click to toggle)
udm 1.0.0.352-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,076 kB
  • sloc: pascal: 72,496; ansic: 6,892; awk: 880; makefile: 768; sh: 493; perl: 34; python: 22; tcl: 18
file content (74 lines) | stat: -rw-r--r-- 1,519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
unit arpmethod;

{$mode ObjFPC}{$H+}

interface

uses
  Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, StdCtrls,
  Grids;

type

  { TFormarpmethod }

  TFormarpmethod = class(TForm)
    ARPStatusMemo: TMemo;
    FixXPortButton: TButton;
    FixXPortGroupBox: TGroupBox;
    IPEdit: TEdit;
    FreeIPsLabel: TLabel;
    ChooseIPGroupBox: TGroupBox;
    InstructionsMemo: TMemo;
    InstructionsLabel: TLabel;
    StatusLabel: TLabel;
    IPsInUseGroupBox: TGroupBox;
    AssignedIPsLabel: TLabel;
    FindIPsButton: TButton;
    AssignedIPsStringGrid: TStringGrid;
    FreeIPsStringGrid: TStringGrid;
    RandomlyChooseIPButton: TButton;
    procedure FormShow(Sender: TObject);
    procedure FindIPsButtonClick(Sender: TObject);
  private

  public

  end;

var
  Formarpmethod: TFormarpmethod;

implementation
uses
  Unit1,Process;

{ TFormarpmethod }

procedure TFormarpmethod.FindIPsButtonClick(Sender: TObject);
var
  s : ansistring;
begin
  //See if arp command is available
  //if RunCommand('/bin/bash',['-c','echo $PATH'],s) then
   ARPStatusMemo.Lines.Add('Running arp');
   Application.ProcessMessages;
   if RunCommand('arp',['-a'],s) then begin
     ARPStatusMemo.Lines.Add(s);
     //writeln(s);
   end else
     ARPStatusMemo.Lines.Add('The arp command cannot be accessed. Install it, or check the PATH.');

end;

procedure TFormarpmethod.FormShow(Sender: TObject);
begin
   ARPStatusMemo.Clear;
   ARPStatusMemo.Font.Name:=FixedFont;
end;

initialization
  {$I arpmethod.lrs}

end.