🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.netware.misc
Article #603

Re: Is LanWorkPlace Winsock 1.1 compliant?

#603
From: Glenn Baddeley
Date: Wed, 09 Aug 1995 00:00
58 lines
3040 bytes
marka@halcyon.com (Mark Anacker) wrote:
> 
> But how do you tell the stack what it's own name is?  It doesn't seem to do
> a reverse lookup by address on either the DNS or the local hosts table, so
> it can't find it's own local name.  Thus gethostname() fails, and there's
> no way for an application to find out what it's IP address is...
> 
Yeah, but we do somehting along these lines and it works:

char   szBuff[100];
struct  hostent *hent;
int rc;
HANDLE hWLibSock;
FGETIP lpfnGetIpAddress;
unsigned long LocalIpAddress;

      if ((rc = gethostname(szBuff,sizeof(szBuff))) != 0)
         {
         rc = WSAGetLastError();
          etc....
         }
/* This little kludge is because the Novell Winsock library seems to
return a null string for gethostname. */
      if (strlen(szBuff) == 0)
       {
         /* first load the WLIBSOCK novell function library */
         hWLibSock = LoadLibrary("WLIBSOCK.DLL");
         if (hWLibSock < 32)
          {
               /* Oops, not installed */
          }
         else
          {
            lpfnGetIpAddress = (FGETIP) GetProcAddress( hWLibSock, 
"getmyipaddr");
            LocalIpAddress = lpfnGetIpAddress();
            FreeLibrary(hWLibSock); /* release the library */
            
          }
       }
      else
       {
         if ((hent = gethostbyname(szBuff)) == NULL)
             {
             rc = WSAGetLastError();
               etc..
             };
         _fmemcpy(LocalIpAddress,hent->h_addr_list[0],hent->h_length);
       }

Copyright 1995 Telstra Corp Ltd.

Glenn Baddeley,
Telstra ITG.

Now in return: Can someone please send me some code for PING
(ICMP echo request and reply), which preferably uses Novell
LWD Winsock.  Even any PING code whatsoever will do!!!
Technical Details
Message-ID: <4099ag$92k@cdn_mail.telecom.com.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3rkc8n$b0u@mark.ucdavis.edu> <3rng03$bp6@lastactionhero.rs.itd.umich.edu> <3v5997$18ou@hearst.cac.psu.edu> <3v74l9$dmf@i-2000.com> <3v8rog$f47@data.interserv.net> <3vlbe8$o89@r25.cae.ge02.honeywell.de> <3vma61$o18@data.interserv.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fe659,1ae250b5d94ff60f
X-Google-Attributes: gidfe659,public
X-Google-Thread: fa939,1ae250b5d94ff60f
X-Google-Attributes: gidfa939,public
X-Google-Thread: f5694,1ae250b5d94ff60f
X-Google-Attributes: gidf5694,public
X-Google-Thread: 110d1c,1ae250b5d94ff60f
X-Google-Attributes: gid110d1c,public
X-Google-Thread: 10f035,1ae250b5d94ff60f
X-Google-Attributes: gid10f035,public
X-Google-Thread: f8bf7,1ae250b5d94ff60f
X-Google-Attributes: gidf8bf7,public
X-Google-Thread: fc8d0,1ae250b5d94ff60f
X-Google-Attributes: gidfc8d0,public
From: Glenn Baddeley <gbaddele@vitgssw.telecom.com.au>
Subject: Re: Is LanWorkPlace Winsock 1.1 compliant?
Date: 1995/08/09
Message-ID: <4099ag$92k@cdn_mail.telecom.com.au>
X-Deja-AN: 107837412
references: <3rkc8n$b0u@mark.ucdavis.edu> <3rng03$bp6@lastactionhero.rs.itd.umich.edu> <3v5997$18ou@hearst.cac.psu.edu> <3v74l9$dmf@i-2000.com> <3v8rog$f47@data.interserv.net> <3vlbe8$o89@r25.cae.ge02.honeywell.de> <3vma61$o18@data.interserv.net>
organization: Telstra
newsgroups: comp.os.netware.misc,comp.os.netware.connectivity,Alt.winsock,alt.winsock.programming,alt.winsock.trumpet,bit.listserv.novell,comp.sys.novell,com