3 * $Id: target.h,v 1.2 2003/11/25 14:08:23 mdw Exp $
5 * Description of forwarding targets
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.2 2003/11/25 14:08:23 mdw
33 * Debianization. Socket target options. Internet binding.
35 * Revision 1.1 1999/07/26 23:33:01 mdw
36 * Infrastructure for the new design.
47 /*----- Header files ------------------------------------------------------*/
59 /*----- Data structures ---------------------------------------------------*/
61 /* --- A basic target object --- */
63 typedef struct target {
64 struct target_ops *ops;
68 /* --- Forwarding target operations --- */
70 typedef struct target_ops {
71 const char *name; /* Name of this target */
75 * Arguments: @target *t@ = pointer to target object, or zero if global
76 * @scanner *sc@ = scanner to read from
78 * Returns: Nonzero to claim the option.
80 * Use: Handles an option string from the configuration file.
83 int (*option)(target */*t*/, scanner */*sc*/);
87 * Arguments: @scanner *sc@ = pointer to scanner to read from
89 * Returns: Pointer to a target object to claim, null to reject.
91 * Use: Parses a target description from the configuration file.
92 * Only the socket target is allowed to omit the prefix on a
93 * target specification.
96 target *(*read)(scanner */*sc*/);
100 * Arguments: @target *t@ = pointer to target
101 * @const char *desc@ = description of connection
103 * Returns: Pointer to a created endpoint.
105 * Use: Generates a target endpoint for communication.
108 endpt *(*create)(target */*t*/, const char */*desc*/);
110 /* --- @destroy@ --- *
112 * Arguments: @target *t@ = pointer to target
116 * Use: Destroys a target.
119 void (*destroy)(target */*t*/);
123 /*----- That's all, folks -------------------------------------------------*/