3 * Standard routines for forwarding sources
5 * (c) 1999 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the `fwd' port forwarder.
12 * `fwd' 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 * `fwd' 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 `fwd'; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Static variables --------------------------------------------------*/
31 static source
*sources
= 0;
33 /*----- Main code ---------------------------------------------------------*/
35 /* --- @source_add@ --- *
37 * Arguments: @source *s@ = pointer to a source
41 * Use: Adds a source to the master list. Only do this for passive
42 * sources (e.g., listening sockets), not active sources (e.g.,
43 * executable programs).
46 void source_add(source
*s
)
55 /* --- @source_remove@ --- *
57 * Arguments: @source *s@ = pointer to a source
61 * Use: Removes a source from the master list.
64 void source_remove(source
*s
)
67 s
->next
->prev
= s
->prev
;
69 s
->prev
->next
= s
->next
;
74 /* --- @source_killall@ --- *
80 * Use: Frees all sources.
83 void source_killall(void)
94 /*----- That's all, folks -------------------------------------------------*/