/* Open a socket. Depending on the protocol present, open the right socket. The socket will allow us to talk to the driver.  */
int iw_sockets_open(void)
/* Open a socket. Depending on the protocol present, open the right socket. The socket will allow us to talk to the driver.  */
int iw_sockets_open(void)
{
  static const int families[] = {
    AF_INET, AF_IPX, AF_AX25, AF_APPLETALK
  };
  unsigned int	i;
  int		sock;
  for(i = 0; i < sizeof(families)/sizeof(int); ++i)
    {
      sock = socket(families[i], SOCK_DGRAM, 0);
      if(sock >= 0)
	return sock;
  }
  return -1;
}