Subject: Question about socket calls
From: "Ashish C. Nagre" <[email-masked]>
To: [email-masked], [email-masked], [email-masked]
Cc: [email-masked], [email-masked]
Date: Wed, 26 May 1999 15:20:48 -0700

Hello,
I am a new user of cygnus and am trying to port a UNIX application to NT
4.0
My problem is as follows:
	
	One of the functions tries to get all the IP addresses associated with
a network interface. For this it creates a DGRAM socket and does a few
other things, but when it makes the following call:

  THIS ONE RIGHT HERE 
	 if (ioctl(fd, SIOCGIFADDR, (char *)&ifr) < 0) {
 *********************************************************
            (void)fprintf(stderr, "Error returned %d",err
            (void)sprintf(errbuf, "SIOCGIFADDR: %s: %s",
               device,strerror(errno));

            (void)close(fd);
            return (-1);
        }

It returns errno = 22 which means Invalid argument.
SIOCGIFADDR has been defined by me as follows:

#define IOC_INOUT       (IOC_IN) /* |IOC_OUT) */
#define _IOWR(x, y, t) \
        (IOC_INOUT|((((int)sizeof (t))&IOCPARM_MASK)<<16)|(x<<8)|y)
#define SIOCGIFADDR     _IOWR('i', 13, struct ifreq)    /* get ifnet
address */

Since there was no _IOWR defined in the include/asm/socket.h

Can someone please tell me how I could get all the IP addresses
associated with an interface or why the above call does not work.
Your help is greatly appreciated.

Regards,
Ashish

--
Want to unsubscribe from this list?
Send a message to [email-masked]