All ntop does is use the standard gethostbyname() function.  There are some
knowledge base articles about it - fixes in SP2.

Now, it should just return the same thing (see note below from
gethostbyname() man page), but perhaps they are being clever??

Anyway, try

1) nslookup on the numeric address
2) use the name in the -g parameter (or both)

and let us know...

-----Burton



sql.c

static void openSQLsocket(char* dstHost, int dstPort) {
  struct hostent *hostAddr = gethostbyname(dstHost);

  if(hostAddr == NULL) {
    traceEvent(TRACE_INFO, "Unable to resolve address '%s'\n", dstHost);
    exit(-1);
  }

  memcpy(&dest.sin_addr.s_addr, hostAddr->h_addr_list[0],
         hostAddr->h_length);
  dest.sin_family      = AF_INET;
  dest.sin_port        = (int)htons((unsigned short int)dstPort);

  sqlSocket = socket (AF_INET, SOCK_DGRAM, 0);

  if(sqlSocket <= 0) {
    traceEvent(TRACE_INFO, "Unable to open SQLsocket\n");
      exit(-1);
  } else {
    traceEvent(TRACE_INFO, "Open channel with ntop SQL client running @
%s:%d\n", dstHost, dstPort);
  }
}

man gethostbyname
...
     The name argument to gethostbyname is a character string containing an
     Internet hostname or an Internet address in standard dot notation (see
     inet(3N)).  If the name contains no dot, and if the environment
variable
     HOSTALIASES contains the name of an alias file, the alias file is first
     searched for an alias matching the input name.  See hostname(5) for the
     alias file format.  The addr argument to gethostbyaddr points to a
buffer
     containing a 32-bit Internet host address in network byte order.
addrlen
     contains the address length in bytes; it should be set to sizeof(struct
     in_addr).  type specifies the address family and should be set to
     AF_INET.
...





-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Jonathan S. Polacheck
Sent: Friday, June 21, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [Ntop-dev] ntop -g on a Win2K system (ntop-2.0-demo.exe)


C:\Program Files\ntop-Win32>nslookup netman
Server:  aus-dc02.company.pvt
Address:  204.6.15.251

Name:    netman.company.pvt
Address:  204.6.15.8

C:\Program Files\ntop-Win32>ntop -g 204.6.15.8:4444
21/Jun/2002 10:59:10 Unable to resolve address '204.6.15.8'

????

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev

_______________________________________________
Ntop-dev mailing list
[EMAIL PROTECTED]
http://lists.ntop.org/mailman/listinfo/ntop-dev

Reply via email to