1 /************************************************************************
2 * IRC - Internet Relay Chat, src/listener.c
3 * Copyright (C) 2001 Perry Lorier <isomer@coders.net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 1, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <sys/types.h>
24 #include <sys/socket.h>
26 struct Iauth_Outstanding {
27 struct iauth_outstanding *next;
31 static struct Iauth_Outstanding *iauth_freelist=NULL;
32 struct Iauth IauthPollList = NULL;
34 void iauth_new(char *service)
36 /* TODO: Check to see if the service is a hostname, and if so
37 * connect to it like hybrid does. Hybrid uses a blocking
38 * gethostbyname here (bletch!!). On the other hand a
39 * nonblocking solutions likely to be worse....
41 struct Iauth* tmp = (struct Iauth *)malloc(sizeof(struct Iauth));
43 tmp->next = IauthPollList;
45 tmp->service=strdup(service);
48 if (socketpair(domain,type,protocol,fd)<0) {
58 for (i = 2; i < MAXCONNECTIONS; i++)
60 if (pi[1] != 0 && pi[1] != 1)
62 (void)execlp(tmp->service, tmp->service, 0);
65 /* TODO: Put the real servername in there */
66 (void)write(tmp->fd,"Server undernet.org 1.1");