[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference lassie::ucx

Title:DEC TCP/IP Services for OpenVMS
Notice:Note 2-SSB Kits, 3-FT Kits, 4-Patch Info, 7-QAR System
Moderator:ucxaxp.ucx.lkg.dec.com::TIBBERT
Created:Thu Nov 17 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5568
Total number of notes:21492

5481.0. "INETACP$C_HOSENT_OFFSET usage" by 43984::HELLIAR (http://samedi.reo.dec.com/) Fri May 02 1997 06:08

    Hi,
    
    Can someone help me with this...Im getting BADAPARAM using the
    ACPCONTROL function. My guess is that its the 'hostent' return
    parameter thats at fault.
    
    
        unsigned long status = DECEDI__SUCCESS;
            /* status returns */
        short int channel, iosb[4];
        struct SOCKADDRIN remote_host;
        short int retlen_w;
        struct IL3
        {
            unsigned short il3_length, parameter_name;
            char *il3_address;
            unsigned int il3_retlen;
        } rhst_adrs = {sizeof remote_host, INET$C_SOCK_NAME, &remote_host,
                            &retlen_w};
    
        struct hostent host_ptr;
        int subfunction = (INETACP$C_HOSTENT_OFFSET * 256) +
                                    INETACP_FUNC$C_GETHOSTBYADDR ;
        struct IL2
        {
            unsigned short length;
            unsigned short null;
            char *address;
        }
             command = { sizeof(subfunction),0, &subfunction },
             host_desc = { sizeof(remote_host.sin_addr.S_un.S_addr), 0,
                            &remote_host.sin_addr.S_un.S_addr },
             host_ad_desc = {sizeof(host_ptr),0,&host_ptr};
    
    
        channel =  socket;
        if ((status = sys$qiow(0, channel, IO$_SENSEMODE, iosb, 0, 0,
                               0,0, 0, &rhst_adrs, 0, 0)) & 1)
             status = iosb[0];
        if (!(status & 1))
        {
            DECEDI__GEN_LOAD_ERROR(status, "GETPEERNAME");
            status = DECEDI__ERROR;
        }
        else
        {
            if ((status = sys$qiow(0, channel, IO$_ACPCONTROL, iosb, 0, 0,
                               &command,  &host_desc, &retlen_w,
                                &host_ad_desc, 0, 0)) & 1)
                status = iosb[0];
            if (!(status & 1))
            {
                DECEDI__GEN_LOAD_ERROR(status, "GETHOSTBYADDR");
                status = DECEDI__ERROR;
            }
            else
            {
                strcpy(DECEDI_CS_PEERNAME, host_ptr.h_addr_list[0]);
                status = DECEDI__SUCCESS;
            }
        }
    
    
    Thanks in advance,
    
    Graham
T.RTitleUserPersonal
Name
DateLines
5481.1Still stuck43945::HELLIARhttp://samedi.reo.dec.com/Tue May 06 1997 03:538
    Hi,
    
    Im still stuck on this, with searching this conference and the
    UCX$EXAMPLES showing no example usages of this particlar call.
    
    Any help would be really appreciated.
    
    Graham