+++ /dev/null
-/* -*-c-*-
- *
- * Description of forwarding targets
- *
- * (c) 1999 Straylight/Edgeware
- */
-
-/*----- Licensing notice --------------------------------------------------*
- *
- * This file is part of the `fw' port forwarder.
- *
- * `fw' is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * `fw' is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with `fw'; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef TARGET_H
-#define TARGET_H
-
-#ifdef __cplusplus
- extern "C" {
-#endif
-
-/*----- Header files ------------------------------------------------------*/
-
-#include <stdio.h>
-
-#ifndef ENDPT_H
-# include "endpt.h"
-#endif
-
-#ifndef SCAN_H
-# include "scan.h"
-#endif
-
-/*----- Data structures ---------------------------------------------------*/
-
-/* --- A basic target object --- */
-
-typedef struct target {
- struct target_ops *ops;
- char *desc;
-} target;
-
-/* --- Forwarding target operations --- */
-
-typedef struct target_ops {
- const char *name; /* Name of this target */
-
- /* --- @option@ --- *
- *
- * Arguments: @target *t@ = pointer to target object, or zero if global
- * @scanner *sc@ = scanner to read from
- *
- * Returns: Nonzero to claim the option.
- *
- * Use: Handles an option string from the configuration file.
- */
-
- int (*option)(target */*t*/, scanner */*sc*/);
-
- /* --- @read@ --- *
- *
- * Arguments: @scanner *sc@ = pointer to scanner to read from
- *
- * Returns: Pointer to a target object to claim, null to reject.
- *
- * Use: Parses a target description from the configuration file.
- * Only the socket target is allowed to omit the prefix on a
- * target specification.
- */
-
- target *(*read)(scanner */*sc*/);
-
- /* --- @confirm@ --- *
- *
- * Arguments: @target *t@ = pointer to target
- *
- * Returns: ---
- *
- * Use: Confirms configuration of a target.
- */
-
- void (*confirm)(target */*t*/);
-
- /* --- @create@ --- *
- *
- * Arguments: @target *t@ = pointer to target
- * @const char *desc@ = description of connection
- *
- * Returns: Pointer to a created endpoint.
- *
- * Use: Generates a target endpoint for communication.
- */
-
- endpt *(*create)(target */*t*/, const char */*desc*/);
-
- /* --- @destroy@ --- *
- *
- * Arguments: @target *t@ = pointer to target
- *
- * Returns: ---
- *
- * Use: Destroys a target.
- */
-
- void (*destroy)(target */*t*/);
-
-} target_ops;
-
-/*----- That's all, folks -------------------------------------------------*/
-
-#ifdef __cplusplus
- }
-#endif
-
-#endif