3 * Standard routines for forwarding sources
5 * (c) 1999 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the `fw' port forwarder.
12 * `fw' is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * `fw' is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with `fw'; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 /*----- Header files ------------------------------------------------------*/
35 /*----- Static variables --------------------------------------------------*/
37 static source
*sources
= 0;
39 /*----- Main code ---------------------------------------------------------*/
41 /* --- @source_add@ --- *
43 * Arguments: @source *s@ = pointer to a source
47 * Use: Adds a source to the master list. Only do this for passive
48 * sources (e.g., listening sockets), not active sources (e.g.,
49 * executable programs).
52 void source_add(source
*s
)
61 /* --- @source_remove@ --- *
63 * Arguments: @source *s@ = pointer to a source
67 * Use: Removes a source from the master list.
70 void source_remove(source
*s
)
73 s
->next
->prev
= s
->prev
;
75 s
->prev
->next
= s
->next
;
80 /* --- @source_killall@ --- *
86 * Use: Frees all sources.
89 void source_killall(void)
100 /*----- That's all, folks -------------------------------------------------*/