home *** CD-ROM | disk | FTP | other *** search
- {*******************************************************}
- { }
- { MiTeC System Information Component }
- { Network Detection Part }
- { version 8.3 for Delphi 5,6,7 }
- { }
- { Copyright ⌐ 1997,2003 Michal Mutl }
- { }
- {*******************************************************}
-
- {$INCLUDE MITEC_DEF.INC}
-
- unit MSI_Network;
-
- interface
-
- uses
- SysUtils, Windows, Classes, WinSock, MSI_Common, MiTeC_IpHlpAPI;
-
- type
- TWinsock = class(TPersistent)
- private
- FDesc: string;
- FStat: string;
- FMajVer: word;
- FMinVer: word;
- public
- procedure GetInfo;
- published
- property Description: string read FDesc {$IFNDEF D6PLUS} write FDesc {$ENDIF} stored False;
- property MajorVersion: word read FMajVer {$IFNDEF D6PLUS} write FMajVer {$ENDIF} stored False;
- property MinorVersion: word read FMinVer {$IFNDEF D6PLUS} write FMinVer {$ENDIF} stored False;
- property Status: string read FStat {$IFNDEF D6PLUS} write FStat {$ENDIF} stored False;
- end;
-
- TAdapterType = (atOther, atEthernet, atTokenRing, atFDDI, atPPP, atLoopback, atSlip);
-
- PAdapter = ^TAdapter;
- TAdapter = record
- Name,
- Address: string;
- Typ: TAdapterType;
- EnableDHCP,
- HaveWINS: boolean;
- IPAddress,
- IPAddressMask,
- Gateway_IPAddress,
- Gateway_IPAddressMask,
- DHCP_IPAddress,
- DHCP_IPAddressMask,
- PrimaryWINS_IPAddress,
- PrimaryWINS_IPAddressMask,
- SecondaryWINS_IPAddress,
- SecondaryWINS_IPAddressMask: TStringList;
- end;
-
- TNodeType = (ntUnknown, ntBroadcast, ntPeerToPeer, ntMixed, ntHybrid);
-
- TTCPIP = class(TPersistent)
- private
- FAdapters: TStringList;
- FProxy: boolean;
- FRouting: boolean;
- FDNS: boolean;
- FHost: string;
- FDomain: string;
- FDNSPrefix: string;
- FDNSList: TStrings;
- FDNSSuffix: TStrings;
- FNode: TNodeType;
- FDHCPScope: string;
- FCount: Word;
-
- procedure ClearList;
- function GetAdapter(Index: Word): TAdapter;
- function GetAdapterCount: Word;
- public
- constructor Create;
- destructor Destroy; override;
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- function FindAdapter(AName: string): Integer;
-
- property Adapter[Index: Word]: TAdapter read GetAdapter;
- published
- property AdapterCount: Word read GetAdapterCount {$IFNDEF D6PLUS} write FCount {$ENDIF} stored False;
- property HostName: string read FHost {$IFNDEF D6PLUS} write FHost {$ENDIF} stored False;
- property DomainName: string read FDomain {$IFNDEF D6PLUS} write FDomain {$ENDIF} stored False;
- property EnableProxy: boolean read FProxy {$IFNDEF D6PLUS} write FProxy {$ENDIF} stored False;
- property EnableRouting: boolean read FRouting {$IFNDEF D6PLUS} write FRouting {$ENDIF} stored False;
- property EnableDNS: boolean read FDNS {$IFNDEF D6PLUS} write FDNS {$ENDIF} stored False;
- property PrimaryDNSSuffix: string read FDNSPrefix {$IFNDEF D6PLUS} write FDNSPrefix {$ENDIF} stored False;
- property DHCPScopeName: string read FDHCPScope {$IFNDEF D6PLUS} write FDHCPScope {$ENDIF} stored False;
- property DNSServers: TStrings read FDNSList {$IFNDEF D6PLUS} write FDNSList {$ENDIF} stored False;
- property DNSSuffixes: TStrings read FDNSSuffix {$IFNDEF D6PLUS} write FDNSSuffix {$ENDIF} stored False;
- property NodeType: TNodeType read FNode {$IFNDEF D6PLUS} write FNode {$ENDIF} stored False;
- end;
-
- TNetwork = class(TPersistent)
- private
- FAdapter: TStrings;
- FWinsock: TWinsock;
- FIPAddress: TStrings;
- FMACAddress: TStrings;
- FCli: TStrings;
- FServ: TStrings;
- FProto: TStrings;
- FNCAI: integer;
- FMode: TExceptionMode;
- FNetCard: string;
- FTCPIP: TTCPIP;
- function GetLocalIP :string;
- public
- constructor Create;
- destructor Destroy; override;
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- property Networkcard: string read FNetCard;
- published
- property ExceptionMode: TExceptionMode read FMode write FMode;
- property IPAddresses: TStrings read FIPAddress {$IFNDEF D6PLUS} write FIPAddress {$ENDIF} stored false;
- property MACAddresses: TStrings read FMACAddress {$IFNDEF D6PLUS} write FMACAddress {$ENDIF} stored False;
- property Adapters :TStrings read FAdapter {$IFNDEF D6PLUS} write FAdapter {$ENDIF} stored false;
- property CardAdapterIndex: integer read FNCAI {$IFNDEF D6PLUS} write FNCAI {$ENDIF} stored False;
- property Protocols :TStrings read FProto {$IFNDEF D6PLUS} write FProto {$ENDIF} stored False;
- property Services :TStrings read FServ {$IFNDEF D6PLUS} write FServ {$ENDIF} stored False;
- property Clients :TStrings read FCli {$IFNDEF D6PLUS} write FCli {$ENDIF} stored False;
- property WinSock: TWinsock read FWinsock {$IFNDEF D6PLUS} write FWinsock {$ENDIF} stored false;
- property TCPIP: TTCPIP read FTCPIP {$IFNDEF D6PLUS} write FTCPIP {$ENDIF} stored False;
- end;
-
- const
- NodeTypes: array[TNodeType] of string = ('Unknown','Broadcast','Peer-To-Peer','Mixed','Hybrid');
-
- AdapterTypes: array[TAdapterType] of string = ('Other', 'Ethernet', 'Token Ring', 'FDDI', 'PPP', 'Loopback', 'Slip');
-
- implementation
-
-