]> andersk Git - moira.git/blob - dbck/dbck.h
e7a245f1d3275e84d68614f33f3eca3030ca9b82
[moira.git] / dbck / dbck.h
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 extern struct hash *containers;
23
24 #define MAX_ID_VALUE 131072
25 #define MIN_ID_VALUE 100
26
27 #define dprintf if (debug) printf
28
29 struct user {
30   char login[USERS_LOGIN_SIZE];
31   char potype;
32   char *fullname;
33   int status;
34   int users_id;
35   int pobox_id;
36   int comment;
37   int modby;
38   int fmodby;
39   int pmodby;
40   int sigwho;
41 };
42
43 struct machine {
44   char name[MACHINE_NAME_SIZE];
45   char owner_type;
46   int owner_id;
47   int snet_id;
48   int mach_id;
49   int clucount;
50   int acomment;
51   int ocomment;
52   int creator;
53   int modby;
54 };
55
56 struct subnet {
57   char name[SUBNET_NAME_SIZE];
58   char owner_type;
59   int owner_id;
60   int snet_id;
61   int modby;
62 };
63
64 struct cluster {
65   char name[CLUSTERS_NAME_SIZE];
66   int clu_id;
67   int modby;
68 };
69
70 struct list {
71   char name[LIST_NAME_SIZE];
72   char acl_type;
73   char memacl_type;
74   int list_id;
75   int acl_id;
76   int memacl_id;
77   int modby;
78   int members;
79 };
80
81 struct string {
82   char *name;
83   int string_id;
84   int refc;
85 };
86
87 struct filesys {
88   char name[FILESYS_LABEL_SIZE];
89   char dir[FILESYS_NAME_SIZE];
90   char type;
91   int filsys_id;
92   int mach_id;
93   int owner;
94   int owners;
95   int phys_id;
96 };
97
98 struct nfsphys {
99   char dir[NFSPHYS_DIR_SIZE];
100   int mach_id;
101   int nfsphys_id;
102   unsigned long long allocated;
103   int modby;
104   unsigned long long count;
105 };
106
107 struct printserver {
108   int mach_id;
109   int printer_types;
110   char owner_type;
111   int owner_id;
112   int lpc_acl;
113   int modby;
114 };
115
116 struct container {
117   char name[CONTAINERS_NAME_SIZE];
118   int cnt_id;
119   int list_id;
120   char acl_type;
121   int acl_id;
122   char memacl_type;
123   int memacl_id;
124   int modby;
125 };
126
127 void dbmserr(void);
128 void out_of_mem(char *msg);
129 void cleanup(void);
130
131 void modified(char *table);
132
133 void phase1(void);
134 void phase2(void);
135 void phase3(void);
136 void phase4(void);
137 void count_only_setup(void);
138
139 /* prototypes from fix.pc */
140 void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table,
141                     char *idfield, int preen);
142 void single_delete(char *table, char *idfield, int id);
143 void zero_fix(char *tbl, char *zrfield, char *idfield, int id);
144 int single_fix(char *msg, int preen);
145 void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg,
146                  void (*ffunc)(void *), int preen);
147 int prompt(char *msg);
148 int set_next_object_id(char *object, char *tablename);
149 int generic_fix_id(char *tbl, char *idfield, char *txtfield,
150                    int oldid, char *name);
151
152 /* prototypes from phase3.pc */
153 struct string *string_check(int id);
This page took 0.155866 seconds and 3 git commands to generate.