× 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.



This is a multi-part message in MIME format.
--
PROGRAM - you mean I was supposed to write a program to do this?

I'm trying to use the API in an RPG program to return the reverse DNS
lookup.  I downloaded example code here...
It consistently returns nothing - zip.  I don't remember where I found
the code... (sorry!)

Brian Ditz published this someplace...
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
-----Original Message-----
        From: Scott Klement
        Sent: Mon 12/3/2001 6:39 PM
        To: rpg400-l@midrange.com
        Cc:
        Subject: Re: Reverse DNS Lookup...




        You say that it works with NSLOOKUP.  But you don't say under
which
        circumstances it fails to work...    Is it failing on a ping?
Or are you
        trying to do a reverse lookup in an RPG program?  Or What?

        If this is an RPG lookup, which API are you using?   Can we see
a code
        snippet?


        On Mon, 3 Dec 2001, Andrew Borts wrote:

        > OK - try as I might, I'm trying to get the reverse DNS lookup
        > functioning, and it aint working... hate to ask a generic
question - but
        > is there an example of one that WORKS?  I serve web pages, and
I'm able
        > to use NSLOOKUP and receive results, so unless there's
something I don't
        > know about, I don't think it's a setup issue... does anyone
have a hint
        > or 2 for me?
        >

        _______________________________________________
        This is the RPG programming on the AS400 / iSeries (RPG400-L)
mailing list
        To post a message email: RPG400-L@midrange.com
        To subscribe, unsubscribe, or change list options,
        visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
        or email: RPG400-L-request@midrange.com
        Before posting, please take a moment to review the archives
        at http://archive.midrange.com/rpg400-l.



--
[ winmail.dat of type application/ms-tnef deleted ]


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.