Subject: Amateurish question

From: [email-masked]
Date: Mon, 14 Jun 1999 11:59:33 +0530

Hi,

I am new to the network programming. Forgive me for this silly question.

I am working in a corporate network of Windows NT 4.0 workstations which is
protected by a firewall
This firewall also has a proxy server. Users has to authenticate them
selves to connect to web thro' proxy.

I have written a small program using sockects to connect to my firewall.
When I try to connect to my firewall using my application (port:  8080) it
is failing. Specifically gethostbyaddr() returning NULL.
But the telnet and browser applications are able to connect to the firewall
at that port.

Why this?

Thanks
Srinivas S

---

From: [email-masked]
Date: Mon, 14 Jun 1999 18:18:00 +0530

Hi Mike,

Thanks for the reply.
I have initialized the libraries properly, And I am able to connect to
another systems except the firewall system.

Here is the actual code:

char *server_name = "172.30.81.30";
WSADATA wsaData;

     if     (::WSAStartup(0x202,&wsaData)!=0)
     {
          printf("\nError in Startup session.\n");
          WSACleanup();
          return -1;
     }

     addr = inet_addr(server_name);
     hp = gethostbyaddr((char *)&addr,4,AF_INET); // @@@@this statement is
failing@@@@

     if (hp == NULL )
     {
          fprintf(stderr,"Client: Cannot resolve address [%s]: Error %d\n",
               server_name,WSAGetLastError());
          return 0;
     }

Thanx

Srinivas S

"Michael J. Slifcak" <[email-masked]> on 06/14/99 17:21:40

To:   Srinivasarao Sakhamuri/Chennai/HCLDELUXE
cc:
Subject:  Re: Amateurish question

Hi, Srinivas.
If you are using the Win32 APIs, WOSA must be initialized before
opening a socket.  Also, you must call closesocket in lieu of close.
Here is sample code from UC-Davis SNMP project that does the
WOSA start/stop.

Best Regards,
-Mike Slifcak, Internet Security Systems, Inc.

char *
winsock_startup (void)
{
 WORD VersionRequested;
 WSADATA stWSAData;
 int i;
 static char errmsg[100];

 VersionRequested = MAKEWORD(1,1);
 i = WSAStartup(VersionRequested, &stWSAData);
 if (i != 0)
 {
  if (i == WSAVERNOTSUPPORTED)
    sprintf(errmsg,"Unable to init. socket lib, does not support 1.1");
  else
  {
    sprintf(errmsg,"Socket Startup error %d", i);
  }
  return(errmsg);
 }
 return(NULL);
}

void winsock_cleanup (void)
{
   WSACleanup();
}

---

From: [email-masked]
Date: Mon, 14 Jun 1999 18:18:00 +0530

Hi Mike,

Thanks for the reply.

Here is the actual code:

     if (hp == NULL )
     {

Thanx

Srinivas S

Hi, Srinivas.

Best Regards,

char *
winsock_startup (void)
{
 WORD VersionRequested;
 WSADATA stWSAData;
 int i;
 static char errmsg[100];