]>
Commit | Line | Data |
---|---|---|
1 | /* $Header$ | |
2 | * | |
3 | * Declarations for Moira database consistancy checker | |
4 | * | |
5 | * (c) Copyright 1988 by the Massachusetts Institute of Technology. | |
6 | * For copying and distribution information, please see the file | |
7 | * <mit-copyright.h>. | |
8 | */ | |
9 | ||
10 | #include <mit-copyright.h> | |
11 | #include <moira_site.h> | |
12 | #include <moira_schema.h> | |
13 | ||
14 | #define MODE_ASK 1 | |
15 | #define MODE_NO 2 | |
16 | #define MODE_PREEN 3 | |
17 | #define MODE_YES 4 | |
18 | ||
19 | extern int debug, mode, fast, dcmenable, warn; | |
20 | extern struct hash *users, *machines, *clusters, *lists, *printservers; | |
21 | extern struct hash *filesys, *nfsphys, *strings, *subnets, *string_dups; | |
22 | ||
23 | #define MAX_ID_VALUE 32765 | |
24 | #define MIN_ID_VALUE 100 | |
25 | ||
26 | #define dprintf if (debug) printf | |
27 | ||
28 | struct user { | |
29 | char login[USERS_LOGIN_SIZE]; | |
30 | char potype; | |
31 | char *fullname; | |
32 | int status; | |
33 | int users_id; | |
34 | int pobox_id; | |
35 | int comment; | |
36 | int modby; | |
37 | int fmodby; | |
38 | int pmodby; | |
39 | int sigwho; | |
40 | }; | |
41 | ||
42 | struct machine { | |
43 | char name[MACHINE_NAME_SIZE]; | |
44 | char owner_type; | |
45 | int owner_id; | |
46 | int snet_id; | |
47 | int mach_id; | |
48 | int clucount; | |
49 | int acomment; | |
50 | int ocomment; | |
51 | int creator; | |
52 | int modby; | |
53 | }; | |
54 | ||
55 | struct subnet { | |
56 | char name[SUBNET_NAME_SIZE]; | |
57 | char owner_type; | |
58 | int owner_id; | |
59 | int snet_id; | |
60 | int modby; | |
61 | }; | |
62 | ||
63 | struct cluster { | |
64 | char name[CLUSTERS_NAME_SIZE]; | |
65 | int clu_id; | |
66 | int modby; | |
67 | }; | |
68 | ||
69 | struct list { | |
70 | char name[LIST_NAME_SIZE]; | |
71 | char acl_type; | |
72 | char memacl_type; | |
73 | int list_id; | |
74 | int acl_id; | |
75 | int memacl_id; | |
76 | int modby; | |
77 | int members; | |
78 | }; | |
79 | ||
80 | struct string { | |
81 | char *name; | |
82 | int string_id; | |
83 | int refc; | |
84 | }; | |
85 | ||
86 | struct filesys { | |
87 | char name[FILESYS_LABEL_SIZE]; | |
88 | char dir[FILESYS_NAME_SIZE]; | |
89 | char type; | |
90 | int filsys_id; | |
91 | int mach_id; | |
92 | int owner; | |
93 | int owners; | |
94 | int phys_id; | |
95 | }; | |
96 | ||
97 | struct nfsphys { | |
98 | char dir[NFSPHYS_DIR_SIZE]; | |
99 | int mach_id; | |
100 | int nfsphys_id; | |
101 | int allocated; | |
102 | int modby; | |
103 | int count; | |
104 | }; | |
105 | ||
106 | struct printserver { | |
107 | int mach_id; | |
108 | int printer_types; | |
109 | char owner_type; | |
110 | int owner_id; | |
111 | int lpc_acl; | |
112 | int modby; | |
113 | }; | |
114 | ||
115 | void dbmserr(void); | |
116 | void out_of_mem(char *msg); | |
117 | void cleanup(void); | |
118 | ||
119 | void modified(char *table); | |
120 | ||
121 | void phase1(void); | |
122 | void phase2(void); | |
123 | void phase3(void); | |
124 | void phase4(void); | |
125 | void count_only_setup(void); | |
126 | ||
127 | /* prototypes from fix.pc */ | |
128 | void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table, | |
129 | char *idfield, int preen); | |
130 | void single_delete(char *table, char *idfield, int id); | |
131 | void zero_fix(char *tbl, char *zrfield, char *idfield, int id); | |
132 | int single_fix(char *msg, int preen); | |
133 | void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg, | |
134 | void (*ffunc)(void *), int preen); | |
135 | int prompt(char *msg); | |
136 | int set_next_object_id(char *object, char *tablename); | |
137 | int generic_fix_id(char *tbl, char *idfield, char *txtfield, | |
138 | int oldid, char *name); | |
139 | ||
140 | /* prototypes from phase3.pc */ | |
141 | struct string *string_check(int id); |