亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? iphelper.pas

?? 一個用于端口監(jiān)聽的源碼
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit IPHelper;

interface

uses
  Windows, Messages, SysUtils, Classes, Dialogs, IpHlpApi;

const
  NULL_IP       = '  0.  0.  0.  0';

//------conversion of well-known port numbers to service names----------------

type
  TWellKnownPort = record
    Prt: DWORD;
    Srv: string[20];
  end;


const
    // only most "popular" services...
  WellKnownPorts: array[1..27] of TWellKnownPort
  = ( ( Prt: 7; Srv: 'ECHO' ), {ping}
    ( Prt: 9; Srv: 'DISCRD' ), { Discard}
    ( Prt: 13; Srv: 'DAYTIM' ), {DayTime}
    ( Prt: 17; Srv: 'QOTD' ), {Quote Of The Day}
    ( Prt: 19; Srv: 'CHARGEN' ), {CharGen}
    ( Prt: 20; Srv: 'FTP ' ),
    ( Prt: 21; Srv: 'FTPC' ), { File Transfer Control Protocol}
    ( Prt: 23; Srv: 'TELNET' ), {TelNet}
    ( Prt: 25; Srv: 'SMTP' ), { Simple Mail Transfer Protocol}
    ( Prt: 37; Srv: 'TIME' ),
    ( Prt: 53; Srv: 'DNS ' ),
    ( Prt: 67; Srv: 'BOOTPS' ), { BOOTP Server }
    ( Prt: 68; Srv: 'BOOTPC' ), { BOOTP Client }
    ( Prt: 69; Srv: 'TFTP' ), { Trivial FTP  }
    ( Prt: 70; Srv: 'GOPHER' ), { Gopher       }
    ( Prt: 79; Srv: 'FING' ), { Finger       }
    ( Prt: 80; Srv: 'HTTP' ), { HTTP         }
    ( Prt: 88; Srv: 'KERB' ), { Kerberos     }
    ( Prt: 109; Srv: 'POP2' ), { Post Office Protocol Version 2 }
    ( Prt: 110; Srv: 'POP3' ), { Post Office Protocol Version 3 }
    ( Prt: 119; Srv: 'NNTP' ), { Network News Transfer Protocol }
    ( Prt: 123; Srv: 'NTP ' ), { Network Time protocol          }
    ( Prt: 135; Srv: 'LOCSVC'), { Location Service              }
    ( Prt: 137; Srv: 'NBNAME' ), { NETBIOS Name service          }
    ( Prt: 138; Srv: 'NBDGRAM' ), { NETBIOS Datagram Service     }
    ( Prt: 139; Srv: 'NBSESS' ), { NETBIOS Session Service        }
    ( Prt: 161; Srv: 'SNMP' ) { Simple Netw. Management Protocol }
    );


//-----------conversion of ICMP error codes to strings--------------------------
             {taken from www.sockets.com/ms_icmp.c }

const
  ICMP_ERROR_BASE = 11000;
  IcmpErr : array[1..22] of string =
  (
   'IP_BUFFER_TOO_SMALL','IP_DEST_NET_UNREACHABLE', 'IP_DEST_HOST_UNREACHABLE',
   'IP_PROTOCOL_UNREACHABLE', 'IP_DEST_PORT_UNREACHABLE', 'IP_NO_RESOURCES',
   'IP_BAD_OPTION','IP_HARDWARE_ERROR', 'IP_PACKET_TOO_BIG', 'IP_REQUEST_TIMED_OUT',
   'IP_BAD_REQUEST','IP_BAD_ROUTE', 'IP_TTL_EXPIRED_TRANSIT',
   'IP_TTL_EXPIRED_REASSEM','IP_PARAMETER_PROBLEM', 'IP_SOURCE_QUENCH',
   'IP_OPTION_TOO_BIG', 'IP_BAD_DESTINATION','IP_ADDRESS_DELETED',
   'IP_SPEC_MTU_CHANGE', 'IP_MTU_CHANGE', 'IP_UNLOAD'
  );


//----------conversion of diverse enumerated values to strings------------------

  ARPEntryType  : array[1..4] of string = ( 'Other', 'Invalid',
    'Dynamic', 'Static'
    );
  TCPConnState  :
    array[1..12] of string =
    ( 'closed', 'listening', 'syn_sent',
    'syn_rcvd', 'established', 'fin_wait1',
    'fin_wait2', 'close_wait', 'closing',
    'last_ack', 'time_wait', 'delete_tcb'
    );

  TCPToAlgo     : array[1..4] of string =
    ( 'Const.Timeout', 'MIL-STD-1778',
    'Van Jacobson', 'Other' );

  IPForwTypes   : array[1..4] of string =
    ( 'other', 'invalid', 'local', 'remote' );

  IPForwProtos  : array[1..18] of string =
    ( 'OTHER', 'LOCAL', 'NETMGMT', 'ICMP', 'EGP',
    'GGP', 'HELO', 'RIP', 'IS_IS', 'ES_IS',
    'CISCO', 'BBN', 'OSPF', 'BGP', 'BOOTP',
    'AUTO_STAT', 'STATIC', 'NOT_DOD' );


