]>
Commit | Line | Data |
---|---|---|
d2543f8c | 1 | /* $Header$ |
2 | * | |
2ce085d2 | 3 | * Declarations for Moira database consistancy checker |
d2543f8c | 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 | ||
d2543f8c | 10 | #include <mit-copyright.h> |
7ac48069 | 11 | #include <moira_site.h> |
cfc4f91e | 12 | #include <moira_schema.h> |
d2543f8c | 13 | |
14 | #define MODE_ASK 1 | |
15 | #define MODE_NO 2 | |
16 | #define MODE_PREEN 3 | |
17 | #define MODE_YES 4 | |
18 | ||
6f4e78e6 | 19 | extern int debug, mode, fast, dcmenable, warn; |
fe0a844a | 20 | extern struct hash *users, *machines, *clusters, *lists, *printservers; |
ab05f33a | 21 | extern struct hash *filesys, *nfsphys, *strings, *subnets, *string_dups; |
d2543f8c | 22 | |
23 | #define MAX_ID_VALUE 32765 | |
24 | #define MIN_ID_VALUE 100 | |
25 | ||
5eaef520 | 26 | #define dprintf if (debug) printf |
d2543f8c | 27 | |
28 | struct user { | |
cfc4f91e | 29 | char login[USERS_LOGIN_SIZE]; |
ab05f33a | 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; | |
d2543f8c | 40 | }; |
41 | ||
42 | struct machine { | |
cfc4f91e | 43 | char name[MACHINE_NAME_SIZE]; |
ab05f33a | 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 { | |
cfc4f91e | 56 | char name[SUBNET_NAME_SIZE]; |
ab05f33a | 57 | char owner_type; |
58 | int owner_id; | |
59 | int snet_id; | |
60 | int modby; | |
d2543f8c | 61 | }; |
62 | ||
63 | struct cluster { | |
cfc4f91e | 64 | char name[CLUSTERS_NAME_SIZE]; |
5eaef520 | 65 | int clu_id; |
66 | int modby; | |
d2543f8c | 67 | }; |
68 | ||
69 | struct list { | |
cfc4f91e | 70 | char name[LIST_NAME_SIZE]; |
5eaef520 | 71 | char acl_type; |
ad47bcbe | 72 | char memacl_type; |
5eaef520 | 73 | int list_id; |
cfc4f91e | 74 | int acl_id; |
ad47bcbe | 75 | int memacl_id; |
cfc4f91e | 76 | int modby; |
5eaef520 | 77 | int members; |
d2543f8c | 78 | }; |
79 | ||
80 | struct string { | |
5eaef520 | 81 | char *name; |
82 | int string_id; | |
83 | int refc; | |
d2543f8c | 84 | }; |
85 | ||
86 | struct filesys { | |
cfc4f91e | 87 | char name[FILESYS_LABEL_SIZE]; |
88 | char dir[FILESYS_NAME_SIZE]; | |
5eaef520 | 89 | char type; |
90 | int filsys_id; | |
91 | int mach_id; | |
92 | int owner; | |
93 | int owners; | |
94 | int phys_id; | |
d2543f8c | 95 | }; |
96 | ||
97 | struct nfsphys { | |
cfc4f91e | 98 | char dir[NFSPHYS_DIR_SIZE]; |
5eaef520 | 99 | int mach_id; |
100 | int nfsphys_id; | |
101 | int allocated; | |
cfc4f91e | 102 | int modby; |
5eaef520 | 103 | int count; |
d2543f8c | 104 | }; |
7ac48069 | 105 | |
fe0a844a | 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 | ||
7ac48069 | 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); |