× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Retrieve Domain name API
  • From: bdietz@xxxxxx
  • Date: Thu, 13 Jul 2000 18:14:49 -0400


Here is an RPGLE version:
   PGM        PARM(&IP)
   DCL        VAR(&IP) TYPE(*CHAR) LEN(15)
   DCL        VAR(&HOST) TYPE(*CHAR) LEN(64)
   CALL       PGM(GETHOST1) PARM(&IP &HOST)
   SNDPGMMSG  MSG('The host name for TCP/IP address ' || +
                &IP *BCAT 'is ' || &HOST)
   ENDPGM

      *===================================================================
      *  Bryan Dietz                                                     *
      *  3X Corp.                                                        *
      *  bdietz@3x.com                Parts by others                    *
      *==================================================================*
     hdebug dftactgrp( *no ) bnddir( 'QC2LE' )
     Dinet_addr        PR            10U 0 ExtProc('inet_addr')
     D  IPAddr                         *   Value

     DGetHostByAddr    PR              *   ExtProc('gethostbyaddr')
     D  HostEnt                        *   Value
     D  AddrLen                       5I 0 Value
     D  AddrType                      5I 0 Value

     DSysInfDS        SDS
     D CurDevice             244    253

     DRcvVar           DS
     D  Protocol             859    859
     D  IPAddress            878    892

     DRcvLen           S              9B 0
     DFormat           S              8
     DDevice           S             10
     DIPAddr           S               *
     DHostEnt          S               *
     DHostAddr         S               *
     DAddrLen          S              5I 0
     DAddrType         S              5I 0

     DHostEntS         DS                  Based(HostEntP)
     D  HostNPtr                       *

     DHostName         S             64    Based(HostNameP)

     DHostAddrS        DS                  Based(HostAddrP)
     D  IP32Addr                     10U 0

     DAF_INET          S              5I 0 Inz(2)
     DSpaces           S             64    Inz(*Blanks)

     DAPIError         DS
     D  NbrBytes               1      4B 0 Inz(15)
     D  CPFID                  9     15
      *****************************************************************
     C     *Entry        PList
     C                   Parm                    P#IPAddress      15
     C                   Parm                    P#IPName         64


      * Get IP-name
     c                   Eval      IPAddress = P#IPAddress
     C                   Eval      HostEntP  = %Addr(HostEnt)

     C                   Eval      HostAddrP = %Addr(HostAddr)
     C                   Eval      IP32Addr  = inet_addr(%Addr(IPAddress))
     C                   Eval      AddrLen   = %Size(HostAddrS)
     C                   Eval      AddrType  = AF_INET


     C                   Eval      HostEntP  = GetHostByAddr(HostAddrP:
     C                                                       AddrLen:
     C                                                       AddrType)


     C     HostEntP      IfEq      *NULL
     C                   Eval      P#IPName  = Spaces
     C                   Else
     C                   Eval      HostNameP = HostNPtr
     C                   Eval      P#IPName  = HostName

     C     X'00':X'40'   XLate     P#IPName      P#IPName

     C                   EndIf

      * Return parameters
     C                   Eval      P#IPAddress = IPAddress

     C                   SetOn                                        Lr
     C                   Return


Bryan Dietz




                                                                                
                      
                    Larryt222@aol.com                                           
                      
                    Sent by:                   To:     
<MIDRANGE-L@midrange.com>                      
                    owner-midrange-l@mi        cc:                              
                      
                    drange.com                 Subject:     Retrieve Domain 
name API                  
                                                                                
                      
                                                                                
                      
                    07/13/00 03:39 PM                                           
                      
                    Please respond to                                           
                      
                    MIDRANGE-L                                                  
                      
                                                                                
                      
                                                                                
                      




Does anyone know of an API that will return the Domain name for a given IP?

Thanks,

Larry
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to
MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator:
david@midrange.com
+---



+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.