//---------------exported stuff-----------------------------------------------

procedure Get_AdaptersInfo( List: TStrings );
procedure Get_NetworkParams( List: TStrings );
procedure Get_ARPTable( List: TStrings );
procedure Get_TCPTable( List: TStrings );
procedure Get_TCPStatistics( List: TStrings );
procedure Get_UDPTable( List: TStrings );
procedure Get_UDPStatistics( List: TStrings );
procedure Get_IPAddrTable( List: TStrings );
procedure Get_IPForwardTable( List: TStrings );
procedure Get_IPStatistics( List: TStrings );
function Get_RTTAndHopCount( IPAddr: DWORD; MaxHops: Longint;
  var RTT: longint; var HopCount: longint ): integer;
procedure Get_ICMPStats( ICMPIn, ICMPOut: TStrings );
procedure Get_IfTable( List: TStrings );
procedure Get_RecentDestIPs( List: TStrings );

// conversion utils
function MacAddr2Str( MacAddr: TMacAddress; size: integer ): string;
function IpAddr2Str( IPAddr: DWORD ): string;
function Str2IpAddr( IPStr: string ): DWORD;
function Port2Str( nwoPort: DWORD ): string;
function Port2Wrd( nwoPort: DWORD ): DWORD;
function Port2Svc( Port: DWORD ): string;
function ICMPErr2Str( ICMPErrCode: DWORD) : string;

implementation

var
  RecentIPs     : TStringList;

//--------------General utilities-----------------------------------------------

{ extracts next "token" from string, then eats string }
function NextToken( var s: string; Separator: char ): string;
var
  Sep_Pos       : byte;
begin
  Result := '';
  if length( s ) > 0 then begin
    Sep_Pos := pos( Separator, s );
    if Sep_Pos > 0 then begin
      Result := copy( s, 1, Pred( Sep_Pos ) );
      Delete( s, 1, Sep_Pos );
    end
    else begin
      Result := s;
      s := '';
    end;
  end;
end;

//------------------------------------------------------------------------------
{ concerts numerical MAC-address to ww-xx-yy-zz string }
function MacAddr2Str( MacAddr: TMacAddress; size: integer ): string;
var
  i             : integer;
begin
  if Size = 0 then
  begin
    Result := '00-00-00-00-00-00';
    EXIT;
  end
  else Result := '';
  //
  for i := 1 to Size do
    Result := Result + IntToHex( MacAddr[i], 2 ) + '-';
  Delete( Result, Length( Result ), 1 );
end;

//------------------------------------------------------------------------------
{ converts IP-address in network byte order DWORD to dotted decimal string}
function IpAddr2Str( IPAddr: DWORD ): string;
var
  i             : integer;
begin
  Result := '';
  for i := 1 to 4 do
  begin
    Result := Result + Format( '%3d.', [IPAddr and $FF] );
    IPAddr := IPAddr shr 8;
  end;
  Delete( Result, Length( Result ), 1 );
end;

//------------------------------------------------------------------------------
{ converts dotted decimal IP-address to network byte order DWORD}
function Str2IpAddr( IPStr: string ): DWORD;
var
  i             : integer;
  Num           : DWORD;
begin
  Result := 0;
  for i := 1 to 4 do
  try
    Num := ( StrToInt( NextToken( IPStr, '.' ) ) ) shl 24;
    Result := ( Result shr 8 ) or Num;
  except
    Result := 0;
  end;

end;

//------------------------------------------------------------------------------
{ converts port number in network byte order to DWORD }
function Port2Wrd( nwoPort: DWORD ): DWORD;
begin
  Result := Swap( WORD( nwoPort ) );
end;

//------------------------------------------------------------------------------
{ converts port number in network byte order to string }
function Port2Str( nwoPort: DWORD ): string;
begin
  Result := IntToStr( Port2Wrd( nwoPort ) );
end;

//------------------------------------------------------------------------------
{ converts well-known port numbers to service ID }
function Port2Svc( Port: DWORD ): string;
var
  i             : integer;
