1f65688fcbcbf1f0ddea0feef56c9d450166eff1
3 * Description of forwarding targets
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.
34 /*----- Header files ------------------------------------------------------*/
46 /*----- Data structures ---------------------------------------------------*/
48 /* --- A basic target object --- */
50 typedef struct target
{
51 struct target_ops
*ops
;
55 /* --- Forwarding target operations --- */
57 typedef struct target_ops
{
58 const char *name
; /* Name of this target */
62 * Arguments: @target *t@ = pointer to target object, or zero if global
63 * @scanner *sc@ = scanner to read from
65 * Returns: Nonzero to claim the option.
67 * Use: Handles an option string from the configuration file.
70 int (*option
)(target */
*t*/
, scanner */
*sc*/
);
74 * Arguments: @scanner *sc@ = pointer to scanner to read from
76 * Returns: Pointer to a target object to claim, null to reject.
78 * Use: Parses a target description from the configuration file.
79 * Only the socket target is allowed to omit the prefix on a
80 * target specification.
83 target
*(*read
)(scanner */
*sc*/
);
85 /* --- @confirm@ --- *
87 * Arguments: @target *t@ = pointer to target
91 * Use: Confirms configuration of a target.
94 void (*confirm
)(target */
*t*/
);
98 * Arguments: @target *t@ = pointer to target
99 * @const char *desc@ = description of connection
101 * Returns: Pointer to a created endpoint.
103 * Use: Generates a target endpoint for communication.
106 endpt
*(*create
)(target */
*t*/
, const char */
*desc*/
);
108 /* --- @destroy@ --- *
110 * Arguments: @target *t@ = pointer to target
114 * Use: Destroys a target.
117 void (*destroy
)(target */
*t*/
);
121 /*----- That's all, folks -------------------------------------------------*/