Lisp_Object process, option, value;
Lisp_Object no_error;
{
- int s, i;
+ int s;
CHECK_PROCESS (process);
#endif /* HAVE_SOCKETS */
\f
-#ifdef HAVE_SOCKETS
+#if defined(HAVE_SOCKETS) && defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H)
#ifdef SIOCGIFCONF
DEFUN ("network-interface-list", Fnetwork_interface_list, Snetwork_interface_list, 0, 0, 0,
doc: /* Return an alist of all network interfaces and their network address.
Each element is a cons, the car of which is a string containing the
interface name, and the cdr is the network address in internal
-format; see the description of ADDRESS in 'make-network-process'. */)
+format; see the description of ADDRESS in `make-network-process'. */)
()
{
struct ifconf ifconf;
return res;
}
-#endif
+#endif /* SIOCGIFCONF */
#if defined(SIOCGIFADDR) || defined(SIOCGIFHWADDR) || defined(SIOCGIFFLAGS)
return Qnil;
elt = Qnil;
-#ifdef SIOCGIFFLAGS
+#if defined(SIOCGIFFLAGS) && defined(ifr_flags)
if (ioctl (s, SIOCGIFFLAGS, &rq) == 0)
{
int flags = rq.ifr_flags;
res = Fcons (elt, res);
elt = Qnil;
-#ifdef SIOCGIFHWADDR
+#if defined(SIOCGIFHWADDR) && defined(ifr_hwaddr)
if (ioctl (s, SIOCGIFHWADDR, &rq) == 0)
{
- Lisp_Object hwaddr = Fmake_vector (6, Qnil);
+ Lisp_Object hwaddr = Fmake_vector (make_number (6), Qnil);
register struct Lisp_Vector *p = XVECTOR (hwaddr);
int n;
any++;
for (n = 0; n < 6; n++)
p->contents[n] = make_number (((unsigned char *)&rq.ifr_hwaddr.sa_data[0])[n]);
- elt = Fcons (XINT (rq.ifr_hwaddr.sa_family), hwaddr);
+ elt = Fcons (make_number (rq.ifr_hwaddr.sa_family), hwaddr);
}
#endif
res = Fcons (elt, res);
elt = Qnil;
-#ifdef SIOCGIFNETMASK
+#if defined(SIOCGIFNETMASK) && defined(ifr_netmask)
if (ioctl (s, SIOCGIFNETMASK, &rq) == 0)
{
any++;
res = Fcons (elt, res);
elt = Qnil;
-#ifdef SIOCGIFBRDADDR
+#if defined(SIOCGIFBRDADDR) && defined(ifr_broadaddr)
if (ioctl (s, SIOCGIFBRDADDR, &rq) == 0)
{
any++;
res = Fcons (elt, res);
elt = Qnil;
-#ifdef SIOCGIFADDR
+#if defined(SIOCGIFADDR) && defined(ifr_addr)
if (ioctl (s, SIOCGIFADDR, &rq) == 0)
{
any++;
Lisp_Object proc;
register int channel;
{
- register int nchars, nbytes;
+ register int nbytes;
char *chars;
register Lisp_Object outstream;
register struct buffer *old = current_buffer;
defsubr (&Sset_network_process_option);
defsubr (&Smake_network_process);
defsubr (&Sformat_network_address);
+#endif /* HAVE_SOCKETS */
+#if defined(HAVE_SOCKETS) && defined(HAVE_NET_IF_H) && defined(HAVE_SYS_IOCTL_H)
#ifdef SIOCGIFCONF
defsubr (&Snetwork_interface_list);
#endif
#if defined(SIOCGIFADDR) || defined(SIOCGIFHWADDR) || defined(SIOCGIFFLAGS)
defsubr (&Snetwork_interface_info);
#endif
-#endif /* HAVE_SOCKETS */
+#endif /* HAVE_SOCKETS ... */
#ifdef DATAGRAM_SOCKETS
defsubr (&Sprocess_datagram_address);
defsubr (&Sset_process_datagram_address);