begin
  Result := Format( '%4d', [Port] ); // in case port not found
  for i := Low( WellKnownPorts ) to High( WellKnownPorts ) do
    if Port = WellKnownPorts[i].Prt then
    begin
      Result := WellKnownPorts[i].Srv;
      BREAK;
    end;
end;

//-----------------------------------------------------------------------------
{ general,  fixed network parameters }
procedure Get_NetworkParams( List: TStrings );
var
    FixedInfo     : PTFixedInfo;
    InfoSize      : integer;
    ErrorCode     : DWORD;
    I             : Integer;
    DNS           : PTIP_ADDR_STRING;
begin
    if not Assigned( List ) then EXIT;
    List.Clear;
    InfoSize := 1024;
    GetMem(FixedInfo,infosize);
    ErrorCode := GetNetworkParams( FixedInfo, InfoSize );
    if ErrorCode = ERROR_SUCCESS then
    begin
        with FixedInfo^ do
        begin
        List.Add( 'HOSTNAME          : ' + string( HostName ) );
        List.Add( 'DOMAIN            : ' + string( DomainName ) );
        List.Add( 'SCOPE             : ' + string( ScopeID ) );
        List.Add( 'NETBIOS NODE TYPE : ' + NETBIOSTypes[NodeType] );
        List.Add( 'ROUTING ENABLED   :' + IntToStr( EnableRouting ) );
        List.Add( 'PROXY   ENABLED   :' + IntToStr( EnableProxy ) );
        List.Add( 'DNS     ENABLED   :' + IntToStr( EnableDNS ) );
        end;
        //獲取域名解析服務(wù)器地址
        DNS := @FixedInfo^.DNSServerList;
        Repeat
            List.Add('DNS '+IntToStr(I)+': '+DNS^.IpAddress);
            Inc(I);
            DNS := DNS^.Next;
        Until (DNS = nil);
    end
    else
    List.Add( SysErrorMessage( ErrorCode ) );
end;

//------------------------------------------------------------------------------
function ICMPErr2Str( ICMPErrCode: DWORD) : string;
var
 i : integer;
begin
   Result := 'UnknownError : ' + IntToStr( ICMPErrCode );
   dec( ICMPErrCode, ICMP_ERROR_BASE );
   if ICMPErrCode in [Low(ICMpErr)..High(ICMPErr)] then
     Result := ICMPErr[ ICMPErrCode];
end;




//------------------------------------------------------------------------------
procedure Get_IfTable( List: TStrings );
var
  IfRow         : TMibIfRow;
  i,
    Error,
    TableSize   : integer;
  pBuf          : PChar;
  NumEntries    : DWORD;
  sDescr,
    Temp        : string;
begin
  if not Assigned( List ) then EXIT;
  List.Clear;
  TableSize := 0;
   // first call: get memsize needed
  Error := GetIfTable( PTMibIfTable( pBuf ), @TableSize, false );
  if Error <> ERROR_INSUFFICIENT_BUFFER then
    EXIT;
  GetMem( pBuf, TableSize );

   // get table pointer
  Error := GetIfTable( PTMibIfTable( pBuf ), @TableSize, false );
  if Error = NO_ERROR then
  begin
    NumEntries := PTMibIfTable( pBuf )^.dwNumEntries;
    if NumEntries > 0 then
    begin
      inc( pBuf, SizeOf( NumEntries ) );
      for i := 1 to NumEntries do
      begin
        IfRow := PTMibIfRow( pBuf )^;
        with IfRow do
        begin
          SetLength( sDescr, dwDescrLen );
          move( bDescr, sDescr[1], Length( sDescr ) );
          sDescr := trim( sDescr );
          List.Add( Format( '%0.8x| %3d| %16s| %8d| %12d| %2d| %2d| %-s',
            [dwIndex, dwType,
            MacAddr2Str( TMacAddress( bPhysAddr ), dwPhysAddrLen )
              , dwMTU, dwSpeed, dwAdminStatus,
              dwOPerStatus, sDescr] )
              );
        end;
        inc( pBuf, SizeOf( IfRow ) );
      end;
    end
    else
      List.Add( 'no entries.' );
  end
  else
    List.Add( SysErrorMessage( GetLastError ) );
  dec( pBuf, SizeOf( DWORD ) + NumEntries * SizeOf( IfRow ) );
  FreeMem( pBuf );
end;



//網(wǎng)卡配置信息
procedure Get_AdaptersInfo( List: TStrings );
var
    Error,
    BufLen      : DWORD;
    AdapterInfo : PTIP_ADAPTER_INFO;
    Descr,
    LocalIP,
    GatewayIP,
    DHCPIP      : string;
