]>
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; |
d2543f8c | 20 | extern struct hash *users, *machines, *clusters, *lists; |
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; |
72 | int list_id; | |
cfc4f91e | 73 | int acl_id; |
74 | int modby; | |
5eaef520 | 75 | int members; |
d2543f8c | 76 | }; |
77 | ||
78 | struct string { | |
5eaef520 | 79 | char *name; |
80 | int string_id; | |
81 | int refc; | |
d2543f8c | 82 | }; |
83 | ||
84 | struct filesys { | |
cfc4f91e | 85 | char name[FILESYS_LABEL_SIZE]; |
86 | char dir[FILESYS_NAME_SIZE]; | |
5eaef520 | 87 | char type; |
88 | int filsys_id; | |
89 | int mach_id; | |
90 | int owner; | |
91 | int owners; | |
92 | int phys_id; | |
d2543f8c | 93 | }; |
94 | ||
95 | struct nfsphys { | |
cfc4f91e | 96 | char dir[NFSPHYS_DIR_SIZE]; |
5eaef520 | 97 | int mach_id; |
98 | int nfsphys_id; | |
99 | int allocated; | |
cfc4f91e | 100 | int modby; |
5eaef520 | 101 | int count; |
d2543f8c | 102 | }; |
7ac48069 | 103 | |
104 | void dbmserr(void); | |
105 | void out_of_mem(char *msg); | |
106 | void cleanup(void); | |
107 | ||
108 | void modified(char *table); | |
109 | ||
110 | void phase1(void); | |
111 | void phase2(void); | |
112 | void phase3(void); | |
113 | void phase4(void); | |
114 | void count_only_setup(void); | |
115 | ||
116 | /* prototypes from fix.pc */ | |
117 | void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table, | |
118 | char *idfield, int preen); | |
119 | void single_delete(char *table, char *idfield, int id); | |
120 | void zero_fix(char *tbl, char *zrfield, char *idfield, int id); | |
121 | int single_fix(char *msg, int preen); | |
122 | void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg, | |
123 | void (*ffunc)(void *), int preen); | |
124 | int prompt(char *msg); | |
125 | int set_next_object_id(char *object, char *tablename); | |
126 | int generic_fix_id(char *tbl, char *idfield, char *txtfield, | |
127 | int oldid, char *name); | |
128 | ||
129 | /* prototypes from phase3.pc */ | |
130 | struct string *string_check(int id); |