2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 1991-1998 University of Maryland at College Park
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of U.M. not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. U.M. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
16 * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18 * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: James da Silva, Systems Design and Analysis Group
24 * Computer Science Department
25 * University of Maryland at College Park
28 * $Id: driverio.h,v 1.13.2.7.4.3 2001/11/08 18:44:56 martinea Exp $
30 * driver-related helper functions
34 #include "server_util.h"
36 #define MAX_DUMPERS 63
42 /* dumper process structure */
44 typedef struct dumper_s {
45 char *name; /* name of this dumper */
46 int pid; /* its pid */
52 typedef struct assignedhd_s {
59 /* schedule structure */
61 typedef struct sched_s {
62 int attempted, priority;
63 int level, degr_level;
64 long est_time, degr_time;
65 unsigned long est_size, degr_size, act_size;
66 char *dumpdate, *degr_dumpdate;
67 int est_kps, degr_kps;
68 char *destname; /* file/port name */
77 #define sched(dp) ((sched_t *) (dp)->up)
80 /* holding disk reservation structure */
82 typedef struct holdalloc_s {
83 int allocated_dumpers;
87 #define holdalloc(hp) ((holdalloc_t *) (hp)->up)
89 GLOBAL dumper_t dmptable[MAX_DUMPERS];
92 GLOBAL fd_set readset;
93 GLOBAL int taper, taper_busy, taper_pid;
96 void startup_tape_process P((char *taper_program));
97 void startup_dump_process P((dumper_t *dumper, char *dumper_program));
98 void startup_dump_processes P((char *dumper_program, int inparallel));
99 cmd_t getresult P((int fd, int show, int *result_argc, char **result_argv, int max_arg));
100 int taper_cmd P((cmd_t cmd, void *ptr, char *destname, int level, char *datestamp));
101 int dumper_cmd P((dumper_t *dumper, cmd_t cmd, disk_t *dp));
102 disk_t *serial2disk P((char *str));
103 void free_serial P((char *str));
104 char *disk2serial P((disk_t *dp));
105 void update_info_dumper P((disk_t *dp, long origsize, long dumpsize, long dumptime));
106 void update_info_taper P((disk_t *dp, char *label, int filenum, int level));
107 void free_assignedhd P((assignedhd_t **holdp));