begin
    if not Assigned( List ) then EXIT;
    List.Clear;
    BufLen := SizeOf( AdapterInfo^ );
    New( AdapterInfo );
    Error := GetAdaptersInfo( AdapterInfo, @BufLen );
    if Error = NO_ERROR then
    begin
        while ( AdapterInfo <> nil ) do
        with AdapterInfo^ do
        begin
            SetLength( Descr, SizeOf( Description ) );
            Descr := Trim( string( Description ) );
            LocalIP := NULL_IP;
            if IPAddressList.IpAddress[1] <> #0 then
                LocalIP := IPAddressList.IpAddress
            else
                LocalIP := NULL_IP;
            if GateWayList.IPAddress[1] <> #0 then
                GateWayIP := GatewayList.IPAddress
            else
                GateWayIP := NULL_IP;
            if DHCPServer.IPAddress[1] <> #0 then
                DHCPIP := DHCPServer.IPAddress
            else
                DHCPIP := NULL_IP;

            List.Add( Descr );
            List.Add( Format(
                '%8.8x|%6s|%16s|%2d|%16s|%16s|%16s',
                [Index, AdaptTypes[aType],
                MacAddr2Str( TMacAddress( Address ), AddressLength ),
                DHCPEnabled, LocalIP, GatewayIP, DHCPIP] ));
            List.Add( '  ' );
            AdapterInfo := Next;
        end
    end
    else
        List.Add( SysErrorMessage( Error ) );
    Dispose( AdapterInfo );
end;

//獲取數(shù)據(jù)到達指定主機的中轉(zhuǎn)次數(shù)與時間
function Get_RTTAndHopCount( IPAddr: DWORD; MaxHops: Longint; var RTT: Longint;
  var HopCount: Longint ): integer;
begin
    if not GetRTTAndHopCount( IPAddr, @HopCount, MaxHops, @RTT ) then
    begin
        Result := GetLastError;
        RTT := -1; //無法到達指定主機
        HopCount := -1;
    end
    else
    Result := NO_ERROR;
end;

//-----------------------------------------------------------------------------
{ARP列表中保存遠程主機的IP地址與實際物理地址(MAC)之間的映射。
}
procedure Get_ARPTable( List: TStrings );
var
    IPNetRow      : TMibIPNetRow;
    TableSize     : DWORD;
    NumEntries    : DWORD;
    ErrorCode     : DWORD;
    i             : integer;
    pBuf          : PChar;
