source: trunk/third/moira/dbck/dbck.h @ 24319

Revision 24319, 3.1 KB checked in by broder, 14 years ago (diff)
New Moira snapshot from SVN.
Line 
1/* $HeadURL: svn+ssh://svn.mit.edu/moira/trunk/moira/dbck/dbck.h $ $Id: dbck.h 3956 2010-01-05 20:56:56Z zacheiss $
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
19extern int debug, mode, fast, dcmenable, warn;
20extern struct hash *users, *machines, *clusters, *lists, *printservers;
21extern struct hash *filesys, *nfsphys, *strings, *subnets, *string_dups;
22extern struct hash *containers;
23
24#define MAX_ID_VALUE 131072
25#define MIN_ID_VALUE 100
26
27#define dprintf if (debug) printf
28
29struct 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  char sponsor_type;
42  int sponsor_id;
43};
44
45struct machine {
46  char name[MACHINE_NAME_SIZE];
47  char owner_type;
48  int owner_id;
49  int snet_id;
50  int mach_id;
51  int clucount;
52  int acomment;
53  int ocomment;
54  int creator;
55  int modby;
56};
57
58struct subnet {
59  char name[SUBNET_NAME_SIZE];
60  char owner_type;
61  int owner_id;
62  int snet_id;
63  int modby;
64};
65
66struct cluster {
67  char name[CLUSTERS_NAME_SIZE];
68  int clu_id;
69  int modby;
70};
71
72struct list {
73  char name[LIST_NAME_SIZE];
74  char acl_type;
75  char memacl_type;
76  int list_id;
77  int acl_id;
78  int memacl_id;
79  int modby;
80  int members;
81};
82
83struct string {
84  char *name;
85  int string_id;
86  int refc;
87};
88
89struct filesys {
90  char name[FILESYS_LABEL_SIZE];
91  char dir[FILESYS_NAME_SIZE];
92  char type;
93  int filsys_id;
94  int mach_id;
95  int owner;
96  int owners;
97  int phys_id;
98};
99
100struct nfsphys {
101  char dir[NFSPHYS_DIR_SIZE];
102  int mach_id;
103  int nfsphys_id;
104  unsigned long long allocated;
105  int modby;
106  unsigned long long count;
107};
108
109struct printserver {
110  int mach_id;
111  int printer_types;
112  char owner_type;
113  int owner_id;
114  int lpc_acl;
115  int modby;
116};
117
118struct container {
119  char name[CONTAINERS_NAME_SIZE];
120  int cnt_id;
121  int list_id;
122  char acl_type;
123  int acl_id;
124  char memacl_type;
125  int memacl_id;
126  int modby;
127};
128
129void dbmserr(void);
130void out_of_mem(char *msg);
131void cleanup(void);
132
133void modified(char *table);
134
135void phase1(void);
136void phase2(void);
137void phase3(void);
138void phase4(void);
139void count_only_setup(void);
140
141/* prototypes from fix.pc */
142void generic_delete(struct save_queue *sq, int (*pfunc)(void *), char *table,
143                    char *idfield, int preen);
144void single_delete(char *table, char *idfield, int id);
145void zero_fix(char *tbl, char *zrfield, char *idfield, int id);
146int single_fix(char *msg, int preen);
147void generic_fix(struct save_queue *sq, int (*pfunc)(void *), char *msg,
148                 void (*ffunc)(void *), int preen);
149int prompt(char *msg);
150int set_next_object_id(char *object, char *tablename);
151int generic_fix_id(char *tbl, char *idfield, char *txtfield,
152                   int oldid, char *name);
153
154/* prototypes from phase3.pc */
155struct string *string_check(int id);
Note: See TracBrowser for help on using the repository browser.