#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.46 2002-04-09 07:37:59 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/inet.c,v 1.47 2002-06-11 17:04:45 itojun Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
{
struct sockaddr *newsa;
unsigned int size;
-
+
size = SA_LEN(sa);
if ((newsa = malloc(size)) == NULL)
return (NULL);
"malloc: %s", pcap_strerror(errno));
return (-1);
}
-
+
/*
* Fill in the entry.
*/
} else
prevdev->next = curdev;
}
-
+
*curdev_ret = curdev;
return (0);
}
}
} else
curaddr->netmask = NULL;
-
+
if (broadaddr != NULL) {
curaddr->broadaddr = dup_sockaddr(broadaddr);
if (curaddr->broadaddr == NULL) {
}
} else
curaddr->broadaddr = NULL;
-
+
if (dstaddr != NULL) {
curaddr->dstaddr = dup_sockaddr(dstaddr);
if (curaddr->dstaddr == NULL) {
}
} else
curaddr->dstaddr = NULL;
-
+
/*
* Find the end of the list of addresses.
*/
/*
* This could be the separator between a
* name and an alias number, or it could be
- * the separator between a name with no
+ * the separator between a name with no
* alias number and the next field.
*
* If there's a colon after digits, it
if (pcap_findalldevs(&alldevs, errbuf) == -1)
return (NULL);
-
+
if (alldevs == NULL || (alldevs->flags & PCAP_IF_LOOPBACK)) {
/*
* There are no devices on the list, or the first device
register struct sockaddr_in *sin;
struct ifreq ifr;
- /*
+ /*
* The pseudo-device "any" listens on all interfaces and therefore
* has the network address and -mask "0.0.0.0" therefore catching
* all traffic. Using NULL for the interface is the same as "any".