begin
    if not Assigned( List ) then EXIT;
    List.Clear;
    //首先取得列表所需內(nèi)存的大小
    TableSize := 0;
    ErrorCode := GetIPNetTable( PTMIBIpNetTable( pBuf ), @TableSize, false );
    if ErrorCode = ERROR_NO_DATA then
    begin
        List.Add( ' ARP-cache empty.' );
        EXIT;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品国产三级国产有无不卡 | 亚洲精品v日韩精品| 日韩亚洲欧美中文三级| 在线成人av网站| 91丨porny丨最新| 99久久精品久久久久久清纯| 国产成人在线色| 久久国内精品视频| 免费av成人在线| 秋霞午夜av一区二区三区| 日韩精品每日更新| 日韩电影在线一区二区| 亚洲午夜久久久久久久久久久| 日韩一区欧美小说| 一区二区欧美视频| 亚洲一区二区三区在线播放| 亚洲激情第一区| 婷婷国产在线综合| 激情综合亚洲精品| 国产成人在线视频播放| av影院午夜一区| 欧美午夜一区二区三区| 欧美日本精品一区二区三区| 538在线一区二区精品国产| 欧美久久一二区| 久久综合久久综合久久综合| 久久久久国色av免费看影院| 成人欧美一区二区三区白人| 亚洲精品少妇30p| 亚洲精品乱码久久久久久日本蜜臀| 亚洲欧美一区二区不卡| 亚洲一区二区三区四区在线观看 | 91麻豆国产福利在线观看| 99久久免费视频.com| 欧美日韩综合在线| 久久综合狠狠综合久久激情| 国产精品福利一区| 天天综合天天综合色| 国内精品写真在线观看| av一区二区不卡| 欧美一区二区三区在线电影| 国产香蕉久久精品综合网| 18成人在线观看| 蜜臀av亚洲一区中文字幕| 成人小视频在线观看| 欧美妇女性影城| 国产精品人成在线观看免费| 香蕉久久一区二区不卡无毒影院| 麻豆精品新av中文字幕| 色综合久久99| 亚洲精品一区二区三区福利| 亚洲精品五月天| 精久久久久久久久久久| 日本高清不卡视频| 国产亚洲视频系列| 偷拍日韩校园综合在线| 成人免费视频视频| 欧美一区二区三区思思人| 国产精品久久影院| 韩国欧美一区二区| 欧美日韩国产经典色站一区二区三区| 欧美国产一区二区在线观看 | 日韩精品欧美精品| 在线视频综合导航| 国产精品国产精品国产专区不蜜| 日韩二区三区在线观看| 在线免费不卡电影| 最近中文字幕一区二区三区| 风间由美中文字幕在线看视频国产欧美| 欧美三级电影网站| 亚洲精品免费在线播放| av一区二区三区在线| 国产精品网友自拍| 成人理论电影网| 亚洲国产激情av| 成人永久免费视频| 国产精品久久久久桃色tv| 高清在线成人网| 欧美—级在线免费片| 高清av一区二区| 精品国产自在久精品国产| 麻豆一区二区三区| 精品国产一区二区三区四区四| 日本亚洲最大的色成网站www| 欧美日本国产一区| 免费久久99精品国产| 日韩欧美色电影| 国内精品在线播放| 欧美国产激情二区三区| 99久久婷婷国产综合精品| 亚洲天堂精品在线观看| 色综合久久88色综合天天6| 亚洲精品免费在线观看| 欧美日韩不卡一区二区| 麻豆国产欧美日韩综合精品二区| 日韩一级片在线播放| 久久99日本精品| 久久午夜色播影院免费高清| 成人av先锋影音| 亚洲一区二区三区爽爽爽爽爽| 欧美日韩国产三级| 国产在线精品不卡| 自拍偷拍亚洲激情| 欧美丰满嫩嫩电影| 国产精品原创巨作av| 亚洲欧洲三级电影| 欧美精品18+| 国产精品自产自拍| 一区二区在线观看av| 制服丝袜日韩国产| 国产一区二区三区免费看| 亚洲视频一二三| 91 com成人网| 高清成人免费视频| 午夜欧美在线一二页| 精品国产成人系列| 在线视频一区二区三区| 韩国一区二区三区| 亚洲无线码一区二区三区| 欧美大片在线观看一区| 99久久久精品免费观看国产蜜| 亚洲高清视频在线| 中文字幕国产一区| 日韩欧美国产不卡| 欧美性做爰猛烈叫床潮| 麻豆成人久久精品二区三区红 | 欧美激情一区不卡| 欧美日韩美少妇| 成人网男人的天堂| 人禽交欧美网站| 一区在线观看免费| 欧美精品一区二区不卡| 精品视频免费看| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 精品久久久三级丝袜| 99精品桃花视频在线观看| 九色|91porny| 日韩1区2区3区| 亚洲综合色噜噜狠狠| 国产精品午夜在线| www一区二区| 欧美va在线播放| 91精品国产高清一区二区三区| 91女厕偷拍女厕偷拍高清| 丁香婷婷综合五月| 国模冰冰炮一区二区| 三级欧美在线一区| 亚洲一区在线视频观看| 亚洲欧美日韩中文字幕一区二区三区 | 久久精品视频网| 日韩精品最新网址| 欧美videos大乳护士334| 7777精品伊人久久久大香线蕉经典版下载| 成熟亚洲日本毛茸茸凸凹| 黄色成人免费在线| 狠狠网亚洲精品| 另类小说一区二区三区| 青草国产精品久久久久久| 日韩av一级片| 性欧美疯狂xxxxbbbb| 午夜久久久影院| 亚洲一区在线视频| 午夜视频在线观看一区二区三区| 亚洲国产精品欧美一二99| 亚洲成a人在线观看| 亚洲bt欧美bt精品777| 久久66热re国产| 久久99久久99小草精品免视看| 蜜桃视频第一区免费观看| 日本不卡123| 韩日欧美一区二区三区| 激情深爱一区二区| 成人丝袜18视频在线观看| 成人一区在线看| 色av一区二区| 欧美一区在线视频| 久久网站热最新地址| 国产精品你懂的在线| 亚洲精品你懂的| 日本视频在线一区| 国产盗摄视频一区二区三区| 成人激情黄色小说| 欧美一a一片一级一片| 日韩一区二区在线观看视频| 国产亚洲精品久| 亚洲久本草在线中文字幕| 亚洲r级在线视频| 国内精品第一页| 91国产丝袜在线播放| 欧美一区二区不卡视频| 国产亚洲一区二区三区四区| 亚洲免费观看高清完整版在线 | 亚洲综合色婷婷| 精久久久久久久久久久| 99在线精品免费| 欧美不卡视频一区| 中文字幕欧美区| 日韩电影在线一区二区| 成人综合日日夜夜| 日韩欧美一区电影|