3 * $Id: source.c,v 1.1 1999/07/26 23:33:01 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 /*----- Revision history --------------------------------------------------*
32 * Revision 1.1 1999/07/26 23:33:01 mdw
33 * Infrastructure for the new design.
37 /*----- Header files ------------------------------------------------------*/
45 /*----- Static variables --------------------------------------------------*/
47 static source
*sources
= 0;
49 /*----- Main code ---------------------------------------------------------*/
51 /* --- @source_add@ --- *
53 * Arguments: @source *s@ = pointer to a source
57 * Use: Adds a source to the master list. Only do this for passive
58 * sources (e.g., listening sockets), not active sources (e.g.,
59 * executable programs).
62 void source_add(source
*s
)
71 /* --- @source_remove@ --- *
73 * Arguments: @source *s@ = pointer to a source
77 * Use: Removes a source from the master list.
80 void source_remove(source
*s
)
83 s
->next
->prev
= s
->prev
;
85 s
->prev
->next
= s
->next
;
90 /* --- @source_killall@ --- *
96 * Use: Frees all sources.
99 void source_killall(void)
105 ss
->ops
->destroy(ss
);
110 /*----- That's all, folks -------------------------------------------------*/