2 Unix SMB/CIFS implementation.
3 process incoming packets - main loop
4 Copyright (C) Jean François Micouleau 1998-2002.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #include "wins_repl.h"
24 fd_set *listen_set = NULL;
25 int listen_number = 0;
26 int *sock_array = NULL;
28 /*******************************************************************
29 Add an fd from the sock_array
30 ******************************************************************/
31 void add_fd_to_sock_array(int fd)
35 temp_sock=(int *)Realloc(sock_array, (listen_number+1)*sizeof(int));
40 sock_array[listen_number]=fd;
45 /*******************************************************************
46 Remove an fd from the sock_array
47 ******************************************************************/
48 void remove_fd_from_sock_array(int fd)
52 for (i=0; sock_array[i]!=fd && i<listen_number; i++)
55 if (i==listen_number) {
56 DEBUG(0,("remove_fd_from_sock_array: unknown fd: %d\n", fd));
60 if (i==listen_number-1) {
61 sock_array=(int *)Realloc(sock_array, --listen_number*sizeof(int));
65 for (j=i; j<listen_number-1; j++)
66 sock_array[j]=sock_array[j+1];
68 sock_array=(int *)Realloc(sock_array, --listen_number*sizeof(int));