3 * $Id: source.c,v 1.2 2004/04/08 01:36:25 mdw Exp $
5 * Standard routines for forwarding sources
7 * (c) 1999 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of the `fw' port forwarder.
14 * `fw' is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * `fw' is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with `fw'; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Header files ------------------------------------------------------*/
37 /*----- Static variables --------------------------------------------------*/
39 static source *sources = 0;
41 /*----- Main code ---------------------------------------------------------*/
43 /* --- @source_add@ --- *
45 * Arguments: @source *s@ = pointer to a source
49 * Use: Adds a source to the master list. Only do this for passive
50 * sources (e.g., listening sockets), not active sources (e.g.,
51 * executable programs).
54 void source_add(source *s)
63 /* --- @source_remove@ --- *
65 * Arguments: @source *s@ = pointer to a source
69 * Use: Removes a source from the master list.
72 void source_remove(source *s)
75 s->next->prev = s->prev;
77 s->prev->next = s->next;
82 /* --- @source_killall@ --- *
88 * Use: Frees all sources.
91 void source_killall(void)
102 /*----- That's all, folks -------------------------------------------------*/